Fate/destiny vs our effort:
The below is a context from Shanthi Parvam of Mahabhartam. Yudhishtira asks Bheeshma, why to put efforts when everything is by fate/destiny? Then Beeshma answers this question by saying that a similar question was once asked by Parushurama to Dhattatreya. Here is how the conversation went:

Parushurama: Oh Lord!! It is said that, whatever is happening is part of our fate/destiny. Then, why should we put our effort in doing something at all?

Dhattatreya: Dear Parushurama, everything happens as per the destiny, but putting all the efforts into something can even change the destiny.

Parushurama: Oh lord! If so, which is greater & better to follow?

Dhattatreya: If two Rams(goats with horns, Pottelu in telugu) are fighting, which one will win?

Parushurama: The one which is stronger

Dhattatreya: Parushurama!! that is the answer to your question. If your destiny is stronger it will win, but if your efforts are much stronger, you can win over your destiny.

Enabling USB/Smart card reader on Virtualbox

Recently I got a new laptop at my work space, which has a smart card reader. I use virtualbox, and I needed the smartcard reader to work with my VM. But unfortunately I couldn't make it to work. I searched all around the web with the keywords like "Enabling smart card reader on virtualbox" and similar, but none of the posts solved my issue. The virtual box says the "device is busy". Then today after a week of searching, I found the solution by chopping of smartcard in my search keyword, and replacing with usb. So here is what solved my issue.

  1. 1. Shutdown Virtualbox Machine. 

  2. 2. If your usb device/smart card reader is external then you can just unplug it and skip this step. If your device is inbuilt then, In the device manager of host machine(the machine in which the virtualbox is installed), go to the "Smart card readers" section, right click on your usb/smartcard reader and disable it. In my case the card was "Alcor Micro USB".     

  1. 3. Now go to your virtual machine settings. Click on "USB" from the left and click on little "+"(plus) icon on the right, and add the device, the name of the device may be different from the one in the screenshot. Most of the times the name has the words "EMV", "Generic". Select it, and click "OK".

  1. 4. Now start your virtual machine. Once the "OS" is loaded and you have logged in, go the device manager of the host machine and enable the device(which you have disabled in step 2). 

  2. 5. After the above step your virtual machine would most probably recognizes the card reader/usb device. 

  3. 6. If for some reason the device failed to install on the virtual machine, I think you know what to do (Just download and install the driver for your usb/card reader).
If the above steps doesn't work, I am sorry as I cannot help further. I am no expert in Virtualbox, the above are the steps I followed, which worked for me. 

Virtualbox Forum: https://forums.virtualbox.org/viewtopic.php?t=737

How Indian Customs are related to Science

Today one of my cousins "Hari Vardhan" suggested me to share a very informative post here. The message is about the relation between the Indian customs and science.

వేప (Neem)

People are advised to worship Neem and Banyan tree in the morning. Inhaling the air near these trees, is good for health.

యోగ (Yoga)

If you are trying to look ways for stress management, there can’t be anything other than Hindu Yoga aasan Pranayama (inhaling and exhaling air slowly using one of the nostrils).

మూలస్ధాపన (Moolasthapana: Center of the Temple)

Hindu temples are built scientifically. The place where an idol is placed in the temple is called ‘Moolasthanam’. This ‘Moolasthanam’ is where earth’s magnetic waves are found to be maximum, thus benefitting the worshipper.

తులసి పూజ (Basil worship)

Every Hindu household has a Tulsi plant. Tulsi or Basil leaves when consumed, keeps our immune system strong to help prevent the H1N1 disease.

మంత్ర పఠనం (Reading Mantras)

The rhythm of Vedic mantras, an ancient Hindu practice, when pronounced and heard are believed to cure so many disorders of the body like blood pressure.

భస్మధారణ (Using sacred ash)

Hindus keep the holy ash in their forehead after taking a bath, this removes excess water from your head.

కుంకుమ (Kumkum)

Women keep kumkum bindi on their forehead that protects from being hypnotised.

చేతితో భోజనం (Eating with Hand)

Eating with hands might be looked down upon in the west but it connects the body, mind and soul, when it comes to food.

అరిటాకు భోజనం (Eating in Banana leaf)

Hindu customs requires one to eat on a leaf plate. This is the most eco-friendly way as it does not require any chemical soap to clean it and it can be discarded without harming the environment.banana; palash leaves

