My Mac Crashed

That is something I have never have to say in my 10 years or so of using a mac. I used my first macbook for about 4 years before giving it away to a friend (who still uses it), and my current Macbook is also 4 years old….before it crashed for the first and hopefully the last time.

 
My friend came back from Kenya on Sunday night, and because he bought so many things, he forgot one of his bags in the Taxi….the said bag contains his Laptop. Try as we may, we couldn’t find the Taxi driver. Luckily for him, it was a new laptop, all his important work are done directly on dropbox and he still has his old laptop (unformatted).
 
On Monday morning, I opened my Mac, and instead of being greater by the login screen, I was greeted by a black screen. I reckoned the battery must have run out, so I pushed the power button, I saw the white screen, waited a while but no login screen…2 mins turn to 5 mins which turn to 10 mins. I was beginning to worry.
 
A week earlier, I had travelled to Addis Ababa, leaving my backup disk at home in Lagos, so you can understand my panic. I had backed up before leaving Lagos, but my Addis trip will not be over until another 2 weeks. I booted up again, holding the option key and I was greeted by the recovery screen. At least all is not lost.
 
I immediately opened terminal to see that all my files are in place, yes they are. Only problem is my mac is 250GB, I don’t have a 250GB HDD (The one I have is 100GB) nor the time to back up the mac and re-install even if I got a 250GB USD Drive. So I did the most sane thing I could think of, launched Disk utility from the recovery screen and did a repair a couple of times. I rebooted my Mac, but all I still see is the white screen….I waited another 10 mins, but I wasn’t greeted with the login screen.
 
I decided to re-install the Mac at that point, I thought to myself if I have done any worthwhile work in the past one week….just a bunch of documents (which are in dropbox), a bunch of notes (which are in evernote) and some code (which are in github). I decided to format the Mac and do a re-install from the recovery screen. Easier said than done.
 
First, The re-install download is 5GB, There’s no where in Addis I could download that….Even at the fasted internet connection I could find, it will still take about 11 hours. I tried and tried and tried several offices of my friends, but the fastest internet will take about 8 hours to complete. I finally decided to leave it overnight in a friend’s office, only to come back the next day and found out that the internet connection had gone off sometimes in the middle of the night, I have to restart installation. 
 
By now it is Wednesday and I have not been able to do any constructive work for 2 days. I deceived I am going to give it one more try and if it fails. I’ll pickup the Mac and wait till I get back to Nigeria. By Thursday evening, I had packed up my Mac. I could have downloaded the Mac Install from torrent, but torrent (and a lot of other things) have been blocked in ALL the places I tried.
 
The two weeks without my Mac was like living in the stone age. I did everything on my phone, Skype, Evernote, Documents, Excel sheets etc etc. I have an iPad back home, but I decided not to bring it to Addis, I also have two windows PCs that I rarely used…back in Lagos. This time I was wishing I had brought at least one of the iPad or the windows PC. So many things suffered, I couldn’t update my website as regularly as I used to, I have to stay plugged in to a PC or power outlet all day, because my phone battery doesn’t last more than a few hours, I have to sacrifice twitter (which is my major source of news and updates), etc etc.
 
…………….…………….…………….…………….…………….
 
Back in Lagos, I downloaded the Installer from torrent, created an 8GB Partition in my 100GB HDD I usually carry around and make it bootable into OSX. It took me about 3 hours to torrent, make the bootable disk and get my Mac back up (Maybe one day I will have enough time to post a tutorial how I did it….google is your friend though). I am typing this from my Mac.
 
LESSONS LEARNT WHEN TRAVELLING
 
  1. When travelling, NEVER rely on a single Computer, always pack a spare.
  2. If you are using a Mac, carry an 8GB flash disk containing bootable OS X with you.
  3. ALWAYS have some sort of Backup locally…As for me, I have a 2TB disk that I use for TimeMachine backup. It was easy to get back on track, after re-installing, there’s a point in the configuration that asks you if you want to restore from a TimeMachine backup.
  4. Use Evernote, iCloud, Dropbox, github etc…use them often…they could save your life one day.

Leave a Comment

NO

