Blog

I didn’t “Hack” Your Site

If you are seeing my website instead of the one you’re supposed to see, this post is for you. I sharing a hosting server with several hundreds of people. That server had a hardware failure, and backups are being restored as I speak.

Why are you seeing my site?

My Domain starts with the letter A. Thus, it was copied to the server from a backup first. Even before the default file, as it starts with D. So, for a brief period, you saw my site. Till that default got copied over.

I didn’t hack you.

Please contact your hosting provider.

Visualizing and Understanding Grassroots Healthcare in Bangladesh

I made use of publicly available data from the Directorate General of Health Services to get a picture about healthcare in all across Bangladesh.

Data Source: http://facilityregistry.dghs.gov.bd

Continue reading Visualizing and Understanding Grassroots Healthcare in Bangladesh

Categorical and Numeric Data in Scikit-Learn Pipelines

I always tend to organize every aspect of my experiments with organizers as useful as Pipeline. However, one shouldn’t be passing continuous variables into a OneHotEncoder or vice versa for Scalers. The solution is, split your data, treat them in separate pipelines before merging them together again. Inspired by Scikit Learn Examples.

Continue reading Categorical and Numeric Data in Scikit-Learn Pipelines

Counting Weekends between Two Dates in PostgreSQL

I found myself the problem of counting the occurrence of specific “days of the week” between two dates; for, of course, generating features for a predictive analysis task. For example, the number of Fridays and Saturdays between 2019-01-01 and 2019-01-15. And thankfully, good old PostgreSQL came to the rescue!

Continue reading Counting Weekends between Two Dates in PostgreSQL

GP launched 013: Update your RegExp!

Grameenphone quietly rolled out its 013 series of numbers and it wrecked everything. No web service, including Google is working with this 013 series of numbers. Its time for developers to fix this mess and update every validation logic you may have for validating mobile numbers or MSISDNs.

I enlisted a few RegExps for de-terrorizing you, even if a bit.

01[35-9]\d{8}

Enough reading, update your RegExps now!

Flask-like “global” request context in Sanic (asyncio)

Although something like Flask’s globally accessible request object is considered a terrible way of writing code (explicit is better than implicit), sometimes it makes sense to use it. For example, while passing a Correlation-ID to track a request’s life cycle through your micro-services.

Continue reading Flask-like “global” request context in Sanic (asyncio)

Viewing OpenCV matrices with matplotlib (w/ Jupyter Notebook)

While working with OpenCV, constantly popping up a new Window to view the results might not be the most effective way of work. However, we can minimize the burden if we are working on Jupyter Notebook; with matplotlib. Essentially we plot the matrices with matplotlib.pyplot.imshow.

Continue reading Viewing OpenCV matrices with matplotlib (w/ Jupyter Notebook)

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. Continue reading Reading Bangladeshi NID and Smart Cards with ZXing