<commit_before>// for debugging
function MOVE_TO(x,y) {
  VIEWER1.MainView.Camera.SetFocalPoint(x,y);
  VIEWER1.MainView.Camera.ComputeMatrix();
  eventuallyRender();
}




// This file contains some global variables and misc procedures to
// initials shaders and some buffers we need and to render.

var ROOT_DIV;

var SLICE = 1;

// globals (for now)
var imageProgram;
var textProgram;
var polyProgram;
var mvMatrix = mat4.create();
var pMatrix = mat4.create();
var squareOutlinePositionBuffer;
var squarePositionBuffer;
var tileVertexPositionBuffer;
var tileVertexTextureCoordBuffer;
var tileCellBuffer;

var MOBILE_DEVICE = false;
// Hack to get rid of white lines.
var I_PAD_FLAG = false;


function detectMobile() {
  MOBILE_DEVICE = false;
  if ( navigator.userAgent.match(/Android/i)) {
   MOBILE_DEVICE = "Andriod";
  }
  if ( navigator.userAgent.match(/webOS/i)) {
   MOBILE_DEVICE = "webOS";
  }
  if ( navigator.userAgent.match(/iPhone/i)) {
   MOBILE_DEVICE = "iPhone";
  }
  if ( navigator.userAgent.match(/iPad/i)) {
   MOBILE_DEVICE = "iPad";
   I_PAD_FLAG = true;
  }
  if ( navigator.userAgent.match(/iPod/i)) {
   MOBILE_DEVICE = "iPod";
  }
  if ( navigator.userAgent.match(/BlackBerry/i)) {
   MOBILE_DEVICE = "BlackBerry";
  }
  if ( navigator.userAgent.match(/Windows Phone/i)) {
   MOBILE_DEVICE = "Windows Phone";
  }
  if (MOBILE_DEVICE) {
    MAXIMUM_NUMBER_OF_TILES = 5000;
  }
}



// This global is used in every class that renders something.
// I can not test multiple canvases until I modularize the canvas
// and get rid of these globals.
// WebGL context
var GL;

function GetUser() {
  if (typeof(USER) != "undefined") {
    return USER;
  }
  if (typeof(ARGS) != "undefined") {
    return ARGS.User;
  }
  alert ("Could not find user");
  return "";
}


function GetViewId () {
  if (typeof(VIEW_ID) != "undefined") {
    return VIEW_ID;
  }
  if (typeof(ARGS) != "undefined") {
    return ARGS.Viewer1.viewid;
  }
  if ( ! NOTES_WIDGET && ! NOTES_WIDGET.RootNote) {
    return NOTES_WIDGET.RootNote._id;
  }
  alert ("Could not find view id");
  return "";
}

function GetSessionDatabase() {
  if (typeof(SESSION_DATABASE) != "undefined") {
    return SESSION_DATABASE;
  }
  if (typeof(ARGS) != "undefined") {
    return ARGS.Viewer1.db;
  }
  alert ("Could not find session database");
  return "";
}


// WebGL Initialization

function doesBrowserSupportWebGL(canvas) {<commit_msg>Use canvas by default (not webGL)<commit_after>// for debugging
function MOVE_TO(x,y) {
  VIEWER1.MainView.Camera.SetFocalPoint(x,y);
  VIEWER1.MainView.Camera.ComputeMatrix();
  eventuallyRender();
}




// This file contains some global variables and misc procedures to
// initials shaders and some buffers we need and to render.

var ROOT_DIV;

var SLICE = 1;

// globals (for now)
var imageProgram;
var textProgram;
var polyProgram;
var mvMatrix = mat4.create();
var pMatrix = mat4.create();
var squareOutlinePositionBuffer;
var squarePositionBuffer;
var tileVertexPositionBuffer;
var tileVertexTextureCoordBuffer;
var tileCellBuffer;

var MOBILE_DEVICE = false;
// Hack to get rid of white lines.
var I_PAD_FLAG = false;


function detectMobile() {
  MOBILE_DEVICE = false;
  if ( navigator.userAgent.match(/Android/i)) {
   MOBILE_DEVICE = "Andriod";
  }
  if ( navigator.userAgent.match(/webOS/i)) {
   MOBILE_DEVICE = "webOS";
  }
  if ( navigator.userAgent.match(/iPhone/i)) {
   MOBILE_DEVICE = "iPhone";
  }
  if ( navigator.userAgent.match(/iPad/i)) {
   MOBILE_DEVICE = "iPad";
   I_PAD_FLAG = true;
  }
  if ( navigator.userAgent.match(/iPod/i)) {
   MOBILE_DEVICE = "iPod";
  }
  if ( navigator.userAgent.match(/BlackBerry/i)) {
   MOBILE_DEVICE = "BlackBerry";
  }
  if ( navigator.userAgent.match(/Windows Phone/i)) {
   MOBILE_DEVICE = "Windows Phone";
  }
  if (MOBILE_DEVICE) {
    MAXIMUM_NUMBER_OF_TILES = 5000;
  }
}



// This global is used in every class that renders something.
// I can not test multiple canvases until I modularize the canvas
// and get rid of these globals.
// WebGL context
var GL;

function GetUser() {
  if (typeof(USER) != "undefined") {
    return USER;
  }
  if (typeof(ARGS) != "undefined") {
    return ARGS.User;
  }
  alert ("Could not find user");
  return "";
}


function GetViewId () {
  if (typeof(VIEW_ID) != "undefined") {
    return VIEW_ID;
  }
  if (typeof(ARGS) != "undefined") {
    return ARGS.Viewer1.viewid;
  }
  if ( ! NOTES_WIDGET && ! NOTES_WIDGET.RootNote) {
    return NOTES_WIDGET.RootNote._id;
  }
  alert ("Could not find view id");
  return "";
}

function GetSessionDatabase() {
  if (typeof(SESSION_DATABASE) != "undefined") {
    return SESSION_DATABASE;
  }
  if (typeof(ARGS) != "undefined") {
    return ARGS.Viewer1.db;
  }
  alert ("Could not find session database");
  return "";
}


// WebGL Initialization

function doesBrowserSupportWebGL(canvas) {
    return false;
{'fraction_non_alphanumeric': 0.1276639344262295, 'fraction_numerical': 0.004508196721311476, 'mean_word_length': 3.675287356321839, 'pattern_counts': {'":': 0, '<': 3, '<?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': '776539', 'n_tokens_mistral': 1752, 'n_tokens_neox': 1708, 'n_words': 421}