Insertion sort in python

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 the cards already in the hand, from right to left.

Read more →

How to use Google Appengine Remote API for Java

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, data from one datastore can be copied to data on another app engine instance as well.

Read more →

Read GAE Admin Backups fromLevelDB format and export GAE Entities using bulkloader

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 you web app, however, there are alternative ways which I have highlighted below. 2. One of the easiest alternative is by using Datastore Admin . This tool will easily let you backup you GAE DataStore Entities to google cloud storage in the same project which can later be downloaded locally, by using cloud console or gsutil like this gsutil cp -R /gs/your_bucket_name/your_path /local_target 4. Then there is Remote API for python and Java, which perhaps was created to modify the datastore directly via code from your local machine 6. Finally there is a python utility called bulkloader.py which is coupled with remote_apii , this utility does require python sdk to be installed and added to your system path.

Read more →

Serving raster layers on Google Cloud Platform

In this blog post, I will write about using Google cloud storage as a Raster Tile Server for static imagery.

In the GIS domain, various techniques are used to add custom raster overlay on top of a base maps, or to even use custom imagery, as a base map itself.

This approach is also useful if you have a large quantity of satellite or aerial imagery, that you need to serve at scale onto a Google map or any other GIS tool.

Read more →