Mohanad Kaleia

Idea for a cause

OOP in Python

During my Master as a Computer Engineer, I worked with Python for data analysis, machine learning and deep learning projects. Python becomes more and more popular especially for writing AI and machine learning algorithms. But that is not the only thing that makes it great programming language, Python is just as C++ and Java supports Object Oriented Programming OOP. Which makes it suitable not just for research purposes but also for large scale applications.

In this article I will discuss OOP concepts in Python. As well as, we will highlight the differences in OOP between C++ and Python as a comparison between the two.

Python is designed from the beginning to support Object Oriented Programming concepts, providing the ability to build  large scale applications. If you don’t know or you kind of don’t remember the concepts of OOP we will review them here briefly in this article. OOP concepts are divided into 5 aspects as follow:
  • Class: represents a prototype for an object. This prototype describe object’s attributes and behavior
  • Object: an instance of its defined class (prototype). An object can hold values for attributes and execute functions defined by its prototype. 
  • Abstraction: with abstraction a class can hide some of its details and expose only specific information to the outside 
  • Inheritance: one of most important aspects in OOP is inheritance for code reusability. 
  • Polymorphisim: means the ability to have same function with different behavior.
We will go through these concepts one by one with an example for each of them. 

Read More

Interpreted Languages VS Compiled Languages

Have you ever wondered what is the difference between interpreted languages and compiled languages. You may already used some interpreted (scripting) languages like Python and some other compiled languages like C++. In this post I will explain briefly what is the difference between scripting and compiled languages.

The main difference between scripting and compiled languages is the former are interpreted where they do not require compilation step while the other do. For example a scripting language (e.g., Python) you can write a code and execute it write away without the need to compile it first and then execute it. The interpreter is execute the code line by line, that’s why interpreted languages considered slower than compiled languages. While a compiler convert the source code into a middle phase named as Byte-code. The byte-code is an executable version of the code that can be executed by an interpreter.

Examples of interpreted languages are PHP, JavaScript and Pyhon. While,  C++ for example is considered as a compiled languages.

There are many advantages of interpreted programming languages, some of them:

  • Interpreted languages saves the compilation time, that’s why they are good for proof of concept application and for scientific applications
  • Interpreted languages are platform independent, unlike in the compiled languages where we have to produce a compiled version for every platform and operating system. This is very useful in web, for example JavaScript application can be run on different browser under different operating system. Just imagine if JavaScript is compiled language then for any webpage we have to test what is the platform and send an appropriate compiled version of the code to the client!
  • Smaller executable package size comparing with a compiled source code

Now we need to speak about the advantages of compiled languages:

  • Compiled languages are considered to be faster in the execution than interpreted languages. Because of that many large and critical projects are written in C++. (e.g., Linux operating system, many web browsers, IDEs, games, …, etc)
  • Secured. the compiled version of a code is not clear and cannot be read this makes application written in compiled languages (e.g., C++) are hard for reverse engineering.

There are many other advantages and disadvantages of both, but I want to limit this post to highlight only the major differences between interpreted and compiled programming languages.




My Resume :)

Alhamdulillah, I recently graduated from the University of Oklahoma with a master degree in Electrical and Computer Engineering.

My journey in searching for a job just started!.

I prepared my resume in a way to show my academic and practical experiences and skills in one page,

In addition, I designed my online resume with a portfolio that some of projects I worked to better show off my skills.

To check out my web resume can be visited from 

Leave your feedback in a comment and let me know what you think!



Different Countries, Different Personalities


Travelling abroad has so many advantages, one of them is seeing different cultures, different traditions and manners. Some manners considered to be good in countries are considered bad in some other countries. For example giving a tip in Japan for a server in a restaurant is kind of rude, while in US is totally the opposite. Another example, is clearing your plate. In China when dining, you should leave some part of the food on your plate. Speaking about food, in Europe if you did not finish your plate it is not popular to the left over in a box, people consider is impolite. Read More


A research considered to be good ONLY if the industry accepted it.. otherwise it is just ink on paper

— Mohanad Kaleia

Pin Plotter – pin some markers on maps

Hi :)

Google maps is one of the most famous API for developer to work with maps. I worked on several projects in the intelligent transportation systems domain, analysis traffic data. Dealing with Google maps was one of essential things. Sometimes, I had to quickly plot points on the maps that reflect specific segments on highways, for that reason I developed a very simple tool to plot markers on the map based on Latitude and Longitude data. I like to make it open source and available so anyone can work on it on fly.

Oops, forgot to say, the tool is implemented based on HTML, CSS and JavaScript. You really don’t need to install anything, find it on my website:

or find the open code on github:


Caffe Tutorial: build, train and predict

Caffe is one of the most popular tools for deep learning, with it you can easily build, train and use deep neural networks and it is considered as the fastest framework as the time of writing this post. The reason why I’m writing this post is because I could not find one article that can answer all of my questions, I had to go back and forth between caffe’s official website, and other blogs in order to get the full picture of how to use Caffe. In this post I’m gonna cover the following points, of how to create a neural network, how can I train it and then use the trained model to predict new samples, I will cover the different approach and highlights the differences between them. Also, I’m gonna cover how to get and use a pre-trained model from Model Zoo. 
In this post, we will implement LeNet on MNIST dataset, where the LeNet is known for its ability to classify handwritten digits. So let’s get started!
I will suppose that you already have Caffe installed on your device or you have an access to remote machine with Caffe installed on it. If you did not install it you can refer to another post that I wrote on how to install Caffe on a CPU only machine

Read More

Install Caffe on Ubuntu with no GPU

If you are reading this post then for sure you know what is Caffe and most probably you want to install it on your machine so I don’t want to speak about what is Caffe and how to use it, this post is just to explain how to install it without having a hard time hopefully. Okay, the installation of Caffe was not straight forward to me, I ran into several problems, first my system was not clean, I had a lot of broken packages that drove me crazy, until I decided eventually to install Caffe on a clean Ubuntu system in a virtual machine without GPU not the best option but for testing and get hands dirty it is okay. I need to mention that my operating system is Ubuntu 16.04. Read More


When you got a statistical data and you need to describe your data in a mathematical function, you need then to fit a distribution with your data. In general four steps in fitting distributions:

  1. Choose a function that you think fits the more with your data
  2. Estimate parameters
  3. Evaluate the quality of the fit
  4. Do statistical test

This article, in general, is not aimed to give information how to fit a distribution with a specific language, although you can do that very easily using R, or Python. Read More