text:
(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  define(['./script/proj4gl.js', 'dojo/Stateful', './script/webgl-utils.js'], function(Proj4Gl, Stateful) {
    var RasterLayer, createAndCompileShader;
    createAndCompileShader = function(gl, type, source) {
      var shader;
      shader = gl.createShader(type);
      gl.shaderSource(shader, source);
      gl.compileShader(shader);
      if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
        console.error('Error compiling shader:');
        console.error(source);
        console.error(gl.getShaderInfoLog(shader));
      }
      return shader;
    };
    RasterLayer = (function(_super) {

      __extends(RasterLayer, _super);

      function RasterLayer(map, textureUrls, description) {
        var _this = this;
        this.map = map;
        this.textureUrls = textureUrls;
        this.description = description;
        this.shaderProgram = null;
        this.texture = null;
        this.visible = true;
        this.map.watch('gl', function(n, o, gl) {
          return _this._glChanged();
        });
        this.map.watch('projection', function(n, o, proj) {
          return _this._projectionChanged();
        });
        this._glChanged();
      }

      RasterLayer.prototype._visibleSetter = function(visible) {
        this.visible = visible;
        return this.map.scheduleRedraw();
      };

      RasterLayer.prototype._glChanged = function() {
        var gl, maxTextureSize, sz, texture, textureSize, textureUrl, url, _i, _len, _ref,
          _this = this;
        if (!(this.map.gl != null)) {
          return;
        }
        gl = this.map.gl;
        maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
        console.log('maximum texture size', maxTextureSize);
        textureSize = 0;
        textureUrl = null;
        _ref = this.textureUrls;
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          texture = _ref[_i];
          sz = texture[0];
          url = texture[1];
          if (sz > textureSize && sz <= maxTextureSize) {
            textureSize = sz;
            textureUrl = url;
          }
        }
        if (!(textureUrl != null)) {
          return;
        }
        console.log('using texture url', textureUrl);
        this.texture = gl.createTexture();
        this.texture.image = new Image();
        this.texture.image.onload = function() {
          return _this._textureLoaded();
        };
        this.texture.image.src = textureUrl;
        this.texture.loaded = false;
        this.vertexBuffer = gl.createBuffer();
        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
        gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 0, -0.5, -0.5, 1, -1, 0, 0.5, -0.5, 1, 1, 0, 0.5, 0.5, -1, 1, 0, -0.5, 0.5]), gl.STATIC_DRAW);
        this.vertexBuffer.stride = 5 * 4;
        this.vertexBuffer.textureOffset = 3 * 4;
        this.vertexBuffer.textureSize = 2;
        this.vertexBuffer.positionOffset = 0 * 4;
        this.vertexBuffer.positionSize = 3;
        this.indexBuffer = gl.createBuffer();
        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 3]), gl.STATIC_DRAW);
        this.indexBuffer.numItems = 4;
        return this._projectionChanged();
      };

      RasterLayer.prototype._projectionChanged = function() {
        var fragmentShader, gl, paramDef, proj, projSource, vertexShader, _i, _len, _ref, _results;
        this.shaderProgram = null;
        if (!(this.map.projection != null) || !(this.map.gl != null)) {
          return;
        }
        proj = this.map.projection;
        gl = this.map.gl;
        projSource = Proj4Gl.projectionShaderSource(proj.projName);
        vertexShader = createAndCompileShader(gl, gl.VERTEX_SHADER, "attribute vec2 aTextureCoord;\nattribute vec3 aVertexPosition;\nvarying vec2 vTextureCoord;\n\nuniform vec2 uViewportSize; // in pixels\nuniform float uScale; // the size of one pixel in projection co-ords\nuniform vec2 uViewportProjectionCenter; // the center of the viewport in projection co-ords\n\nvoid main(void) {\n  vec3 pos = aVertexPosition;\n  gl_Position = vec4(pos, 1.0);\n\n  // convert texture coord in range [-0.5, 0.5) to viewport pixel coord\n  vec2 pixelCoord = aTextureCoord * uViewportSize;\n\n  // convert to projection coordinates\n  vTextureCoord = pixelCoord * uScale - uViewportProjectionCenter;\n}");
        fragmentShader = createAndCompileShader(gl, gl.FRAGMENT_SHADER, "precision mediump float;\n\n// define the projection and projection parameters structure\n" + projSource.source + "\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform " + projSource.paramsStruct.name + " uProjParams;\n\nvoid main(void) {\n  vec2 lonlat = " + projSource.backwardsFunction + "(vTextureCoord, uProjParams);\n  lonlat /= vec2(2.0 * 3.14159, 3.14159);\n  lonlat += vec2(0.5, 0.5);\n  gl_FragColor = texture2D(uSampler, lonlat);\n}");
        this.shaderProgram = gl.createProgram();
        gl.attachShader(this.shaderProgram, vertexShader);
        gl.attachShader(this.shaderProgram, fragmentShader);
        gl.linkProgram(this.shaderProgram);
        if (!gl.getProgramParameter(this.shaderProgram, gl.LINK_STATUS)) {
          throw 'Could not initialise shaders';
        }
        this.shaderProgram.attributes = {
          vertexPosition: gl.getAttribLocation(this.shaderProgram, 'aVertexPosition'),
          textureCoord: gl.getAttribLocation(this.shaderProgram, 'aTextureCoord')
        };
        this.shaderProgram.uniforms = {
          sampler: gl.getUniformLocation(this.shaderProgram, 'uSampler'),
          viewportSize: gl.getUniformLocation(this.shaderProgram, 'uViewportSize'),
          scale: gl.getUniformLocation(this.shaderProgram, 'uScale'),
          viewportProjectionCenter: gl.getUniformLocation(this.shaderProgram, 'uViewportProjectionCenter'),
          projParams: {}
        };
        _ref = projSource.paramsStruct.params;
        _results = [];
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
          paramDef = _ref[_i];
          _results.push(this.shaderProgram.uniforms.projParams[paramDef[0]] = {
            loc: gl.getUniformLocation(this.shaderProgram, 'uProjParams.' + paramDef[0]),
            type: paramDef[1]
          });
        }
        return _results;
      };

      RasterLayer.prototype.drawLayer = function() {
        var gl, k, proj, v, _, _ref, _ref1, _ref2;
        if (!this.visible || !(this.map.gl != null) || !this.map.projection || !(this.shaderProgram != null) || !((_ref = this.texture) != null ? _ref.loaded : void 0)) {
          return;
        }
        gl = this.map.gl;
        proj = this.map.projection;
        gl.useProgram(this.shaderProgram);
        _ref1 = this.shaderProgram.attributes;
        for (_ in _ref1) {
          v = _ref1[_];
          gl.enableVertexAttribArray(v);
        }
        gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
        gl.vertexAttribPointer(this.shaderProgram.attributes.vertexPosition, this.vertexBuffer.positionSize, gl.FLOAT, false, this.vertexBuffer.stride, this.vertexBuffer.positionOffset);
        gl.vertexAttribPointer(this.shaderProgram.attributes.textureCoord, this.vertexBuffer.textureSize, gl.FLOAT, false, this.vertexBuffer.stride, this.vertexBuffer.textureOffset);
        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
        gl.useProgram(this.shaderProgram);
        gl.activeTexture(gl.TEXTURE0);
        gl.bindTexture(gl.TEXTURE_2D, this.texture);
        gl.uniform1i(this.shaderProgram.uniforms.sampler, 0);
        gl.uniform2f(this.shaderProgram.uniforms.viewportSize, this.map.element.clientWidth, this.map.element.clientHeight);
        gl.uniform1f(this.shaderProgram.uniforms.scale, this.map.scale);
        gl.uniform2f(this.shaderProgram.uniforms.viewportProjectionCenter, this.map.center.x, this.map.center.y);
        _ref2 = this.shaderProgram.uniforms.projParams;
        for (k in _ref2) {
          v = _ref2[k];
          if (!(proj[k] != null)) {
            continue;
          }
          if (v.type === 'int') {
            gl.uniform1i(v.loc, proj[k]);
          } else if (v.type === 'float') {
            gl.uniform1f(v.loc, proj[k]);
          } else {
            console.error('unknown parameter type for ' + k.toString());
          }
        }
        return gl.drawElements(gl.TRIANGLE_FAN, this.indexBuffer.numItems, gl.UNSIGNED_SHORT, 0);
      };

      RasterLayer.prototype._textureLoaded = function() {
        var gl;
        gl = this.map.gl;
        if (!(gl != null)) {
          throw 'map GL context unavailable';
        }
        gl.bindTexture(gl.TEXTURE_2D, this.texture);
        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this.texture.image);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
        gl.bindTexture(gl.TEXTURE_2D, null);
        this.texture.loaded = true;
        return this.map.scheduleRedraw();
      };

      return RasterLayer;

    })(Stateful);
    return RasterLayer;
  });

}).call(this);


text:
template <typename T>
class Vector
{
public:
	Vector(void);
	Vector(unsigned int);
	Vector(const Vector&);
	Vector(unsigned int, T, T);
	~Vector(void);

	inline T& operator[](unsigned int);
	inline T const& operator[](unsigned int) const;
	Vector<T>& operator=(const Vector<T>&);

	unsigned int size(void);

private:
	T* _array;
	unsigned int _size;
};

redpajama_set_name: RedPajamaGithub


text:
package uk.ac.ebi.pride.jmztab.utils.parser;

import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.ac.ebi.pride.jmztab.model.MZTabDescription;
import uk.ac.ebi.pride.jmztab.model.Metadata;
import uk.ac.ebi.pride.jmztab.utils.errors.FormatErrorType;
import uk.ac.ebi.pride.jmztab.utils.errors.LogicalErrorType;
import uk.ac.ebi.pride.jmztab.utils.errors.MZTabErrorList;
import uk.ac.ebi.pride.jmztab.utils.errors.MZTabException;

import java.io.FileNotFoundException;
import java.net.URL;

import static org.junit.Assert.assertTrue;

/**
 * @author qingwei
 * @since 10/09/13
 */
public class MZTabHeaderLineValidateTest {
    private static Logger logger = LoggerFactory.getLogger(MZTabHeaderLineValidateTest.class);

    private Metadata metadata;
    private MZTabErrorList errorList;

    @Before
    public void setUp() throws Exception {
        MTDLineParserTest test = new MTDLineParserTest();
        String fileName = "testset/mtdFile.txt";

        URL uri = MZTabHeaderLineValidateTest.class.getClassLoader().getResource(fileName);
        if(uri!=null) {
            metadata = test.parseMetadata(uri.getFile());
        } else {
            throw new FileNotFoundException(fileName);
        }
        errorList = new MZTabErrorList();
    }

    @Test
    public void testStableColumns() throws Exception {
        // miss accession column.
        String prh = "PRH\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tambiguity_members\tmodifications";

        PRHLineParser prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == FormatErrorType.StableColumn);
            logger.debug(e.getMessage());
        }

        // miss retention_time_window column
        String peh = "PEH\tsequence\taccession\tunique\tdatabase\tdatabase_version\tsearch_engine\t" +
            "modifications\tretention_time\tcharge\tmass_to_charge\tspectra_ref";

        PEHLineParser pehParser = new PEHLineParser(metadata);
        try {
            pehParser.parse(1, peh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == FormatErrorType.StableColumn);
            logger.debug(e.getMessage());
        }
    }

