Kenya is currently in the grips of a wave of student riots. In the last month alone, about 300 secondary schools have shut down as a result of the unrest. The timing of the riots is not surprising: national exam season is just around the corner. The month of July is when most schools would sit for their Mock examinations – internal exams designed to simulate the national exams. Performance in Mocks is taken as a good indicator of expected performance in the national exam – a fact that makes the exams stressful.

 Given the high tension atmosphere, it is quite likely that events that would ordinarily draw minor reactions from students get blown out of proportion. So what is it that most students are complaining about?

 “The exams are hard.” (according to an investigation by Nation)

 Exams have always been hard and there have always been schools that went on strike on this grievance. I remember an eruption of school strikes in my district when I was in form 2.  Four schools went on strike in close succession around Mock time and they sent emissaries to our school urging us to boycott the exams. The following year, when national exams results were released, one of the schools went on strike over their performance. This time, they marched to the District Education Board office carrying banners that asked “Why did we fail?” in big bold letters. It was a study in irony. The students alleged a plot by district officials to favor certain schools, evidenced by those schools good performance. Incidentally, the ‘favored’ schools had not boycotted mock exams in the previous year.

 Thinking back to this incident led me to some conclusions on the force behind the current wave. Read more

The cheek with which Finance Minister Amos Kimunya proposed his new tax measures aimed at cigarettes may have unnerved some, but he was unflinching. In a section of his 2008-2009 budget speech appropriately titled Contribution to National Development he “propose[d] to allow cigarette smokers to be proud Kenyans by making additional token contribution, averaging only (emphasis supplied) Kshs. 7 per packet toward development.” If the smoking fraternity were un-amused by his humor, the brewers certainly found it caustic: “Mr. Speaker,” the veritable Kimunya began, “Hon members will recall that last year, I increased the excise tax payable on malt-beer by only Kshs. 2 per liter, or an equivalent of Kshs. 1 per bottle of beer. Following this insignificant adjustment, the industry immediately advertised a price adjustment of Kshs. 5 per bottle, translating to a net gain to the industry of Kshs. 4 per bottle. To recoup part of this gain made by the industry to finance priority programs in this budget, I propose to increase …”

Pity we may not get more Kimunya budget humor. Pity, too, that the circumstances surrounding his hounding out of office may blunt the prospects of what was probably the year’s biggest budgetary innovation – long term bonds, including sovereign bonds, to finance infrastructure development. With allegations of corruption leading to his resignation, the sovereign bond, especially, may not succeed, leaving the country with a huge budget deficit of almost $2 billion. While the government has always made efforts to keep the interest rates low, a regime of high-interest rates with its attendant high inflation rates may just be in the offing, and, is in fact, already here. The Commercial Bank of Africa recently revised its base lending rate to 22% with other banks expected to quickly follow suit. As for inflation … it still remains death. Okay, okay … has been death for quite some time now. (The full quote that I read so many years ago went something like “Inflation hasn’t changed the wages of sin, it still remains death”).

I’d, as usual, ordered my budget meal of rice and beans and was surprised – but not perturbed – when the bill was 80 Shillings and not 70. I understand, I told myself, everything has been going up. It’s expected. A week later I ordered the same meal, handed my 80 shillings to the attendant expecting some change back. Thanks, she said, and I understood that she meant “please come back again.” I was still ruminating on the sudden change in my lunch budget when the late night matatu made the last stop. Even before I stepped out, a feeling of unfamiliarity suffused the air. A bunch of people stood on the roadside beside what that morning was a row of kiosks, in whose stead now were the smoking ashes of dying fires. The big kiosk had been turned over, the rest flattened out. I forgot about the pinch in my wallet that night, but instead cried for the kiosk owners. The next morning and the next the kiosks stood somber and sullen, in the evenings gaunt and grotesque. For about a week the life that had so suddenly ebbed out stayed snuffed out. Yet one evening, about a week later, the fillip was palpable as teams of workmen worked on putting the structures back up. They weren’t daunted by the chill of the morrow’s morning, their enthusiasm buoyant.

Another late evening that night, and the sore realization that the kiosks were all flat and the big one toppled over yet again. On the morrow the life was absent, the roadside deserted. No quick banana before hopping into the matatu, or donuts for my breakfast at the office. I held my chin and stared into the distance. That evening, some of the dying embers had kindled a fire, and instead of the gaunt roadside was a stall – a small one, on which three shelves stuck out holding a crate of eggs, a rack of tomatoes and one of kales and cabbages. At one side of the stall stood the owner of the toppled-over kiosk. As I walked past her, I hoped I could shop with her just to show my solidarity. It was another week when the fire started to spread. This time, however, the stalls came up hesitantly and diffidently. Even after the big kiosk stood on its floor the owner didn’t start selling. Instead, only the other smaller kiosks seem to open only about half of the time.

