<commit_before>#!/usr/bin/perl -w

use strict;
use Data::Dumper;
use CGI;
use Image::Size;
use HTML::Template;
use CoGe::Accessory::LogUser;
use CoGe::Accessory::Web;
use CGI::Ajax;
use DBI;
use File::Path;
no warnings 'redefine';

delete @ENV{ 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' };

use vars qw ($P $FORM $USER $DATE $TEMPDIR $TEMPURL);
$P = CoGe::Accessory::Web::get_defaults();
$ENV{PATH} = $P->{COGEDIR};

$FORM = new CGI;
$TEMPDIR = $P->{TEMPDIR}."GEvo";
$TEMPURL = $P->{TEMPURL}."GEvo";
mkpath ($TEMPDIR, 0,0777) unless -d $TEMPDIR;

($USER) = CoGe::Accessory::LogUser->get_user();
$DATE = sprintf( "%04d-%02d-%02d %02d:%02d:%02d",
		 sub { ($_[5]+1900, $_[4]+1, $_[3]),$_[2],$_[1],$_[0] }->(localtime));


my $pj = new CGI::Ajax (
			gen_html => \&gen_html,
			update => \&update,
		       );

$pj->js_encode_function('escape');

#print $pj->build_html($FORM, \&gen_html);

print $FORM->header, gen_html();


sub gen_html
  {
#    my $form = $FORM;
    my $template = HTML::Template->new(filename=>$P->{TMPLDIR}.'generic_page.tmpl');
    $template->param(BODY=>gen_body());
    my $name = $USER->user_name;
        $name = $USER->first_name if $USER->first_name;
        $name .= " ".$USER->last_name if $USER->first_name && $USER->last_name;
        $template->param(USER=>$name);
    $template->param(HELP=>"/wiki/index.php?title=GEvo_direct");
    $template->param(LOGON=>1) unless $USER->user_name eq "public";
    $template->param(DATE=>$DATE);
    $template->param(TITLE=>"GEvo direct:  reviewing past results.");
    $template->param(PAGE_TITLE=>"GEvo direct");
#    print $form->header;
#    print STDERR $template->output;
    return $template->output;
  }

sub gen_body
    {
      my $form = $FORM;
      my $name = $form->param('name');
      my $cmd = "/usr/bin/svnversion ".$P->{COGEDIR}."gobe/flash";
      my $gobe_version = `$cmd`;
      $gobe_version =~ s/\n//g;;

      my %files;
      my $tiny;
      
      open (CMD, "/bin/ls $TEMPDIR/$name"."* |");
      while (<CMD>)
	{
	  my $touch = "touch $_";
	  my $x;
	  ($x, $touch) =CoGe::Accessory::Web::check_taint($touch);
	  `$touch`;
	  foreach (split /\n/)
	    {
	      if (/\.anno/)
		{
		  push @{$files{anno}},$_;
		}
	      elsif (/\.faa/)
		{
		  push @{$files{faa}},$_;
		}
	      elsif (/\.png/)
		{
		  push @{$files{png}},$_;
		}
	      elsif (/\.log/)
		{
		  open (IN, $_);
		  while (my $line = <IN>)
		    {
		      if ($line =~ /tiny url: (.*)/i)
			{
			  $tiny= $1;
			  last;<commit_msg>updated path to sys command touch<commit_after>#!/usr/bin/perl -w

use strict;
use Data::Dumper;
use CGI;
use Image::Size;
use HTML::Template;
use CoGe::Accessory::LogUser;
use CoGe::Accessory::Web;
use CGI::Ajax;
use DBI;
use File::Path;
no warnings 'redefine';

delete @ENV{ 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' };

use vars qw ($P $FORM $USER $DATE $TEMPDIR $TEMPURL);
$P = CoGe::Accessory::Web::get_defaults();
$ENV{PATH} = $P->{COGEDIR};

$FORM = new CGI;
$TEMPDIR = $P->{TEMPDIR}."GEvo";
$TEMPURL = $P->{TEMPURL}."GEvo";
mkpath ($TEMPDIR, 0,0777) unless -d $TEMPDIR;

($USER) = CoGe::Accessory::LogUser->get_user();
$DATE = sprintf( "%04d-%02d-%02d %02d:%02d:%02d",
		 sub { ($_[5]+1900, $_[4]+1, $_[3]),$_[2],$_[1],$_[0] }->(localtime));


my $pj = new CGI::Ajax (
			gen_html => \&gen_html,
			update => \&update,
		       );

$pj->js_encode_function('escape');

#print $pj->build_html($FORM, \&gen_html);

print $FORM->header, gen_html();


sub gen_html
  {
#    my $form = $FORM;
    my $template = HTML::Template->new(filename=>$P->{TMPLDIR}.'generic_page.tmpl');
    $template->param(BODY=>gen_body());
    my $name = $USER->user_name;
        $name = $USER->first_name if $USER->first_name;
        $name .= " ".$USER->last_name if $USER->first_name && $USER->last_name;
        $template->param(USER=>$name);
    $template->param(HELP=>"/wiki/index.php?title=GEvo_direct");
    $template->param(LOGON=>1) unless $USER->user_name eq "public";
    $template->param(DATE=>$DATE);
    $template->param(TITLE=>"GEvo direct:  reviewing past results.");
    $template->param(PAGE_TITLE=>"GEvo direct");
#    print $form->header;
#    print STDERR $template->output;
    return $template->output;
  }

sub gen_body
    {
      my $form = $FORM;
      my $name = $form->param('name');
      my $cmd = "/usr/bin/svnversion ".$P->{COGEDIR}."gobe/flash";
      my $gobe_version = `$cmd`;
      $gobe_version =~ s/\n//g;;

      my %files;
      my $tiny;
      
      open (CMD, "/bin/ls $TEMPDIR/$name"."* |");
      while (<CMD>)
	{
	  my $touch = "/usr/bin/touch $_";
	  my $x;
	  ($x, $touch) =CoGe::Accessory::Web::check_taint($touch);
	  `$touch`;
	  foreach (split /\n/)
	    {
	      if (/\.anno/)
		{
		  push @{$files{anno}},$_;
		}
	      elsif (/\.faa/)
		{
		  push @{$files{faa}},$_;
		}
	      elsif (/\.png/)
		{
		  push @{$files{png}},$_;
		}
	      elsif (/\.log/)
		{
		  open (IN, $_);
		  while (my $line = <IN>)
		    {
		      if ($line =~ /tiny url: (.*)/i)
			{
			  $tiny= $1;
			  last;
{'fraction_non_alphanumeric': 0.22944588917783557, 'fraction_numerical': 0.012002400480096018, 'mean_word_length': 3.088307440719542, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 85, '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': '4695874', 'n_tokens_mistral': 2138, 'n_tokens_neox': 2014, 'n_words': 390}