//    @Test
//    public void testFixedAndVariableMod() throws Exception {
//        // if PSM section is present, fixed_mod and variable_mod should be defined in metadata.
//        String psh = "PSH\tsequence\tPSM_ID\taccession\tunique\tdatabase\tdatabase_version\t" +
//            "search_engine\tsearch_engine_score\treliability\tmodifications\tretention_time\tcharge\t" +
//            "exp_mass_to_charge\tcalc_mass_to_charge\turi\tspectra_ref\tpre\tpost\tstart\tend";
//        PSHLineParser pshParser = new PSHLineParser(metadata);
//
//        try {
//            pshParser.parse(1, psh, errorList);
//            assertTrue(true);
//        } catch (MZTabException e) {
//            assertTrue(false);
//        }
//
//        metadata.getFixedModMap().clear();
//        try {
//            pshParser.parse(1, psh, errorList);
//            assertTrue(false);
//        } catch (MZTabException e) {
//            assertTrue(e.getError().getType() == LogicalErrorType.FixedMod);
//            logger.debug(e.getMessage());
//        }
//    }

    @Test
    public void testMsRunOptionalColumn() throws Exception {
        // not define ms_run[30] in metadata.
        String prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\tsearch_engine\t" +
            "best_search_engine_score[1]\tsearch_engine_score[1]_ms_run[1]\treliability\tnum_psms_ms_run[1]\t" +
            "num_psms_ms_run[30]\tnum_peptides_distinct_ms_run[1]\tnum_peptides_distinct_ms_run[2]\t" +
            "num_peptides_unique_ms_run[1]\tambiguity_members\tmodifications\turi\tgo_terms\tprotein_coverage";

        PRHLineParser prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.MsRunNotDefined);
            logger.debug(e.getMessage());
        }

        // num_peptides_distinct_ms_run[1] not allowed displayed in the peptide header.
        String peh = "PEH\tsequence\taccession\tunique\tdatabase\tdatabase_version\tsearch_engine\t" +
            "best_search_engine_score[1]\tnum_peptides_distinct_ms_run[1]\treliability\tmodifications\t" +
            "retention_time\tretention_time_window\tcharge\tmass_to_charge\turi\tspectra_ref\n";

        PEHLineParser pehParser = new PEHLineParser(metadata);
        try {
            pehParser.parse(1, peh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() ==  LogicalErrorType.ColumnNotValid);
            logger.debug(e.getMessage());
        }

        // search_engine_score_ms_run[0] not validat number.
        String smh = "SMH\tidentifier\tchemical_formula\tsmiles\tinchi_key\tdescription\texp_mass_to_charge\t" +
            "calc_mass_to_charge\tcharge\tretention_time\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "reliability\turi\tspectra_ref\tsearch_engine\tbest_search_engine_score[1]\tsearch_engine_score[1]_ms_run[0]\t" +
            "modifications";

        SMHLineParser smhParser = new SMHLineParser(metadata);
        try {
            smhParser.parse(1, smh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.IdNumber);
            logger.debug(e.getMessage());
        }
    }

    @Test
    public void testAbundanceAssayColumns() throws Exception {
        String prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";

        // peptide_abundance_assay not allow defined in the protein header.
        prh += "\tpeptide_abundance_assay[1]";
        PRHLineParser prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == FormatErrorType.AbundanceColumn);
            logger.debug(e.getMessage());
        }

        prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";

        // assay[30] not defined in the metadata.
        prh += "\tprotein_abundance_assay[30]";
        prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.AssayNotDefined);
            logger.debug(e.getMessage());
        }

        String psh = "PSH\tsequence\tPSM_ID\taccession\tunique\tdatabase\tdatabase_version\t" +
            "search_engine\tsearch_engine_score[1]\treliability\tmodifications\tretention_time\tcharge\t" +
            "exp_mass_to_charge\tcalc_mass_to_charge\turi\tspectra_ref\tpre\tpost\tstart\tend";

        // PSM header doesn't support optional columns.
        psh += "\tpsm_abundance_assay[1]";
        PSHLineParser pshParser = new PSHLineParser(metadata);
        try {
            pshParser.parse(1, psh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.ColumnNotValid);
            logger.debug(e.getMessage());
        }
    }

    @Test
    public void testAbundanceStudyVariableColumns() throws Exception {
        String prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";

        // study_variable[10] not defined in the metadata.
        prh += "\tprotein_abundance_study_variable[10]\tprotein_abundance_stdev_study_variable[10]\tprotein_abundance_std_error_study_variable[10]";
        PRHLineParser prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.StudyVariableNotDefined);
            logger.debug(e.getMessage());
        }

        // miss protein_abundance_stdev_study_variable[1], three columns should be display together.
        prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";
        prh += "\tprotein_abundance_study_variable[1]\tprotein_abundance_std_error_study_variable[1]";
        prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.AbundanceColumnTogether);
            logger.debug(e.getMessage());
        }

        // study_variable id number not same error.
        prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";
        prh += "\tprotein_abundance_study_variable[1]\tprotein_abundance_stdev_study_variable[2]\tprotein_abundance_std_error_study_variable[1]";
        prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.AbundanceColumnSameId);
            logger.debug(e.getMessage());
        }
    }

    @Test
    public void testCVParamOptionalColumn() throws Exception {
        //  Column names MUST only contain the following characters: 'A'-'Z', 'a'-'z', '0'-'9', '_', '-', '[', ']', and ':'.
        String prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";
        prh += "\topt_assay[1]_#y_value";
        PRHLineParser prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == FormatErrorType.OptionalCVParamColumn);
            logger.debug(e.getMessage());
        }

        //  assay[10] not defined in the metadata.
        prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";
        prh += "\topt_assay[10]_my_value";
        prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.AssayNotDefined);
            logger.debug(e.getMessage());
        }

        //  assay[x] is not a number.
        prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";
        prh += "\topt_assay[x]_my_value";
        prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.IdNumber);
            logger.debug(e.getMessage());
        }
    }

    @Test
    public void testModeType() throws Exception {
        metadata.setMZTabMode(MZTabDescription.Mode.Complete);
        metadata.setMZTabType(MZTabDescription.Type.Identification);

        // In Complete and Identification document, user should provide:
        // search_engine_score_ms_run[1-n], num_psms_ms_run[1-n], num_peptides_distinct_ms_run[1-n]
        // num_peptide_unique_ms_run[1-n]
        String prh = "PRH\taccession\tdescription\ttaxid\tspecies\tdatabase\tdatabase_version\t" +
            "search_engine\tbest_search_engine_score[1]\treliability\tambiguity_members\tmodifications\turi\t" +
            "go_terms\tprotein_coverage";
        PRHLineParser prhParser = new PRHLineParser(metadata);
        try {
            prhParser.parse(1, prh, errorList);
            assertTrue(false);
        } catch (MZTabException e) {
            assertTrue(e.getError().getType() == LogicalErrorType.NotDefineInHeader);
            logger.debug(e.getMessage());
        }
    }
}


text:
package org.mmtk.policy;

import org.mmtk.plan.markcompact.MC;
import org.mmtk.utility.Conversions;
import org.mmtk.utility.alloc.Allocator;
import org.mmtk.utility.alloc.BumpPointer;
import org.mmtk.vm.VM;

import org.vmmagic.pragma.*;
import org.vmmagic.unboxed.Address;
import org.vmmagic.unboxed.Extent;
import org.vmmagic.unboxed.ObjectReference;

/**
 * This class implements unsynchronized (local) elements of a
 * sliding mark-compact collector. Allocation is via the bump pointer
 * (@see BumpPointer).
 *
 * @see BumpPointer
 * @see MarkCompactSpace
 */
@Uninterruptible public final class MarkCompactLocal extends BumpPointer {

  /**
   * Constructor
   *
   * @param space The space to bump point into.
   */
  public MarkCompactLocal(MarkCompactSpace space) {
    super(space, true);
  }

  /**
   * Perform the compacting phase of the collection.
   */
  public void compact() {
    /* Has this allocator ever allocated anything? */
    if (initialRegion.isZero()) return;

    /* Loop through active regions or until the last region */
    Address start = initialRegion;
    Address allocStart = initialRegion;
    Address allocEnd = initialRegion.plus(REGION_LIMIT_OFFSET).loadAddress();
    Address allocCursor = allocStart.plus(DATA_START_OFFSET);

    /* Keep track of which regions are being used */
    int oldPages = 0;
    int newPages = Conversions.bytesToPages(allocEnd.diff(allocStart).plus(BYTES_IN_ADDRESS));

    while (!start.isZero()) {
      /* Get the end of this region */
      Address end = start.plus(REGION_LIMIT_OFFSET).loadAddress();
      Address dataEnd = start.plus(DATA_END_OFFSET).loadAddress();
      Address nextRegion = start.plus(NEXT_REGION_OFFSET).loadAddress();
      oldPages += Conversions.bytesToPages(end.diff(start).plus(BYTES_IN_ADDRESS));

      /* dataEnd = zero represents the current region. */
      Address currentLimit = (dataEnd.isZero() ? cursor : dataEnd);
      ObjectReference current =
        VM.objectModel.getObjectFromStartAddress(start.plus(DATA_START_OFFSET));

      while (VM.objectModel.refToAddress(current).LT(currentLimit) && !current.isNull()) {
        ObjectReference next = VM.objectModel.getNextObject(current);

        ObjectReference copyTo = MarkCompactSpace.getForwardingPointer(current);

        if (!copyTo.isNull() && Space.isInSpace(MC.MARK_COMPACT, copyTo)) {
          if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!MarkCompactSpace.isMarked(current));
          // To be copied.
          if (copyTo.toAddress().GT(allocEnd) || copyTo.toAddress().LT(allocStart)) {
            // changed regions.

            VM.memory.zero(allocCursor, allocEnd.diff(allocCursor).toWord().toExtent().plus(BYTES_IN_ADDRESS));

            allocStart.store(allocCursor, DATA_END_OFFSET);
            allocStart = allocStart.plus(NEXT_REGION_OFFSET).loadAddress();
            allocEnd = allocStart.plus(REGION_LIMIT_OFFSET).loadAddress();
            allocCursor = allocStart.plus(DATA_START_OFFSET);

            newPages += Conversions.bytesToPages(allocEnd.diff(allocStart).plus(BYTES_IN_ADDRESS));

            if (VM.VERIFY_ASSERTIONS) {
              VM.assertions._assert(allocCursor.LT(allocEnd) && allocCursor.GE(allocStart));
            }
          }
          allocCursor = VM.objectModel.copyTo(current, copyTo, allocCursor);
          MarkCompactSpace.setForwardingPointer(copyTo, ObjectReference.nullReference());
        }
        current = next;
      }
      if (dataEnd.isZero()) {
        break;
      }
      start = nextRegion;
    }
    Extent zeroBytes = allocEnd.diff(allocCursor).toWord().toExtent().plus(BYTES_IN_ADDRESS);
    VM.memory.zero(allocCursor, zeroBytes);