Their resilience has astounded me. But if this teen counselor was right, I also have such “bed-bug” blood in me. “If you’re Kenyan,” she noted, “you are like a bed-bug. She’s often been heard telling her young ones: ‘Even hot water has to get cold after some time then life goes back to normal’”. It most certainly was in this lad who walked into this CitiHoppa minibus I was in, with a black polyethylene bag wrapped over what I assumed was a big novel. Once he’d ascertained the conductor was to his back, he unwrapped the bag, picked out a few sweets which he started hawking to the passengers. No one seemed to buy, and, a few minutes later, he lightly wrapped the polyethylene bag over the candy and hopped out as if taking back his rejected novel. Even if we bought some of his candy, I wondered, would he get enough to live on? I wondered. Still wondering about this lad, I asked my friend what he thought of such an enterprise: resilience, entrepreneurship or misapplied effort?

It’s a little bit of all, we agreed, but certainly misapplied effort. But we also noted we were harsh. The [grim] rules that are economic reality probably stand impregnable to his yearning for change. He only does what – and all – he can. Suppose there were a government-funded labor-intensive public works project … would my lad, or the kiosk owners participate in it? Definitely, I thought. In case they wouldn’t, they would have a very good reason backing their decision, I reasoned. But herein also lay the contrast: my friend and I believe the economic reality can be changed. Maybe that’s why we think misapplied effort is not good for the economy. But herein also lies the hope: we don’t need to remain persevering bedbugs – we can apply our efforts appropriately and reap success, not resilience.

I held the rails on the third floor balcony and strained my eyes towards the valley a little on the left to see if a flare, or the bright of a flame, would light up the hazy mist hanging over the valley. Kevin stood on my left.

“The police must have arrived. You hear the sirens?”

We all strained to expecting some flashing lights to announce their arrival. An orange glow persisted above the misty haze.

“No, that can’t be a fire. It’s the flood lights.”

“Yeah, they’re floodlights,” we all agreed.

“They’re not flashing.”

“Yeah, they’re not flashing. They can’t be fires … must be the flood lights.”

There were a couple rat-a-tats in quick succession from the left edge of the valley. Two or three reverberated from Juja Road, on the opposite side.

“Dude, that must be the Mungiki.”

“You mean the ones to the left?”

A few more distant shots.

“Do you think it will spill out of the valley?”

“Maybe.” A pause. “I really don’t know … actually maybe. But wait … it doesn’t sound that bad.”

We stared into the valley, expecting it to answer us back. Wails, distant and feeble, then – still distant, but – more certain.

“Something’s going on. What’ll we do if it spills over into Pangani?”

“I think we’ll have time to leave the house and get away.”

“Yeah, there’s many houses before they reach our block.”

“There’s also a wall. The one they built two years ago to keep the thieves away.”

“But dude, you know the road passes right behind our compound?!”

“Aw, goodness me!”

The orange glow persisted above the valley. As I sighed “goodness me!” I turned and this girl was clung tightly on Dedan’s arm. Dedan had another girlfriend??!! Still, I felt lonely, a little scared perhaps. But certainly wishing the girl was clinging to my arm instead.

The distant shots again. Another, louder, where Juja Road met the street our gate stood on. Three bangs no more than a hundred meters from our gate! We all scurried down the stairs and in one fell swoop the two girls, Kevin, Dedan and I found ourselves in our tiny bachelor’s pad. Two chapattis were still rolled in a clear polyethene bag, left-over ugali on a plate, and the beef sufuria balanced on giant tweezers on the table. We excused the mess. I offered my name to the two girls and was surprised Dedan offered his too. Kevin had meanwhile dashed to his house to latch it but was back in a moment. With Joanna, the next-door neighbor. Joanna stood at the door.

“Please come in.”

“Goodness … you think it’s going to grow worse?”

In the house I offered Mani and Nunu dinner. Nunu stared at Mani. I stared at Mani.

“Er … I’ve already eaten.”

“I don’t think so … really? It’s fine … it will be okay … will you?”

“Uhm … not really.”

“Tea then?” Unrelenting.

“Okay, tea.”

“But you’re taking dinner … right?” I said turning to Nunu.

“Tea too.”

I stared disapprovingly. Play-acting … or rather, desperately persuading. To overcome Nunu and Mani’s fear, society’s fear, our fear, my fear. As much as we boast of our collective welcoming spirit, a surprising majority of us never dares eat in strangers’ homes. Perhaps I saw myself in them as I pleaded. I was grateful that they agreed to eat.

Dedan had since gathered the courage to walk up to the gate and stare down the whole length of the street and confirmed that there was no one on the 10 o’clock street. He ominously announced that it would be a long night as he walked in with Kevin. (When Kevin – and Joanna -eventually got the courage to leave, Dedan explained that Kevin had been too scared to walk up to the gate with him).

