African Tech Tidbits: Week of February 13th 2012

16 Feb
X-Net The first Cameroonian created cell phone

X-Net The first Cameroonian created cell phone

It’s the middle of the week, I’ve been busy with life and wanted to post a few articles but never got time, so  decided to start a new, hopefully weekly series of articles aggregating articles that I find interesting related to Africa and Tech. So for this week:

Over at Forbes, a list of the top 20 African Tech startups: A good variety in terms of business models and technologies, going from social networks, job portals and mobile shops/apps to payment solutions, but the overall trend is definitely in the mobile space.

The lucrative skills African talent should acquire in 2012: An interesting article at Appfrica on what skills techies and non techies should acquire in the ongoing year. From a developer perspective I found it pretty much accurate and in line with the trends I am seeing in the US especially with the re-emergence of RoR and Python/Django as viable alternative. Food for beyond thought, action. There is also a set of skills for non techies that are good to possess.

Internet Outages in Benin(in French): The Internet is out again in Benin with no warning, back in January the whole country went off the grid for a whole week because of a fire at one of the routing hubs, and the problem seem to be back. My friend Senam at Etrilabs has been living this from the front lines and this is a highlight of one of the biggest issues with trying to do tech business in certain African countries, which is one, the lack of supporting infrastructure and two, outdated or counter-productive government regulations. Can you imagine trying to run a tech hub with no internet access for a week? And when we’re talking about Internet, we’re not talking about your run of the mill cable connection that they’d be happy to have, we’re talking about the low rungs of the scale ADSL connections. The other alternative is satellite internet connections, but this too is heavily regulated (as pay us a very hefty, does not make business sense,  license fee) by the Beninese government which even has a sniffer truck driving around looking for illegal SAT setup to impose heavy fines.

Meet X-Net, the first African designed cell phone: Created by a three Cameroonian expatriates in the US and Germany (manufactured in China), this cell phone features two SIM card slots, an MP3/MP4 player, an optional camera, FM radio and a flashlight. It’s already being sold in Cameroon by Lekoua & Fils for about $21 to $25 depending on the camera option. The engineers behind this basic phone worked on it for a year and wished to remain anonymous as they are currently working for western cell phone makers.

 

 

Tags: , , , ,

Speed up your CakePHP application by using Memcached

13 Feb

In anticipation of heavier traffic and also just for performance reasons, I’ve started looking into ways of caching data for Nouchi.Mobi. Since this is a CakePHP application, I naturally looked into PHP cache based solutions and you’d be hard pressed not be recommended Memcached(Used by Facebook, Twitter, Youtube, Flicker amongst others). Why would you want database caching? If you’re using a framework to build your application or just from building any type of decently functional custom coded dynamic application nowadays, chances are you will make numerous calls to retrieve the data you want to display (the average Drupal site issues 300/400 queries!). Some pages do actually make more SQL queries than others and caching the result of these queries would give your application a significant performance boost. Memcached is a high performance in-memory data caching system that works by storing data as key-value pairs, meaning :

  • Store the value V with the key K
  • Retrieve the Value V identified by the key K

In the context of CakePHP, follow these instructions to get Memcached up and running in your local development environment. The trickiest steps in this set up will probably enabling the memcache support in your PHP configuration (getting and enabling the php_memcache.so extension in Linux). Keep in mind that for your production environment, unless you have your own Virtual Private Server, you’d be hard pressed to find any  host that will let you run Memcached in a shared hosting environment, but this is a scaling issue, and a problem you want to have, meaning your application is getting popular. Next you’d need to enable it in CakePHP in your app/core.php

Cache::config('default', array('engine' => 'Memcache'));

Once it’s up and running what you have to remember about using caching is that it is not magic. You have to code with caching in mind, and caching works best for queries that return the same data or that don’t change often. Teknoid has a good article on explaining what I mean by that with an example. Hope that’s enough to get you started and you can also take a look at this excellent Nettuts tutorial on the matter.

Tags: , ,

Rails console not starting up in Ubuntu 11.10

12 Feb

On trying to launch the Rails console from the command line by running the “rails console” command I got this error:

/home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /media/DATA/Development/www/cakephp/cake/console in PATH, mode 040777
/home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `require’: no such file to load — readline (LoadError)
from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `’
from /home/abou/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.0.11/lib/rails/commands/console.rb:3:in `require’
from /home/abou/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.0.11/lib/rails/commands/console.rb:3:in `’
from /home/abou/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.0.11/lib/rails/commands.rb:20:in `require’
from /home/abou/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/railties-3.0.11/lib/rails/commands.rb:20:in `’
from script/rails:6:in `require’
from script/rails:6:in `’