    allocStart.store(Address.zero(), DATA_END_OFFSET);
    region = allocStart;
    cursor = allocCursor;
    updateLimit(allocEnd, region, 0);
    if (oldPages > newPages) {
      ((MarkCompactSpace) space).unusePages((oldPages - newPages));
    }

    // Zero during GC to help debugging.
    allocStart = allocStart.loadAddress(NEXT_REGION_OFFSET);
    while (!allocStart.isZero()) {
      allocStart.store(Address.zero(), DATA_END_OFFSET);
      if (VM.VERIFY_ASSERTIONS) {
        Address low = allocStart.plus(DATA_START_OFFSET);
        Extent size = allocStart.loadAddress(REGION_LIMIT_OFFSET).diff(allocStart).toWord().toExtent().minus(2 * BYTES_IN_ADDRESS);
        VM.memory.zero(low, size);
      }
      allocStart = allocStart.loadAddress(NEXT_REGION_OFFSET);
    }
  }

  /**
   * Perform a linear scan through the objects allocated by this bump pointer,
   * calculating where each live object will be post collection.
   */
  public void calculateForwardingPointers() {
    /* Has this allocator ever allocated anything? */
    if (initialRegion.isZero()) return;

    /* Loop through active regions or until the last region */
    Address start = initialRegion;
    Address allocStart = initialRegion;
    Address allocDataEnd = initialRegion.plus(DATA_END_OFFSET).loadAddress();
    Address allocLimit = (allocDataEnd.isZero() ? cursor : allocDataEnd);
    Address allocCursor = start.plus(DATA_START_OFFSET);

    while (!start.isZero()) {
      /* Get the end of this region */
      Address dataEnd = start.plus(DATA_END_OFFSET).loadAddress();

      /* dataEnd = zero represents the current region. */
      Address currentLimit = (dataEnd.isZero() ? cursor : dataEnd);
      ObjectReference current =
        VM.objectModel.getObjectFromStartAddress(start.plus(DATA_START_OFFSET));

      while (VM.objectModel.refToAddress(current).LT(currentLimit) && !current.isNull()) {
        ObjectReference next = VM.objectModel.getNextObject(current);

        if (MarkCompactSpace.toBeCompacted(current)) {
          if (VM.VERIFY_ASSERTIONS)
            VM.assertions._assert(MarkCompactSpace.getForwardingPointer(current).isNull());

          // Fake - allocate it.
          int size = VM.objectModel.getSizeWhenCopied(current);
          int align = VM.objectModel.getAlignWhenCopied(current);
          int offset = VM.objectModel.getAlignOffsetWhenCopied(current);
          allocCursor = Allocator.alignAllocationNoFill(allocCursor, align, offset);

          boolean sameRegion = allocStart.EQ(start);

          if (!sameRegion && allocCursor.plus(size).GT(allocLimit)) {
            allocStart = allocStart.plus(NEXT_REGION_OFFSET).loadAddress();
            allocDataEnd = allocStart.plus(DATA_END_OFFSET).loadAddress();
            allocLimit = (allocDataEnd.isZero() ? cursor : allocDataEnd);
            allocCursor = Allocator.alignAllocationNoFill(allocStart.plus(DATA_START_OFFSET), align, offset);
          }

          ObjectReference target = VM.objectModel.getReferenceWhenCopiedTo(current, allocCursor);
          if (sameRegion && target.toAddress().GE(current.toAddress())) {
            MarkCompactSpace.setForwardingPointer(current, current);
            allocCursor = VM.objectModel.getObjectEndAddress(current);
          } else {
            MarkCompactSpace.setForwardingPointer(current, target);
            allocCursor = allocCursor.plus(size);
          }
        }
        current = next;
      }
      if (dataEnd.isZero()) {
        break;
      }
      start = start.plus(NEXT_REGION_OFFSET).loadAddress(); // Move on to next
    }
  }

  /**
   * Some pages are about to be re-used to satisfy a slow path request.
   * @param pages The number of pages.
   */
  protected void reusePages(int pages) {
    ((MarkCompactSpace)space).reusePages(pages);
  }

  /**
   * Maximum size of a single region. Important for children that implement
   * load balancing or increments based on region size.
   * @return the maximum region size
   */
  protected Extent maximumRegionSize() { return Extent.fromIntZeroExtend(4 << LOG_CHUNK_SIZE) ; }
}


text:
<?php

namespace Illuminate\Foundation\Auth;

use Illuminate\Http\Request;

trait VerifiesEmails
{
    use RedirectsUsers;

    /**
     * Show the email verification notice.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function show(Request $request)
    {
        return $request->user()->hasVerifiedEmail()
                        ? redirect($this->redirectPath())
                        : view('auth.verify');
    }

    /**
     * Mark the authenticated user's email address as verified.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function verify(Request $request)
    {
        if ($request->route('id') == $request->user()->getKey()) {
            $request->user()->markEmailAsVerified();
        }

        return redirect($this->redirectPath());
    }

    /**
     * Resend the email verification notification.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function resend(Request $request)
    {
        $request->user()->sendEmailVerificationNotification();

        return back()->with('resent', true);
    }
}


text:
<!DOCTYPE html>
<html >
<body>

Hello World from AppEngine Standard!

</body>
</html>


text:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Text;

namespace _3d
{
	public class threeD : System.Windows.Forms.Form
	{
        private const int   INTERFACE_UPDATETIME = 50;
        private const float DISTANCEFACTOR = 1.0f;          // Units per meter.  I.e feet would = 3.28.  centimeters would = 100.

        private FMOD.System  system   =  null;
        private FMOD.Sound   sound1   = null, sound2 = null, sound3 = null;
        private FMOD.Channel channel1 = null, channel2 = null, channel3 = null;
        private bool         listenerflag = true;

        private FMOD.VECTOR          lastpos = new FMOD.VECTOR();
        private FMOD.VECTOR          listenerpos = new FMOD.VECTOR();
        private static float         t = 0;

        private System.Windows.Forms.StatusBar statusBar;
        private System.Windows.Forms.Button exit_button;
        private System.Windows.Forms.Label label;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Button button4;
        private System.Windows.Forms.Timer timer;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.TrackBar trackBarPosition;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.ComponentModel.IContainer components;

		public threeD()
		{
			InitializeComponent();
		}

		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
                FMOD.RESULT     result;

                /*
                    Shut down
                */
                if (sound1 != null)
                {
                    result = sound1.release();
                    ERRCHECK(result);
                }
                if (sound2 != null)
                {
                    result = sound2.release();
                    ERRCHECK(result);
                }
                if (sound3 != null)
                {
                    result = sound3.release();
                    ERRCHECK(result);
                }
                if (system != null)
                {
                    result = system.close();
                    ERRCHECK(result);
                    result = system.release();
                    ERRCHECK(result);
                }