“Dudes, what if Luos overrun this compound? We’ll be finished!”

Joanna told Kevin never say that!

“But it’s true … we’ll be done!” It sounded exuberant, but what it lacked in pathos, it made for in sting. Dedan and I would not be overrun.

Mani and Nunu wished they’d traveled to Kiambu that day. They’d now be safe.

I said it would be fine. I said it as much to Mani, Nunu, Kevin and Joanna as I did to myself. Perhaps more so to them, as they seemed more scared than I was. You see, I’ve never quite seen danger make a beeline towards me and that makes me believe I’ll always be fine. Dedan seemed to feel the same way.

“Dude, it could be the Mungiki …” I found myself saying. Kevin interrupted the silent stares that answered better than would have been said … “Let’s watch TV.”

“We guys have DSTv and GTv … have a favorite?” Dedan asked. Nunu and Mani said anything would be fine. I thought they felt cold but couldn’t say, so went to the other room and grabbed two blankets for them. Kevin had grabbed the living room linen, and, sitting next to the door, occasionally pulled the door to stare the way of his house to make sure no one had by chance got into it. Joanna, Dedan and I watched TV.

It was sleep, however, that eventually overcame everyone’s scares. At 3 a.m. Kevin felt safe enough to leave at the urging of Joanna, who, though afraid, wanted to go to bed but was too afraid to leave alone. By 4 a.m. it was Nunu and Mani who said they thought they would be fine. But they made us promise to grab them in case anything came up. We’d also made Eleven, the Eritrean, promise to drive us away in his car if anything came up.

When we finally had the house to ourselves, I poked fun at Dedan for being so good with the ladies. He laughed. But we both reflected similarly. It’s Dedan who said first. Afraid that Luo mobs may overrun our compound, our Kikuyu and Meru neighbors had come to seek safety in our house. But we’d also needed them. We both knew we’d have hidden in the second room and asked Kevin to answer for us if perchance the Mungiki came knocking. My friend hypothesizes that perhaps some primordial sense of insecurity in each of our tribes crescendos into irrational orgies of violence such as may have been happening in Mathare that night. True, it makes sense. But that primordial fear also drove us to seek refuge in our differences. We all want to live.

When I was 17, I wondered how little my parents knew. When I turned 23 I was surprised at how much they’d learnt in a few short years!

~ Paraphrase of Rudyard Kipling courtesy of my high school English teacher, and 8 years of convenient recall.

‘Sikate Tamaa ni jina la diwani ya kwanza ya mashairi ya Said Ahmed Mohammed. Niligundua diwani hii siku moja maktabani nilipokuwa kidato cha tatu. Kilichonivutia kwanza ilikuwa ni muundo wa mashairi ya diwani hii – mengi yalikuwa mafupi na, tofauti na nilivyozoea, ni machache tu yaliyokuwa tarbia. Nilianza kusoma shairi la kwanza huku nikijitayarisha kukumbana na misamiati.

Shairi lenyewe lilitirirka – maneno pia na mawazo. Hili lilikuwa shairi lililopendeza kusoma, lenye maudhui dhabiti na lenye lugha isiyoficha maana. Halikuvunja urari wa vina au kanuni zingine zilizotawala ushairi – idadi ya vina katika kila mshororo. Hii ilikuwa ndio sanaa iliyokamilika.

Ilikuwa ndio mara yangu ya kwanza kupata shairi la kiswahili lililopendeza hivi. Baada ya kusoma mashairi mawili au matatu yaliyofuatia nilijua kwamba lazima ningenua kitabu hiki. Malenga huu alipata mfuasi.

Shairi hilo la kwanza, ‘Sikate Tamaa, limenipa moyo mara nyingi pale nilipokaribia kufa tamaa.

Umeanguka, inuka, simama kama mnazi
Umechunika, inuka, tia dawa kwa ujuzi
Sasa inuka, inuka, kijana ianze kazi
Sikate tamaa

Usife tamma, nyanyuka, ni muweza wa kutenda
Kuna hadaa, nyanyuka, anza tena kujipinda
Dunia baa, nyanyuka, anza tena kujiunda
Sikate tamaa

Sivunjwe moyo, dunia, hivyo itakunyanyasa
Futa kiliyo, dunia, hiyo idhibiti sasa
Ipe kamiyo, dunia, kamwe, siache kufusa
Sikate tamaa

Una nguvu, simama, wewe upambane nao
Una werevu, simama, uzepuke njama zao
Usiche kovu, simama, ujifunze vumilio
Sikate tamaa

