Commits

Shlomi Fish committed 63520aa Merge

Merged.

Comments (0)

Files changed (20)

 black-hole-solitaire/B
 black-hole-solitaire/BUILD
 black-hole-solitaire/Games-Solitaire-BlackHole-Solver/Build
+black-hole-solitaire/Games-Solitaire-BlackHole-Solver/META.json
+black-hole-solitaire/Games-Solitaire-BlackHole-Solver/META.yml
 black-hole-solitaire/Games-Solitaire-BlackHole-Solver/MYMETA.json
 black-hole-solitaire/Games-Solitaire-BlackHole-Solver/MYMETA.yml
+black-hole-solitaire/Games-Solitaire-BlackHole-Solver/Makefile.PL
 black-hole-solitaire/Games-Solitaire-BlackHole-Solver/_build
 black-hole-solitaire/Games-Solitaire-BlackHole-Solver/blib
 black-hole-solitaire/Games-Solitaire-BlackHole-Solver/bliba
 d2e76f472e7837eec9005510300d6ee6f4a15934 c-solver/releases/0.4.0
 e87e53886cc5ad23b1aae38e0f0e2284c840bf9b c-solver/releases/0.6.0
 ced95d5793a2b2593da26f64d9737f22351d20b6 c-solver/releases/0.8.0
+f0ad12ef2d31682205f779602e4583acc93aba27 Games-Solitaire-BlackHole-Solver/releases/0.0.2

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/Build.PL

     module_name         => 'Games::Solitaire::BlackHole::Solver',
     license             => 'mit',
     dist_author         => q{Shlomi Fish <shlomif@iglu.org.il>},
-    dist_version_from   => 'lib/Games/Solitaire/BlackHole/Solver.pm',
+    dist_version_from    => 'lib/Games/Solitaire/BlackHole/Solver.pm',
+    configure_requires => {
+        'Module::Build' => '0.36',
+    },
     requires => {
         'strict' => 0,
         'warnings' => 0,
         'Getopt::Long' => 0,
         'Pod::Usage' => 0,
+        'perl' => '5.008',
     },
     build_requires => {
         'Test::More' => 0,
             "solver",
             "solving",
         ],
-    },    
+    },
 );
 
 $builder->create_build_script();

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/Changes

 Revision history for Games-Solitaire-BlackHole-Solver
 
-0.0.1   Mon Jan 11 17:53:01 IST 2010
+0.0.2   2014-01-30
+        - Add the LICENSE file (CPANTS Kwalitee).
+        - Add t/cpan-changes.t and t/style-trailing-space.t .
+        - Minimum version of perl is now 5.8.x (CPANTS Kwalitee).
+
+0.0.1   2010-01-11
         First version, with rudimentary features but is working.

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/LICENSE

+Copyright (c) 2010 Shlomi Fish
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/MANIFEST

 Build.PL
 Changes
+LICENSE
+MANIFEST
+META.json
+META.yml
+Makefile.PL
+README
 contrib/make_pysol_board.py
 inc/Test/Run/Builder.pm
+lib/Games/Solitaire/BlackHole/Solver.pm
 lib/Games/Solitaire/BlackHole/Solver/App.pm
-lib/Games/Solitaire/BlackHole/Solver.pm
-Makefile.PL
-MANIFEST
-META.yml
-README
 scripts/black-hole-solve
 t/00-load.t
 t/01-run.t
+t/cpan-changes.t
 t/data/26464608654870335080.bh.board.txt
 t/pod-coverage.t
 t/pod.t
+t/style-trailing-space.t

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/README

 Games-Solitaire-BlackHole-Solver
 
