Monthly Archive for December, 2010

Have I Stopped Believing?

This is something I want to discuss with my grandfather. But he is in Varanasi and I in Bangalore. Of late, my visits to Varanasi have become too few. And he is too old and has difficulty hearing through a mobile. So I will write down here what I want him to know about my conflicts.

I follow no religion and believe in no god. I do not know Pagan properly, but if it is what I think I understand then I would like to call myself a Pagan instead. This is something I need to ask my grandfather. So here I am, a person who does not believe in any divine power. I have had quite a lot of discussions with people who challenge my stance. But I do not budge. I do not want to believe in God and am not going to change my stance.

Not long ago, I was not like this. There was a gradual change in my attitude towards god. At a very young age I would read Ramayan and pray to god. That was a time I was influenced by the society and people around me and let me tell you, being brought up in India, it is not easy to escape the notion of existence of god. I remember visiting a Hanuman temple every Tuesday with my grandfather to listen to priests chant Hanuman Chalisa. I would visit temples of Durga and all with my grandmother.

Then came the adolescence stage when I would question everything in the name of science. I would tell people that even the Church had been questioned. I became agnostic. It was at this time that my grandfather insisted that I read the book Journey to the East by Hermann Hesse. The book made little sense to me and my attitude remained the same.

A few years later and I became an Atheist that I am now. I have my own set of rules and guidelines that I strictly follow. They govern my actions and are what make up my principles shaping up my personality. I am happy and at peace with myself.

Yet sometimes, there are these moments of doubt. They stem from a basic conflict in my guidelines. On one hand I have convinced myself that there is no god to look up to. And on the other hand I have decided to try and have an open mind towards all opinions. Being open minded doesn’t mean I accept them. It only implies that I am tolerant towards the opinions of other people. And it is the latter that has given birth to the doubt.

Let me go back to the book by Hermann Hesse that I have mentioned above. In the book, the author tells us a story of a queer trip he decided to take. It was a group of people wanting to travel east to discover some divine power. Every member had a personal reason for making this trip. Throughout the journey, the group would break up to fulfill their quests. They would always manage to regroup and continue the journey. On one such personal trips, our author and a small group of people had doubts regarding the journey. Simply put, they lost their faith but decided continue the journey none the less. However, much they tried but could not find the group. They assumed that the group had disbanded and deserted the quest. They went back to their home. A few years later, the author was in India and he accidentally came across a member of the group. He happened to be the president of the group. He told the author that the rest of the group, the ones who still had faith, continued the journey and found whatever they had joined the quest to find. It was just the author who had deserted the journey.

Now this story makes more sense to me. It forces me to question whether I have lost that path because I stopped believing. Am I an Atheist only because I wanted to be, instead of it being a logical decision? And this doubt was reinforced by a book by Paulo Coelho – The Witch of Portobello. I now wonder whether I should be more open in my beliefs and be an agnostic once again?

Popularity: 2% [?]

The Gmail Delegate Feature

gmail Pictures, Images and PhotosGmail has this feature using which a person can delegate someone else to read and reply on his behalf. This could be an interesting and useful feature for a lot of people, myself included. I have two email ids, Earlier I had enabled multiple sign-on to be able to open both the gmail accounts in the same browser. But the multiple sign-on is a beta feature.

The delegate feature on the other hand simply lets me delegate the second id to the first one. So logged into the first one, with the click of a button (two actually) I can have the second email id opened up in a new tab. I can view all the mails of both the id’s and reply to the mails as well.

One important thing to note is the sent-by and sent-from addresses. The sent from contains the original email id and the sent-by contains the email id of the delegate.

The setup is pretty simple. One can turn on the delegate feature from Settings -> Accounts and Import -> Grant Access To Your Account.

grantAccess

Once the access has been granted, a drop down option appears besides the email id on the top right corner of the screen. In my case, I have delegated s.anuvrat to take care of my singh.anuvrat mails.

delegateInfo

Now when I click on the singh.anuvrat link in the Delegated Accounts sections, a new tab opens up to show the inbox of singh.anuvrat. I can compose any mail on behalf of singh.anuvrat.

mailReceivedGmail displays that the email is sent from singh.anuvrat but by s.anuvrat. And when you click the reply button, the default to-adress is the singh.anuvrat address.

Popularity: 5% [?]

Project Euler : Compute ( p * a^b + q ) mod c

The problem 97 of Project Euler required one to find the value of:

28433×27830457+1.

Anshumali Srivastava and I spent a lot of time on time, trying to factor the expression into smaller numbers which could make the computation easier. We tried a few things but got stuck every time.

Finally giving up on it, I decided to brute force it using the BigInteger class of Java. Amazingly, it took just a few seconds to get the answer. Looking at the solutions posted in the forum I realized that everyone had done the same and even the Project Euler admin called this one as a freebie. There was one suggestion to improve the solution. You can read about it here:

http://www.osix.net/modules/article/?id=696

The Java implementation for the same would be:

    public static final BigInteger TWO = BigInteger.valueOf(2);

    /**
     * Computes the value of a^b mod c
     *
     * @param a The base
     * @param b The exponent
     * @param c The mod number
     * @return The value of a^b mod c
     */
    public static final BigInteger aPowbModc(BigInteger a, BigInteger b, BigInteger c) {
        long longValue = b.longValue();
        if (longValue < 0) throw new IllegalArgumentException("Exponent should be non negative");
        if (longValue == 0) return BigInteger.ONE;
        if (a.longValue() == 0) return BigInteger.ZERO;

        BigInteger v = NumberUtil.aPowbModc(a, b.divide(NumberUtil.TWO), c).modPow(NumberUtil.TWO, c);

        return longValue % 2 == 1 ? v.multiply(a).mod(c) : v;
    }

The recursive exponentiation function:

    public static BigInteger getVal() {
        BigInteger mod = new BigInteger("10").pow(10);
        BigInteger val = NumberUtil.aPowbModc(new BigInteger("2"), new BigInteger("7830457"), mod)
                .multiply(new BigInteger("28433")).add(BigInteger.ONE);
        return val.mod(mod);
    }

Popularity: 5% [?]

Want A Free Chrome Notebook?

Woke up in the morning and found this mail in my inbox.

Want a Free Chrome Notebook ?

I checked the from-address and it was indeed from Google domain : chrome-notebook-team@google.com.

The mail contains a link to a form which contains questions about how one uses a computer, which applications are preferred, etc. And finally there’s a text box in which you have to justify yourself as an ideal candidate to receive the notebook.

Unfortunately, I am not a resident of USA. I might forward it to someone though.

Popularity: 3% [?]