Graph of Different Probability Distributions

When modeling real world scenarios , data scientists are often confronted with the need to characterize them using one of the many statistical distributions. With literally hundreds of choices, this can be confusing  for people like me who are not trained as hardcore statisticians. It would be good to have a comparative image of the […]

Categories
Programming

Connecting Midi Device to Browser with the Web MIDI API & Web Audio API

Web MIDI API + Web Audio API = A killer combo ! We live in exciting times. Browsers are equipped with the Web MIDI API specification which lets us manipulate and access MIDI Interface devices to communicate with the browser over hardware MIDI ports or even USB ports for devices that support USB-MIDI. The icing […]

Categories
Programming

Django, Celery, RabbitMQ tutorial

The Big Picture Use cases You primarily use Celery to: 1) exclude time-taking jobs from blocking the request-response cycle, 2) schedule tasks to run at a specific time 3) manage tasks that may need to be retried. Some common use-cases for this: 1) sending emails 2) rebuilding search Indexes on addition/modification/deletion of items from the […]

Categories
Programming

Asyncio : A tutorial for the beginners

The word Asyncio is made of two terms: Async + I/O. “Async” is about concurrency. Concurrency is about doing more than one thing at a time. The I/O term there means that we use Asyncio to handle I/O bound tasks and not CPU bound tasks. “Bound task” means the thing that you are waiting on. […]

Categories
Programming

DIY PCB Etching using Laser Printer: Illustrated

Step 1: Schematic, Simulation & PCB Design Draw your schematics. I highly recommend easyEDA as a schematic designer and PCB creator. EasyEDA is free as long as you keep your schematics public. It has a huge components library. I never had a problem finding my components. You can also design your components if you do […]

Categories
Programming

Django Haystack + Elasticsearch + Autocomplete + Faceting Tutorial

In this tutorial, we will implement a ‘Products’ search similar to what you would find on any e-commerce store. The search results can be refined using multiple facets as shown here. We will also implement search auto complete which will provide real time suggestions as the user types in his search query. Here’s the end […]

Categories
Calculators

Inductance Calculator (Air cored, Single Layer)

This calculator can be used to find the Inductance of a multiturn single layer circular coil. This is based on a compact six-figure approximation formula for the inductance of a cylindrical current sheet from the book: “A Handbook Formula for the Inductance of a Single-Layer Circular Coil” by Richard Lindin. Reference to the book can […]

Categories
Programming

Open Source Android App to Calculate Sunrise Sunset Time

I recently did this app in free time. It lets you calculate sunrise and sunset time at any given location. I have used the library by Mike Reedell to do the astronomical calculations.(corrected one rounding off error in the original library). The app can pick locations from a MAP or from GPS or you can […]

Categories
Programming

Android: Adding Glow Effect to UI elements

Here’s the secret recipe for making your UI Glow like the moon, and the stars, and the sun. The secret to glow lies in the shadows. You heard that right…The bigger the darkness, the easier it is to spot your little light. You can achieve different glow effects playing with the following xml shadow options […]

Categories
Programming

OpenCV: Interlacing Two Images

The code defines two method 1) interlace_two_images(img1, img2) 2) main() – which calls the above method to interlace two images named circle.jpg and polygon.jpg import sys, os import numpy as np import cv2 def interlace_two_images(img1, img2): interlacedimg = np.zeros((img1.shape[0]+img2.shape[0], img1.shape[1],img1.shape[2]), dtype=np.uint8) interlacedimg[0::2,:,:]=img1 interlacedimg[1::2,:,:]=img2 return interlacedimg def main(): imagesdirectory = os.path.join(‘knowpapa’) print “Interlace images circle.jpg and […]