చెవి కుట్టడం (Ear piercing)

Piercing of baby’s ears is actually part of acupuncture treatment. The point where the ear is pierced helps in curing Asthma.

పసుపు నీరు చల్లడం (Spreading turmeric water)

Sprinkling turmeric mixed water around the house before prayers and after. Its known that turmeric has antioxidant, antibacterial and anti-inflammatory qualities.

గోవు పేడ (Significance of Cow dung)

The old practice of pasting cow dung on walls and outside their house prevents various diseases/viruses as this cow dung is anti-biotic and rich in minerals.

గోమూత్రం (Significance of Cow Urine) 

Hindus consider drinking cow urine to cure various illnesses. Apparently, it does balance bile, mucous and airs and a remover of heart diseases and effect of poison.

గుంజీళ్ళు (Squats) 

The age-old punishment of doing sit-ups while holding the ears actually makes the mind sharper and is helpful for those with Autism, Asperger’s Syndrome, learning difficulties and behavioural problems.

దీపం (Using oil lamps)

Lighting ‘diyas’ or oil or ghee lamps in temples and house fills the surroundings with positivity and recharges your senses.

యజ్ఞోపవీతం (The thread worn by Bramhins) 

 Janeu, or the string on a Brahmin’s body, is also a part of Acupressure ‘Janeu' and keeps the wearer safe from several diseases.

మామిడి తోరణం (Tying Mango leaves to the door frames)

Decorating the main door with ‘Toran’- a string of mangoes leaves;neem leaves;ashoka leaves actually purifies the atmosphere.

పాదాభివందనం (Touching the feet of elders with forehead)

Touching your elder’s feet keeps your backbone in good shape.

చితి (Burning the dead)

Cremation or burning the dead, is one of the cleanest form of disposing off the dead body.

ఓం (Significance of OM)

 Chanting the mantra ‘Om’ leads to significant reduction in heart rate which leads to a deep form of relaxation with increased alertness.

హనుమాన్ చాలీసా (Hanuman Chalisa)

Hanuman Chalisa, according to NASA, has the exact calculation of the distance between Sun and the Earth.

శంఖ నాదం (Significance of Shankh )

The ‘Shankh Dhwani’ creates the sound waves by which many harmful germs, insects are destroyed. The mosquito breeding is also affected by Shankh blowing and decreases the spread of malaria.

Simple jQuery KPI's in SharePoint

In a recent Meetup, I came across a question "What is the simplest way of creating a KPI in SharePoint with out of the box capabilities". So in this post, I will walk you through a simple KPI with SharePoint calculated columns, and jQuery. For this I have created a SharePoint list named KPI Demo, below is how it looks.

Step - 1: Let's create a column named "Project State" which is a calculated field.

  1. For this, click on "edit", located on the top of the list(you can see in the figure above).
  2. Click on the little plus sign beside the column name "Client Rating" as shown below, and select "More Column Types":
  3. In the following screen name the column as "Project Status" and the field type as a "Calculated Column". Now paste the following formula in the calculated column formula field

Here is how the calculation is done:
  1. If a project's performance rating + client rating is greater than 7, set the value to "Good"
  2. If a project's performance rating + client rating is less than or equals 7 and greater than and equals 5, set the value to "Needs Help".
  3. If a project's performance rating + client rating is less than 5, set the value to "At Risk".

Step - 2: Append our KPI Indicators to the Project Status column.

For this we will be using jQuery. Please refer to this post, for creating a scripts and styles library. If you think it is too much for you to take from the post in the link above, follow these simple steps:
  1. Create a document library and name it as "Scripts"
  2. Right click on this point, click on "Save link As", and save it with name "jQuery.js".
  3. Now upload the "jQuery.js" file you have saved in the previous step to your document library named "Scripts".
  4. Now the Scripts library should look like the image below
  5. Now click on the "Open Menu" icon and copy the link to jQuery as shown below.
Now save this link to a sticky note or notepad.

Step - 3: The big part

