<commit_before>//var imageLocation = './firefox.png';
var imageLocation = './the-scream.png';

var timeoutId;
var timeoutDelay = 0;
var timeoutLikenessDelay = 100;

var modelCanvas, genCanvas;
var modelCtx, genCtx;
var modelImage;
var modelImageData;

var imageWidth;
var imageHeight;

var pausePlayButton;
var resetButton;
var play;

var likeness;

var lessDiff; 
var maxDiffPossible;

var maxLineWidth;
var maxRadius;

var drawManager;


function initialize()
{
  modelCanvas = document.getElementById('model-canvas');
  genCanvas = document.getElementById('generate-canvas');
  pausePlayButton = document.getElementById('pause-play-button');
  resetButton = document.getElementById('reset-button');
  likeness = document.getElementById('likeness');

  modelCtx = modelCanvas.getContext('2d');
  genCtx = genCanvas.getContext('2d');

  drawManager = new DrawManager();



  modelImage = new Image();
  modelImage.onload = function() {
    imageWidth = modelImage.width;
    imageHeight = modelImage.height;

    maxDiffPossible = imageWidth * imageHeight * 3 * 256;
    maxRadius = (imageWidth + imageHeight) / 2 / 2;
    maxLineWidth = (imageWidth + imageHeight) / 2 / 20;

    modelCanvas.width = modelImage.width;
    modelCanvas.height = modelImage.height;
    modelCtx.drawImage(modelImage, 0, 0)
    modelImageData = modelCtx.getImageData(0, 0, imageWidth, imageHeight);

    genCanvas.width = modelImage.width;
    genCanvas.height = modelImage.height;
    genCtx.beginPath();
    genCtx.rect(0, 0, imageWidth, imageHeight);
    genCtx.fillStyle = 'white';
    genCtx.fill();

    play = true;
    setMainTimeout();
    
    setTimeout(displayLikeness, timeoutLikenessDelay);

    pausePlayButton.value = 'pause';
    resetButton.value = 'reset';
    pausePlayButton.addEventListener('click', playPause);
    resetButton.addEventListener('click', reset);

  }
  modelImage.src = imageLocation;
}

function DrawManager()
{
  var that = this;

  this.methods = [
    { name: 'circle', func: randomCircle },
    { name: 'triangle', func: randomTriangle },
    { name: 'line', func: randomLine },

  ];

  for (var i = 0; i < this.methods.length; i++)
  {
    var name = this.methods[i].name;
    var elt = document.getElementById('enable-' + name)    
    this.methods[i].element = elt;
    elt.addEventListener('CheckboxStateChange', function() { that.updateFuncTable() });
  }

  this.funcTable = [];<commit_msg>small update<commit_after>//var imageLocation = './firefox.png';
var imageLocation = './the-scream.png';

var timeoutId;
var timeoutDelay = 0;
var timeoutLikenessDelay = 100;

var modelCanvas, genCanvas;
var modelCtx, genCtx;
var modelImage;
var modelImageData;

var imageWidth;
var imageHeight;

var pausePlayButton;
var resetButton;
var play;

var likeness;

var lessDiff; 
var maxDiffPossible;

var maxLineWidth;
var maxRadius;

var drawManager;


function initialize()
{
  modelCanvas = document.getElementById('model-canvas');
  genCanvas = document.getElementById('generate-canvas');
  pausePlayButton = document.getElementById('pause-play-button');
  resetButton = document.getElementById('reset-button');
  likeness = document.getElementById('likeness');

  modelCtx = modelCanvas.getContext('2d');
  genCtx = genCanvas.getContext('2d');

  drawManager = new DrawManager();



  modelImage = new Image();
  modelImage.onload = function() {
    imageWidth = modelImage.width;
    imageHeight = modelImage.height;

    maxDiffPossible = imageWidth * imageHeight * 3 * 256;
    maxRadius = (imageWidth + imageHeight) / 2 / 2;
    maxLineWidth = (imageWidth + imageHeight) / 2 / 20;

    modelCanvas.width = modelImage.width;
    modelCanvas.height = modelImage.height;
    modelCtx.drawImage(modelImage, 0, 0)
    modelImageData = modelCtx.getImageData(0, 0, imageWidth, imageHeight);

    genCanvas.width = modelImage.width;
    genCanvas.height = modelImage.height;
    genCtx.beginPath();
    genCtx.rect(0, 0, imageWidth, imageHeight);
    genCtx.fillStyle = 'white';
    genCtx.fill();

    play = true;
    setMainTimeout();
    
    setTimeout(displayLikeness, timeoutLikenessDelay);

    pausePlayButton.value = 'pause';
    resetButton.value = 'reset';
    pausePlayButton.addEventListener('click', playPause);
    resetButton.addEventListener('click', reset);

  }
  modelImage.src = imageLocation;
}

function DrawManager()
{
  var that = this;

  this.methods = [
    { name: 'circle', func: randomCircle },
    { name: 'triangle', func: randomTriangle },
    { name: 'line', func: randomLine },

  ];

  for (var i = 0; i < this.methods.length; i++)
  {
    var name = this.methods[i].name;
    var elt = document.getElementById('enable-' + name)    
    this.methods[i].element = elt;
    elt.checked = true;
    elt.addEventListener('CheckboxStateChange', function() { that.updateFuncTable() });
  }

  this.funcTable = [];
{'fraction_non_alphanumeric': 0.12769895126465144, 'fraction_numerical': 0.009047912811022003, 'mean_word_length': 4.024793388429752, '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': '1809814', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1497, 'n_words': 335}