I’m not watching my language, if you’re a kid get lost
it’s time to bear it all
say something you might get attacked for
but without something to die for, what are you living for
every day we crawl on all fours
begging to get what’s for us all
we live in a metaphor
we’ve got thieves leading whores
idiots calling the shots
we celebrate flops
we’ve got no words in us
we all a bunch of cowards
there’s no place for martyrdom
only a tiny room with a metal door

how many more will die
or be afraid to fly
our youths idling by
cos jobs are a mirage
and thousands can’t even get by
the whores get bribes
the thieves take more than they can carry
the idiots fight and die
for a loaf of bread or a plate of gravy
the innocent? cops cop
the hospitals? no drugs
education? nothing to be taught

There’s no change, except in the thieves pockets
whores sell the future of their children
putting flops at the helm
Illiterate children become idiots causing mayhem
is there a way out? maybe death

No. That’s what we must say. No
We’ve had enough, now we know
what are we? a child, yet 50 years old
We’ve been a fool for too long, it’s time to grow
So we say No.
No, thieves can no longer be allowed to steal
No, we are not going to whore our future for a piece of meal
No, we are going to fight, but you have to lead the team

Leave a Comment

From Zero To Profit – The NaLyrics Story.

Let me start by saying that I am programmer. What I am about to share with you is lessons learnt by running a business for one year. A programmer can also run a business if he put half as much energy into running the business that he put into coding.

NaLyrics is a platform for distributing and promoting songs via lyrics. It is run by myself and two other people (Not programmers). We have built a mobile app, website and wap site (mobile web). We have some unique idea on how to distribute and promote songs and we believe it will work. Our major concern is if one of our bigger competitors get a whiff of our idea, we are basically dead in the waters. So how did we manage to operate under the radar and yet go from zero to start making profit?

Let me also say that we didn’t have funding from anywhere (well, more like we didn’t want funding). First the reason why we didn’t want funding is because we are afraid the sudden fame that comes with funding might actually be the death of us. If we display our trump card too soon, they (competitors) have the money and resources to just swallow us up.

We also didn’t make any money in the first 9 months. So how did we survive? We had an initial funding of about 300, 000 naira. What we did was maximize the use of that money. For example we didn’t spend money advertising. We also found a way to run the business without borrowing. The lessons I am about to share might not work exactly for your startup, but what I learnt is if you spend time thinking about it properly, you will find a way.

We needed to advertise, without advertisement this project won’t get anywhere, like someone said, having a product without advertising is like winking in the dark. You know what you are doing but no one else does. The problem with advertisement is that it costs money and it puts you kind of in the spotlight. If we start advertising, competitors will notice us and we might be gone the next day. So what did we do? Our major market are the blackberry users, Blackberry smartphones are still the most used in Nigeria, so it makes sense to target the blackberry users. I personally scouted the web until I found two facebook groups where Nigerians post their BBM pins. The idea is to invite the people via their pins and tell them about the app. A major challenge is blackberry BBM doesn’t allow for bulk invitation. I quickly wrote a blackberry app that can do bulk invitation.

Another decision we made that paid off was, we didn’t send BBM broadcasts, because some people find it annoying. So after adding someone new to BBM, we chat with them one on one, telling them about our platform and how they can get use it. The one on one chat paid off. We have made a beautiful app and so even those that don’t like music, after downloading the app recommends it to their friends. This way we are doing advertising without being noticed by the big shots who can swallow us up.

We faced some challenges when we started. The main one is where do we get lyrics of Nigerian songs. There are a couple of websites that post lyrics of Nigerian songs, but about 80% of those lyrics are from less-known artists. Our aim is to post the lyrics of the big shots, and our major challenge is, will they give us the lyrics? Of course the answer is NO! I can remember I was able to setup a meeting with just two known artists during the early days, Vector and Mode 9. I met Mode 9 at an event and I quickly used the opportunity to tell me about my cool new app. Of course he was happy to lend any help he could. At the time he has licensed his lyrics to some other site. But after some cajoling, the site allowed us to use the lyrics on our platform as ling as we give them credit. The lessons I learnt here is, if you wait until all the conditions are right (for us, we need the artists to send us their lyrics), you might never get anything done. We need to find a way around this.

