Memories of Masdar: 2011 – 2013

I wrote a memories of Ife piece after completing my bachelors and it would be just as well to write another post about my time at Masdar. Masdar is a great school, has an international student community, extremely nice people, an awesome nearly unbeatable welfare package and a great beautiful environment.

I arrived at MASDAR in the fall of 2011 as a young naïve man with some basic development experience. Something unexpected happened just before I resumed; that event, which left an unpleasant indelible mark, propelled me to give my all and Alhamdulilah I emerged as a better person in the end.

The first few months were somewhat lonely – it was an unfamiliar emotion as I was used to being alone and far away from family all my life. The feelings of loneliness soon vanished when lectures went into full gear. I had thought everything would be super easy however I soon realized I had grossly underestimated the coursework involved as I struggled to understand some of the material and complete projects.

My interest in socio-mobile computing got me involved in the joint SCAIlab-MIT social fitness project. It involved extending a Pedometer app with social networking support, data collection, accuracy tweaking and influence mechanism design. Although the project was not completed, I got to learn more Android programming as well as Git.

I spent my first break solving Project Euler puzzles (a way to simultaneously hone my new Python skills), polishing my résumé and hunting for internships ( I applied to about 10+ software firms).

During my second semester, I got to learn more about Algorithms, distributed systems (hadoop, Skype, networking etc) and social computing. In my spare time, I learnt vim (and I am glad I did) using the excellent byte of vim book. Alhamdulilah, I spent the summer as a SDET intern with the Microsoft TFS Agile team.

In my last year, I finally took the dreaded software engineering ( got to learn about C, valgrind, make etc.) and sustainability courses. I also had to work extremely hard and at an insane pace to make up for the time I lost duing my internship. My first attempt didn’t turn out well so I had to start afresh.

Gains at MASDAR

Sometimes the loneliness and extreme levels of hard work got to me – the emotional drain and stress were just too much at times. I had to force myself to persevere ( giving up was easy but too costly) and I repeatedly prayed to Allaah to bless my sacrifices and efforts. Looking back, I am glad I got to improve on some of my weaknesses.

I improved my time organization, goal setting and progress tracking skills. I learnt to focus ( after getting burnt out a gazillion times) and also realized that I had a limit and couldn’t do everything. It was good to learn that being consistent was much better than alternating between periods of high and low productivity.

It was also at MASDAR that I started making conscious efforts to improving the quality of blog posts. The goals were quite clear: I wanted to create a knowledge repository for myself (something I can always refer to when I am in doubt), improve my writing and inform people. Now, when I write, I ask the ‘so what?’ question :).

My academic training equipped me with lots of computer science / software engineering knowledge. I got to conquer my fear of public speaking, honed my leadership skills and teamwork contribution. Oh, and I picked up the habit of continuously enrolling in online courses. Learning never ends…

I made a couple of true friends: the camaraderie, the teasing, the play, the talks and the sharing actually enabled me to come out of my shell. I met people who were extremely nice, friendly and wonderful. I couldn’t have asked for better companions and I do hope we’ll keep in touch for life.

It wasn’t all fun at MASDAR though – there were a couple of unpleasant experiences as expected. However I am glad because I learnt from such experiences too. In the end, I think I became more mature and discovered the meaning of self-worth.

I have left MASDAR now (I actually felt bad leaving MASDAR because I had become so attached) however I hope the lessons I learnt there would stay with me, that I have friends for life and have become a better person for it.


MOOC Review : Machine Learning

So I completed the Machine learning course on Coursera recently; it’s my umpteenth MOOC Course and I actually do not know how many I have taken or want to take. Despite this,  I have only gotten three certificates so far; all my attempts at integrating Coursera courses into my schedule have not been successful. I have had to settle for auditing courses at my pace: at least I get to fulfill my goal insha Allaah: learning and understanding.

