Friday, January 27, 2006

Perl Bigram count

#program: bigramcount - counts the number of bigrams in a text,
# prints them out in order of decreasing frequency

while(<>) {
chop;
tr/A-Z/a-z/;
tr/.,:;!?"(){}//d;
foreach $word1 (split) {
$bigram = "$word2 $word1";
$word2 = $word1;
$count{$bigram}++;
}
}

foreach $bigram (sort numerically keys %count) {
print "$count{$bigram} $bigram\n";
}

sub numerically { # compare two words numerically
$count{$b} <=> $count{$a}; # decreasing order
# $count{$b} <=> $count{$a}; # increasing order
}

Frequency counts

while(<>) {
chop;
tr/A-Z/a-z/; # convert to lower case
tr/.,:;!?"(){}//d; # strip out punctuation
foreach $word (split) { # split line into words
$count{$word}++; # count words, put count into hash (word is key, count is value)
}

}

foreach $word (sort keys %count) { # sort hash by the value of the key
print "$word $count{$word}\n"; # print out the hash in key order

}

Tuesday, January 24, 2006

Mahle Kwababa

















One cool brother at Godfirst Church, Jo'burg. I call him the real Makhoya! Posted by Picasa

Wednesday, January 18, 2006

What Every PhD student dreads

On Monday January, 16th, 2006, I received a very upsetting email from my UK PhD supervisor, Adam Kilgarriff that one Makerere University (Computer Science) student had plagiarised my PhD Research Proposal and attempted to submit it as his, both at Makerere and to my supervisor asking if my supervisor could supervise him! My supervisor forwarded this "gentleman's" email to me & I read it. I have launched a formal complaint with the Dean of Faculty of Computing and IT at Makerere University, Dr Venansius Baryamureeba. Dr Baryamureeba promised to consider may complaint "together with my colleagues and get back to you as soon as possible but not exceeding two weeks from now." I await his response.

Monday, January 16, 2006

God is ever present in dark times

New year resolutions are not my thing for life is like a flood with seconds, minutes, hours, days, weeks, months pouring into others without any hiccups. I look back into 2005 and my experience is better characterised by oxymorons: white-darkness; bitter-sweet; melancholy-gladness & bleeding laughter. My country (yes I feel a certain ownership of Botswana, for our national anthem is right: "This land is a gift from God; An inheritance from our fore-fathers") has experienced some of the worst nightmares badly termed passion killings. "Passion killings"? It is hard to imagine any murder which occurs without a certain degree of passion: a swelling of emotions! A famous footballer (and a policeman) star killed his girlfriend; a 77 year old man killed his wife in her late 60's and her daughter in her 40's. Reasons remain a mystery. Many young men killed their "lovers" in some of the most gruesome ways ever recorded anywhere in 2005 - stuff of horror movies! Botswana was also hit by a massive drought leaving Gaborone dam 17% full (or is it 17% empty?). These were the dark, bitter, melancholic & bleeding times.

Inspite of all this, God always raises up the standard against the enemy. That is a fact! At the end of 2005, the rains came - not simple showers - but rains that flooded the land. I knew as I do now that troubles don't last always and joy comes at the break of dawn. Forever, dawn will follow the darkness of the night. Crucifiction was followed by resurrection; Peter's 3 times denial of Jesus was followed by his robust preaching and defence of the gospel; Paul's persecution of the church was subsequently followed by an apostolic work of establishing churches in Greece and many places. Hard times are never eternal - God intervenes and turns things around.

In 2005, I took a step of faith and moved from Brighton to Johannesburg where God has been working on me in different ways since. I love Brighton - but I love God more. My move was in response to his plan and purpose for my life. The church plant in Gaborone is right on God's schedule. It will not start a minute early nor a minute late. God will build his own church in Botswana - not me nor any other!

I stand in awe that God would call me his own. Grace is not only scandalous it is ridiculous: criminals evade punishment & are saved for free! 'I stand amazed when I realised your love for me is beyond all measure Lord.'