-This is a solver for the Solitaire "Black Hole", implemented in Perl as a 
+This is a solver for the Solitaire "Black Hole", implemented in Perl as a
 command line application. See:
 
 http://pysolfc.sourceforge.net/doc/rules/blackhole.html

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/inc/Test/Run/Builder.pm

         Test::Run::CmdLine::Iface->new(
             {
                 'test_files' => [glob("t/*.t")],
-            }   
+            }
             # 'backend_params' => $self->_get_backend_params(),
         );
 
 sub ACTION_tags
 {
     my $self = shift;
-    return 
+    return
         $self->do_system(
             "ctags",
             qw(-f tags --recurse --totals

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/lib/Games/Solitaire/BlackHole/Solver.pm

 use warnings;
 use strict;
 
+use 5.008;
+
 =head1 NAME
 
 Games::Solitaire::BlackHole::Solver - A solver for Black Hole Solitaire
 
 =head1 VERSION
 
-Version 0.0.1
+Version 0.0.2
 
 =cut
 
-our $VERSION = '0.0.1';
+our $VERSION = '0.0.2';
 
 =head1 SYNOPSIS
 

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/lib/Games/Solitaire/BlackHole/Solver/App.pm

 use strict;
 use warnings;
 
+use 5.008;
+
 use Getopt::Long;
 use Pod::Usage;
 
 
 =head1 VERSION
 
-Version 0.0.1
+Version 0.0.2
 
 =cut
 
-our $VERSION = '0.0.1';
+our $VERSION = '0.0.2';
 
 =head1 SYNOPSIS
 
 A script that encapsulates this application accepts a filename pointing
 at the file containing the board or C<"-"> for specifying the standard input.
 
-A board looks like this and can be generated for PySol using the 
+A board looks like this and can be generated for PySol using the
 make_pysol_board.py in the contrib/ .
 
     Foundations: AS
     exit(! $verdict);
 }
 
+=head1 SEE ALSO
+
+The Black Hole Solitaire Solvers homepage is at
+L<http://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/>
+and one can find there an implementation of this solver as a C library (under
+the same licence), which is considerably faster and consumes less memory,
+and has had some otehr impovements.
 
 =head1 AUTHOR
 

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/t/cpan-changes.t

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval 'use Test::CPAN::Changes';
+plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
+
+changes_ok();
+

black-hole-solitaire/Games-Solitaire-BlackHole-Solver/t/style-trailing-space.t

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval "use Test::TrailingSpace";
+if ($@)
+{
+   plan skip_all => "Test::TrailingSpace required for trailing space test.";
+}
+else
+{
+   plan tests => 1;
+}
+
+# TODO: add .pod, .PL, the README/Changes/TODO/etc. documents and possibly
+# some other stuff.
+my $finder = Test::TrailingSpace->new(
+   {
+       root => '.',
+       filename_regex => qr/(?:\.(?:t|pm|pl|xs|c|h|txt|pod|PL)|README|Changes|TODO|LICENSE)\z/,
+   },
+);
+
+# TEST
+$finder->no_trailing_space(
+   "No trailing space was found."
+);

black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/Makefile

 	tar -cvf $@ $(DOCS)
 
 $(BASE)/all_in_a_row_SUMMARY-no-prune.txt $(BASE)/all_in_a_row_SUMMARY-prune.txt : $(BASE)/%: archived_SUMMARIES/% compress-output.pl Makefile
+	mkdir -p $(BASE)
 	perl compress-output.pl < $< > $@
 
 $(BASE)/README.txt $(BASE)/expand.pl: $(BASE)/%: docs/%
+	mkdir -p $(BASE)
 	cp -f $< $@
 
 test: $(ARC_TAR)

black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/black-hole-from-sql.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use DBIx::Simple;
+use IO::All;
+
+my $db = DBIx::Simple->connect("dbi:SQLite:dbname=./bhs.sqlite3");
+
+my $fh = io->file("./SUMMARY-no-prune.txt");
+
+{
+    my $result = $db->query("SELECT idx, status, num_checked, num_generated FROM bhs_runs");
+
+    $result->bind(my ($idx, $status, $num_checked, $num_generated));
+
+    while ($result->fetch)
+    {
+        $fh->append(join("\t", ($idx, $status, $num_checked, $num_generated)), "\n");
+    }
+}

black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/collect.pl

 
 my $start_idx;
 
-if (my $last_line = sum_fh()->[-1])
+if (-e $SUMMARY_FN)
 {
+    my $last_line = `tail -1 "$SUMMARY_FN"`;
     ($start_idx) = $last_line =~ m/\A(\d+)/;
     $start_idx++;
 }

black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/monitoring-helpers.bash

 l() { ls summaries/ ; }
 c() { perl collect.pl ; }
 t() { tail -1 SUMMARY.txt ; }
+u() { myrsync SUMMARY.txt lap:Arcs/ ; myrsync SUMMARY.txt hostgator: ; }
 f1() { perl -lane '/([US])/ && print $1'; }
 f2() { perl -lane '$F[1] eq $ENV{V} and print $F[2]'; }
 report() { local w="$1" ; shift; (export V="$w" ; paste <(f2 < SUMMARY-no-prune.txt ) <(f2 < SUMMARY-prune.txt ) > iters-"$V".txt ) ; }

black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/range-solving.bash

     args+=" --prune"
 fi
 
+# --sshlogin 4/sh --sshlogin 2/lap \
+# -j4 \
+
+
 seq "${start_idx//,/}" "${end_idx//,/}" | \
-    parallel --ungroup --sshlogin 4/sh --sshlogin 2/lap \
-    # parallel --ungroup -j4 \
+    parallel --ungroup \
+    -j4 \
     --max-args 16 \
     perl "$(pwd)"/summarize.pl $args {}

black-hole-solitaire/all-in-a-row-gnu-parallel-range-solving/validate-summary.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $n = 1;
+
+sub is_n
+{
+    return shift(@_) =~ /\A[1-9][0-9]*/;
+}
+
+while (my $l = <>)
+{
+    chomp($l);
+    my @f = split(/\t/, $l);
+
+    if ($f[0] ne $n)
+    {
+        die "Error - wrong num - at Line '$l' at $ARGV : $.!";
+    }
+
+    if ($f[1] !~ m{\A[US]\z})
+    {
+        die "Error - wrong verdict - at Line '$l' at $ARGV : $.!";
+    }
+
+    if (! is_n($f[2]))
+    {
+        die "Error - wrong f[2] - at Line '$l' at $ARGV : $.!";
+    }
+
+    if (! is_n($f[3]))
+    {
+        die "Error - wrong f[3] - at Line '$l' at $ARGV : $.!";
+    }
+
+    if ($f[2] > $f[3])
+    {
+        die "f[2] is bigger than f[3] - at Line '$l' at $ARGV : $.!";
+    }
+}
+continue
+{
+    $n++;
+}
+print "OK!\n";

black-hole-solitaire/c-solver/CMakeLists.txt

     ARGS "config.h.in"
 )
 
+ENABLE_TESTING()
+
+ADD_TEST(
+    NAME perl_run_tests
+    COMMAND "perl" "${CMAKE_CURRENT_SOURCE_DIR}/run-tests.pl"
+)
+
 ADD_CUSTOM_TARGET(
-    "test"
+    "check"
     "perl" "${CMAKE_CURRENT_SOURCE_DIR}/run-tests.pl"
 )
 
-ADD_DEPENDENCIES(
-    "test"
-    "all"
-)
-
 INCLUDE(CPack)

black-hole-solitaire/c-solver/Tatzer

 # This cache is sometimes causing problems.
 unlink("CMakeCache.txt");
 
+# Removed:
+# ($test_suite ? ("-DFCS_WITH_TEST_SUITE=1") : ()),
+
 my @cmd= ("cmake",
     "-DCMAKE_BUILD_TYPE=$build_type",
     "-DBHS_STATE_STORAGE=BHS_STATE_STORAGE_$state_storage",
     "-DDATADIR=$prefix/share",
     ((!$build_static_lib) ? ("-DBUILD_STATIC_LIBRARY=") : ()),
     (defined($pack_size) ? ("-DFCS_IA_PACK_SIZE=$pack_size") : ()),
-    ($test_suite ? ("-DFCS_WITH_TEST_SUITE=1") : ()),
     (defined($cpu_arch) ? ("-DCPU_ARCH=$cpu_arch") : ()),
     ($omit_frame ? "-DOPTIMIZATION_OMIT_FRAME_POINTER=1" : ()),
     ($state_storage_libavl2_tree