Wednesday, August 27, 2014

Unique unconventional Arty Farty gift options in Bangalore

A list of unique arty-farty  gift options in Bangalore.

Caricature from BLOT STUDIO

Blot Studio is a one stop shop catering to all your creative needs delivered with utmost professionalism. Established in 2002, the studio has catered to various clients - corporates as well as individuals. We rely upon detailed ideation, artistic illustrations and a passionate approach in our efforts to achieve creative brilliance. Furthermore, we seek to build a collaborative relationship with those with whom we work.
At Blot Studio we strive to enhance our vision with every project we undertake. Our studio comprises of artists who are experienced, witty and creative. It shall always be our endeavor to provide quality work within available time frames and budgets.

Charcoal Painting by PENCIL CHAAP

Phone 9902857298

Look at the world with your big eyes, capture the moment and create it into a beautiful art! That's what all is Pencil Chhaap about. Giving a meaning to life with all the hardwork, here I will provide you with glimpse of my artwork and insanity!

Painting made out of Cofee 

from Distractor's Coffee Art

Who said coffee is just for drinking. 
A cuppa joe can make some beautiful splashes. Splashes so good they look like Marylin Monroe or your own face. ;)
coffee - you either love it or you hate it. 

We took the love for coffee to the next level and started using it as a medium to paint with. Paintings (if you can call them that) are available in 8x10, 12x10 and 12x16 (as of now) and are customizable. Unfortunately they come at a price, so ping me and name your price. I usually say 'yes' to whatever you say unless you quote a price that is lower in sea level than Australia.

If you don't love your painting any more just add some milk or water on to it and bingo your coffee is ready to be consumed or not.

A shining piece from OWL

Handmade Eco friendly decorative lighting products.To order any product write to us at .We also customize products based on your requirement.Ph- 9900315432.
Company Overview
Light has long been a metaphor for knowledge,discovery and new creation.

OWL lighting is intricate yet simple using mathematical shapes to create a functional form that has aesthetical appeal while using the material in an intelligent manner that definitely suits contemporary and minimalist spaces. 

The Material that we use is completely recyclable and contains on an average about 50-60% recycled component and we produce each light shade with minimal waste. It is chemically unreactive,biologically inert and food contact safe with no plasticisers
Every product from OWL is hand crafted and made in our Bangalore Studio . 
To Order any Product write to

Madhubani Paininting from Pretty Pallete


Stand there, watch and you will find yourself indulging in the beauty of the art - be it oil, tanjore
madhubani, textured, glass painting etc etc.,

Handcrafted Jewellery by Kakoli Roy


Cookies from Patisserie Nitash

#12 , 2nd cross Hutchins Road,Off Wheeler road Extension, St.Thomas Town.
Bangalore, India 560084
Today 9:00am - 4:30pm
Phone +91 80 41670364 or on +91 98454 27364(mobile)

Comfy Cottons From Indian Yards

Phone 096 63 144494

Indian Yards takes custom orders for below mentioned quilts and bedspreads:

•Photo quilts/Bedspread
Tee Shirt quilts/Bedspread (check photos) 
•Old baby clothes quilts/Bedspread (check photos)
•Memory quilts/Bedspread (Check Photos)
•Patchwork quilts/Bedspread (check photos)
•Patchwork Curtains

Indian Yards is founded by Sunita Suhas, a self taught quilter. Indian Yards reaches out to women from economically weaker section of the society and trains them on the indigenous art of patchwork quilt making. Indian Yards is based in Mysore and intends to have a full fledged training unit so more women can be empowered in the longer run. We make custom quilts, bags, table runners, patchwork curtains, gadget sleeves, cushion covers and all other home decor utility products. We are interested in bulk and overseas orders.

Crafty Card from Growing Crafts

Phone 096 19 462335

Gift your loved ones their precious memories with a touch of love.. A personalised Scrapbook, Photoalbum and cards.. 

Sports Car Designed Cake from GiftmyCake 

Phone 9342837640

What comprise our pricing:

Creativity and passion in making your dear one's Birthday Unique
Imported ingredients from Malaysia
The selective and qualified manpower

Mojaris from Jodhpuris.

Phone 093 42 422245

Rajasthan, the land of Rajas (kings), is world renowned for its art and craft. Within the state, more so Jodhpur enjoys a distinguished reputation for producing elegant and artistic handicrafts.

We bring you products from the heart of Rajasthan, an array of handcrafted objects which reflects its rootedness to this indigenous history and traditions.

Jodhpuri’s houses one of the finest collections of intricately hand crafted artifacts, each product a masterpiece. We shall be privileged to satisfy one and all, both individual clients as well as businesses dealing in handicrafts, in any corner of the world.

Classic Vinyl Records from Avenue Road

Seetha Phone Company.

Setting up development environment on Mac with Python and Virtual Environment.

Install virtual environment.

pip install virtualenv

Create a virtual environment.

virtualenv venv

Activate your virtual environment.

source venv/bin/activate

Deactivate your virtual environment.


Tuesday, August 26, 2014

Java Merge Sort Source Code

I was not able to find a good implementation of merge sort in java as most of the implementations online didn't use comparable and have flags for sorting direction, so I decided to write one of my own.

import java.util.Arrays;