I took a couple of data mining courses during my master’s degree and have some experience with a variety of tools and programming languages (Octave, Weka). As grad students, we had to write our own classifiers and performance evaluators (kNN, Naive Bayes, ROC curves). Using Weka or similar tools/libraries would have saved us much trouble however our lecturer did not agree. I believe his approach was great as we were ‘forced’ to learn and got to really understand what the mathematics was all about.

Back to the Machine learning course, I think Professor Andrew Ng (Stanford) is simply awesome at what he does – everything is explained in really simple terms. He is also the guy behind the awesome autonomous helicopter video, haven’t seen it? Here is the link, go watch it!

It was refreshing to use Octave again, its elegant approach to numerical computation is mind-blowing – it makes it possible to get a lot done in a few lines. It also seems to handle the floating-point issue well (0.1 + 0.2 = 0.3). These features are impressive when compared to other languages; however every language has its strengths, weaknesses and application domains.

Alhamdulilaah I learned a great deal and refreshed my background in a variety of machine learning techniques and applications. It was nice to relearn the concepts of gradient and stochastic descent, clustering, overfitting and underfitting (bias and variance). There were a couple of new topics such as principal component analysis (beautifully explained), logistic regression, anomaly detection, recommender systems and support vector machines.

I struggled with the neural networks section and at times found the programming exercises quite challenging. It was a surprise (albeit a humbling one) to realize that I didn’t know as much as I thought I knew. The suggestions and advice on data mining are invaluable, he gave suggestions on setting up a processing pipeline, ceiling analysis, learning curves, error analysis and regularization and creating artificial data and dealing with massive datasets.

Overall I think it is a great course and Alhamdulilah I am glad to have taken it. The next challenge is to find some way to use these techniques – there is no better way to fully understand than to practice, not so?

Interested? Head over to Coursera and sign up. It is currently not running however you can either view the archives at your own pace or wait for a new run. I have also written on some other MOOCs too: Databases and Social Networks. Do check out this cool infographic too.


The language Series: Python

My Python Story

I had always wanted to learn Python ever since I was an undergraduate but my commitments took all my time. Alhamdulilah, I finally got my chance in my first semester at MASDAR when I had to do the Artificial Intelligence project in Python. It was a pretty challenging one; it involved building a framework that used brute-force in solving problems with humongous search spaces.

It has been a nifty tool for my research work too: starting with stackoverflow to openstreetmap data. Python provides easy-to-use tools for data cleaning, processing and graphing; some of its libraries are a sheer pleasure to use: matplotlib, networkx, scipy, numpy etc. More importantly, I can write my full processing stack in Python without having to resort to other languages or tools. Although, there are speed and memory consumption trade-offs; overall, it’s been a pretty good bargain.

The Good Parts

  • The language has an almost non-existent learning curve; it’s soooooo easy to learn.
  • Comes in handy when you want to write a script or solve a little problem.
  • An awesome community, nice package management and great libraries – examples include scientific libs (matplotlib, numpy, scipy) SQLAlchemy, PyTables, Sage, networkx.
  • Cross-platform and supports full-stack development.
  • Great readability, high expressiveness and a very simple grammar – almost reads like English at times.
  • Allows returning multiple values from a method.
  • Some cool supported operations in Python:
    • Swapping: x, y = y, x
    • Floor division: 5.0//2 = 2.
    • Comparisons: if 3 > x > 1: print x; I don’t know of any other language that has this feature.
    • Iterating through two lists simultaneously using the zip keyword.
    • List comprehensions are super-awesome.

