<commit_before>var Shader = function(vertices, indices, index, size, type, norm, stride, offset) {
  this.vertices = vertices;
  this.indices  = indices;
  this.index    = index;
  this.size     = size;
  this.type     = type;
  this.norm     = norm;
  this.stride   = stride;
  this.offset   = offset;
  this.vertexBuffer = Spider.gl.createBuffer();
  this.indexBuffer  = Spider.gl.createBuffer();
}

Shader.prototype.getVertices = function() {
  return this.vertices;
}

Shader.prototype.getIndices = function() {
  return this.indices;
}

Shader.prototype.getVertexBuffer = function() {
  return this.vertexBuffer;
}

Shader.prototype.getIndexBuffer = function() {
  return this.indexBuffer;
}

Shader.prototype.createVertex = function() {
  var content = 'attribute vec3 aVertexPosition' +
                'void main(void) {' +
                'gl_Position = vec4(aVertexPosition, 1.0);' +
                '}';

  var script = document.createElement('script');
  script.setAttr('type', 'x-shader/x-vertex');
  script.innerHTML = content;
  document.body.appendChild(script);
}

var Spider = {
  //__privated variables
  gl      : null,
  width   : 800,
  height  : 800,
  names : ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"],
  buffer  : Spider.gl.createBuffer(),

  //__functions
  startWeb: function(canvasId, width, height) {
    var canvas = document.getElementById(canvasId);
    Spider.width = width;
    Spider.height = height;
    var i = 0;
    // Spider.gl = canvas.getContext('webgl');
    while ((Spider.gl == null) && (i < Spider.names.length)) {
      try {
          Spider.gl = canvas.getContext(Spider.names[i]);
        } catch (e) {
          console.log(e)
        };
        i++;
    }
  },

  isStarted: function() {
    if (Spider.gl == null) return false;
    else return true;
  },

  clear: function() {
    if (Spider.isStarted()) {
      Spider.gl.clear(Spider.gl.COLOR_BUFFER_BIT);
      Spider.gl.viewport(0, 0, Spider.width, Spider.height);
    }
  },
<commit_msg>refactored<commit_after>var Shader = function(vertices, indices, index, size, type, norm, stride, offset) {
  this.vertices = vertices;
  this.indices  = indices;
  this.index    = index;
  this.size     = size;
  this.type     = type;
  this.norm     = norm;
  this.stride   = stride;
  this.offset   = offset;
  this.vertexBuffer = Spider.gl.createBuffer();
  this.indexBuffer  = Spider.gl.createBuffer();
}

Shader.prototype.getVertices = function() {
  return this.vertices;
}

Shader.prototype.getIndices = function() {
  return this.indices;
}

Shader.prototype.getVertexBuffer = function() {
  return this.vertexBuffer;
}

Shader.prototype.getIndexBuffer = function() {
  return this.indexBuffer;
}

Shader.prototype.createVertex = function() {
  var content = 'attribute vec3 aVertexPosition' +
                'void main(void) {' +
                'gl_Position = vec4(aVertexPosition, 1.0);' +
                '}';

  var script = document.createElement('script');
  script.setAttr('type', 'x-shader/x-vertex');
  script.innerHTML = content;
  document.body.appendChild(script);
}

var Spider = {
  //__privated variables
  gl      : null,
  width   : 800,
  height  : 800,
  names : ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"],
  buffer  : null,

  //__functions
  startWeb: function(canvasId, width, height) {
    var canvas = document.getElementById(canvasId);
    Spider.width = width;
    Spider.height = height;
    var i = 0;
    // Spider.gl = canvas.getContext('webgl');
    while ((Spider.gl == null) && (i < Spider.names.length)) {
      try {
          Spider.gl = canvas.getContext(Spider.names[i]);
        } catch (e) {
          console.log(e)
        };
        i++;
    }
  },

  createBuffer: function() {
    Spider.gl.createBuffer();
  },

  isStarted: function() {
    if (Spider.gl == null) return false;
    else return true;
  },

  clear: function() {
    if (Spider.isStarted()) {
      Spider.gl.clear(Spider.gl.COLOR_BUFFER_BIT);
      Spider.gl.viewport(0, 0, Spider.width, Spider.height);
    }
  },

{'fraction_non_alphanumeric': 0.14633546483030005, 'fraction_numerical': 0.006886374815543532, 'mean_word_length': 2.7973856209150325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4538106', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1326, 'n_words': 265}