-
使用高德纳的算法
4c9a2e1dedcf9c411b0d3ca664d32a37000……【阅读全文】
4c9a2e1dedcf9c411b0d3ca664d32a37000……【阅读全文】
Term::ANSIColor的函数color有以下参数:
clear, reset, dark, bold, underline, underscore, blink, reverse, concealed, black, red, green, yellow, blue, magenta, cyan, white, on_black, on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, and on_white
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #!/usr/bin/perl use Term::ANSIColor; print color "red"; print "REDn"; print color "green"; print "GREENn"; print color "bold blue"; print "BOLD BLUEn"; print color "on_yellow"; print "ON YELLOWn"; print color "on_cyan"; print "ON CYANn"; print color "reset"; |
1 2 3 4 5 6 7 8 | #!/usr/bin/perl my $max = 10; for ( 1 .. $max ) { my $percent = $_ / $max * 100; print "$_ - $percent % OK!n"; sleep(1); } |
从“…..”的长度来判断进度。
1 2 3 4 5 6 7 8 9 | #!/usr/bin/perl -w $| = 1; my $max = 10; for ( 1 .. $max ) { print "."; print " Complete!n" if ( $_ == $max ); sleep(1); } |
用滚轮在原地显示进度,当然也可以加入百分比。
1 2 3 4 5 6 7 8 9 10 11 12 | #!/usr/bin/perl -w local $| = 1; my @progress_symbol = ( '-', '', '|', '/' ); my $n = 0; for ( my $i = 1 ; $i <= 100 ; $i++ ) { print "r $progress_symbol[$n] $i"; $n = ( $n 》= 3 ) ? 0 : $n + 1; select( undef, undef, undef, 0.1 ); } print "n"; local $| = 0; |
4c9a2e1dedcf9c411b0d3ca664d32a37007……【阅读全文】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/usr/bin/perl -w use Term::ProgressBar 2.00; use constant MAX =》 100_0000; my $progress = Term::ProgressBar-》new(MAX); for ( 0 .. MAX ) { my $is_power = 0; for ( my $i = 0 ; 2**$i 《= $_ ; $i++ ) { $is_power = 1 if 2**$i == $_; } if ($is_power) { $progress-》update($_); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/usr/bin/perl -w use Term::ProgressBar 2.00; my $max = 100000; my $progress = Term::ProgressBar-》new($max); for ( 0 .. $max ) { my $is_power = 0; for ( my $i = 0 ; 2**$i 《= $_ ; $i++ ) { $is_power = 1 if 2**$i == $_; } $progress-》update($_); } |
4c9a2e1dedcf9c411b0d3ca664d32a37010……【阅读全文】
使用Parallel::ForkManager模块可以很方便得在for、foreach等循环中使用多线程进行并行运算,示例如下:……【阅读全文】
关于seqTools v1.0的详细信息可以参看:对FASTA格式的简单处理与统计……【阅读全文】
4c9a2e1dedcf9c411b0d3ca664d32a37015……【阅读全文】
Get every new post delivered to your Inbox
Join other followers