<commit_before>(function($){
	// This function adds noise to the background-color attribute of an element
	$.fn.noisy = function(options) {
		return this.each(function() {
	 		var canvas = document.createElement('canvas'),
	 		    ctx = canvas.getContext("2d");
	 		
	 		var defaults = {
	 			// How many percent of the image that is filled with noise, 
	 			//   represented by a number between 0 and 1 inclusive
	 			noise:              1,
	 			
	 			// The width and height of the background image in pixels
	 			tileSize:           200,
	 			
	 			// An empty string is transparent
	 			backgroundColor:    '',
	 			
	 			// The maximum noise particle opacity,
	 			//   represented by a number between 0 and 1 inclusive
	 			maxNoiseOpacity:    20/255,
	 			
	 			// A string linking to the image used if there's no canvas support
	 			fallbackImage:      undefined,
	 			
	 			// Specifies wheter the particles are grayscale or colorful
	 			monochromatic:      false
	 		};
	 		options = $.extend(defaults, options);
	 		
	 		// Use fallback image if canvas isn't supported
	 		if ((options.fallbackImage !== undefined) && !ctx) {
	 			$(this).css('background-image', options.fallbackImage);
	 			return;
	 		}
	 		
	 		canvas.width = canvas.height = options.tileSize;
	 		var imgData = ctx.createImageData(canvas.width, canvas.height);
	 		
	 		var rand = function(min, max) {
	 			return Math.floor(Math.random()*(max-min)+min);
	 		};
	 		
	 		// Add black and white pixels at random positions to the canvas
	 		for (var i = 0; i < options.noise * Math.pow(options.tileSize, 2); i++) {
	 			var x = rand(1, canvas.width),
	 			    y = rand(1, canvas.height),
	 			    index = (x + y * imgData.width) * 4;
	 			
	 			if (options.monochromatic) var randColorChannel = rand(0, 255);
	 			
	 			imgData.data[index  ] = randColorChannel;                                           // red
	 			imgData.data[index+1] = options.monochromatic ? randColorChannel : rand(0, 255);    // green
	 			imgData.data[index+2] = options.monochromatic ? randColorChannel : rand(0, 255);    // blue
	 			imgData.data[index+3] = rand(0, 255*options.maxNoiseOpacity);                       // alpha
	 		}
	 		
	 		ctx.putImageData(imgData, 0, 0);
	 		$(this).css('background', 'url(' + canvas.toDataURL('image/png') + ')' + options.backgroundColor);
		});
	};
})(jQuery);<commit_msg>'x,y of the random noise particles was excluding the 0th row/column of the image' ~Ignition<commit_after>(function($){
	// This function adds noise to the background-color attribute of an element
	$.fn.noisy = function(options) {
		return this.each(function() {
	 		var canvas = document.createElement('canvas'),
	 		    ctx = canvas.getContext("2d");
	 		
	 		var defaults = {
	 			// How many percent of the image that is filled with noise, 
	 			//   represented by a number between 0 and 1 inclusive
	 			noise:              1,
	 			
	 			// The width and height of the background image in pixels
	 			tileSize:           200,
	 			
	 			// An empty string is transparent
	 			backgroundColor:    '',
	 			
	 			// The maximum noise particle opacity,
	 			//   represented by a number between 0 and 1 inclusive
	 			maxNoiseOpacity:    20/255,
	 			
	 			// A string linking to the image used if there's no canvas support
	 			fallbackImage:      undefined,
	 			
	 			// Specifies wheter the particles are grayscale or colorful
	 			monochromatic:      false
	 		};
	 		options = $.extend(defaults, options);
	 		
	 		// Use fallback image if canvas isn't supported
	 		if ((options.fallbackImage !== undefined) && !ctx) {
	 			$(this).css('background-image', options.fallbackImage);
	 			return;
	 		}
	 		
	 		canvas.width = canvas.height = options.tileSize;
	 		var imgData = ctx.createImageData(canvas.width, canvas.height);
	 		
	 		var rand = function(min, max) {
	 			return Math.floor(Math.random()*(max-min)+min);
	 		};
	 		
	 		// Add black and white pixels at random positions to the canvas
	 		for (var i = 0; i < options.noise * Math.pow(options.tileSize, 2); i++) {
	 			var x = rand(0, canvas.width),
	 			    y = rand(0, canvas.height),
	 			    index = (x + y * imgData.width) * 4;
	 			
	 			if (options.monochromatic) var randColorChannel = rand(0, 255);
	 			
	 			imgData.data[index  ] = randColorChannel;                                           // red
	 			imgData.data[index+1] = options.monochromatic ? randColorChannel : rand(0, 255);    // green
	 			imgData.data[index+2] = options.monochromatic ? randColorChannel : rand(0, 255);    // blue
	 			imgData.data[index+3] = rand(0, 255*options.maxNoiseOpacity);                       // alpha
	 		}
	 		
	 		ctx.putImageData(imgData, 0, 0);
	 		$(this).css('background', 'url(' + canvas.toDataURL('image/png') + ')' + options.backgroundColor);
		});
	};
})(jQuery);
{'fraction_non_alphanumeric': 0.1173172757475083, 'fraction_numerical': 0.01681893687707641, 'mean_word_length': 2.2724184782608696, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '604021', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1446, 'n_words': 409}