[ the code for a course follows the convention category.id.level.sessions and uniquely identifies a course ]
lecture code viewer
downloads
Code
More String Manipulation
More String Manipulation
Martin Krzywinski
#!/home/martink/bin/perl
$\ = "\n";
$seq = make_sequence(bp=>"agtc",len=>1000);
while($seq =~ /(at.gc)/g) {
$match = $1;
$matchpos = pos $seq;
print "matched $match at ",$matchpos-5," around ",substr($seq,$matchpos-7,10);
}
sub make_sequence {
%args = @_;
@bp = split("",$args{bp});
$seq = "";
for (1..$args{len}) {
$seq .= $bp[rand(@bp)];
}
return $seq;
}
|
7 |
More String Manipulation |
1.0.1.8.7
1.0.1.8.7.c1 |
match-01
|
Martin Krzywinski
|
code
1.0.1.8.7.c2 |
match-02
|
Martin Krzywinski
|
code
1.0.1.8.7.c3 |
match-03
|
Martin Krzywinski
|
code
1.0.1.8.7.c4 |
replace-01
|
Martin Krzywinski
|
code
1.0.1.8.7.c5 |
replace-02
|
Martin Krzywinski
|
code
1.0.1.8.7.c6 |
replace-03
|
Martin Krzywinski
|
code
1.0.1.8.7.c7 |
substr
|
Martin Krzywinski
|
code
1.0.1.8.7.c8 |
tr-01
|
Martin Krzywinski
|
code
1.0.1.8.7.a1 |
More String Manipulation
|
Martin Krzywinski
|
pdf
1.0.1.8.7.p1 |
More String Manipulation
|
Martin Krzywinski
|
ppt
1.0.1.8.7.s1 |
More String Manipulation
|
Martin Krzywinski
|
slides
|