Categories
NLP

FastText vectors with spaCy: A Tutorial

FastText has recently gained popularity among developers and researchers as the word embedding of choice, alongside GloVe, word2vec, StarSpace, RAND-WALK etc. By default, spaCy expects you to provide a word2vec vector. However, you can use your fastText vectors if you want to!

Categories
Hacks

pyenv build depencies on Ubuntu

pyenv can get particularly annoying during building Python. Dependencies are often missing resulting in failed builds. This short blog post is outlining the required dependencies to reduce headaches for future me, and anyone else reading this.

Categories
Tutorials

Viewing OpenCV matrices with matplotlib (w/ Jupyter Notebook)

Using matplotlib alongside OpenCV to render results in Jupyter Notebook. We will be using pyplot.imshow to render images within the browser interface for easier interaction and usage.

Categories
Hacks

Reading Bangladeshi NID and Smart Cards with ZXing

Bangladeshi NID and Smart Cards come printed with a 2D Datamatrix Barcode, known as PDF417. The information on the cards can be extracted without using an OCR solution through the barcode. We’ll be using Google’s ZXing library; learn about the basics of using it.

Categories
Hacks

Probability of Coin Tosses and Pascal’s Triangle

A coin’s faces are marked with 0 and 1. What is the probability of scoring K 1s in N tosses?

Categories
Testing

Beginners’ Guide to Effortless Doctests in Python

Doctests are essentially tests embedded in a docstring. They serve both as example use cases and test cases! A Python expression is provided along with an expected outcome, a test runner collects that and evaluates the expression. This post explains the basics and goes up to using doctests in production.

Categories
Hacks

Simple Python Profiling with IPython

Profiling is imperative to understand your application. However, getting started with profiling might seem to be a steep learning curve; but it doesn’t have to be! IPython has a lot of built-in magic commands, and some of them are helpful to profile your Python code. %timeit and %prun are among the ones I found most useful.

Categories
Hacks

Mitigating High-Traffic with Simple Static Content Generation

Your application probably does not need to execute some code each time it is used. We have been caching for decades; reducing database queries, using key-value stores, OPcode caching and the list runs on. Things become overwhelming. I believe often we can find the best answers in simplicity; complexity should not be introduced where a simple […]

Categories
Uncategorized

Learn you some HTTP for fun and glory

We all use HTTP, develop for HTTP and think that we know HTTP. But, I believe as engineers we should never take things for granted; rather we should dissect everything that comes before us, recursively as many times as possible. So, let’s keep applying this principle for HTTP.

Categories
Uncategorized

Erlang and Elixir: Managing Multiple versions with asdf

Often keeping multiple versions of Erlang or Elixir on the same machine might become necessary; also it helps to have the latest versions on your machine as soon as they are released. An amazing tool asdf is capable of doing just that. It makes things as easy as, asdf install erlang 20.3.2 asdf install elixir […]