First we made the app a wiki, meaning you can register and post lyrics on the app. But after a lot of spamming, we disabled the wiki feature. We got someone who can listen to songs and write the lyrics. After posting the lyrics, we have an automated system that tweets and post the lyrics on facebook, 4 times a day for 7 days. In the posts and tweets, we copy the artist and other people related to the song, like the producer, record label etc. This gave us credibility with the artist because in a way we are helping to promote their songs via lyrics. After a while we can now count a couple artists who sent us the lyrics of their songs.

We also made some mistakes. One of them I believe now is starting with a mobile app only. We should have launched both the mobile app and the mobile web the same time. We are making some money from adverts on the app, but it is not comparable to the money we are making from the mobile web site. The mobile web site now generates about 90% of all our income and it is growing on a daily basis. If we had started with the mobile web, we would have broken even a long time ago. The lesson here is, Nigerians seldom click ads in mobile apps, but they will gladly click same ads on a web or wap site. The second mistake is we launched with blackberry app. It makes sense at the time. Our major market is Nigeria, and most Nigerians don’t use anything except blackberries and j2me devices. We had over 300K downloads from RIM appstore and another 100K from getjar.com (for J2ME devices) and almost zero income from ads. Those two platforms (Blackberry and J2ME) are the most difficult to monetize.

We also learnt that analytics is good. We found out that we are getting loads of downloads from Cameroon. We couldn’t spend the needed money to translate the app. Remember we are making almost zero income. So I got a Cameroonian friend who assisted us in translating the app to French. We now have the app in two languages. Also we have to launch the Android app (It makes sense, android is becoming very popular).

To make sure we don’t run into debt, we decided to spend the 300K initial funding we had very wisely.

1. We can not get salaries
2. We can not afford to spend more that 20, 000 naira per month (this will keep us running for about 15 months).
3. We refused all forms of grants and investment opportunities less that a certain amount of money. (Sorry I won’t disclose). Because the amount we are asking for is huge, no one invested. I think it did us good, because if we have gotten the grant or small investments, maybe we would have ended up like Tiketmobile (No offence please). Although we didn’t have the opportunity to turn down 25K, but I am sure we would not have turned it down. The reason is that if an investor think there’s a market in what we are doing, we better accept his offer, especially if it is 25K and loads of experience, else he will just take his money, influence and experience elsewhere.

About a month after we launched the mobile site, we started getting some trickles from advertisements and we added two more people to our lyrics writers. Today, about a year after, we have 5 people writing lyrics of Nigerian songs, 1 person writing Gospel lyrics, 3 people writing lyrics of Ghanian songs, 2 managers (one per country) and we are in the advanced stage of starting South African Lyrics.

So in conclusion, our most important decision is to have a wap site for those who couldn’t use the app for any reason. The wap site adverts picked up faster than the mobile apps and today, we have expanded to 2 other african countries, the third one in progress, funded exclusively from the money made from the ads on the wap site.

I believe Nigeria is a big market and soon, apps will start to do well, but for startups, my advice is to build a web/wap site. If you think you have a chance of winning 25K in google app challenge, then please do build a app (case study? AfriNolly), else focus your energy on the web/wap. Then build an app. Also build an app for Android and iOS, they are the easiest to monetize in terms of Ads. Studies have also shown that iOS users tend to even pay for stuff (in app purchases) more than Android users and finally, Blackberry might be dying a slow death in the west, it is still very popular around here, build an app for Blackberry, you might not be able to monetize it, but it will give you the necessary stats you need to pitch if you need to.

Links.

Website – http://nalyrics.com.ng
Mobile – http://nalyrics.com.ng (auto detect mobile sites)
Apps
Blackberry – http://appworld.blackberry.com/webstore/content/113630
Android – http://play.google.com/store/apps/details?id=com.trinisoftinc.nlw

Comments (1)

My First Taste Of Success

I have written a lot of code. I have worked for several companies and written loads of code for them, but most times I am not even permitted to disclose what I was working on. I have a few projects that has seen some few interests, in sourceforge and on github, personal open source projects, but not at a scale I would really call successful.

I have also written a few web apps (faffies.com, unotifier.com, statusforsale, gridtext, jaara, webatter). Of all these I still support only the first two, the remaining I have either discontinued or have not put any work into them for over a year.

