Tuesday 23 December 2014

THE NEW YEAR BECKONS

I will take a short tech-blog break and ponder (hopefully philosophically) on the year in retrospect and for posterity sake (at the very least) put down in ink (or html, whichever you like) what my targets for the new year would be.

This year has been one of the most eventful years of my life. From participating in the Shell Eco-Marathon in Rotterdam to completing my final exams in the University of Lagos. There has never been a shortage of interesting activities which have occupied my time this year.

However, this post is not about the fine details about my accomplishments but an overview on what I have been able to achieve in 2014.

At the start of the start of the year, I wanted to be a more efficient person, more time conscious, more effective. I also wanted to "live a little" ( I have been accused of being too rigid). In retrospect I have found out that being a more efficient person is more than having TODO lists for every single day. I am still learning, will get there eventually.

I am an African and as such also very religious. This year however I got more spiritual and alot of that was as a result of joining Opus Dei.

I had an awesome year with awesome friends +David Emukpere +Paula Aliu +Abraham Imohiosen   and met new friends +Victor Adegboye, +omijie emmanuel osas

Most importantly however as the final curtain closes on the year, I have been challenged. There is no room to be inept, no room to be ineffective. There is only results. They speak louder than words. This challenge forms the basis on which my target for 2015 is based.

Whatever must be done this year, must be done with perfection. No excuses, none whatsoever. It's a long walk to freedom, but one which I would walk.

Merry Christmas and a happy new year in advance!

Sunday 21 December 2014

Android Quickies

With the amount of free time I "apparently" have on my hands, I have finally been able to dabble more into android programming. This blog will be a collection of some short lines which I have found useful.

Updating an ArrayAdapter for a list view


            ArrayList newData = new ArrayList(Arrays.asList(jsonString));
            myData.clear();
            myData.addAll(newData);
            myArrayAdapter.notifyDataSetChanged();
And that takes care of that!


ACTION BAR IN SETTINGS ACTIVITY

Typically, Settings activity extends a Preference Activity. However, for easy addition of the action bar, activities extend the ActionBar activity. You cannot extend more than one class in Java which means that if you are using the Preference activity method you will have to find a hack to hook up the action bar to your Settings activity. There a few workarounds.

If you are targeting android 3.0 and above (quite frankly, I see very little reason why you would be targeting anything less) then you should use PreferenceFragments and attach it to an activity which extends ActionBar activity. A description is given here in the android Docs.

If you are still bent on supporting other devices,..., well I have not figured that out yet. When I do will let you know. If you have please do post a comment.

Wednesday 17 December 2014

Helpful Linux Terminal Commands

Okay, so I would be compiling a list of helpful linux commands for getting you out of that jam in no time.

REPAIRING A CORRUPT ZIP FILE

You have downloaded a large zip file, with possibly several files in the archive but your Internet connection decides to mess up at the last minute and so a few files at the end have not been downloaded. As a result, there is an end of file (EOF) error and you would have to start all over again.

Well with a simple command you can at least get the files which were completely downloaded with this command:

zip -FF Corrupted.zip --out New.zip
and now you can extract em, good luck!


INSTALLING A .deb FILE FROM COMMAND PROMPT


sudo dpkg -i "file"

CHECKING YOUR FORMATTED DISK SPACE

df -h

RUNNING A COMMAND AS ANOTHER USER (SOURCE)

sudo -H -u otheruser bash -c 'echo "I am $USER, with uid $UID"' 

Sunday 14 December 2014

Setting Up VIM for Python Code Testing

Hello guys,

So I have got a bit more time on my hands which would mean that I can be doing this alot more often.

I will quickly show how to set up auto-complete features for python on the vi editor in Linux (I am running Ubuntu Gnome 14.04).

First things,

Get Vundle (It's a package manager for vim). The link is here. Follow all the instructions on the page, it is quite detailed.

Next up, head over to the github site here and add this to the .vimrc file and then add it to the plug-ins to be installed. And that is all.

Thank you!