Now let's open a note editor, I personally prefer notepad++ and copy the code below to the text editor, and save as "Kpi.js"

  1. In the above script, we have looked for the column index of the column "Project Status" from our SharePoint list.
  2. Then we loop through the table that has the column named "Project Status". 
  3. Once we find the table in the page, we iterate through each row of the table and find the column values at the column index. 
  4. In the switch case we check if the value is either "Good" or "Need Help" or "At Risk" and based on this we append the kpi image. Don't worry of changing the KPI image url, most of the SharePoint environments have an image at that address. 

Once the JavaScript file is saved, our scripts-document library should look something like the below image.

Step - 4: Creating the Page

  1. Now, before we go further, lets copy the path of our "KPI.js" file from our Scripts folder, similar to our Step - 2.
  2. Now create a new webpart page in SharePoint. To do that, click on the site settings icon at the top and click on "Site Contents".

  1. Then click on "Site Pages", to open the library. From the top breadcrumb, click the arrow below new, and click on "webpart page" and name the page and select a layout. For this demo, I have selected the default layout.

  1. Once the page is created, it will be opened in edit mode as shown below.

  1. Now click on the top most "Add a Web Part" section. From the top menu click on category "Media and Content". From the right pane select "Content Editor" and click "Add".

  2. Now, click on the little arrow on the right of the content editor and click "edit webpart".

  3. An options pane opens on the right hand side. Paste the link to our "KPI.js" file in the first textbox and click save.
  4. Now in the middle webpart section, click on "Add a Web Part" button. From the Categories pane, select "Apps". And from the right pane select our list "KPI Demo", and click "Add". 
  5. Now click on "Stop Editing" on the top left corner.
  6. If everything goes well, our list now looks as in the image below.

Step - Optional: Change the look

In case if you wish to have the KPI's in a separate column. Create a single line field named "KPI column", and replace the script with the below.

After replacing the script with the above, the list would look something like the below image.

Setting up Arduino to work with Mega ADK & Simple LED Blink code

To setup the environment for Arduino Mega ADK it is quite simple.

  • Download & install the latest Arduino software installation from here. I have installed Arduino V1.6.5 here is the link to the installer.
  • Download & unzip USB_Host zip file from here. And here is the link to the direct zip file.
  • Once the above zip file is extracted, rename the folder(in my case the folder was "USB_Host_Shield_2.0-master" ) to "USB_Host_Shield_20" without the quotes.
  • Now copy "USB_Host_Shield_20" folder to Arduino Libraries folder. In my case the folder is located at "C:\Program Files (x86)\Arduino\libraries". After this step the libraries folder should look something similar to the below screenshot

Now open the Arduino program. Click on File -> Examples -> USB Host Shield Library 2.0 -> adk -> ArduinoBlinkLED.

Now the blink LED code is available, compile the code and see if everything goes well. That's it, the LED blink from Arduino side is ready. Below is the code with some modifications.

I connected a LED to the Arduino board as in the link here. And changed the "#define LED 9" to "#define LED 13".

From the above code, note that the part where it says "ADK adk(&Usb, "Srichakram",.........." should match the code in the "accessory_filter.xml" from android app. i.e., The Manufacturer, Model and Version from the code above should match the manufacture, model, version in the "accessory_filter.xml" in the android application.

Next comes the tricky part, either you may get the app to run with android from here, or follow up with my next blog post(below link) to write your own application using Android Studio.

Next Steps: 

Setting up Android Studio to work with Mega ADK & Simple LED Blink code
Continue with Arduino Mega ADK and Android Application communication through the end


Arduino Mega ADK and Android Application communication

After 4 weeks of browsing, trials and errors, I finally found a solution for the Arduino Mega ADK and Android simple LED Blink. So, I thought I can help you in saving some time for similar situation.

In this blog post I will walk you through the communication process of Arduino Meag ADK (which I bought from Microcenter for $17) and an android phone - LG Volt (which I bought from BestBuy for around $40). There two critical parts for this tutorial. Dont worry it was easy compared to all my research for 4 weeks. If you follow each and every step in this tutorial you will have a working prototype in an hour or less. Lets start.

Part 1: Setting up Arduino Mega ADK & Coding
Part 2: Setting up Android Studio to work with Google API & Coding

Once the above two steps are complete, make sure you have developer options turned on and connect your android to the MegaADK. You should receive a prompt asking for permissions, if not, tap the push button on the Arduino board, that should get you prompt. If everything goes well, you will have the light blinking with your touch on the Android app that is developed.


