A real-world Python example that makes sense

The Problem

Correct me if I’m wrong, but what good are factory bananas that are peeled then wrapped in plastic?

  1. They’re expensive.
  2. They do not serve a purpose (a peel is replaced with another).
  3. Unless that banana is a banana cake, then it’s just a good old banana.

Well, the same goes for most examples on the factory design pattern, which are not useful from a data science perspective where readability and computational expenses of operations are real and can not be extended with object creation unless justified.

Take this for example:

As the example output is text-based, it faces the…

Problem Statement:

Whenever plotting Gaussian Distributions is mentioned, it is usually in regard to the Univariate Normal, and that is basically a 2D Gaussian Distribution method that samples from a range array over the X-axis, then applies the Gaussian function to it, and produces the Y-axis coordinates for the plot.

In the case of a 3D Gaussian Distribution however, the sampling happens over both the X-axis and the Y-axis, and the coordinates are projected over the Z-axis. This case is rarely mentioned in tutorials, although it is very useful in many situations.

Solution Outline:

To sample over two axes: X and Y, you need…


HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP 5 and 7. It achieves superior performance compared to the Zend Engine by utilizing a just-in-time (JIT) compilation approach.

Hack is an open-source dialect of PHP created by Facebook, its most distinct feature is gradual typing (allowing both static and dynamic typing).

The Goal:

While there have been excellent guides around on how to install HHVM, most are for older releases of Ubuntu, and I ran into minor hiccups trying to follow them, therefor my aim is to streamline the process for the 18.04 release of Ubuntu.


Tensorflow is a machine learning framework offered as an opensource project by Google to help the AI community build and realize their models in a variety of programming languages, it offers a cutting edge toolbox implemented in a professional and polished way, it keeps up with the curve and it is witnessing a lot of growth and progress, which makes it ideal for both testing and production. …

Aly Shmahell

A Computer Scientist with a background in Computer Engineering, a tech enthusiast, and an open-source advocate. https://buymeacoff.ee/AlyShmahell

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store