line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::randskip; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
47557
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
App::randskip - Samples lines randomly with an efficient internal mechanism - a random number is generated per a output line not per an input line - both with replacement and without replacement. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 0.0003 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.0003'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
You can see the help manual by : |
23
|
|
|
|
|
|
|
randskip --help |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
The help is mainly Japanese with minimum Englih, sorry. But the program is fairly short and simple |
26
|
|
|
|
|
|
|
so the author thinks that you can easily understand what this program does. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Try: |
29
|
|
|
|
|
|
|
seq 50 | randskip -e 0.2 |
30
|
|
|
|
|
|
|
# -e specifies the possibility each line will appear. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
seq 10 | randskip -e 0.4 -s 123 |
33
|
|
|
|
|
|
|
# you can fix the random seed. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
randskip -e 0.3 -r somefile |
36
|
|
|
|
|
|
|
# -r mean sampling "with replacement". -e specifies the expectation appearance number of each input line. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 AUTHOR |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
"Toshiyuki Shimono", C<< >> |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 BUGS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
46
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
47
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SUPPORT |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
perldoc App::randskip |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
You can also look for information at: |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=over 4 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker (report bugs here) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
L |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item * CPAN Ratings |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * Search CPAN |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=back |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Copyright 2018 "Toshiyuki Shimono". |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify |
90
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
91
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
92
|
|
|
|
|
|
|
(at your option) any later version. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
95
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
96
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
97
|
|
|
|
|
|
|
GNU General Public License for more details. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
100
|
|
|
|
|
|
|
along with this program. If not, see L. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; # End of App::randskip |