public class MergeSort {

public static void main(String[] args) {
Integer[] a = new Integer[] {3,2,1,4,2,7,1,3,4,5,6,8,9,6,7,8};
public static void sort(Comparable[] list,boolean asc) {
Comparable[] aux = new Comparable[list.length];
mergeSort(list, aux, 0, list.length-1,asc);
private static void mergeSort(Comparable[] list,Comparable[] aux, int start, int end,boolean asc) {
if(end <= start) {
return ;
int mid = (start+end)/2;

private static void merge(Comparable[] list, Comparable[] aux, int start, int mid, int end, boolean asc) {
for (int i = start; i <= end; i++) {
aux[i] = list[i];
int i = start;
int j = mid + 1;
for (int k = start; k <= end; k++) {
if (i > mid)
list[k] = aux[j++];
else if (j > end)
list[k] = aux[i++];
else if (asc ? aux[j].compareTo(aux[i]) < 0 : aux[j]
.compareTo(aux[i]) > -1)
list[k] = aux[j++];
list[k] = aux[i++];


Simulate the roll of a bias or weighted dice.

Recently I can across this problem and find it really interesting, so i thought why not write a code and share it.

There is a probability distribution given for a n sided dice in form an array. Write a code in java to simulate the roll of dice?

I came up with a solution initially which I am not proud of involving caching the outcomes and then based on that rolling the dice. But some googling pointed me finally to this Stackoverflow post:

Which explains the algorithm for the same:

down voteaccepted
In general, if your probabilities are {p1,p2, ...,p6}, construct the following helper list:
{a1, a2, ... a5} = { p1, p1+p2, p1+p2+p3, p1+p2+p3+p4, p1+p2+p3+p4+p5}  
Now get a random number X in [0,1]
        X <= a1  choose 1 as outcome  
   a1 < X <= a2  choose 2 as outcome 
   a2 < X <= a3  choose 3 as outcome  
   a3 < X <= a4  choose 4 as outcome  
   a4 < X <= a5  choose 5 as outcome  
   a5 < X        choose 6 as outcome 
Or, more efficient pseudocode
   if     X > a5 then N=6
   elseif X > a4 then N=5
   elseif X > a3 then N=4
   elseif X > a2 then N=3
   elseif X > a1 then N=2
   else               N=1
This is equivalent to the roulette wheel selection you mention in your question update as shown in this picture:
enter image description here

I decide why don't i write a Java code for the hep of others:

package com.biplav.algorithms;

import java.util.Random;

public class WeightedDiceSimulation {
private static Random r= new Random();

public static int roll(int[] n) {
int[] wieghtedSum = new int[n.length];
wieghtedSum[0] = n[0];
for(int i=1;ilength
;i++) {
wieghtedSum[i] = wieghtedSum[i-1]+n[i];
int p = r.nextInt(100);
for(int i=0;ilength
-1;i++) {
if(p <= wieghtedSum[i]) 
return i+1;
else if(p > wieghtedSum[i] && p<=wieghtedSum[i+1]) {
return i+2;
return n.length;
public static void main(String[] args) {
int[] n = new int[] {20,30,10,0,20,20};
for(int i=0;i<10 i="" p="">

Tuesday, August 19, 2014

Setting up Google Apps to receive emails on multiple domain.

Many times we have multiple domains for our business like, and
And our customers usually make mistakes while tying email as mixing up various domain. So, its important for us to receive all the mails on various domains on the same inbox. This can be achieved in Google Apps environment.

To do this :

  1. Login to the the control panel of google apps
  2. Click on the More Controls at the bottom of your page.
  3. Select Domains.
  4. Click Add a Domain alias.
  5. Enter your new domain.
  6. Verify the domain.
  7. To do this you would have to login with Google Webmaster Tools account and add google app admin as an owner for that domain.
  8. Once the domain is verified add the MX Records.
  9. In Big Rock I DNS Management control panel I was getting a weird error as conflict with the CNAME record. For this I modified my @ CNAME record temporarily adding * in place of @ and then added all the MX records based on following table and then re modified CNAME record replacing * with @.  Set any TTL values to the maximum allowed.
    MX Server address Priority
  10. Now wait for MX records to be verified by google. It can take upto 48 hours. So be patient.
  11. Once, it verified. Tada now you have one more email id for inbox, your old user name @ new domain.

Monday, August 18, 2014

Sun JDK Java 6 to OpenJDK Java 7 recompilation on Ubuntu 12.04 and movement to Jetty 9.x

Recently I took up a task of moving our old project from Sun Java 6 to Open Java 7.
As such our project was using Spring, Hibernate, GWT and many more libraries.

There was a lots of fingers crossed when we took up this task, as we did not know the kind of impact it can lead to varying from refactoring to performance.

Kind of refactoring attempt which it took:

  • To begin with we need to do a change in our DataSource implementation as javax.sql.CommonDataSource has added a new method getParentLogger() . So we had to override that method in our class definition. 
          import java.util.logging.*;

          public Logger getParentLogger() {
                    return null;
  • org.apache.commons StringUtils.join now takes an iterator then list. So we need to pass List.listIterator over there.
  • There were project where maven-war plugin was not specified, that was leading us to problems. A specific pom entry was made to project to point to 2.3.2 version of the plugin.
  • The deb package version should not have any character only numerics and dots are allowed.
  • Jetty 9.x is official release for Java 7. So moving to Jetty 9.x is advised. ChangeLog for Jetty 9.x is available here. The way to start jetty have changed slightly. Java system property for port is not longer supported. Hence, you need to do 
          java -jar start.jar -jetty.port=8080 .

  • Https calls might fail with exception :

          [com.lifesize.mgmt.proxy.manager.tunnelserver.blocking.BlockingTunneledSessionReader] - <>
       Caused by:       CKR_DOMAIN_PARAMS_INVALID

This is a bug with opnjdk. Refer to the following links to fix this:

Will update this thread with performance issues as I discover more.