<commit_before><?php
/*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the Revised BSD License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    Revised BSD License for more details.

    Copyright 2011-2012 Cool Dude 2k - http://idb.berlios.de/
    Copyright 2011-2012 Game Maker 2k - http://intdb.sourceforge.net/
    Copyright 2011-2012 <NAME> - https://github.com/KazukiPrzyborowski

    $FileInfo: code39.php - Last Update: 02/02/2012 Ver. 2.1.0 RC 1 - Author: cooldude2k $
*/
$File3Name = basename($_SERVER['SCRIPT_NAME']);
if ($File3Name=="code39.php"||$File3Name=="/code39.php") {
	chdir("../");
	require("./upc.php");
	exit(); }

function create_code39($upc,$imgtype="png",$outputimage=true,$resize=1,$resizetype="resize",$outfile=NULL,$hidecd=false) {
	if(!isset($upc)) { return false; }
	if(strlen($upc) < 1) { return false; }
	if(!preg_match("/([0-9a-zA-Z\-\.\$\/\+% ]+)/", $upc)) { return false; }
	if(!isset($resize)||!preg_match("/^([0-9]*[\.]?[0-9])/", $resize)||$resize<1) { $resize = 1; }
	if($resizetype!="resample"&&$resizetype!="resize") { $resizetype = "resize"; }
	if($imgtype!="png"&&$imgtype!="gif"&&$imgtype!="xbm"&&$imgtype!="wbmp") { $imgtype = "png"; }
	$upc = strtoupper($upc);
	$upc_matches = str_split($upc);
	$upc_size_add = (count($upc_matches) * 15) + (count($upc_matches) + 1);
	if(count($upc_matches)<=0) { return false; }
	if($imgtype=="png") {
	if($outputimage==true) {
	header("Content-Type: image/png"); } }
	if($imgtype=="gif") {
	if($outputimage==true) {
	header("Content-Type: image/gif"); } }
	if($imgtype=="xbm") {
	if($outputimage==true) {
	header("Content-Type: image/x-xbitmap"); } }
	if($imgtype=="wbmp") {
	if($outputimage==true) {
	header("Content-Type: image/vnd.wap.wbmp"); } }
	$upc_img = imagecreatetruecolor(48 + $upc_size_add, 62);
	imagefilledrectangle($upc_img, 0, 0, 48 + $upc_size_add, 62, 0xFFFFFF);
	imageinterlace($upc_img, true);
	$background_color = imagecolorallocate($upc_img, 255, 255, 255);
	$text_color = imagecolorallocate($upc_img, 0, 0, 0);
	$alt_text_color = imagecolorallocate($upc_img, 255, 255, 255);
	$NumTxtZero = 0; $LineTxtStart = 25;
	imagestring($upc_img, 2, 8, 48, "*", $text_color);
	while ($NumTxtZero < count($upc_matches)) {
	imagestring($upc_img, 2, $LineTxtStart, 48, $upc_matches[$NumTxtZero], $text_color);
	$LineTxtStart += 17;
	++$NumTxtZero; }
	imagestring($upc_img, 2, $LineTxtStart, 48, "*", $text_color);
	imageline($upc_img, 0, 4, 0, 47, $alt_text_color);
	imageline($upc_img, 1, 4, 1, 47, $alt_text_color);
	imageline($upc_img, 2, 4, 2, 47, $alt_text_color);
	imageline($upc_img, 3, 4, 3, 47, $alt_text_color);
	imageline($upc_img, 4, 4, 4, 47, $alt_text_color);
	imageline($upc_img, 5, 4, 5, 47, $alt_text_color);
	imageline($upc_img, 6, 4, 6, 47, $alt_text_color);
	imageline($upc_img, 7, 4, 7, 47, $alt_text_color);
	imageline($upc_img, 8, 4, 8, 47, $alt_text_color);
	imageline($upc_img, 9, 4, 9, 47, $text_color);
	imageline($upc_img, 10, 4, 10, 47, $alt_text_color);
	imageline($upc_img, 11, 4, 11, 47, $alt_text_color);
	imageline($upc_img, 12, 4, 12, 47, $alt_text_color);
	imageline($upc_img, 13, 4, 13, 47, $text_color);
	imageline($upc_img, 14, 4, 14, 47, $alt_text_color);
	imageline($upc_img, 15, 4, 15, 47, $text_color);
	imageline($upc_img, 16, 4, 16, 47, $text_color);
	imageline($upc_img, 17, 4, 17, 47, $text_color);<commit_msg>Small bug fix.<commit_after><?php
/*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the Revised BSD License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    Revised BSD License for more details.

    Copyright 2011-2012 Cool Dude 2k - http://idb.berlios.de/
    Copyright 2011-2012 Game Maker 2k - http://intdb.sourceforge.net/
    Copyright 2011-2012 <NAME> - https://github.com/KazukiPrzyborowski

    $FileInfo: code39.php - Last Update: 02/02/2012 Ver. 2.1.0 RC 1 - Author: cooldude2k $
*/
$File3Name = basename($_SERVER['SCRIPT_NAME']);
if ($File3Name=="code39.php"||$File3Name=="/code39.php") {
	chdir("../");
	require("./upc.php");
	exit(); }

function create_code39($upc,$imgtype="png",$outputimage=true,$resize=1,$resizetype="resize",$outfile=NULL,$hidecd=false) {
	if(!isset($upc)) { return false; }
	if(strlen($upc) < 1) { return false; }
	if(!preg_match("/([0-9a-zA-Z\-\.\$\/\+% ]+)/", $upc)) { return false; }
	if(!isset($resize)||!preg_match("/^([0-9]*[\.]?[0-9])/", $resize)||$resize<1) { $resize = 1; }
	if($resizetype!="resample"&&$resizetype!="resize") { $resizetype = "resize"; }
	if($imgtype!="png"&&$imgtype!="gif"&&$imgtype!="xbm"&&$imgtype!="wbmp") { $imgtype = "png"; }
	$upc = strtoupper($upc);
	$upc_matches = str_split($upc);
	$upc_size_add = (count($upc_matches) * 15) + (count($upc_matches) + 1);
	if(count($upc_matches)<=0) { return false; }
	if($imgtype=="png") {
	if($outputimage==true) {
	header("Content-Type: image/png"); } }
	if($imgtype=="gif") {
	if($outputimage==true) {
	header("Content-Type: image/gif"); } }
	if($imgtype=="xbm") {
	if($outputimage==true) {
	header("Content-Type: image/x-xbitmap"); } }
	if($imgtype=="wbmp") {
	if($outputimage==true) {
	header("Content-Type: image/vnd.wap.wbmp"); } }
	$upc_img = imagecreatetruecolor(48 + $upc_size_add, 62);
	imagefilledrectangle($upc_img, 0, 0, 48 + $upc_size_add, 62, 0xFFFFFF);
	imageinterlace($upc_img, true);
	$background_color = imagecolorallocate($upc_img, 255, 255, 255);
	$text_color = imagecolorallocate($upc_img, 0, 0, 0);
	$alt_text_color = imagecolorallocate($upc_img, 255, 255, 255);
	$NumTxtZero = 0; $LineTxtStart = 30;
	imagestring($upc_img, 2, 14, 48, "*", $text_color);
	while ($NumTxtZero < count($upc_matches)) {
	imagestring($upc_img, 2, $LineTxtStart, 48, $upc_matches[$NumTxtZero], $text_color);
	$LineTxtStart += 16;
	++$NumTxtZero; }
	imagestring($upc_img, 2, $LineTxtStart, 48, "*", $text_color);
	imageline($upc_img, 0, 4, 0, 47, $alt_text_color);
	imageline($upc_img, 1, 4, 1, 47, $alt_text_color);
	imageline($upc_img, 2, 4, 2, 47, $alt_text_color);
	imageline($upc_img, 3, 4, 3, 47, $alt_text_color);
	imageline($upc_img, 4, 4, 4, 47, $alt_text_color);
	imageline($upc_img, 5, 4, 5, 47, $alt_text_color);
	imageline($upc_img, 6, 4, 6, 47, $alt_text_color);
	imageline($upc_img, 7, 4, 7, 47, $alt_text_color);
	imageline($upc_img, 8, 4, 8, 47, $alt_text_color);
	imageline($upc_img, 9, 4, 9, 47, $text_color);
	imageline($upc_img, 10, 4, 10, 47, $alt_text_color);
	imageline($upc_img, 11, 4, 11, 47, $alt_text_color);
	imageline($upc_img, 12, 4, 12, 47, $alt_text_color);
	imageline($upc_img, 13, 4, 13, 47, $text_color);
	imageline($upc_img, 14, 4, 14, 47, $alt_text_color);
	imageline($upc_img, 15, 4, 15, 47, $text_color);
	imageline($upc_img, 16, 4, 16, 47, $text_color);
	imageline($upc_img, 17, 4, 17, 47, $text_color);
{'fraction_non_alphanumeric': 0.1994097807757167, 'fraction_numerical': 0.06112984822934233, 'mean_word_length': 5.505484460694698, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5166041', 'n_tokens_mistral': 3324, 'n_tokens_neox': 2914, 'n_words': 611}