This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's an example of having BioPerl write an alignment into the middle | |
# of an HTML stream: | |
use strict; | |
use IO::Scalar; | |
use BIo::AlignIO; | |
my $html = "<h1>Blah!</h1>\n"; | |
my $html_fh = new IO::Scalar \$html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================= | |
What I've learned so far... | |
================================= | |
[raymond] says that daily optimize is probably too much. Instead, only run when your data is 'churned'. | |
10:33 < deafferret> [raymond]: want to give me a clue about how to know if my data is churned? | |
10:34 < [raymond]> deafferret: SHOW GLOBAL STATUS LIKE 'Com_%'; -- look through that list, you'll find some interesting data points. | |
================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open my $in, "oma_repl_language_text.sql"; | |
open (my $out, ">:encoding(UTF-8)", "utf8.sql"); | |
while (<$in>) { | |
print $out $_; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $answer; | |
while (! $answer) { | |
$answer = prompt(); | |
} | |
if ($answer == 1) { | |
print "you chose foo\n"; | |
} elsif ($answer == 2) { | |
print "you chose bar\n"; | |
} elsif ($answer == 3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use Bio::SeqIO; | |
my @files = `find /home/obcarter/2010/bacteria/ -name "*.gbk"`; | |
foreach my $file (@files) { | |
chomp $file; | |
my $in = Bio::SeqIO->new(-file => $file, -format => 'genbank'); | |
while (my $seq = $in->next_seq) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %cities; | |
open my $in, "infile"; | |
while (<$in>) { | |
my @line = split /\t/; | |
next unless $line[2] eq "H1N1"; | |
next unless $line[6] eq "South Africa"; | |
my @city = split /\//, $line[3]; | |
$city = $city[1]; | |
$cities{$city} = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's my most recent stack... | |
View/System/ows/cache/runner.pl | |
View/Runner.pm | |
MooseX::Workers | |
Moose, POE | |
========================================================== | |
View/System/ows/cache/runner.pl | |
========================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $string = "abcdef"; | |
my $newstring; | |
foreach my $letter (split //, $string) { | |
$newstring .= "[$letter]"; | |
} | |
print "$newstring\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use diagnostics; | |
use warnings; | |
use IPC::System::Simple qw(run system capture EXIT_ANY); | |
use WWW::Search; | |
$SIG{ALRM} = sub { die "timeout" }; | |
my $random_word = random_dictionary_word(); | |
my $oSearch = new WWW::Search('MSN'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use diagnostics; | |
my %weeks; | |
open my $fh, "<", "weekConverter.txt" or die "Can't open weeks file: $!"; | |
while (<$fh>) { | |
chomp; | |
my ($date, $week) = split /\t/; | |
} |