I have also written a few mobile apps, blackberry and j2me (expensetracker, faffies, king solomon’s mines, RimSMS etc). None of those ever see light of day, in terms of downloads. The only one I still support is expensetracker and I have not added any new feature in over a year.

For android, I have written a few also (ICE, JungleEscape, ChatRevolver). I never get to finish JungleEscape. But both ICE and ChatRevolver are still kind of active. Even at that, both combined did not even crossed the 100 downloads mark.

But my luck is about to turn. I have an app that has 35, 000 downloads in 4 months. Yes you read that right. And unlike faffies and the others, I have not paid a dime in advertisement!! How I did it??

First, my experience has shown me that Nigeria has a very high Blackberry user base, so I should put more effort in making the blackberry app if I am going to sell in the Nigerian market. So I made an app with local contents and put it on the blackberry app store. The first few weeks was boring, trickle of downloads per day, even zero on some days.

Next, I created a twitter account for the app. So that I can tweet @ the people I post their contents and hopefully I will get a retweet. Some of them have hundreds of thousands of followers.

Getting contents is hard, so I have foot soldiers. I pay them a token to help get the contents. At first I have 4 of them, but as we have loads and loads of contents, I let three of them go and I have only 1 for now.

Next I tried to forge a partnership with some of the content owners. So that they can retweet me and instead of me getting the contents myself, they can give me the contents themselves, before it gets to the public.

Next, I started attending events where I know my content providers will also be. It afford me time to meet so many of them and show them my app. I know it is something that has not been done before and immediately I show some of them, they were endeared to it.

By this time, we are 1 month since release and I have about 1K downloads already, that number is huge for me, and I celebrated it big. I even rewarded some of the people that downloaded with free airtime (I get some airtime for free every month in my workplace).

One day, I stumbled upon two facebook groups where people share their blackberry pins. I decided to get a new blackberry for the app, and use it to invite the people on that group and chat with them one on one, telling them about the app. I also send broadcasts once in a while. This is where things began to get interesting.

At first I sit by my computer and invite the people from that group one after the other. it was slow work and painful as hell. There’s no way to bulk invite people to your blackberry messenger. The only alternative is write a code that can do it. In under an hour, I wrote another BB app, I call it Invitator. It’s simple, give it a comma separated list of bb pins and it will send them an invite using your bb pin.

The next job is sit down and harvest the pins. It was easier than I thought and after a few days I have harvested over 1K pins. I chat with each and every one that accept the invite. It was a painstakingly boring job for a programmer. But I did it anyway. Within a month after I started this exercise, we had another 5K downloads.

All these while, I have not advertised on facebook or yahoo or google like I would have normally done. A lot of people even advised I do it, but I was head strong. I wanted to see what I can do without adverts. Because of the increase in downloads, reviews and comments and RFEs starting pouring in. I tried my best to implement some of the features people are requesting and downloads are soaring. I couldn’t do much because I have a day job and only have the nights and weekends to work on the app. People starting telling their friends about the new cool app.

And here we are, four months down the line, I have 35K downloads, and for the first time, I feel what having a successful app is like. It’s a feeling of joy, that people find pleasure in your work, and actually use it. On a daily basis now, we have over 5K calls to the server from within the app and about 500 downloads per day on a bad day.

I know you have been dying to know what the app is all about. It is called NaijaLyricsWiki. It is an app that provides a wiki like functionality for lyrics of Nigerian songs. You can also download the song you are viewing the lyrics, you can share lyrics on facebook or send to a friend. And finally you can get latest entertainment news and gists from the app. If you have a blackberry, you can download from the app store. If you use an android device, you can download from getjar.com. Either blackberry or Android, you can download directly from http://bit.ly/nlwmobile. The website is http://naijalyricswiki.org

Comments (6)

Simple Sorting Algorithms Implementations – Part 1

In the below, I will be presenting java source code of popular sorting algorithms. The problem with so many books I have read is that they don’t provide the simplest of solutions. I always consider myself an Hello World programmer. If I pick a new language, the first thing I look for is hello world, if I pick a concept, the first thing I look for is the simplest implementation, not the most optimized solution. NO. So when I look for implementations of algorithms, even if you are going to present me the most optimized algorithm, let me see the simplest, non-optimized implementation first.

