Git Rebasing

 

Problem Description

Suppose you have a local GIT repository where dev-stable-topic is the development branch and time to time the releases are made to the customer from a remote GIT repository which has a branch called release-stable from where the selective changes are merge in a controlled way. The remote repository is hosted in a separate linux server.

Read More »

Marketing Management Assignment – Feasibility Analysis: Launching a branch of a company in a new market/country/economic zone

Task

In your role as a Marketing Consultant, you have been asked by Wiggo*: a fictitious European supermarket (food retailer) chain (similar to Aldi and Lidl) to research and report on the feasibility of them launching in a new international market (this can be a country or economic zone of your choice and/or one you are familiar with).

Read More »

How to publish a topic with mqtt broker running on iot.eclipse.org server

As part of iot application development for IoT I had to play around with the SSL connection establishment  with the remote mqtt servers. The below briefly describes the issue I faced and how did I got over the problem while connecting to a remote mqtt server over SSL.

https://iot.eclipse.org/ is a publicly accessible which runs a MQTT server. As per the tutorial the MQTT server is accessible using the host name io.eclipse.org and the port 1883 in unsecured mode. The server can be securely accessed on the encrypted port 8883.

Read More »

How to install ssh service in Ubuntu Linux (12.04)

Check if sshd service is running in Ubuntu with the below command:


vbhadra@vbhadra-VirtualBox:~$ ps aux | grep ssh
vbhadra 1702 0.0 0.0 4088 204 ? Ss 11:49 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=ubuntu
vbhadra 4358 0.0 0.0 4400 824 pts/3 S+ 14:10 0:00 grep --color=auto ssh
vbhadra@vbhadra-VirtualBox:~$ sudo netstat -natp | grep sshd
vbhadra@vbhadra-VirtualBox:~$ sudo netstat -natp | grep ssh
vbhadra@vbhadra-VirtualBox:~$

The above command and their output shows there is no sshd service running on my Ubuntu Linux.

Read More »

Write a program to convert a decimal number to its binary equivalent using stack.

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string>

using namespace std;

template <typename T>
class Stack {
private:
    int top;
    T datastore[100];
public:
    Stack() : top(-1) {}
    bool is_stack_empty(void) {return (top == -1) ? true : false;}
    bool is_stack_full(void) {return (top >= 100) ? true : false;}
    void push(T elem)
    {
        if (!is_stack_full()) {
            top++;
            datastore[top] = elem;
        }
    }

    T pop()
    {
        if (is_stack_empty()) {
            cout << "Stack is empty" << endl;
        } else {
            int data = datastore[top];
            top--;
            return data;
        }
    }

    T peek(void)
    {
        if (is_stack_empty()) {
            cout << "Stack is empty" << endl;
        } else {
            int data = datastore[top];
            return data;
        }
    }
};

int main()
{
    Stack<int> s;
    int num;

    do {
        cout << "Enter a number ";
        cin >> num;
        cout << "Number entered is " << num << endl;
        while (num)
        {
            int n = num % 2;
            num = num/2;
            s.push(n);
        }

        cout << "The binary equivalent of the number is " << endl;
        while(!s.is_stack_empty()) {
            cout << s.pop();
        }
        cout << endl;
        cout << "Do you want to continue? (y/n) ";
        getchar();
    } while (getchar() == 'y');

    return 0;
}

Write a program to check if a word is a palindrome using stack.

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <string>

using namespace std;

template <typename T>
class Stack {
private:
    int top;
    T datastore[100];
public:
    Stack() : top(-1) {}
    bool is_stack_empty(void) {return (top == -1) ? true : false;}
    bool is_stack_full(void) {return (top >= 100) ? true : false;}
    void push(T elem)
    {
        if (!is_stack_full()) {
            top++;
            datastore[top] = elem;
        }
    }

    T pop()
    {
        if (is_stack_empty()) {
            cout << "Stack is empty" << endl;
        } else {
            int data = datastore[top];
            top--;
            return data;
        }
    }

    T peek(void)
    {
        if (is_stack_empty()) {
            cout << "Stack is empty" << endl;
        } else {
            int data = datastore[top];
            return data;
        }
    }
};

int main()
{
    Stack<char> word;
    string str;
    string pali = "";

    cout << "Enter a word ";
    cin >> str;
    char w;
    for (auto i = 0; i < str.size(); ++i) {
        w = str[i];
        word.push(w);
    }
    while(!word.is_stack_empty()) {
        stringstream ss;
        char c = word.pop();
        ss << c;
        string s = ss.str();
        pali += s;
    }

    if (str == pali)
        cout << "The word is a palindrome " << endl;
    else
        cout << "The word is not a palindrome " << endl;


    return 0;
}

How to run an external program from a python script