The Bad Parts

  • Speed; Python is slow :(.
  • Memory consumption; you can’t explicitly free memory and it’s not suited for situations requiring extremely small memory footprints.
  • Inadvertent overwriting of default functions or settings. For example, I once did this str = “blah blah blah”; Python raised no objections, it meekly overwrote the str() function.
  • Multi-threading support is not too good.
  • Scoping issues: variables fall out of scope so it’s essential to choose unique names.
  • .3/.1 = 2.99999999999999996. The floating point issue rears its ugly head again.
  • Constants… Python does not support constant declarations out of the box; seems JavaScript got friends.

The Other Parts

  • The indentation can be a pain if your editor gets it all messed up. Use a good editor (vim/Emacs) and make sure your tabs are converted to 4 spaces.
  • IDE support ain’t that great since it’s a dynamic language and there are lots of ways to do the same thing.
  • Weird syntax for the ternary operator : True if condition else False
  • Installing libraries can be a really painful operation if you get it all wrong.
  • Since it’s not a statically typed language, typos aren’t detected until your program goes KABOOM!
  • How do you declare private variables in classes? I still don’t know.
  • Explicit addition of self all the time; I think it is needed to know the current execution scope but still….
  • There is no switch statement in the language; workarounds exist though.

Beginning Python?

Do it! Just jump into the language, learn the pythonic way and slowly you’ll come to see its beauty. It might feel weird if you come from a ‘braceful‘ language (i.e. Java et. al. ) and some concepts might initially perplex you. However, once you get used to the language, I bet you’ll wonder how you managed to get stuff done in other languages.

The sheer expressiveness is amazing at times: you write so little and achieve so much. I think it’s fantastic for data processing, little scripts and heavy lifting ( provided you have enough memory and processing power; some libraries allow you to leverage highly optimized C/FORTRAN code so it’s not totally bad).

Also learn to use the interpreter (you can also try ipython if you’re just starting out) – I use it a lot to speed up my development process and for debugging.


8.5 / 10

One of the easiest languages to learn and use for scripting needs and comes in handy for  rapid prototyping. Extra bonuses include loads of great libraries, support for OOP and functional programming. Sure, it has a few issues but what language is perfect?

Python will probably make you lazy but why do more if you can get the same results with less? :)

Did you enjoy this post? Check out my reviews of C, Java, PHP and JavaScript too.

UPDATE: Thanks to a reader for clarifying my wrong assumption about Python’s ternary operation support.

The student life… of projects, assignments, exams and more work!!!

At last! I finally get to write on my blog. I have been struggling to cope with the never-ending stream of course work, projects and exams. Alhamdulilah I think I have some time for a pretty quick post.

I finally turned in the artificial intelligence project, probably the most challenging projects of the semester. First, it had to be implemented in Python – a language I didn’t know too well. The project involved writing a parser to read PDDL files, creating some representation of the parsed problems, and then plugging the models into the existing infrastructure so that search could be carried out for plans. Well, I started and thought it wasn’t going to be too tough but ultimately spent hours upon hours coding, debugging, testing, validating and as usual, tearing at my hair in frustration at times :D.

At last, I finally got a working model, got more insight into AI and learnt a thing or two more about Python : I particularly love the interactive shell, it was easy to run my buggy programs in interactive mode and then hack them until the bugs ‘submitted’ and vanished! Victory is sweet!! I don’t know any other language that gives me this flexibility. Ahh, there were the usual problems of memory leaks, computation time, generators, memoization and stuff like that; some neat tricks were involved too. Looking back, I can say it was fun and I really enjoyed it. :D

Artificial intelligence is cool; have been learning about search, planning and now Bayesian Networks – you hear talk of constraint satisfaction problems, D-separation, Bayes’ theorem and stuff like that. I also take courses in Multi-Agent Systems and Data mining too and I have bagged some hours using Octave which is a ‘calculator’ according to my colleague.

Aside, I get to work on an Android-Django project whenever I have few minutes to spare – not too often but I play a supporting role to my teammate who is more involved in coding. Insha Allah, I’ll be doing more work after my finals… for now.. aarghh… I have a project in data mining due soon… more information after I turn it in insha Allah.

Lastly, you should check out Stanford online teaching classes… they are pretty great stuff!!!