When someone asked me why am I using for example, java.util.logging instead of log4j, I tell them, so far java.util.logging is working and I am yet to see a case I can not easily handle with it. So it is with these algorithms, let the reader/student see the simple solution and then present him with the problems with the simple solution, and then the optimized, more difficult to implement solution. If he likes, he can go with the simple implementation, when he finally discovered the problems with the simple implementation himself, it will be easier to understand the complex ones.

The programs below are very simple. Non of them have been optimized, they are meant to introduce to you these algorithms. You can take the code and optimize all you want. I also take care to use only simple data structures, no Lists, or Sets or any class in the collections package.

The below code are just segments of the full code. The important segments. The full source code is publicly hosted on Github

Finally if you want to read-up on these algorithms, please head to wikipedia
BUBBLE SORT

The algorithm below is based on the assumption that after every run through the array, the last element is already sorted.

So
for run1, the nth element is sorted,
for run2, the n-1th element is sorted,
for run3, the n-2th element is sorted, etc

	public void sortList(int n) {
		boolean swapped = true;
		while(swapped) {
			swapped = false;
			for(int i = 1; i < n; i++) {
				if (toSort[i] < toSort[i - 1]) {
					swap(i, i - 1);
					swapped = true;
				}
			}
			printArray();
			n = n -1;
		}
	}

INSERTION

	public void algorithm() {
		for(int i = 1; i < toSort.length; i++) {
			int key = toSort[i];
			int k = i - 1;
			while(k >= 0 && toSort[k] > key) {
				toSort[k + 1] = toSort[k];
				k--;
			}
			toSort[k + 1] = key;
		}
	}

SELECTION

	private void sortList(int startIndex) {
		int minIndex = findMinimum(startIndex);
		if(minIndex != startIndex) {
			//swap
			int temp = toSort[minIndex];
			toSort[minIndex] = toSort[startIndex];
			toSort[startIndex] = temp;
		}
		startIndex++;
		if(startIndex < toSort.length) {
			//recursively call sortList
			sortList(startIndex);
		}
	}

	public int findMinimum(int startIndex) {
		int min = toSort[startIndex];
		int minIndex = startIndex;

		for(int i = (startIndex + 1); i < toSort.length; i++) {
			if(min > toSort[i]) {
				min = toSort[i];
				minIndex = i;
			}
		}
		return minIndex;
	}

In the Part 2 of this post, I will show codes for MergeSort, QuickSort and HeapSort.

Source Code: Github

Comments (1)

Codename One Dynamic Ads Component

Codename One (CN1) really took off with a blast. Although still in beta, but loads of people are already using it for various apps, from banking to a mobile front for this. What is commendable is the ease with with you can build mobile apps that are truly cross platform without having to install tools for each platform.

If you are still wondering what CN1 is, please head to CN1 Website and read up about it for yourself.

I am going to be doing a series of tutorials or useful code snippets for CN1. Today we are looking at the ads component.

To use codename one ads, you need to register and have an account on inner active

