Last updated: July 25, 2026 This policy covers this website only — the blog at varunpant.com. It does not cover any app. Apps are separate products, distributed through app stores, and each has its own privacy policy that stands entirely on its own. Nothing in this website policy applies to them, and nothing in an app’s policy applies to this website. App pages hosted here carry no…
Last updated: April 12, 2025 Overview # ArtTracer is designed with privacy as a core principle. Your data stays on your device. Data Collection # ArtTracer does not collect, store, or transmit any personal data. There are no analytics, no tracking, no advertising SDKs, and no third-party services. Camera Access # ArtTracer requests camera access solely to display a live viewfinder for the tracing…
Need help with ArtTracer? Find answers below or get in touch. Frequently Asked Questions # How do I trace an image? # Open ArtTracer and tap Photo Library or Files Select the image you want to trace Choose Normal or AR-Assisted tracing mode Position your device above your tracing surface Adjust the image opacity, scale, and position using gestures Trace the image onto your surface What gestures…
Cloud composer orchestration via cloud build # Google cloud composer is a managed apache airflow service that helps create, schedule, monitor and manage workflows.Cloud Composer automation helps you create Airflow environments quickly and use Airflow-native tools, such as the powerful Airflow web interface and command line tools, so you can focus on your workflows and not your infrastructure. In…
Timeseries financial forecasting # Recently, I have been looking into various ways to forecast a time series dataset. This is an old pursuit in the field of statistics and there are many well known ways to achieve this. In this post I will demonstrate a very basic ( Naive ) approach of forecasting a quarterly dataset of sales figure, by using previous 4 years (16 quarters) and…
Here is a quick guide on installing Python3 on a mac Installation # brew update brew upgrade sudo mkdir -p /usr/local/Frameworks sudo chown -R $( whoami ) /usr/local/* brew install python3 brew link python3 brew doctor Aliasing # echo "alias python=/usr/local/bin/python3.7" >> ~/.zshrc or echo "alias python=/usr/local/bin/python3.7" >> ~/.bashrc You could probably have just done this as well alias…
You can now use Alexa to play Apple Music on Amazon Echo speakers. It’s only available for Echo devices and now customers in the UK can also connect their Apple Music account with Alexa. Open the Alexa app then sign into your Amazon account and make sure that your Echo device is connected. Open Menu (top left icon), then select settings. Select Music. Select “Link New Service” Tap the…
Selenium is one of my favourite tools for automation. In this post, I will demonstrate some basic code to download a file from a website in a headless mode, and also provide a docker file to make things simpler. Python Code # Here is some basic code which will make an attempt to download a **7zip exe. ** from pyvirtualdisplay import Display from selenium import webdriver from…
ArtTracer # Camera overlay app for drawing and tracing. Overlay any image onto your live camera feed and trace directly onto paper, canvas, wood, or any surface. Supports AR-assisted tracing for larger surfaces. Available on the App Store | More Info | Support | Privacy RigVeda # Explore the ancient hymns of the Rig Veda on your iPhone or iPad. Browse all 10 Mandals, 1,028 Suktas, and 10,552…
Scrapy is a very popular web scraping/crawling framework, I have been using it for quite some time now. In this post, I will demonstrate creating a very basic web crawler. Install Scrapy # Installation is via pip pip install scrapy Minimalistic Code # A very simple scraper is created like this To Run , simply type scrapy runspider scraper.py Running the above code will output something like below
Summary # Recently I have been looking into ways to test my Apache Beam pipelines at work. Most common use cases of Beam generally involve either batch reading data from GCS and writing to analytical platforms such as Big Query or stream reading data from Pubsub and writing to perhaps Bigtable. A pipeline consists of transforms and its generally easy to test them in isolation as an independent…
GDAL is one of the most frequently used utilities in my toolkit. I am writing this post to make it easier for others to install it from scratch on their macs. Setting up GDAL # The traditional way has always been to visit the dear old kyngchaos.com , and install “GDAL Complete” Framework via deb installer. Do make sure that GDAL Framework is in your path otherwise something like this always helps
This post doesn’t really have anything valuable to contribute, just some cool console trick. Have you ever wanted to plot out a chart, very quickly? Did you ever have an urge to visualise a bunch of numbers without having to use a charting api or copy pasting the data in a spreadsheet? If you did then you might even learn something today :) Here is a simple, yet neat way to plot out a bunch…
Here are a few snippets to make secure http requests using various python libraries. httplib2 # import httplib2 link = "https://example.com h = httplib2 . Http( ".cache" ) r, content = h . request(link, "GET" ) another example # import httplib2 h = httplib2 . Http( ".cache" ) h . add_credentials( 'user' , 'pass' ) r, content = h . request( "https://api.github.com" , "GET" ) print r[ 'status' ]…
I generally am looking for a quick snippet to issue an http request using urllib2 lib. Here is a quick snippet to do so import urllib2 import json from pprint import pprint req = urllib2.Request(url) opener = urllib2.build\_opener() f = opener.open(req) #data varibale recieves the parsed json data = json.loads(f.read()) print len(data) for r in data: pprint(r) print "-"*50 Hope this helps
Brute-force approach # Here I present a few approaches to deduce “minimum insertions” required to convert a string into a palindrome. The basic brute force approach is quite simple, given a string with length L, start comparing, the first character from left and the last character while scanning inwards. Here is a basic test for a palindrome. L = len(s) for i in range(L): if s[i] ! =…
Inverse distance weighting (IDW) is a type of deterministic method for multivariate interpolation with a known scattered set of points. The assigned values to unknown points are calculated with a weighted average of the values available at the known points. This technique, explicitly makes the assumption that things that are close to one another are more alike than those that are farther apart. To…
This post includes go-lang based implementation of some of the classic sorting algorithms. This article primarily, has been written, as an academic exercise, to not forget the basic principles of sorting. Bubble Sort # wiki Bubble sort is perhaps the simplest of all sorting algorithms, the basic principle is to bubble up the largest (or the smallest) and then the second largest and then the third…
Reading and writing binary files can often be fast and very efficient alternatives to csv. They obviously have their challenges, however in this post I intend to present a very basic example of saving models (struct) into binary file and later reading it. package main import ( "log" "os" "encoding/binary" "bytes" "fmt" "math/rand" "time" ) // this type represnts a record with three fields type…
Many useful algorithms are recursive in structure: to solve a given problem, they call themselves recursively one or more times to deal with closely related subproblems. These algorithms typically follow a divide-and-conquer approach: they break the problem into several subproblems that are similar to the original problem but smaller in size, solve the subproblems recursively, and then combine…
Recently, I have been working on algorithms which need elevation data as well as Land Cover data, with world coverage. Google has an excellent elevation API however free usage comes with a limit. While searching, I came across a dataset in geotiff format for landcover as well as a processed version of world elevation . Elevation data comes in various resolutions (250m, 500m, 1km), landcover is…
There are many use cases in GIS world, where the information has to be aggregated, an easy way to achieve this is via gridding or binning, where the area of interest is divided into small sections called grids or bins. These sections are mostly of rectangular form (which can be easily converted into geotiffs), but in some cases even circles or hexagons are also used. You can read a good tutorial…
Projections in GIS are commonly referred to by their “EPSG” codes, these are identifiers managed by the European Petroleum Survey Group. One common identifier is “ EPSG:4326 ”, which describes maps where latitude and longitude are treated as X/Y values. Spherical Mercator has an official designation of EPSG:3857. However, before this was established, a large amount of software used the identifier…
Recently I was trying to build a quick geo lookup service in python, which could be used like an “info tool” in QGIS. This task is trivial in almost all geospatial databases, however I wasn’t able to find much online around querying a shape file. In this post I will demonstrate a simple python code to query a shape file which contains world countries. The file can be downloaded…
One of the most common task for a programmer is either to read or write a csv file Read a csv file # package main import ( "bufio" "encoding/csv" "os" "fmt" "io" ) func main() { // Load a csv file. f, \_ := os.Open("/path/to/my/csv/file.csv") // Create a new reader. r := csv.NewReader(bufio.NewReader(f)) //define seperator r.Comma = ',' for { record, err := r.Read() // Stop at EOF. if err ==…
Most folks have been using Grafana or something similar to monitor Kubernetes cluster. If you are using Google cloud container engine , then the standard unified place to monitor all your application and services is Stackdriver . According to Google’s documentation, when you create a new container cluster using GUI or gcloud, Stackdriver is automatically configured with a sink, however It…
BST data structure supports many dynamic-set operations including Search Minimum Maximum Predecessor Successor Insert Delete These basic operations allow us to treat this data structure both as a dictionary and as a priority queue. Basic operations on a binary tree takes time proportional to the height of the tree, O(lg n) [worst case] and even O(n) if the tree is a linear chain. If you want to…
The (binary) heap data structure is an array object that we can view as a nearly complete binary tree. Each node of the tree corresponds to an element of the array. The tree is completely filled on all levels except possibly the lowest, which is filled from the left up to a point. An array A that represents a heap is an object with two attributes: length, which (as usual) gives the number of…
Insertion sort is an efficient algorithm for sorting a small number of elements. Insertion sort works the way many people sort a hand of playing cards. We start with an empty left hand and the cards face down on the table. We then remove one card at a time from the table and insert it into the correct position in the left hand. To find the correct position for a card, we compare it with each of…
Google App Engine Remote API enables programmers to access Google DataStore remotely from any python script or a Java Program. Remote api essentially is a generic web service, which allows datastore to be accessed from outside the app engine’s environment therefore using this mechanism, users can either bulk insert data or modify existing data from their servers. With the help of remote api,…
Google datastore is pretty awesome when one needs a quick no-sql data storage. However recently I have experienced a problem in exporting my GAE Datastore as csv and in certain cases as a line delimited Json file. Its not very hard to do so and perhaps the easiest way to handle such thing is to write an export handler in your web app, however, there are alternative ways which I have highlighted…
So if you are looking to compile your go project on your server, you would probably need to worry about any third party dependencies. Here is a quick recursive way to do that go get ./… Hope this helps
Bubble sort is a sorting algo that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. It is a popular, but inefficient sorting algo, it has worst-case and average complexity both О ( n 2), where n is the number of items being sorted. Here is an implementation in python count = len(B) for i in xrange(count): for j in…
This is a collection of tools and utilities which I have found indispensable as an engineer. Each has a distinct purpose, and I probably touch each at least a few times a week. These tools save me time and I hope that you will find some of them useful as well. Productivity # s-tui s-tui is a terminal UI for monitoring your computer. s-tui allows you to monitor CPU temperature, frequency, power and…
Introduction # Isochrones are curves of equal travel time from a certain point of origin, another way of saying this would be that an Isochrone is an isoline for travel time, if the weighting factor is changed from time to distance, then the resulting curve is called an Isodistance. In this post I will present a rough way to create an Isochrone and an Isodistance using google’s directions…
HTML5 Geolocation is a feature which allows the browser on a computer or a mobile phone, to acquire the position from the wifi, 2g/3g/4g network or GPS. The HTML Geolocation API is used to get the geographical position of a user. Since this can compromise user privacy, the position is not available unless the user approves it. The simplest way to use it is through navigator.geolocation object ```…
So if you are a JavaScript geek and haven’t yet heard,(if everyone is listening to ECMA announcements, who’s gonna drink beer :) ) ECMA 6 feature set has been drafted, its feature set is frozen, it is mostly being refined now. You can already program in it and compile it to current JavaScript. The JavaScript frameworks AngularJS and Ember.js will be based on it (with ways to opt out).…
def isPailenDrome (s): if len(s) == 1 : return False L = len(s) for i in range(L): if s[i] != s[L - 1 - i]: return False return True def longestPalindrome (s): L = len(s) if len(s) <= 1 : return s if isPailenDrome(s): return s p = {} for u in range(L): for v in range(u + 1 ,L + 1 ): k = s[u:v] # print k,isPailenDrome(k) if isPailenDrome(k): p[len(k)] = k if len(p) > 0 : return p[sorted(p,reverse =…
So I saw this problem in a book today about printing a 2d matrix in spiral order Here are two solutions to it Solution one. # def printSpiralTL (m,x1,y1,x2,y2): for i in range(x1,x2): print m[y1][i] for j in range(y1 + 1 ,y2 + 1 ): print m[j][x2 - 1 ] if x2 - x1 > 0 : printSpiralBL(m, x1, y1 + 1 , x2 - 1 , y2) def printSpiralBL (m,x1,y1,x2,y2): for i in range(x2 - 1 ,x1 - 1 , - 1 ): print m[y2][i]…
Here is a quick code snippet to merge two sorted arrays in python merged = [] l = 0 r = 0 for i in range(len(a) + len(b) ): lval = None rval = None if l < len(a): lval = a[l] if r < len(b): rval = b[r] if (lval < rval and rval and lval) or rval == None: merged.append(lval) l += 1 elif (lval >= rval and rval and lval)or lval == None: merged.append(rval) r += 1 return merged print merge([3,5],[2,4])
Apparently OS X does not have an updatedb command like linux has, so I was stumped on how to update the locate database. I have quickly added this command here, in case I need to use it again. sudo /usr/libexec/locate.updatedb
The Fibonacci numbers are the sequence of numbers defined by the linear recurrence equation  with  and  So in simple…
In this post I will demonstrate using ElasticSearch to spatially query records and filter them by attributes. ElasticSearch is built on top of Lucene which in version 4.0 supports Spatial query features, for those interested here is an example and link to javadocs. You will need to install ElasticSearch , read about installing it here , also install marvel plugin for configuration and testing. For…
I generally have been using loading gifs in my work most of the time to inform the user that the resources are being fetched asynchronously from the server. Ajaxload website is perhaps one of the most used sites to download a suitable gif. In this post I will demonstrate a css3 only way to create a nice loading simulation Basic Code # We will use nested divs to create the loading animation control…
This post is intended to assist folks who are trying to install and work with grunt on mac osx Install Node.js and npm with Homebrew # First, install Homebrew by typing in the following command ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" Then, type in brew update to ensure your Homebrew is up to date. brew update Run brew doctor to make sure your system is all…
This is quick tutorial about installing Tilestache library in OSX Mavericks. Step 1 # Make sure Developer tools are installed xcode-select –install Then add these flags to tell xcode to use python like rest of the world does export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments Finally type in sudo easy_install tilestache That’s it, all done. You might see some warnings, but…
In computer science , a ternary search tree is a type of prefix tree where nodes are arranged as a binary search tree . Like other prefix trees, a ternary search tree can be used as an associative map structure with the ability for incremental string search . However, ternary search trees are more space efficient compared to standard prefix trees, at the cost of speed. Common applications for…
A heat map is a graphical representation of data where the individual values contained in a matrix are represented as colors. This article will attempt to explain the process of creating and using GHEAT-JAVA , which is a port of famous aspen based gheat and took great inspiration from Gheat.net Writing a service which would serve heat map tiles is a bit tricky, there are three major components…