So the issue was that for some reason, my install of the readline library was not getting picked up in my RVM 1.9.1 Ruby install, even thought i had these libraries installed through Aptitude. The next three hours were spent practicing extreme skills of google fu, with various workarounds that did not work for me, but this StackExchange post had something that worked for me, with some tweaks of course:

Edit ~/.rvm/scripts/functions/pkg file and remove this piece of code (Lines 65-81):

 if [[ "${rvm_skip_autoreconf_flag:-0}" == 0 ]] &&
which autoreconf >/dev/null 2>&1 &&
which libtoolize >/dev/null 2>&1 &&
[[ -f configure.ac || -f configure.in ]]
then
if [[ -z "${rvm_autoconf_flags:-}" ]]
then
if uname -s | grep -iE ‘cygwin|mingw’ >/dev/null
then # no symlinks on windows :(
rvm_autoconf_flags=”-ivf”
else
rvm_autoconf_flags=”-is –force”
fi
fi
__rvm_run “$package/autoreconf” “autoreconf ${rvm_autoconf_flags}” \
“Prepare $package in $rvm_src_path/$package-$version.”
fi

Now install the REE Dependencies libraries, which include Readline:

rvm pkg install ree_dependencies 

Now uninstall 1.9.2

rvm remove 1.9.2

Now undo the code deletion you did in the pkg file

Reinstall 1.9.2

rvm install 1.9.2

You should be good. I wasn’t. The post recommended reinstalling 1.9.2 using the following command, which i think was the source of my issue:

rvm install 1.9.2 –with-readline-dir=$rvm_usr_path –with-iconv-dir=$rvm_usr_path –with-zlib-dir=$rvm_usr_path –with-openssl-dir=$rvm_usr_path

On running “rails console” again, i got this error:

/home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’: no such file to load — zlib (LoadError)     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:7:in `<top (required)>’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:78:in `<top (required)>’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:7:in `<top (required)>’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:7:in `<top (required)>’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/source.rb:3:in `<top (required)>’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/dsl.rb:14:in `initialize’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/dsl.rb:6:in `new’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/dsl.rb:6:in `evaluate’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/definition.rb:17:in `build’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler.rb:138:in `definition’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler.rb:126:in `load’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler.rb:110:in `setup’     from /home/abou/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.22/lib/bundler/setup.rb:7:in `<top (required)>’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require’     from /home/abou/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require’     from /media/DATA/Development/rails_projects/demo_app/config/boot.rb:6:in `<top (required)>’     from <internal:lib/rubygems/custom_require>:29:in `require’     from <internal:lib/rubygems/custom_require>:29:in `require’     from script/rails:5:in `<main>’  

I had again to remove 1.92. and reinstall it with the argument less syntax to get it to work. Pfff….

Tags: , ,

Installing MongoDB on Ubuntu 11.10

9 Feb

If you’re like me new to Ubuntu, you’d rather install your software through Aptitude instead of dealing with editing various config files and moving files and archives around, so needing to get up to speed on MongoDB, i looked for a quick way to get it set up and sure enough:

http://www.stehem.net/2012/01/16/how-to-install-mongodb-on-ubuntu-11-10.html

This link will get you up and running real quick on Ubuntu 11.10 with Mongo 2.0.2 and if you are ready to start learning MongoDB, head over to NetTut’s two part tutorial on the topic:

http://net.tutsplus.com/tutorials/databases/getting-started-with-mongodb/

http://net.tutsplus.com/tutorials/databases/getting-started-with-mongodb-part-2/

Fire away!

 

Tags: , , ,

Heroku setup: “git push heroku master” permission denied ssh issue

4 Feb

I think i am not the only one that ran into this issue trying to set up your app into Heroku. I was trying to do so as part of following the Ruby On Rails tutorial and ran into this issue in which i sank a couple of hours. I am running on Ubuntu 11.10, and had already set up my id_rsa and id_rsa.pub keys for Github in ~/.ssh. so when I called in a terminal

heroku login

and provided my login credentials, it told me that it found my public key in ~/.ssh and uploaded to Heroku. All is fine then, but when I ran

git push heroku master

No luck there, I kept getting a :

“Permission denied (publickey). fatal: The remote end hung up unexpectedly”

After deleting my original app I had set up on Heroku, deleted my original keys and setting them up again in Github, i noticed that, contrary to before when setting up keys by running

ssh-keygen -t rsa -C  “myemail.com”

I was asked now in which directory i wanted to save the file, with the default being set to /root/.ssh/id_rsa. That was the rub! Even though Heroku picked up my public key residing in ~/.ssh, when running the git command it was still looking for it in /root/.ssh. I just copied over the keys in ~/.ssh to /root/.ssh and lo and behold, I had a working push again!

I then ran into another issue whereas, having deleted my original Heroku app, my git remote was now invalid. I had to point my git remote to a working app on Heroky. In Git to change your remote, not deleting it but just updating the url to a new one, run:

git remote set-url heroku git@heroku.com:example-app-872223.git

Hope it helps!

 

Tags: , , , ,

Speak Chic: Luxurious pronunciation has no price!

2 Feb
Speak Chic App

The Speak Chic App

I stumbled on this article from Twitter and after a chuckle, I had to post about it, both because it’s a great necessary idea, but with a great funny factor to me. Essentially after seeing foreign brand names getting their pronunciations slaughtered in countless reality shows, hip and pop songs and of course on Youtube (without forgetting obnoxious people at the mall), enter Speak Chic! For $1.99 please make sure that if you are obnoxious enough to bash people ears in with the brand names you own, at least you are pronouncing it correctly!

All jokes aside, this is a great idea and the app is designed by Rebelle a mobile app company founded by Monique Woodard whose main audience are fashion aficionados and insiders who might not always be up on the correct pronunciation for the latest names to make their appearance in the business. The app allow users to “quickly and discreetly search for the correct pronunciation, read the phonetic spelling, and listen to the audio”. Makes sense to me!

 

Tags: , , , ,

E-Book: App Design help for design-averse developers from Afriapps

27 Jan

Cover Afriapps developer Andrew Mugoya is back at it again with a new book offering some designing help to app developers. Titled  “Help! I am a developer with no clue about design”, the book aims to help developers integrate minimal design elements to make their apps acceptable not only to the Afriapps app store but also potentially the Android Market. Mugoya draws from his experience running Afriapps and having to reject badly design apps to offer tips that will ” will not turn developers into killer designers, but they will hopefully ensure users are not turned away from apps/sites due to woeful designs”. In combination with my previous post about website design tips for the African market, it’s a general consensus that in African software development, design if very often given the last place whereas it is a crucial element in making a product successful when well exploited. I would definitely encourage developers to read and learn from both sources in order to better their product and make them more competitive.

You can download the book here.

 

Tags: , , ,

Website design rules for the African market

25 Jan

Will Mutua at Afrinnovator writes an interesting article on how to design websites for the African market and supports it with some facts on the ground. Looking at the examples of the most successful websites in Kenya and Nigeria, Will comes down with the following nuggets when it comes to designing for the African market:

  • First to market:
    Bottom line: If you are offering a great service, and customers catch on and engage with your service, it is unlikely that they’ll jump ship when someone else comes by who’s offering exactly what you are offering with a better looking skin on it.
  • User Experience Design trumps Graphic Design:
    You may not want to hold up the product because of the graphic design side of things but user experience is everything. If you’re going to spend time on design, spend as much of it as you can on getting aspects of user experience and user interaction just right.
  • Mobile Web Rules in Africa Design Specifically for it:
    [...]It would be wise to invest in creating a custom site for mobile, or making your website mobile friendly. As far as web design for mobile goes, the cardinal principle is to minimize. Minimize on the number of graphics you have, minimize on the number of actions a user needs to do or number of pages it takes to accomplish a task.

Great advice very in tune with my own experience so far. Read the whole article here and you should also be a frequent reader of the Afrinnovator website.

 

Tags: , ,

Time localization in CakePHP

24 Jan

It turns out localization is not such an obvious task. I am currently trying to localize my Nouchi.Mobi app built with CakePHP and although CakePHP i18n console shell is helpful in created POT files, there still remains the question of translating time strings in French when using for example the CakePHP timeAgoInWords() or the PHP strftime() functions . I found a good tutorial on getting it set up in your environment here. Luckily I develop on Linux so i was able to find the LC_TIME files and import them in my application. Another tip i found out was also running the i18n shell task on your CAKE_CORE folder. It will create a POT file for your views, and your helpers as well which will give you access to some of the hard coded strings like month and day of the week values.

 

Tags: , ,

The Breakdown – Google Vs Mocality

18 Jan

A video from Mashable explaining the Google flap with Mocality

Follow

Get every new post delivered to your Inbox.

Join 372 other followers