Toggle Rule
#11
i wrote a simple script for this:

Code:
#!/usr/bin/perl

use strict;
use warnings;

my $db2;

while (my $line = <>)
{
  chomp ($line);

  my $db1;

  my $line_len = length ($line);

  my $i;

  for ($i = 0; $i < $line_len; $i += 2)
  {
    my $t = substr ($line, $i, 2);

    last if (exists $db1->{$t});

    $db1->{$t} = undef;
  }

  next if ($i < $line_len);

  my @sorted_keys = sort keys %{$db1};

  my $sorted_keys_s = join ("", @sorted_keys);

  next if (exists $db2->{$sorted_keys_s});

  $db2->{$sorted_keys_s} = undef;

  print "$line\n";
}

and then run the commands:

Quote:$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles1.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles2.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1' | perl optimize_toggle.pl >> toggles5.rule

$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles2.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1' | perl optimize_toggle.pl >> toggles5.rule

$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles3.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule

$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles4.rule
$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule

$ mp64.bin -1 0123456789ABCDE 'T?1T?1T?1T?1T?1' | perl optimize_toggle.pl >> toggles5.rule

ofc you can add more if your like.


Messages In This Thread
Toggle Rule - by Hash-IT - 11-05-2011, 04:51 PM
RE: Toggle Rule - by atom - 11-05-2011, 05:25 PM
RE: Toggle Rule - by Hash-IT - 11-05-2011, 05:30 PM
RE: Toggle Rule - by atom - 11-05-2011, 05:35 PM
RE: Toggle Rule - by Hash-IT - 11-05-2011, 05:42 PM
RE: Toggle Rule - by atom - 11-05-2011, 05:44 PM
RE: Toggle Rule - by Hash-IT - 11-05-2011, 05:50 PM
RE: Toggle Rule - by atom - 11-05-2011, 11:32 PM
RE: Toggle Rule - by Hash-IT - 11-06-2011, 12:13 AM
RE: Toggle Rule - by Hash-IT - 11-10-2011, 03:55 PM
RE: Toggle Rule - by atom - 11-10-2011, 04:53 PM
RE: Toggle Rule - by Hash-IT - 11-10-2011, 05:31 PM
RE: Toggle Rule - by Hash-IT - 11-10-2011, 08:19 PM
RE: Toggle Rule - by Hash-IT - 11-10-2011, 10:22 PM
RE: Toggle Rule - by atom - 11-11-2011, 08:39 AM
RE: Toggle Rule - by Hash-IT - 11-12-2011, 02:39 AM
RE: Toggle Rule - by atom - 11-12-2011, 10:03 AM