BIO notation
Inside-Outside Algorithm
| screen command | Task |
| Ctrl+a c | Create new window |
| Ctrl+a k | Kill the current window / session |
| Ctrl+a w | List all windows |
| Ctrl+a 0-9 | Go to a window numbered 0 9, use Ctrl+a w to see number |
| Ctrl+a Ctrl+a | Toggle / switch between the current and previous window |
| Ctrl+a S | Split terminal horizontally into regions and press Ctrl+a c to create new window there |
| Ctrl+a :resize | Resize region |
| Ctrl+a :fit | Fit screen size to new terminal size. You can also hit Ctrl+a F for the the same task |
| Ctrl+a :remove | Remove / delete region. You can also hit Ctrl+a X for the same taks |
| Ctrl+a tab | Move to next region |
| Ctrl+a D (Shift-d) | Power detach and logout |
| Ctrl+a d | Detach but keep shell window open |
| Ctrl-a Ctrl-\ | Quit screen |
| Ctrl-a ? | Display help screen i.e. display a list of commands |
man screen
“Among modern languages, cases still feature prominently in most of the Balto-Slavic languages, with most having six to eight cases, as well as German and Modern Greek, which have four. In German, cases are mostly market on articles and adjectives, and less so on nouns.” (wikipedia)
In nominative-accusative languages (like English) the agent of a transitive verb and the solitary argument of an intransitive verb are treated alike. They are both called the subject and they have a syntactic/morphological parity which might be word order or grammatical case (nominative). The object of a transitive verb (patient) is treated differently (accusative).
- We run marathons. We sleep.
- They remember us.
In ergative-absolutive languages (e.g. Basque) it is the solitary argument of an intransitive verb and the object of a transitive verb that are treated the same (morphologically or syntactically). In languages with case, solitary argument of an intransitive verb and the object of a transitive verb would have absolutive case. The agent of a transitive verb is treated differently (ergative case).
Some languages have both ergative and accusative morphology.
#!/usr/bin/perl
open IN, “<”, inputfile.txt;
open OUT, “>”, outputfile.txt
if($#ARGV != 2) {
print “ERROR - need 2 args!\n”;
exit;
}
$arg1 = $ARGV[0];
$arg2 = $ARGV[1];
while(<IN) {
$l = $_;
chomp($l):
…
}
close IN;
close OUT;
open FILE, "first2.txt" or die "Personalized error message!!!";
open FILE, "first2.txt" or die $!; # generic error message will be stored in $! variable
open FILE, “>output.txt” or die $!”;
# to use a variable for the filename, it is easier to write the mode in it’s own comma-separated quotes like this:
open FILE, "<", $mine or die $!;
open OUT, ">>", $yours or die $!;
<file.txt (read but DON’T create or truncate/delete/overwrite)
>file.txt (write, create and truncate/overwrite)
>>file.txt (append or create)
* adding ‘+’ allows for simultaneous reading and writing
+< (read/write, but DON’T create or truncate/delete/overwrite)
+> (read/write, create and truncate/overwrite)
+>> (read/append or read/create-write)
-- check if a file exists
$file = ‘ /dir/file.txt’;
if (-e $file) {
print “File exists!”;
}
- FILEHANDLE directly to array
- The file will only be read once per open statement so you can’t do @lines = <FILE> and then while(<FILE>) without closing FILE and re-opening it in between the two <FILE> lines of code.
my @lines = <FILE>;
@myArray = ();
$length = @myArray;
if (exists $myArray[$ind]) #Value EXISTS, but may be undefined.
if(defined $myArray[$ind]) #Value is DEFINED, but may be false.
if($myArray[$ind]) #Value at array index $index is TRUE.
# initialize by assigning to an empty list
%hash = ();
# add value
$hash { ‘key' } = ‘value’;
$hash { $key} = $value; # with vars
%hash = (
key1 => $val1,
key2 => $val2,
key3 => $val3,
);
# reference values of hash
$href->{ ‘key’ } = ‘value’;
$href->{ $key } = $value; # with vars
MORE ON HASHES AND HASH REFERENCES
keys()
value()
# call subroutine
$result = doSomething($input);
# actual subroutine
sub doSomething(){
my $var1 = shift(@_);
….
return $var2;
}
I remember pretty well
foreach (@myArray) {
print $_;
}
foreach $item (@myArray) { # use scalar as iterator for readability
print $item;
}
$linecount++ while (<FILE>);
do { # execute do statement before testing expression
$calc += ($fact * $val); # using an assignment operator
# equivalent to $calc = $calc + ($fact * $val);
} while ($calc < 100);
split, push, pop, shift etc??????
http://en.wikibooks.org/wiki/Perl_Programming/Operators
http://www.cs.mcgill.ca/~abatko/computers/programming/perl/howto/hash/
http://www.troubleshooters.com/codecorn/littperl/perlsub.htm
http://www.cs.cmu.edu/afs/cs/usr/rgs/mosaic/pl-predef.html Predefined names in Perl
http://cslibrary.stanford.edu/108/EssentialPerl.html
http://perldoc.perl.org/functions