Here are the steps to getting your ads on your CN1 app

  1. Create an account on inner active
  2. After login in, click the Add App tab and provide details for your app. The trick is to create different apps for different platforms so that inner active don’t go displaying a download app link on the appstore to blackberry users. You can also profile by age group and/or location.
  3. For every App you added like this, inner active will generate a unique key for you. Key this key.
  4. Now in your code, create an hash table that holds all the keys mapped to the specific platform and populate it. Then write a method as in below to add the ads component to the form.
    public static final Hashtable adKeys = new Hashtable();
    .............
    adKeys.put("rim", "[inner_active_rim_ad_key]);
    adKeys.put("and", "[inner_active_android_ad_key]");
    adKeys.put("me", "[inner_active_others_ad_key]]");
    ......................
    public static void showAds(Form f) {
        Ads ads = new Ads(adKeys.get(Display.getInstance().getPlatformName()).toString());
        if (!f.contains(ads)) {
            f.addComponent(BorderLayout.NORTH, ads);
        }
    }

Now for every page where I want to show the ad, I just call the above method and pass the form instance. Notice however that all my forms are BorderLayout and the North part is reserved for ads.

If you want to however use any type of layout other than border layout, you can use this code to add the ads component to the top of the page

Ads ads = new Ads(Helpers.adKeys.get(Display.getInstance().getPlatformName()).toString());
if (!f.contains(ads)) {
f.addComponent(0, ads);
}

That’s it, you now have Ads. You can visit your inneractive dashboard to see how your App is doing.

Comments (1)

CodenameOne: Another Java Promise Delivered

Back in 2001 when I started reading about this new programming language  called Java, I have only being a programmer for a few months and I see nothing serious about the mantra, “write once, run anywhere“. Don’t blame me, I have just learnt how to make a div jump using javascript and wrote a few arithmetic functions in pascal.

Fast forward to 2003, I have read about C/C++ and I have done more than my fare share of pascal, I never really got the hang of web programming, so I really suck at javascript then, but once again I started reading about Java and this time around something really caught my attention: The book I was reading said “Java can run on anything that has a memory and a microprocessor“. The author said,

soon your fridge will be able to determine when you are low on say milk and automatically make an order using you predefined credit card, soon, you TV will be able to send emails, soon, your credit card will be able to store more information that your account number, and these will be made possible by java.

Now those are pretty big claims to make in 2003, now? not anymore, even though your fridge can’t yet make orders, but the possibility is there and is not really something very difficult to do. But I digress, last week I was installing JRE for a client and Oracle said on the installer that Java runs on 2.5 billion devices! Great numbers right? but no, those numbers meant nothing to me if Java can’t run on iOS. iOS is the biggest mobile operating system out there and powers millions (if not billions) of devices and yet, Java can’t run on them. Those iOS devices are actually in every home right now (maybe not), but the point is Java could run on a gazillion devices, but they meant nothing if it isn’t running where it matters. One can argue that Java powers Android devices, yes, but that doesn’t dispute the fact that iOS devices are actually very important if you are an app developer.

Another place where Java is failing in it’s promises is the write once, run everywhere mantra, no it doesn’t work for mobile devices. There’s no way your can write once and run everywhere in mobile space, you write and write and write and hope and pray it runs on a few devices.

But all that is about to change. Enter Codename One. I don’t even know how to define what Codename One is, all I know is

  1. Now you can write once and run on every mobile platform.
  2. Your Java code can finally be made to run on iOS devices.

You can head to the Codename One Website to learn more about the goodies that it has to offer. I have successfully tested and seen a single code base running on Android (ICS), Blackberry (OS 4.2 and above) and Java ME feature phones (MIDP 2.0 and CLDC 1.0 and above). I didn’t have to make any changes to the codebase, and believe me the UI looks pretty cool.

Development is also easy, all you need is Netbeans. It comes with a GUI builder and a Simulator. One thing you will notice again is that the Simulator is fast. Very fast! Have you tried to develop for Android and Blackberry? Then you will notice that the Codename One Simulator is order of magnitude fast.

If you’ve been following the mobile app development space for a while, you would have heard of LWUIT, Codename One is built on LWUIT but is far more than that, the GUI Builder generates one of the most efficient code I have seen a GUI Builder generate. It throws away most of the fluff GUI Builders add to your code. It also builds your GUI as a state machine, such that you can think of your application as a series of states.

I can go on and on.

Codename One is currently in private beta and I believe beta is not far out (I am not speaking on behalf of the developers, but based on my perceived success of the private beta). I recommend you give it a try, you’ll be amazed.

Below are some sample screen shots from the application I built using Codename One private beta

twitpic.com/8nc5if yfrog.com/kio3ivp yfrog.com/oessyqp yfrog.com/kjm7rgp

And here is a live application

J2ME and RIM: http://www.getjar.com/mwc12

Android: https://market.android.com/details?id=com.israelmobilesummit.mwcevents&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5pc3JhZWxtb2JpbGVzdW1taXQubXdjZXZlbnRzIl0.

iOS: http://itunes.apple.com/us/app/mobile-world-congress-events/id497801040?ls=1&mt=8

Comments (2)

Older Posts »
Follow

Get every new post delivered to your Inbox.

Join 203 other followers