Archive for the ‘Coding’ Category

The below is a sample implementation of a binary search tree for all beginners out there. The code is pretty self-explanatory.

I shall come out with some interesting operations on the binary (search) tree from time to time basis.

package com.revindran.binarytree.utils;

public class BuildBinaryTree {
        static class Treenode{
              Treenode left;
              Treenode right;
              Integer nodeValue;
               public Treenode(Integer aValue){
                      this.nodeValue = aValue;
        public static void addNode(Treenode rootnode, int value) {
               if (value rootnode.nodeValue) {
                      if (rootnode.right != null) {
                            addNode(rootnode.right, value);
                     } else {
                           rootnode. right = new Treenode(value);
                           System. out.println("Inserted " + value + " to the right of "
                                         + rootnode. nodeValue);

        public static void main(String[] args){
              Treenode node1 = new Treenode(5);
               addNode(node1, 6);
               addNode(node1, 1);
               addNode(node1, 7);
               addNode(node1, 4);
               addNode(node1, 3);
               addNode(node1, 0);


Here is a way you can get over the long process of adding the SSH certificates to your system keystore while you are attempting to carry out some activity on the remote host which you trust.

>> curl –insecure [remaining part of your command here]

Important to note:
However, it needs to be understood here that the host you pick to ignore the certificates from, should be a source that you trust. If it’s not a host that you do know very well, I advice you to verify the certificate manually and then add it to the keystore.

The above method should be helpful to people normally when they are dealing with the hosts present in their office/home intranet.

Demo to code and save a Python file, and execute the Python Program, all via Ubuntu Terminal or Shell prompt.

Video Outline:
– Create a sample directory structure
– Write the Python program by making use of “vim” editor
– Execute the Python program

Drop in your comments/suggestions below and I should try incorporating them in my upcoming videos and Please DO NOT FORGET TO SUBSCRIBE to my Channel “HashBoard“. 🙂

Outline of the video:

  • Extracting the downloaded tar file to an appropriate directory of your system
  • Building the extracted files
  • “Hello World” program

Additional Tips not covered in the Video:

Running Python 3:

  • Launch the Terminal
  • Key in “python3” without quotes at the Terminal prompt. This should ideally launch Python 3.2.3

Note: The video instructs you to key in “python” at the Terminal prompt. This launches Python 2.7.3.

This is my first narrative video. So please be gentle with your comments. 🙂

Thank you for watching the video. I appreciate your time.

I thought I had to post this because of the way people tend to confuse with terminologies used in context with Selenium.

Courtesy to this post: “A Digression about Jargon” section @

  • Selenium Core is the heart of the original Selenium implementation, and is a set of JavaScript scripts that control the browser. This is sometimes referred to as “Selenium” and sometimes as “Core”.

  • Selenium RC was the name given to the language bindings for Selenium Core, and is commonly, and confusingly, referred to as just “Selenium” or “RC”. It has now been replaced by Selenium WebDriver, where RC’s API is referred to as the “Selenium 1.x API”.

  • Selenium WebDriver fits in the same niche as RC did, and has subsumed the original 1.x bindings. It refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just “WebDriver” or sometimes as Selenium 2. Doubtless, this will be contracted to “Selenium” over time.

Back again after a long pause. I was in process of installation of Netbeans 7.1.2 yesterday (about half an hour back before this post :). Its 12:07 in the midnight when I’m keying in this post).

Every time I tried to run the Netbeans installer, I came across the warning message stating that the JDK was not detected. I exit the installation wizard, made a couple of restarts after running the apt-get updates in the terminal. However, the installer fails to detect the JDK installed in the system.

Note: The JDK installed in in Ubuntu 12.04 by default is OpenJDK.

Then finally concluded that will go ahead installing the tried/tested/trusted Oracle-java JDK. There begins the problems. Initially downloaded an rpm package from the Oracle-java site. Extracted the files and copied/pasted them into usr/lib/jvm folder. The NetBeans installer still seemed to be reluctant in detecting the JDK. (Not sure if I was right with this approach).

Then tried converting it to .deb package using alien and still the package failed to dpkg. :(. After being done with all the those manual extractions, I was soon on a look out for an installer package or a method to install it from the terminal with auto-download.

It was then that I came across a couple of sites suggesting to add the repositories and then install the package which too began failing.

Then came this QA site which turned out to be a saver.

It initially asks us to clean up the junk and begin with a fresh installation and this was successful after hours of R&D.

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Hope this helps anybody with Ubuntu 12.04 to get over with the issue with installation of Oracle Java 7 and in turn set up IDE's such as NetBeans. I was able to proceed with the installation of NetBeans successfully thereafter.