				if (components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            this.statusBar = new System.Windows.Forms.StatusBar();
            this.exit_button = new System.Windows.Forms.Button();
            this.label = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.button3 = new System.Windows.Forms.Button();
            this.button4 = new System.Windows.Forms.Button();
            this.timer = new System.Windows.Forms.Timer(this.components);
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.trackBarPosition = new System.Windows.Forms.TrackBar();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.trackBarPosition)).BeginInit();
            this.SuspendLayout();
            //
            // statusBar
            //
            this.statusBar.Location = new System.Drawing.Point(0, 291);
            this.statusBar.Name = "statusBar";
            this.statusBar.Size = new System.Drawing.Size(264, 24);
            this.statusBar.TabIndex = 18;
            //
            // exit_button
            //
            this.exit_button.Location = new System.Drawing.Point(96, 264);
            this.exit_button.Name = "exit_button";
            this.exit_button.Size = new System.Drawing.Size(72, 24);
            this.exit_button.TabIndex = 17;
            this.exit_button.Text = "Exit";
            this.exit_button.Click += new System.EventHandler(this.exit_button_Click);
            //
            // label
            //
            this.label.Location = new System.Drawing.Point(0, 0);
            this.label.Name = "label";
            this.label.Size = new System.Drawing.Size(264, 32);
            this.label.TabIndex = 16;
            this.label.Text = "Copyright (c) Firelight Technologies 2004-2011";
            this.label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(16, 32);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(232, 32);
            this.button1.TabIndex = 19;
            this.button1.Text = "Pause/Unpause 16bit 3D sound at any time";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // button2
            //
            this.button2.Location = new System.Drawing.Point(16, 72);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(232, 32);
            this.button2.TabIndex = 20;
            this.button2.Text = "Pause/Unpause 8bit 3D sound at any time";
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // button3
            //
            this.button3.Location = new System.Drawing.Point(16, 112);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(232, 32);
            this.button3.TabIndex = 21;
            this.button3.Text = "Play 16bit STEREO 2D sound at any time";
            this.button3.Click += new System.EventHandler(this.button3_Click);
            //
            // button4
            //
            this.button4.Location = new System.Drawing.Point(16, 152);
            this.button4.Name = "button4";
            this.button4.Size = new System.Drawing.Size(232, 32);
            this.button4.TabIndex = 22;
            this.button4.Text = "Stop/Start listener automatic movement";
            this.button4.Click += new System.EventHandler(this.button4_Click);
            //
            // timer
            //
            this.timer.Enabled = true;
            this.timer.Interval = 49;
            this.timer.Tick += new System.EventHandler(this.timer_Tick);
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.trackBarPosition);
            this.groupBox1.Location = new System.Drawing.Point(16, 192);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(232, 64);
            this.groupBox1.TabIndex = 23;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Listener Position";
            //
            // trackBarPosition
            //
            this.trackBarPosition.Location = new System.Drawing.Point(8, 16);
            this.trackBarPosition.Maximum = 35;
            this.trackBarPosition.Minimum = -35;
            this.trackBarPosition.Name = "trackBarPosition";
            this.trackBarPosition.Size = new System.Drawing.Size(216, 45);
            this.trackBarPosition.TabIndex = 0;
            this.trackBarPosition.TickStyle = System.Windows.Forms.TickStyle.None;
            this.trackBarPosition.Scroll += new System.EventHandler(this.trackBarPosition_Scroll);
            //
            // label1
            //
            this.label1.Location = new System.Drawing.Point(80, 40);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(32, 16);
            this.label1.TabIndex = 1;
            this.label1.Text = "<1>";
            //
            // label2
            //
            this.label2.Location = new System.Drawing.Point(144, 40);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(24, 16);
            this.label2.TabIndex = 2;
            this.label2.Text = "<2>";
            //
            // threeD
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(264, 315);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.button4);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.statusBar);
            this.Controls.Add(this.exit_button);
            this.Controls.Add(this.label);
            this.Name = "threeD";
            this.Text = "3D Example";
            this.Load += new System.EventHandler(this.threeD_Load);
            this.groupBox1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.trackBarPosition)).EndInit();
            this.ResumeLayout(false);

        }
		#endregion

		[STAThread]
		static void Main()
		{
			Application.Run(new threeD());
		}

        private void threeD_Load(object sender, System.EventArgs e)
        {
            uint            version = 0;
            FMOD.RESULT     result;

            trackBarPosition.Enabled = false;

            /*
                Create a System object and initialize.
            */
            result = FMOD.Factory.System_Create(ref system);
            ERRCHECK(result);

            result = system.getVersion(ref version);
            ERRCHECK(result);
            if (version < FMOD.VERSION.number)
            {
                MessageBox.Show("Error!  You are using an old version of FMOD " + version.ToString("X") + ".  This program requires " + FMOD.VERSION.number.ToString("X") + ".");
                Application.Exit();
            }

			FMOD.CAPS        caps        = FMOD.CAPS.NONE;
			FMOD.SPEAKERMODE speakermode = FMOD.SPEAKERMODE.STEREO;

			int	outputrate = 0;
			StringBuilder name = new StringBuilder(128);

			result = system.getDriverCaps(0, ref caps, ref outputrate, ref speakermode);
			ERRCHECK(result);

			result = system.setSpeakerMode(speakermode);                             /* Set the user selected speaker mode. */
			ERRCHECK(result);

			if ((caps & FMOD.CAPS.HARDWARE_EMULATED) == FMOD.CAPS.HARDWARE_EMULATED) /* The user has the 'Acceleration' slider set to off!  This is really bad for latency!. */
			{                                                                        /* You might want to warn the user about this. */
				result = system.setDSPBufferSize(1024, 10);	                     /* At 48khz, the latency between issuing an fmod command and hearing it will now be about 213ms. */
				ERRCHECK(result);
			}

			FMOD.GUID guid = new FMOD.GUID();

			result = system.getDriverInfo(0, name, 256, ref guid);
			ERRCHECK(result);

			if (name.ToString().IndexOf("SigmaTel") != -1)   /* Sigmatel sound devices crackle for some reason if the format is pcm 16bit.  pcm floating point output seems to solve it. */
			{
				result = system.setSoftwareFormat(48000, FMOD.SOUND_FORMAT.PCMFLOAT, 0,0, FMOD.DSP_RESAMPLER.LINEAR);
				ERRCHECK(result);
			}

            result = system.init(32, FMOD.INITFLAGS.NORMAL, (IntPtr)null);
			if (result == FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER)
			{
				result = system.setSpeakerMode(FMOD.SPEAKERMODE.STEREO);             /* Ok, the speaker mode selected isn't supported by this soundcard.  Switch it back to stereo... */
				ERRCHECK(result);

				result = system.init(32, FMOD.INITFLAGS.NORMAL, (IntPtr)null);        /* Replace with whatever channel count and flags you use! */
				ERRCHECK(result);
			}

            /*
                Set the distance units. (meters/feet etc).
            */
            result = system.set3DSettings(1.0f, DISTANCEFACTOR, 1.0f);
            ERRCHECK(result);

            /*
                Load some sounds
            */
            result = system.createSound("../../../../../examples/media/drumloop.wav", (FMOD.MODE.HARDWARE | FMOD.MODE._3D), ref sound1);
            ERRCHECK(result);
            result = sound1.set3DMinMaxDistance(2.0f * DISTANCEFACTOR, 10000.0f * DISTANCEFACTOR);
            ERRCHECK(result);
            result = sound1.setMode(FMOD.MODE.LOOP_NORMAL);
            ERRCHECK(result);

            result = system.createSound("../../../../../examples/media/jaguar.wav", (FMOD.MODE.HARDWARE | FMOD.MODE._3D), ref sound2);
            ERRCHECK(result);
            result = sound2.set3DMinMaxDistance(2.0f * DISTANCEFACTOR, 10000.0f * DISTANCEFACTOR);
            ERRCHECK(result);
            result = sound2.setMode(FMOD.MODE.LOOP_NORMAL);
            ERRCHECK(result);

            result = system.createSound("../../../../../examples/media/swish.wav", (FMOD.MODE.HARDWARE | FMOD.MODE._2D), ref sound3);
            ERRCHECK(result);

            /*
                Play sounds at certain positions
            */
            {
                FMOD.VECTOR pos1 = new FMOD.VECTOR();
                pos1.x = -10.0f * DISTANCEFACTOR; pos1.y = -0.0f; pos1.z = 0.0f;

                FMOD.VECTOR vel1 = new FMOD.VECTOR();
                vel1.x = 0.0f; vel1.y =  0.0f; vel1.z = 0.0f;

                result = system.playSound(FMOD.CHANNELINDEX.FREE, sound1, true, ref channel1);
                ERRCHECK(result);
                result = channel1.set3DAttributes(ref pos1, ref vel1);
                ERRCHECK(result);
                result = channel1.setPaused(false);
                ERRCHECK(result);
            }

            {
                FMOD.VECTOR pos2 = new FMOD.VECTOR();
                pos2.x = 15.0f * DISTANCEFACTOR; pos2.y = -0.0f; pos2.z = -0.0f;

                FMOD.VECTOR vel2 = new FMOD.VECTOR();
                vel2.x = 0.0f; vel2.y = 0.0f; vel2.z = 0.0f;

                result = system.playSound(FMOD.CHANNELINDEX.FREE, sound2, true, ref channel2);
                ERRCHECK(result);
                result = channel2.set3DAttributes(ref pos2, ref vel2);
                ERRCHECK(result);
                result = channel2.setPaused(false);
                ERRCHECK(result);
            }

            lastpos.x = 0.0f;
            lastpos.y = 0.0f;
            lastpos.z = 0.0f;

            listenerpos.x = 0.0f;
            listenerpos.y = 0.0f;
            listenerpos.z = -1.0f * DISTANCEFACTOR;
        }

        private void button1_Click(object sender, System.EventArgs e)
        {
            FMOD.RESULT result;

            bool paused = false;

            result = channel1.getPaused(ref paused);
            ERRCHECK(result);

            result = channel1.setPaused(!paused);
            ERRCHECK(result);
        }

        private void button2_Click(object sender, System.EventArgs e)
        {
            FMOD.RESULT result;

            bool paused = false;

            result = channel2.getPaused(ref paused);
            ERRCHECK(result);

            result = channel2.setPaused(!paused);
            ERRCHECK(result);
        }

        private void button3_Click(object sender, System.EventArgs e)
        {
            FMOD.RESULT result;

            result = system.playSound(FMOD.CHANNELINDEX.FREE, sound3, false, ref channel3);
            ERRCHECK(result);
        }

        private void button4_Click(object sender, System.EventArgs e)
        {
            trackBarPosition.Enabled = listenerflag;
            listenerflag = !listenerflag;
        }

        private void trackBarPosition_Scroll(object sender, System.EventArgs e)
        {
            listenerpos.x = trackBarPosition.Value * DISTANCEFACTOR;
        }

        private void exit_button_Click(object sender, System.EventArgs e)
        {
            Application.Exit();
        }

        private void timer_Tick(object sender, System.EventArgs e)
        {
            FMOD.RESULT result;

            // ==========================================================================================
            // UPDATE THE LISTENER
            // ==========================================================================================

            FMOD.VECTOR forward  = new FMOD.VECTOR();
            forward.x = 0.0f; forward.y = 0.0f; forward.z = 1.0f;

            FMOD.VECTOR up = new FMOD.VECTOR();
            up.x = 0.0f; up.y = 1.0f; up.z = 0.0f;

            FMOD.VECTOR vel = new FMOD.VECTOR();

            if (listenerflag)
            {
                listenerpos.x = ((float)Math.Sin(t * 0.05f) * 33.0f * DISTANCEFACTOR); // left right pingpong
                trackBarPosition.Value = (int)listenerpos.x;
            }

            // ********* NOTE ******* READ NEXT COMMENT!!!!!
            // vel = how far we moved last FRAME (m/f), then time compensate it to SECONDS (m/s).
            vel.x = (listenerpos.x - lastpos.x) * (1000 / INTERFACE_UPDATETIME);
            vel.y = (listenerpos.y - lastpos.y) * (1000 / INTERFACE_UPDATETIME);
            vel.z = (listenerpos.z - lastpos.z) * (1000 / INTERFACE_UPDATETIME);

            // store pos for next time
            lastpos = listenerpos;

            result = system.set3DListenerAttributes(0, ref listenerpos, ref vel, ref forward, ref up);
            ERRCHECK(result);

            t += (30 * (1.0f / (float)INTERFACE_UPDATETIME));    // t is just a time value .. it increments in 30m/s steps in this example

            if (system != null)
            {
                system.update();
            }
        }

        private void ERRCHECK(FMOD.RESULT result)
        {
            if (result != FMOD.RESULT.OK)
            {
                timer.Stop();
                MessageBox.Show("FMOD error! " + result + " - " + FMOD.Error.String(result));
                Environment.Exit(-1);
            }
        }
	}
}


text:
var repository = require('../model/repository'),
    layout = require('./layout');

exports = module.exports = function (req, res) {
    layout(req, res, { title: 'Customers' }, doBody);
}