Shairi hili ni aina ya tarbia lakini si tarbia ya kawaida. Ingawa kila ubeti una mishororo minne, tunapata kwamba kila mshororo umegawa kwa vipande vitatu badala ya kawaida ya vipande viwili. Vipande vyenyewe bado vinadhihirisha urari wa vina na kipande cha kati kinarudiwa kwa kila ubeti. Kurudia huku kunachangia utamu/ladha ya shairi kwani kuna usawa fulani. Pia kurudia huku kunahimiza ujumbe wa shairi hili.

In senior year of college, I took an class that blended information theory, algorithms and networking. It was called “Algorithms at the end of the wire”. My project for that class was an application that finds links for articles in Wikipedia.

Working off the ideas presented in class on search results ranking and vector space models, we proposed that given a query article (an article to add links in), we can find some k articles already in Wikipedia that are most similar to it. We can then we can use the links in those articles to infer the links to create in the query article. In particular, each of the neighboring articles could suggest links for text that they had in common with the query and the set of neighbors would vote on the link with weighing applied based on how close the particular voting article was to the query article. As the mechanism for determining the k nearest neighbors, we would fetch articles from the Wikipedia corpus that had text occurring in the query article then rank the results and pick the top k. Ranking was done separately using PageRank and using Latent Semantic Indexing then the rankings were aggregated.

You can download a prototype of an editor implementing our algorithm here . The editor depends on a web service so you need to be connected to the internet to use it. This is a C# application so you can run it in windows or in Linux using Mono.

kappa_01_prelinking.jpgkappa_01_postlinking.jpg

 

 

 

 

Read more

Kenya is slowly recovering from the effects of the post-election violence that rocked the country for the first two months of the year. One of the parties in the conflict, ODM, is calling for amnesty for those arrested for participating in the violence and various crimes around it. This, they say, is necessary for national healing. A blanket amnesty, in my opinion, is neither necessary nor conducive for the goal of national healing. Read more

Katika miaka ya sitini na sabini, kulikuwa na kipindi cha televisheni kilichoitwa “Let’s Make a Deal” kilichofana nchini Marekani. Katika kila kipindi hiki, kulikuwa na washiriki tofauti ambao Monty Hall, mtangazaji wa kipindi, aliongoza kwa michezo fulani. Mojawapo ya michezo hii ilihusisha kuchagua kati ya vyumba vitatu ambapo chumba kimoja kilikuwa na zawadi (kawaida gari) ilhali vyumba vingine mlikuwa na kitu kisicho dhamana (kawaida mbuzi). Ili kukanganya wachezaji Monty Hall aliwapa fursa ya kuchagua chumba kwanza (kwa kuashiria mlango wa chumba) kisha naye Monty Hall aliashiria moja kati ya vyumba viwili vilivyosalia. Monty Hall aliagiza wasaidizi wake kufungua chumba alichochagua yeye. Kwa kuwa Monty alijua awali chumba chenye zawadi, alipanga kwamba kila wakati mlango wake alionyesha chumba kisicho na zawadi. Hapo mchezaji aliulizwa ikiwa alitaka kubadili chaguo lake kufuatia ujuzi huu mpya.

Kwa watazamaji nyumbani, ambao hujiona kama ndio wachezaji, swali lilikuwa Je mpangilio upi ungezidisha uwezekano wa kushinda? Mwanahesabu mmoja aliamua kutumia mbinu zake kupendekeza mfumo uliofaa – alisema kuwa kubadili chaguo lako kunazidisha uwezekano wako kushinda. Read more

I have been yearning for a while for a device that would help me manage pdf files with the ease and convenience I currently manage my mp3 files. I searched around on the net for a while but didn’t find anything that would fit my needs (there was an interesting MacOS program though). I settled to build the program myself.

I identified the iTextSharp library as my tool for reading and writing pdf metadata. The library is counter-intuitive on some points and it took a while to figure out that the pdfstamper was the best object to use to edit metadata.

This project was my first foray into the world of winforms and it was pretty instructive in that regard. The main lesson learnt was that EventHandlers are your friend. The listview control came in in handy as it was my primary mode of displaying the files being managed. I had to tweak it to enable sorting by various columns and will have to tweak some more to get filtering of items by a query term.

PDF manager

 

 

 

 

Next steps

The whole search mechanism is missing. I could implement this by extracting text from the pdfs and sticking this in a lucene index. If the index returns filenames (and we assume filenames are unchanged) then I would have full text search of pdfs.

I would also like to implement bulk editing of metadata.

I have been reading up on Windows Presentation Foundation and some of the stuff being produced is amazing. I am especially impressed by Delays SilverLight demos. His “surface” demo and XPS reader to me are an indication of the possibilities in interface that are opening up. WPF allows one to write applications in C# that run on the web as well, and that is going to change the limitations of applications. Microsoft quietly launched a beta of a search engine interface I find absolutely impressive – tafiti. It’s about time someone allowed me to save my search results with ease. Here’s a screenshot.tafiti_beta.jpg

Be sure to check out the tree View utility.

← Previous PageNext Page →