Setting up Android Studio to work with Mega ADK & Simple LED Blink code

In this blog post, I will walk you through the process of setting up Android Studio to work with the Arduino Mega ADK. So lets jump into it.

Step 1: Setup Android Studio and run a hello world app.

  Here is how you do that.

Step 2: Modify the Manifest file

Once you were able to run a simple hello world app, make the following changes to it.
In the Android Studio on the "Android" pane on the left, navigate to  app -> manifests -> AndroidManifest.xml and double click to open. Now on the top of

<uses-library android:name="com.android.future.usb.accessory"></uses-library>

Now inside the add the following: 

    <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />

<meta-data    android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"    android:resource="@xml/accessory_filter" />

Now the overall AndroidManifest should look something similar to:

Step 3: Create an accessory filter

Each time an android application connects with a USB accessory, the android application tries to identify the accessory with combination of values. These values are stored in the android "accessory_filter.xml" on the android side.

From the left hand pane navigate to app -> res. Right click on the "res" folder -> New and click on "Android resource directory"

On the following screen type the "Directory name" as xml and the "Resource type" as xml and click ok.

Don't worry if you don't see the xml folder. Now right click on "res" folder -> New and click on "Android Resource File".

On the following screen type the "File name" as "accessory_filter" without quotes and select the "Resource type" as xml and click ok

Type the following in the xml file and save.

xml version="1.0" encoding="utf-8"?><resources>
    <usb-accessory manufacturer="Srichakram" model="ArduinoADK" version="1.0" />

Note: The values in the "accessory_filter.xml" file should match the Arduino ADK initialization values. For example, for my xml code above, my Arduino sketch ADK initialization code would look something like below. Observe the yellow highlighted lines:

ADK adk(&Usb, "Srichakram", // Manufacturer Name
        "ArduinoADK", // Model Name
        "Simple Led blink sketch for the USB Host Shield", // Description (user-visible string)        "1.0", // Version
        "http://www.tkjelectronics.dk/uploads/ArduinoBlinkLED.apk", // URL (web page to visit if no installed apps support the accessory)
        "123456789"); // Serial Number (optional)

Step 4: Configure Android Studio to work with Google API 

Follow this post to configure Android Studio to compile using Google API's

Step 5: The coding part

As my intention of writing this blog post is to help people struggling to make the Arduino Mega ADK to work, I am not going to explain the coding part in deep. I used the code Developed by Kristian Lauszus and made some minor changes to work with all the android versions. I will explain the part where the changes are to be made inorder to eliminate most of the common errors.

Navigate to the app's MainActivity.java (The name may vary if you have given a different one). In my case it is located at app -> java -> adk.srichakram.in.adk_googleapi -> MainActivity.

In the main Activity replace everything after "package ........." with the below code

Change the class name to your main activity. For example, if you have named your main activity as "SomeActivity" change "public class MainActivity extends Activity {" to "public class SomeActivity extends Activity {"

From the code from most of the internet sources, here is something that has to be changed to work with most of the android devices.

Old Code Changes according to new ADK
import com.android.future.usb.UsbAccessory;
import com.android.future.usb.UsbManager;
import android.hardware.usb.UsbAccessory;
import android.hardware.usb.UsbManager;
UsbAccessory accessory = UsbManager.getAccessory(intent);  UsbAccessory accessory = (UsbAccessory)               intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
mUsbManager = UsbManager.getInstance(this); mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);

Step 6: Modify the Main Activity layout file

Navigate to your MainActivity layout file and double click to open it. In my case it is located at app -> res -> layout -> activity_main.xml

By default this file has a ....., remove it and replace with the code below to make it look something like

Step 7: Add the Strings

One last step is to add the strings. Navigate to app -> res -> values -> strings.xml and replace everything in it with

xml version="1.0" encoding="utf-8"?><resources>
    <string name="ToggleButton">ToggleButton</string>
    <string name="app_name">ArduinoBlinkLED</string>

That is it. Now you should have no errors in the android application. Compile the code and install the application to your phone.

Next Steps: 

Setting up Arduino to work with Mega ADK & Simple LED Blink code
Continue with Arduino Mega ADK and Android Application communication through the end


  • Thanks to USB_Shield source code by Kristian Lauszus

  • Accessory Development Kit 2012 Guide