This blog will try to demonstrate how a python script can be used to automate the running of an external program with data input file located at a particular location.

Lets say we have the below c++ program which reads from a data file called myData.txt located for this example at user home i.e. ~/. The user home is usually /home/<username> for example /home/vbhadra in my case. Use your linux user name instead while trying it yourself. To find out what is your home directory you can use echo $HOME in linux command prompt. Our objective in this blog is to demonstrate the pythoin script which will run any external program binary with data input. So we will have a less focus on the c++ program.

Read More »

Is #AAP hurting Modi?

It is a myth being spread across by media that #AAP is sweeping the support of the people all across the country to garner more support in future in favour of it for some vested interest or over enthusiasm. But step back and think for a moment, Delhi was the epitome of #AAP movement, it gained its acme of campaign with all those rhetorical promises, by all those theatrics of cutting the electrical wires, burning bill in public. Populism at its best. But even after all these melodrama it couldn’t even stand as the the single largest party which it claimed to be before the election. It reminds me somewhat of the “Singur” moment in West Bengal by Mamta Banerjee. But the difference is that Mamta Banerjee (for good or bad) was able to sweep whole of Bengal, there was no sign of others around, people truly gave their mandate. But here is a party which claims to be the party with a difference (the difference is yet to come out in their practice) has not even managed to be the single largest party in a small/half state like Delhi. And I believe #AAP had a better popular plank for campaign than Mamta Banerjee. So the first impact of #AAP is not even the half of Trinomool Congress.
Now just after the election #AAP has compromised with its basic promise of not aligning with any of the “Chor”/”Bhrasth” (as they say) national parties. But they have already shook hands with Congress. Some would argue on a super technical theorem that this is not an alliance it is a support etc. But think about the support of Mulayam to Congress, that’s exactly the same, supporting from outside and not an alliance. But there is always a quid-pro-quo – Mulayam provides support to a minority govt and in turn centre doesn’t let the CBI go after him and his party leaders, centre turns a blind eye to the riots happening in the state so on and so forth. Now here in Delhi Congress’s immediate target is to defend Modi, cut into anti-congress vote and restrict him to come to power. And once that is accomplished congress can collect a bunch of so called secular parties and form the next govt. And then after what would it demand from #AAP in future that future will tell us, I have no idea. Congress support to a minority govt has been usually maximum 2 years so far. As I strongly believe there is no free lunch this has to be a part of a grand deal, time will tell.
Now coming back to #AAP garnering support across the country. So a new party with some holier than thou agenda’s, with some populist schemes in the list couldn’t even manage to totally woo the already distressed people of a very small state. And after forming the govt the way they have tried to keep their promises so far gives us two points, one they are following the standard populist measures to woo the voters(free water and 50% electricity bill reduction etc) and two that these people are modern day leftists when it comes to economy. I see a lot of people who perhaps voted for them are not happy and have already started raising their voice. So here #AAP in fact loses their voters share rather than extending it. One more point, a percentage of people who voted for AAP in Delhi thinks they want Modi as their next PM in the LS election. So #AAP loses this section of voters too when it comes to LS. The third is interesting. I see a lot of #AAP supporters are pathological Modi haters. A lot of new #AAP supporters would be bad mouthing about Modi all the time, which indicates they are the original Congress supporters and now turning to #AAP as Congress is nowhere in the picture. This section of voters are interesting because rather than cutting into Modi’s vote (which is Congress’s original plan for supporting #AAP) it seems that #AAP is now cutting into Congress’s traditional vote bank. That be the case it is going to help Mr. Modi in coming days than hurting him. It would be difficult for #AAP to translate all their dramatic campaigns in the national platform simply because state to state India is different and they would realise it soon. They would find it extremely difficult follow what they preach as lots of those are just not practical. Unlike Modi #AAP doesn’t have any track records to showcase to the people as their model of governance. The little they have shown has party gone against them already, at least to a section of voter. So however much the media may try to make the king of their choice, at last the the real people’s king would perhaps have the last laugh. Jai Hind!!

Extremely delighted to start off with my new client.

It’s been a new challenge, a new fresh energy was required and I am putting all into my new assignment. It’s been two weeks now and it’s all fine. Looking forward to excel in coming assignments. Feeling all set for taking up fresh new dimension into the whole aspect.

Extremely missing my family. Haven’t cuddled my little baby for around nine months in a row now. Can’t just wait anymore but still couple of months to go, can’t just help it. The recent currency dilemma is playing bad for my family’s visa. Keeping fingers crossed.
Cheers!

My days in London

Started off with a bright job in hand and it’s going great at the moment. Little worried about my family and hope to get them here in another three months. Things are just settling down and hope to get it in no time. Pray God everything goes well.