function doBody(req, res)
{
    res.write('
\
New Customer\

');

    res.write('
\n');
    res.write('
Id	Name
\n');

    var customers = repository.getList();

    customers.forEach(function(customer) {
        res.write('
\n');
        res.write('' + customer.id + '	\n');
        res.write('' + customer.name + '	\n');
        res.write('
\n');
    });

    res.write('
\n');
}


text:
<?php

/**
 * API Serialized PHP output formatter
 * @ingroup API
 */
class ApiFormatNone extends ApiFormatBase {

	public function getMimeType() {
		return 'text/plain';
	}

	public function execute() {
	}

	public function getDescription() {
		return 'Output nothing' . parent::getDescription();
	}
}


text:
<dom-module id="ghvz-game-page">

<template>
  <template is="dom-if" if="[[game]]">

    <paper-drawer-panel id="drawer" disable-swipe responsive-width="[[computeResponsiveWidth_(isMobile)]]">
      <paper-material drawer>
        <ghvz-drawer
            bridge="[[bridge]]"
            is-admin="[[isAdmin]]"
            database="[[database]]"
            user-id="[[userId]]"
            game="[[game]]"
            player="[[player]]">
        </ghvz-drawer>
      </paper-material>

        <template is="dom-if" if="[[!isMobile]]">
          <ghvz-desktop-app
              bridge="[[bridge]]"
              is-admin="[[isAdmin]]"
              database="[[database]]"
              user-id="[[userId]]"
              email="[[email]]"
              game="[[game]]"
              player="[[player]]"
              player-id="[[playerId]]"
              path="[[innerPath]]">
          </ghvz-desktop-app>
        </template>
        <template is="dom-if" if="[[isMobile]]">
          <ghvz-mobile-app
              bridge="[[bridge]]"
              is-admin="[[isAdmin]]"
              database="[[database]]"
              email="[[email]]"
              user-id="[[userId]]"
              game="[[game]]"
              player="[[player]]"
              path="[[innerPath]]">
          </ghvz-mobile-app>
        </template>

    </paper-drawer-panel>
  </template>
</template>
</dom-module>


text:
package limelight.ui.model;

import limelight.Log;
import limelight.styles.RichStyle;
import limelight.styles.Style;
import limelight.styles.StyleObserver;
import limelight.model.api.FakeSceneProxy;
import limelight.ui.text.StyledText;
import limelight.util.TestUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.awt.*;
import java.awt.font.TextLayout;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;

public class TextPanelTest
{
  private TextPanel panel;
  private Style style;
  private Frame frame;
  private MockProp parent;
  private FakeScene root;
  private String defaultFontFace;
  private String defaultFontSize;
  private String defaultFontStyle;
  private Color defaultTextColor;

  @Before
  public void setUp() throws Exception
  {
    assumeTrue(TestUtil.notHeadless());
    parent = new MockProp();
    parent.setLocation(0, 0);
    parent.setSize(100, 100);
    style = parent.getStyle();
    panel = new TextPanel(parent);
    parent.add(panel);
    panel.setText("Some Text", parent);
    root = new FakeScene();
    root.setStage(new MockStage());
    root.add(parent);
    style.setTextColor("green");
    parent.prop.sceneProxy = new FakeSceneProxy();

    defaultFontFace = style.getFontFace();
    defaultFontSize = style.getFontSize();
    defaultFontStyle = style.getFontStyle();
    defaultTextColor = style.getCompiledTextColor().getColor();
  }

  @After
  public void tearDown()
  {
    if(frame != null)
      frame.setVisible(false);
  }

  @Test
  public void testConstructor() throws Exception
  {
    assertEquals("Some Text", panel.getText());
  }

  @Test
  public void preferredSize() throws Exception
  {
    useFrame();
    Layouts.on(panel, panel.getDefaultLayout());
    assertEquals(58, panel.getWidth());
    assertEquals(14, panel.getHeight());
  }

  @Test
  public void preferredSizeWithMoreText() throws Exception
  {
    useFrame();
    panel.setText("Once upon a time, there was a developer working on a tool called Limelight.", parent);
    Layouts.on(panel, panel.getDefaultLayout());
    assertEquals(true, panel.getWidth() >= 97 && panel.getWidth() <= 99);
    assertEquals(69, panel.getHeight());
  }

  @Test
  public void preferredSizeWithBigFontSize() throws Exception
  {
    useFrame();
    style.setFontSize("40");
    Layouts.on(panel, panel.getDefaultLayout());
    assertEquals(80, panel.getWidth());
    assertEquals(138, panel.getHeight());
  }

  @Test
  public void dimensionsWhenLastLineIsLongest() throws Exception
  {
    useFrame();
    panel.setText("1\n2\n3\nlongest", parent);
    Layouts.on(panel, panel.getDefaultLayout());
    assertEquals(true, panel.getWidth() >= 39 && panel.getWidth() <= 41);
    assertEquals(55, panel.getHeight());
  }

  private void useFrame()
  {
    frame = new Frame();
    frame.setVisible(true);
    panel.setGraphics(frame.getGraphics());
  }

  @Test
  public void textChanged() throws Exception
  {
    assertEquals(false, panel.textChanged());

    panel.setText("Something", parent);
    assertEquals(true, panel.needsLayout());

    panel.resetNeededLayout();
    panel.setText("Something", parent);
    assertEquals(false, panel.needsLayout());

    panel.setText("Something Else", parent);
    assertEquals(true, panel.needsLayout());

    panel.resetNeededLayout();
    assertEquals(false, panel.needsLayout());
  }

  @Test
  public void canBeBuffered() throws Exception
  {
    assertEquals(false, panel.canBeBuffered());
  }

  @Test
  public void buildingLines() throws Exception
  {
    panel.setText("some text", parent);
    panel.buildLines();

    List<TextLayout> lines = panel.getLines();

    assertEquals(1, lines.size());
    TextLayout layout = lines.get(0);
    assertEquals(9, layout.getCharacterCount());
    assertSubString("family=" + defaultFontFace, layout.toString());
    assertSubString("name=" + defaultFontFace, layout.toString());
    assertSubString("size=" + defaultFontSize, layout.toString());
  }

  @Test
  public void stylingAppliedToLine() throws Exception
  {
    createStyles();

    parent.setSize(200, 100);
    panel.setText("<my_style>some text</my_style>", parent);
    panel.buildLines();

    List<TextLayout> lines = panel.getLines();

    TextLayout layout = lines.get(0);
    assertEquals(1, lines.size());
    assertEquals(9, layout.getCharacterCount());
    assertSubString("name=Helvetica", layout.toString());
    assertSubString("style=bold", layout.toString());
    assertSubString("size=20", layout.toString());
  }

  @Test
  public void observerAddedForLineStyling() throws Exception
  {
    panel.setText("some text", parent);
    panel.buildLines();

    Style style = panel.getTextChunks().get(0).getStyle();
    assertEquals(true, style.hasObserver(panel));
  }

  @Test
  public void multipleStylesAppliedToLine() throws Exception
  {
    createStyles();

    parent.setSize(200, 100);
    panel.setText("<my_style>some </my_style><my_other_style>text</my_other_style>", parent);
    panel.buildLines();

    List<StyledText> chunks = panel.getTextChunks();

    StyledText layout = chunks.get(0);
    assertEquals(5, layout.getText().length());
    assertSubString("name=Helvetica", layout.toString());
    assertSubString("style=bold", layout.toString());
    assertSubString("size=20", layout.toString());

    StyledText layout2 = chunks.get(1);
    assertEquals(5, layout.getText().length());
    assertSubString("family=Dialog", layout2.toString());
    assertSubString("name=Cuneiform", layout2.toString());
    assertSubString("style=italic", layout2.toString());
    assertSubString("size=19", layout2.toString());
  }

  private void createStyles()
  {
    root.setStyles(new HashMap<String, RichStyle>());
    RichStyle myStyle = new RichStyle();
    root.getStyles().put("my_style", myStyle);
    myStyle.setFontFace("Helvetica");
    myStyle.setFontStyle("bold");
    myStyle.setFontSize("20");
    myStyle.setTextColor("red");

    RichStyle myOtherStyle = new RichStyle();
    root.getStyles().put("my_other_style", myOtherStyle);
    myOtherStyle.setFontFace("Cuneiform");
    myOtherStyle.setFontStyle("italic");
    myOtherStyle.setFontSize("19");
    myOtherStyle.setTextColor("blue");

    RichStyle sizeOnlyStyle = new RichStyle();
    root.getStyles().put("size_only_style", sizeOnlyStyle);
    sizeOnlyStyle.setFontSize("25");
  }

  @Test
  public void interlacedTextAndStyledText()
  {
    createStyles();
    parent.setSize(200, 100);
    panel.setText("This is <my_other_style>some </my_other_style> fantastic <my_style>text</my_style>", parent);
    panel.buildLines();

    List<StyledText> chunks = panel.getTextChunks();
    assertEquals(4, chunks.size());

    StyledText interlacedLayout = chunks.get(2);
    assertNoSubString("name=Cuneiform", interlacedLayout.toString());
    assertNoSubString("size=19", interlacedLayout.toString());
  }

  @Test
  public void unrecognizedInterlacedStyle()
  {
    createStyles();
    parent.setSize(200, 100);
    panel.setText("This is <my_other_style>some </my_other_style><bogus_style>fantastic</bogus_style><my_style>text</my_style>", parent);
    panel.buildLines();

    List<StyledText> chunks = panel.getTextChunks();
    assertEquals(4, chunks.size());

    StyledText interlacedLayout = chunks.get(2);
    assertNoSubString("name=Cuneiform", interlacedLayout.toString());
    assertNoSubString("size=19", interlacedLayout.toString());
  }

  @Test
  public void styledTextOnSameLine()
  {
    createStyles();
    parent.setSize(200, 100);
    panel.setText("This <my_other_style>some </my_other_style> text", parent);
    panel.buildLines();

    List<TextLayout> lines = panel.getLines();
    assertEquals(1, lines.size());

    String onlyLine = lines.get(0).toString();
    assertSubString("name=Cuneiform", onlyLine);
    assertSubString("size=19", onlyLine);
    assertSubString("style=italic", onlyLine);
    assertSubString("name=" + defaultFontFace, onlyLine);
    assertSubString("size=" + defaultFontSize, onlyLine);
    assertSubString("style=" + defaultFontStyle, onlyLine);
  }

  @Test
  public void styledInheritsFromDefault()
  {
    createStyles();
    parent.setSize(200, 100);
    panel.setText("<size_only_style>This some text</size_only_style>", parent);
    panel.buildLines();

    List<TextLayout> lines = panel.getLines();
    assertEquals(1, lines.size());

    String onlyLine = lines.get(0).toString();
    assertSubString("name=" + defaultFontFace, onlyLine);
    assertSubString("size=" + "25", onlyLine);
    assertSubString("style=" + defaultFontStyle, onlyLine);

    StyledText first = panel.getTextChunks().get(0);
    assertEquals(defaultTextColor, first.getColor());
  }

  @Test
  public void styledAcrossLineBreak()
  {
    createStyles();
    parent.setSize(200, 100);
    panel.setText("This <my_other_style>some\n more</my_other_style> text", parent);

    panel.buildLines();

    List<TextLayout> lines = panel.getLines();
    assertEquals(2, lines.size());

    TextLayout first = lines.get(0);
    TextLayout second = lines.get(1);
    assertSubString("name=Cuneiform", first.toString());
    assertSubString("name=" + defaultFontFace, first.toString());
    assertSubString("name=Cuneiform", second.toString());
    assertSubString("name=" + defaultFontFace, second.toString());
  }

  @Test
  public void textColor() throws Exception
  {
    createStyles();
    panel.setText("text <my_other_style>here</my_other_style> man", parent);
    panel.buildLines();

    StyledText first = panel.getTextChunks().get(0);
    assertEquals(defaultTextColor, first.getColor());

    StyledText second = panel.getTextChunks().get(1);
    assertEquals(new Color(0x0000FF), second.getColor());

    StyledText third = panel.getTextChunks().get(2);
    assertEquals(defaultTextColor, third.getColor());
  }

  @Test
  public void textChunksOverwrittenOnCompile() throws Exception
  {
    panel.setText("Here is some original text.", parent);
    panel.buildLines();

    int originalChunks = panel.getTextChunks().size();

    panel.buildLines();

    assertEquals(originalChunks, panel.getTextChunks().size());
  }

  private void assertSubString(String subString, String fullString)
  {
    int i = fullString.indexOf(subString);
    assertEquals(subString + " not found in " + fullString, true, i > -1);
  }

  private void assertNoSubString(String subString, String fullString)
  {
    int i = fullString.indexOf(subString);
    assertEquals(subString + " found in " + fullString, false, i > -1);
  }

  @Test
  public void changingTestRequiresUpdates() throws Exception
  {
    panel.resetNeededLayout();
    parent.resetNeededLayout();

    panel.setText("New Text", parent);

    assertEquals(true, panel.needsLayout());
    assertEquals(true, parent.needsLayout());
  }

  @Test
  public void layoutCausesDirtyRegion() throws Exception
  {
    Layouts.on(panel, panel.getDefaultLayout());

    ArrayList<Rectangle> list = new ArrayList<Rectangle>();
    root.getAndClearDirtyRegions(list);
    assertEquals(1, list.size());
    assertEquals(panel.getAbsoluteBounds(), list.get(0));
  }

  @Test
  public void resizesTextWhenSizeChanges() throws Exception
  {
    panel.setText("Some really long text so that there are multiple lines requiring layout when the size changes.", parent);
    Layouts.on(panel, panel.getDefaultLayout());

    int originalHeight = panel.getHeight();
    parent.setSize(400, 200);
    Layouts.on(panel, panel.getDefaultLayout());

    int newHeight = panel.getHeight();

    assertEquals(true, 200 - panel.getWidth() < 100);
    assertEquals(true, newHeight < originalHeight);
  }

  @Test
  public void parentSizeChangesAlwaysRequiresLayout() throws Exception
  {
    panel.resetNeededLayout();
    assertEquals(false, panel.needsLayout());

    panel.consumableAreaChanged();

    assertEquals(true, panel.needsLayout());
  }

  @Test
  public void teardownStyledTextBeforeDiscarding() throws Exception
  {
    panel.setText("Original Text", parent);
    Layouts.on(panel, panel.getDefaultLayout());
    List<StyleObserver> observers = panel.getStyle().getObservers();
    assertEquals(1, observers.size());
    StyleObserver observer = observers.get(0);

    Layouts.on(panel, panel.getDefaultLayout());
    List<StyleObserver> newObservers = panel.getStyle().getObservers();
    assertEquals(1, newObservers.size());
    StyleObserver newObserver = newObservers.get(0);
    assertNotSame(newObserver, observer);
  }

  @Test
  public void doestCrashWhenTheresNoConsumableArea() throws Exception
  {
    try
    {
      parent.setSize(-100, 0);
      panel.setText("hello", parent);
      panel.compile();
    }
    catch(Exception e)
    {
      fail("shouldn't throw error: " + e);
    }

  }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Login_model extends CI_Model
{

    function __construct() {
        parent::__construct();
        $this->load->database();
    }

    public function validate_user($data) {
        $this->db->where('username', $data['username']);
        $this->db->where('user_password', md5($data['user_password']));
        return $this->db->get('users')->row();
    }

    function __destruct() {
        $this->db->close();
    }
}


text:
import {
  Component,
  EventEmitter,
  OnDestroy,
  OnInit,
  Output,
  ViewChild
} from '@angular/core';
import { ConfigurationService } from "../../../../services/config.service";
import { Robot } from "../../../../../../ng-swagger-gen/models/robot";
import { ListAllProjectsComponent } from "../list-all-projects/list-all-projects.component";
import { NgForm } from "@angular/forms";
import { debounceTime, distinctUntilChanged, filter, finalize, switchMap } from "rxjs/operators";
import { Access } from "../../../../../../ng-swagger-gen/models/access";
import {
  ACTION_RESOURCE_I18N_MAP, ExpirationType,
  FrontAccess, INITIAL_ACCESSES,
  NAMESPACE_ALL_PROJECTS, onlyHasPushPermission,
  PermissionsKinds,
} from "../system-robot-util";
import { clone } from "../../../../shared/units/utils";
import { RobotService } from "../../../../../../ng-swagger-gen/services/robot.service";
import { ClrLoadingState } from "@clr/angular";
import { MessageHandlerService } from "../../../../shared/services/message-handler.service";
import { Subject, Subscription } from "rxjs";
import { operateChanges, OperateInfo, OperationState } from "../../../../shared/components/operation/operate";
import { OperationService } from "../../../../shared/components/operation/operation.service";
import { InlineAlertComponent } from "../../../../shared/components/inline-alert/inline-alert.component";
import { errorHandler } from "../../../../shared/units/shared.utils";

const MINI_SECONDS_ONE_DAY: number = 60 * 24 * 60 * 1000;

@Component({
  selector: 'new-robot',
  templateUrl: './new-robot.component.html',
  styleUrls: ['./new-robot.component.scss']
})
export class NewRobotComponent implements OnInit, OnDestroy {
  i18nMap = ACTION_RESOURCE_I18N_MAP;
  isEditMode: boolean = false;
  originalRobotForEdit: Robot;
  @Output()
  addSuccess: EventEmitter<Robot> = new EventEmitter<Robot>();
  addRobotOpened: boolean = false;
  systemRobot: Robot = {};
  expirationType: string = ExpirationType.DAYS;
  systemExpirationDays: number;
  coverAll: boolean = false;
  coverAllForEdit: boolean = false;

  isNameExisting: boolean = false;
  loading: boolean = false;
  checkNameOnGoing: boolean = false;
  loadingSystemConfig: boolean = false;
  defaultAccesses: FrontAccess[] = [];
  defaultAccessesForEdit: FrontAccess[] = [];
  @ViewChild(ListAllProjectsComponent)
  listAllProjectsComponent: ListAllProjectsComponent;
  @ViewChild(InlineAlertComponent)
  inlineAlertComponent: InlineAlertComponent;
  @ViewChild('robotForm', { static: true }) robotForm: NgForm;
  saveBtnState: ClrLoadingState = ClrLoadingState.DEFAULT;
  private _nameSubject: Subject<string> = new Subject<string>();
  private _nameSubscription: Subscription;
  constructor( private configService: ConfigurationService,
               private robotService: RobotService,
               private msgHandler: MessageHandlerService,
               private operationService: OperationService) {
  }
  ngOnInit(): void {
    this.subscribeName();
  }
  ngOnDestroy() {
    if (this._nameSubscription) {
      this._nameSubscription.unsubscribe();
      this._nameSubscription = null;
    }
  }
  subscribeName() {
    if (!this._nameSubscription) {
      this._nameSubscription = this._nameSubject
          .pipe(
              debounceTime(500),
              distinctUntilChanged(),
              filter(name => {
                if (this.isEditMode && this.originalRobotForEdit && this.originalRobotForEdit.name === name) {
                  return false;
                }
                return  name.length > 0;
              }),
              switchMap((name) => {
                this.isNameExisting = false;
                this.checkNameOnGoing = true;
                return  this.robotService.ListRobot({
                  q: encodeURIComponent(`name=${name}`)
                }).pipe(finalize(() => this.checkNameOnGoing = false));
              }))
          .subscribe(res => {
            if (res && res.length > 0) {
              this.isNameExisting = true;
            }
          });
    }
  }
  isExpirationInvalid(): boolean {
    return this.systemRobot.duration < -1;
  }
  inputExpiration() {
    if (+this.systemRobot.duration === -1) {
      this.expirationType = ExpirationType.NEVER;
    } else {
      this.expirationType = ExpirationType.DAYS;
    }
  }
  changeExpirationType() {
    if (this.expirationType === ExpirationType.DEFAULT) {
      this.systemRobot.duration = this.systemExpirationDays;
    }
    if (this.expirationType === ExpirationType.DAYS) {
      this.systemRobot.duration = this.systemExpirationDays;
    }
    if (this.expirationType === ExpirationType.NEVER) {
      this.systemRobot.duration = -1;
    }
  }
  getSystemRobotExpiration() {
      this.loadingSystemConfig = true;
      this.configService.getConfiguration()
          .pipe(finalize(() => this.loadingSystemConfig = false))
          .subscribe(res => {
            if (res && res.robot_token_duration && res.robot_token_duration.value) {
              this.systemRobot.duration = res.robot_token_duration.value;
              this.systemExpirationDays = this.systemRobot.duration;
            }
          });
  }
  inputName() {
    this._nameSubject.next(this.systemRobot.name);
  }
  cancel() {
    this.addRobotOpened = false;
  }
  getPermissions(): number {
    let count: number = 0;
    this.defaultAccesses.forEach(item => {
      if (item.checked) {
        count ++;
      }
    });
    return count;
  }
  chooseAccess(access: FrontAccess) {
    access.checked = !access.checked;
  }
  reset() {
    this.open(false);
    this.defaultAccesses = clone(INITIAL_ACCESSES);
    this.listAllProjectsComponent.init(false);
    this.listAllProjectsComponent.selectedRow = [];
    this.systemRobot = {};
    this.robotForm.reset();
    this.expirationType = ExpirationType.DAYS;
    this.getSystemRobotExpiration();
  }
  resetForEdit(robot: Robot) {
    this.open(true);
    this.defaultAccesses = clone(INITIAL_ACCESSES);
    this.defaultAccesses.forEach( item => item.checked = false);
    this.originalRobotForEdit = clone(robot);
    this.systemRobot = robot;
    this.expirationType =
        robot.duration === -1 ? ExpirationType.NEVER : ExpirationType.DAYS;
    if (robot && robot.permissions && robot.permissions.length) {
      this.coverAll = false;
      robot.permissions.forEach(item => {
        if (item.kind === PermissionsKinds.PROJECT
            && item.namespace === NAMESPACE_ALL_PROJECTS) {
          this.coverAll = true;
          if (item && item.access) {
            item.access.forEach(item2 => {
              this.defaultAccesses.forEach(item3 => {
                if (item3.resource === item2.resource && item3.action === item2.action) {
                  item3.checked = true;
                }
              });
            });
            this.defaultAccessesForEdit = clone(this.defaultAccesses);
          }
        }
      });
    }
    if (!this.coverAll) {
      this.defaultAccesses.forEach( item => item.checked = true);
    }
    this.robotForm.reset({
      name: this.systemRobot.name,
      expiration: this.systemRobot.duration,
      description: this.systemRobot.description,
      coverAll: this.coverAll
    });
    this.coverAllForEdit = this.coverAll;
    this.listAllProjectsComponent.init(true);
    this.listAllProjectsComponent.selectedRow = [];
    const map = {};
    this.listAllProjectsComponent.projects.forEach( (pro, index) => {
      if (this.systemRobot && this.systemRobot.permissions) {
        this.systemRobot.permissions.forEach( item => {
           if (pro.name === item.namespace) {
             item.access.forEach(acc => {
               pro.permissions[0].access.forEach(item3 => {
                 if (item3.resource === acc.resource && item3.action === acc.action) {
                   item3.checked = true;
                 }
               });
             });
             map[index] = true;
             this.listAllProjectsComponent.selectedRow.push(pro);
           }
        });
      }
    });
    this.listAllProjectsComponent.defaultAccesses.forEach( item => item.checked = true);
    this.listAllProjectsComponent.projects.forEach( (pro, index) => {
      if (!map[index]) {
        pro.permissions[0].access.forEach( item => {
          item.checked = true;
        });
      }
    });
  }
  open(isEditMode: boolean) {
    this.isNameExisting = false;
    this.isEditMode = isEditMode;
    this.addRobotOpened = true;
    this.inlineAlertComponent.close();
    this._nameSubject.next('');
  }
  disabled(): boolean {
    if (!this.isEditMode) {
      return !this.canAdd();
    }
    return !this.canEdit();
  }
  canAdd(): boolean {
    if (this.robotForm.invalid) {
      return false;
    }
    if (this.coverAll) {
      let flag = false;
      this.defaultAccesses.forEach(item => {
        if (item.checked) {
          flag = true;
        }
      });
      if (flag) {
        return true;
      }
    }
    if (!this.listAllProjectsComponent || !this.listAllProjectsComponent.selectedRow ||
        !this.listAllProjectsComponent.selectedRow.length) {
      return false;
    }
    for (let i = 0; i < this.listAllProjectsComponent.selectedRow.length; i++) {
      let flag = false;
      for (let j = 0; j < this.listAllProjectsComponent.selectedRow[i].permissions[0].access.length; j++) {
        if (this.listAllProjectsComponent.selectedRow[i].permissions[0].access[j].checked) {
          flag = true;
        }
      }
      if (!flag) {
        return false;
      }
    }
    return true;
  }
  canEdit() {
    if (!this.canAdd()) {
      return false;
    }
    // tslint:disable-next-line:triple-equals
    if (this.systemRobot.duration != this.originalRobotForEdit.duration) {
      return true;
    }
    // tslint:disable-next-line:triple-equals
    if (this.systemRobot.description != this.originalRobotForEdit.description) {
      return true;
    }
    if (this.coverAll !== this.coverAllForEdit) {
      if (this.coverAll) {
        let flag = false;
        this.defaultAccesses.forEach(item => {
          if (item.checked) {
            flag = true;
          }
        });
        if (!flag) {
          return false;
        }
      }
      return true;
    }
    if (this.coverAll === this.coverAllForEdit) {
      if (this.coverAll) {
        let flag = true;
        this.defaultAccessesForEdit.forEach(item => {
          this.defaultAccesses.forEach(item2 => {
            if (item.resource === item2.resource && item.action === item2.action && item.checked !== item2.checked) {
              flag = false;
            }
          });
        });
        return !flag;
      }
    }
    if (this.systemRobot.permissions.length !== this.listAllProjectsComponent.selectedRow.length) {
      return true;
    }
    const map = {};
    let accessFlag = true;
    this.listAllProjectsComponent.selectedRow.forEach(item => {
      this.systemRobot.permissions.forEach( item2 => {
        if (item.name === item2.namespace) {
          map[item.name] = true;
          if (item2.access.length !== this.getAccessNum(item.permissions[0].access)) {
            accessFlag = false;
          }
          item2.access.forEach(arr => {
            item.permissions[0].access.forEach(arr2 => {
              if (arr.resource === arr2.resource && arr.action === arr2.action && !arr2.checked) {
                accessFlag = false;
              }
            });
          });
        }
      });
    });
    if (!accessFlag) {
      return true;
    }
    let flag1 = true;
    this.systemRobot.permissions.forEach(item => {
      if (!map[item.namespace]) {
        flag1 = false;
      }
    });
    return !flag1;
  }
  save() {
    const robot: Robot = clone(this.systemRobot);
    robot.disable = false;
    robot.level = PermissionsKinds.SYSTEM;
    robot.duration = +this.systemRobot.duration;
    robot.permissions = [];
    if (this.coverAll) {
      const access: Access[] = [];
      this.defaultAccesses.forEach(item => {
        if (item.checked) {
          access.push({
            resource: item.resource,
            action: item.action
          });
        }
      });
      robot.permissions.push({
        kind: PermissionsKinds.PROJECT,
        namespace: NAMESPACE_ALL_PROJECTS,
        access: access
      });
    } else {
      this.listAllProjectsComponent.selectedRow.forEach( item => {
        const access: Access[] = [];
        item.permissions[0].access.forEach(item2 => {
          if (item2.checked) {
            access.push({
              resource: item2.resource,
              action: item2.action
            });
          }
        });
        robot.permissions.push({
          kind: PermissionsKinds.PROJECT,
          namespace: item.name,
          access: access
        });
      });
    }
    // Push permission must work with pull permission
    if (robot.permissions && robot.permissions.length) {
      for (let i = 0; i < robot.permissions.length; i++) {
        if (onlyHasPushPermission(robot.permissions[i].access)) {
          this.inlineAlertComponent.showInlineError('SYSTEM_ROBOT.PUSH_PERMISSION_TOOLTIP');
          return;
        }
      }
    }
    this.saveBtnState = ClrLoadingState.LOADING;
    if (this.isEditMode) {
      robot.disable = this.systemRobot.disable;
      const opeMessage = new OperateInfo();
      opeMessage.name = "SYSTEM_ROBOT.UPDATE_ROBOT";
      opeMessage.data.id = robot.id;
      opeMessage.state = OperationState.progressing;
      opeMessage.data.name = robot.name;
      this.operationService.publishInfo(opeMessage);
      this.robotService.UpdateRobot({
        robotId: this.originalRobotForEdit.id,
        robot
      }).subscribe( res => {
        this.saveBtnState = ClrLoadingState.SUCCESS;
        this.addSuccess.emit(null);
        this.addRobotOpened = false;
        operateChanges(opeMessage, OperationState.success);
        this.msgHandler.showSuccess("SYSTEM_ROBOT.UPDATE_ROBOT_SUCCESSFULLY");
      }, error => {
        this.saveBtnState = ClrLoadingState.ERROR;
        operateChanges(opeMessage, OperationState.failure, errorHandler(error));
        this.inlineAlertComponent.showInlineError(error);
      });
    } else {
      const opeMessage = new OperateInfo();
      opeMessage.name = "SYSTEM_ROBOT.ADD_ROBOT";
      opeMessage.data.id = robot.id;
      opeMessage.state = OperationState.progressing;
      opeMessage.data.name = robot.name;
      this.operationService.publishInfo(opeMessage);
      this.robotService.CreateRobot({
        robot: robot
      }).subscribe( res => {
        this.saveBtnState = ClrLoadingState.SUCCESS;
        this.addSuccess.emit(res);
        this.addRobotOpened = false;
        operateChanges(opeMessage, OperationState.success);
      }, error => {
        this.saveBtnState = ClrLoadingState.ERROR;
        this.inlineAlertComponent.showInlineError(error);
        operateChanges(opeMessage, OperationState.failure, errorHandler(error));
      });
    }
  }

  getAccessNum(access: FrontAccess[]): number {
    let count: number = 0;
    access.forEach(item => {
      if (item.checked) {
        count ++;
      }
    });
    return count;
  }
  calculateExpiresAt(): Date {
    if (this.systemRobot && this.systemRobot.creation_time && this.systemRobot.duration > 0) {
      return new Date(new Date(this.systemRobot.creation_time).getTime()
      + this.systemRobot.duration * MINI_SECONDS_ONE_DAY);
    }
    return null;
  }
  shouldShowWarning(): boolean {
    return new Date() >= this.calculateExpiresAt();
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE locale SYSTEM "../../../../../lib/pkp/dtd/locale.dtd">

<!--
  * plugins/generic/customLocale/locale/es_ES/locale.xml
  *
  * Copyright (c) 2003-2013 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * Localization strings for the es_ES (Español (España)) locale.
  *
  -->

<locale name="es_ES" full_name="Español (España)">
	<message key="plugins.generic.customLocale.name">"Plugin" Locale Personalizado</message>
	<message key="plugins.generic.customLocale.description">Este "plugin" permite la personalización de la interfaz de texto de usuario por defecto usada por OJS.</message>

	<message key="plugins.generic.customLocale.longDescription">Esta página lista todos los locales instalados actualmente para la revista.</message>
	<message key="plugins.generic.customLocale.localeDescription">Esta página lista todos los ficheros disponibles para el locale seleccionado.</message>
	<message key="plugins.generic.customLocale.fileDescription">Ingrese texto en el correspondiente campo de texto personalizado. Deje el campo de texto personalizado en blanco si el texto por defecto de OJS debe ser usado.</message>
	<message key="plugins.generic.customLocale.localeName">Nombre del Locale</message>
	<message key="plugins.generic.customLocale.localeKey">Clave</message>
	<message key="plugins.generic.customLocale.localeKeyValue">Valor</message>
	<message key="plugins.generic.customLocale.customize">Personalizar</message>
	<message key="plugins.generic.customLocale.availableLocales">Locales disponibles</message>

	<message key="plugins.generic.customLocale.locale">Locale {$locale}</message>
	<message key="plugins.generic.customLocale.localeFiles">Ficheros del Locale</message>
	<message key="plugins.generic.customLocale.file.filename">Nombre del fichero</message>
	<message key="plugins.generic.customLocale.file.edit">Editando {$filename}</message>
	<message key="plugins.generic.customLocale.file.reference">Texto por defecto</message>
	<message key="plugins.generic.customLocale.file.custom">Texto personalizado</message>
	<message key="plugins.generic.customLocale.localeKey.description">Inserte una clave completa de sitio (locale) para buscar.</message>
</locale>


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.smartsheet.api.models.enums.ColumnTag (Smartsheet Java SDK 2.146.0 API)</title>
<meta name="date" content="2021-11-12">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.smartsheet.api.models.enums.ColumnTag

Packages that use ColumnTag

Package
Description

com.smartsheet.api.models

com.smartsheet.api.models.enums

Uses of ColumnTag in com.smartsheet.api.models

Methods in com.smartsheet.api.models that return types with arguments of type ColumnTag

Modifier and Type
Method and Description

List<ColumnTag>
Column.getTags()

Gets the tags that indicate a special type of column.

Method parameters in com.smartsheet.api.models with type arguments of type ColumnTag

Modifier and Type
Method and Description

Column
Column.setTags(List<ColumnTag> tags)

Sets the tags to indicate a special type of column.

Uses of ColumnTag in com.smartsheet.api.models.enums

Methods in com.smartsheet.api.models.enums that return ColumnTag

Modifier and Type
Method and Description

static ColumnTag
ColumnTag.valueOf(String name)

Returns the enum constant of this type with the specified name.

static ColumnTag[]
ColumnTag.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014–2021 Smartsheet. All rights reserved.


text:
package com.organic.maynard.outliner.util.undo;

import com.organic.maynard.outliner.*;
import com.organic.maynard.outliner.dom.*;
import com.organic.maynard.outliner.event.*;

/**
 * @author  $Author: maynardd $
 * @version $Revision: 1.5 $, $Date: 2002/08/28 05:56:37 $
 */

public class UndoQueue implements com.organic.maynard.outliner.util.Destructible {

	// Class Fields
	public static int MAX_QUEUE_SIZE = 0;

	// Instance Fields
	private Document doc = null;
	private UndoableList queue = new UndoableList(MAX_QUEUE_SIZE);
	private int cursor = -1;

	/**
	 * Creates a new UndoQueue for the provided Document.
	 * an internal cursor is maintained that points to the current location. As
	 * actions are undone/redone this cursor is updated.
	 *
	 * @param doc the document that uses this UndoQueue.
	 */
	public UndoQueue(Document doc) {
		this.doc = doc;
	}

	// Destructible Interface
        @Override
	public void destroy() {
		doc = null;
		queue = null;
	}

	/**
	 * Gets the current size of the UndoQueue.
	 */
	public int getSize() {
		return queue.size();
	}

	/**
	 * Adds the Undoable to this UndoQueue. The
	 * queue is trimmed as neccessary to accomodate the new undoable. If
	 * successful, an UndoQueueEvent is fired.
	 *
	 * @param undoable the Undoable that is being added to
	 *                 this UndoQueue.
	 */
	public void add(Undoable undoable) {
		doc.setModified(true);

		int queueSize = MAX_QUEUE_SIZE;

		// Short Circuit if undo is disabled.
		if (queueSize == 0) {
			return;
		}

		// Trim Redoables
		trim();

		if (queue.size() < queueSize) {
			cursor++;
			queue.add(undoable);
		} else {
			queue.remove(0);
			queue.add(undoable);
		}

		// Fire Event
		Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.ADD);
	}

	/**
	 * Gets the current Undoable pointed to by the internal
	 * cursor.
	 *
	 * @return the current Undoable or null if
	 *         the UndoQueue is empty.
	 */
	public Undoable get() {
		try {
			return queue.get(cursor);
		} catch (IndexOutOfBoundsException aiobe) {
			return null;
		}
	}

	/**
	 * Gets the current Undoable pointed to by the internal
	 * cursor if it is an UndoableEdit object.
	 *
	 * @return the current Undoable or null if
	 *         the UndoQueue is empty, or the current Undoable
	 *         is not an instance of UndoableEdit.
	 */
	public UndoableEdit getIfEdit() {
		Undoable undoable = get();

		if (undoable instanceof UndoableEdit) {
			return (UndoableEdit) undoable;
		} else {
			return null;
		}
	}

	/**
	 * Trim specifically for resizing after MAX_QUEUE_SIZE
	 * has been changed. This is called from PreferencesPanelEditor.
	 */
	public void prefsTrim() {
		int difference = MAX_QUEUE_SIZE - queue.size();
		if (difference >= 0) {
			// Do Nothing since we're still under or at the limit.
		} else {
			// First trim off any redoables
			if (MAX_QUEUE_SIZE > cursor + 1) {
				queue.trim(MAX_QUEUE_SIZE);
			} else {
				queue.trim(cursor + 1);
			}

			// Next, trim undoables.
			int range = queue.size() - MAX_QUEUE_SIZE;
			if (range > 0) {
				queue.removeRange(0, range);
				cursor -= range;
			}
		}

		// Fire Event
		Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.TRIM);
	}

	/**
	 * Trims the undo queue to the current size of the UNDO_QUEUE_SIZE Preference.
	 * Starts by trimming ALL redoables then trims undoables if neccessary. An
	 * UndoQueueEvent is fired.
	 */
	private void trim() {
		// First trim off any redoables
		queue.trim(cursor + 1);

		// Next, trim undoables.
		int range = queue.size() - MAX_QUEUE_SIZE;
		if (range > 0) {
			queue.removeRange(0, range);
			cursor -= range;
		}

		// Fire Event
		Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.TRIM);
	}

	/**
	 * Clears this UndoQueue resetting it's size to zero. An
	 * UndoQueueEvent is fired.
	 */
	public void clear() {
		//System.out.println("Clear");
		cursor = -1;
		queue.clear();

		// Fire Event
		Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.CLEAR);
	}

	/**
	 * Indicates if this UndoQueue is currently empty.
	 *
	 * @return true if empty, otherwise returns false.
	 */
	public boolean isEmpty() {
		if (queue.size() <= 0) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * Calls the undo() method on the current Undoable if the
	 * UndoQueue is currently undoable. An UndoQueueEvent is fired.
	 */
	public void undo() {
		if (isUndoable()) {
			queue.get(cursor).undo();
			cursor--;
			doc.setModified(true);

			// Fire Event
			Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.UNDO);
		}
	}

	/**
	 * Calls the undo() method on each Undoable in the UndoQueue
	 * starting at the current Undoable. An UndoQueueEvent is fired.
	 */
	public void undoAll() {
		while (isUndoable()) {
			queue.get(cursor).undo();
			cursor--;
		}
		doc.setModified(true);

		// Fire Event
		Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.UNDO_ALL);
	}

	/**
	 * Indicates if this UndoQueue is currently undoable.
	 *
	 * @return true if undoable, otherwise returns false.
	 */
	public boolean isUndoable() {
		if (cursor >= 0) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * Gets a String that shows where we are in the undo stack.
	 * The String looks like [24/65/1000] to indicate we can undo
	 * 24 times out of a total of 65 undoable actions on the stack,
	 * and a maximum stack size of 1000.
	 *
	 * @return the formatted value.
	 */
	public String getUndoRangeString() {
		StringBuffer buf = new StringBuffer();
		buf.append("[").append(cursor + 1).append("/").append(queue.size()).append("/").append(MAX_QUEUE_SIZE).append("]");
		return buf.toString();
	}

	/**
	 * Gets a String that shows where we are in the undo stack.
	 * The String looks like [24/65/1000] to indicate we can redo
	 * 24 times out of a total of 65 undoable actions on the stack,
	 * and a maximum stack size of 1000.
	 *
	 * @return the formatted value.
	 */
	public String getRedoRangeString() {
		StringBuffer buf = new StringBuffer();
		buf.append("[").append(queue.size() - cursor - 1).append("/").append(queue.size()).append("/").append(MAX_QUEUE_SIZE).append("]");
		return buf.toString();
	}

	/**
	 * Gets a descriptive name for the current undoable action.
	 *
	 * @return the name of the current undoable action.
	 */
	public String getUndoName() {
		return queue.get(cursor).getName();
	}

	/**
	 * Gets a descriptive name for the current redoable action.
	 *
	 * @return the name of the current redoable action.
	 */
	public String getRedoName() {
		return queue.get(cursor + 1).getName();
	}

	/**
	 * Calls the redo() method on the current Undoable if the
	 * UndoQueue is currently redoable. An UndoQueueEvent is fired.
	 */
	public void redo() {
		if (isRedoable()) {
			cursor++;
			queue.get(cursor).redo();
			doc.setModified(true);

			// Fire Event
			Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.REDO);
		}
	}

	/**
	 * Calls the redo() method on each Undoable in the UndoQueue
	 * starting at the current Undoable. An UndoQueueEvent is fired.
	 */
	public void redoAll() {
		while (isRedoable()) {
			cursor++;
			queue.get(cursor).redo();
		}
		doc.setModified(true);

		// Fire Event
		Outliner.documents.fireUndoQueueEvent(doc, UndoQueueEvent.REDO_ALL);
	}

	/**
	 * Indicates if this UndoQueue is currently redoable.
	 *
	 * @return true if redoable, otherwise returns false.
	 */
	public boolean isRedoable() {
		if (cursor < queue.size() - 1) {
			return true;
		} else {
			return false;
		}
	}
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>SamPy.cosmology.distances.getDiameterDistances — SamPy v0.1 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="SamPy v0.1 documentation" href="index.html" />
    <link rel="up" title="SamPy.cosmology.distances" href="SamPy.cosmology.distances.html" />
    <link rel="next" title="SamPy.cosmology.distances.plot_DA" href="SamPy.cosmology.distances.plot_DA.html" />
    <link rel="prev" title="SamPy.cosmology.distances.cosmocalc" href="SamPy.cosmology.distances.cosmocalc.html" />

Navigation

          index

          modules |

          next |

          previous |

home|

search|

cosmology Package »

SamPy.cosmology.distances »

Previous topic

SamPy.cosmology.distances.cosmocalc

Next topic

SamPy.cosmology.distances.plot_DA

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

SamPy.cosmology.distances.getDiameterDistances¶

<tt class="descclassname">SamPy.cosmology.distances.</tt><tt class="descname">getDiameterDistances</tt><big>(</big>data, redshift=0<big>)</big>¶

Calculates a diameter distance in kpc / arc seconds
from data for all unique redshifts. The redshift
keyword indicates the column of redshifts.

<col class="field-name" />
<col class="field-body" />

Requires :	cosmocalc

Param :	data

Param :	redshift column

Returns:	diameter distances

Return type:	dictionary

Navigation

          index

          modules |

          next |

          previous |

home|

search|

cosmology Package »

SamPy.cosmology.distances »

        © Copyright 2011, Sami-Matias Niemi.


text:
heatmap
=======

(`ls` with fancy colors)

The current idea is to list all files in a directory, and use
different colors to distinguish recently modified files from older
files. So my files untouched since 2014 will be displayed in blue,
while files I edited yesterday will appear red.


text:
With [`gulp-watch`](https://github.com/floatdrop/gulp-watch):

```js
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');

gulp.task('default', function() {
    return gulp.src('./sass/*.scss')
        .pipe(watch())
        .pipe(sass())
        .pipe(gulp.dest('./dist/'));
});
```


text:
<?php

namespace IC\Bundle\Base\TestBundle\Test\DependencyInjection;

use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Config\Definition\Processor;
use IC\Bundle\Base\TestBundle\Test\TestCase;

/**
 * Dependency Injection Configuration Unit test case.
 *
 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
 */
abstract class ConfigurationTestCase extends TestCase
{
    /**
     * @var \Symfony\Component\Config\Definition\Processor
     */
    protected $processor;

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

        $this->processor = new Processor();
    }

    /**
     * {@inheritdoc}
     */
    protected function tearDown()
    {
        unset($this->processor);

        parent::tearDown();
    }

    /**
     * Processes an array of raw configuration and returns a compiled version.
     *
     * @param \Symfony\Component\Config\Definition\ConfigurationInterface $configuration
     * @param array                                                       $rawConfiguration
     *
     * @return array A normalized array
     */
    public function processConfiguration(ConfigurationInterface $configuration, array $rawConfiguration)
    {
        return $this->processor->processConfiguration($configuration, $rawConfiguration);
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\Periodo */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'codigo')->textInput(['maxlength' => true]) ?>
    <?= $form->field($model, 'dtInicio')->widget(\yii\jui\DatePicker::classname(), [
            'language' => 'pt-BR',
            'dateFormat' => 'dd-M-y',
    ]) ?>
    <?= $form->field($model, 'dtTermino')->widget(\yii\jui\DatePicker::classname(), [
            'language' => 'pt-BR',
            'dateFormat' => 'dd-M-y',
    ]) ?>
    <?= Html::submitButton($model->isNewRecord ? 'Cadastrar' : 'Atualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


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

namespace PronoFoot.Logging
{
    public class NLogLoggerFactory : ILoggerFactory
    {
        #region ILoggerFactory Members

        public ILogger CreateLogger(Type type)
        {
            return new NLogLogger(LogManager.GetLogger(type.FullName));
        }

        #endregion
    }
}