Friday, January 17, 2014

O perl! O my love!

O my perl, will you have some Java with me?
You know, I really like L&F of your CSS.
Don't be hesitant because I'm a C++ guy.
You will C, sharp guys are hard to find.
No Python can come our way.
I know you are well :-JRebel.
O my ruby, on rails we can roam the whole world!

Yours RESTfully


(Inspired by a post - Why is it convenient to have a software partner)

Wednesday, January 01, 2014

Complicated investments!



The interest on education loans or home loans is compounded by banks every year at 9-10%.  But, the returns we get on our investments may not be compounded in the same way in plans like some endowment policies or ULIPs. Here's a word of caution while trying to choose your investment plan. I created this java utility class to calculate the final amount I get in one of my investment plans - 198405, when I invested 24000 every year for 7 years compounded at the rate of 5.5%. To check this fact, just replace the 5.5 with 10. There's a difference of ~23000, which is almost an year's investment!
  
/**
In the interest of public
@Author yoursTruly
*/

public class UlipInterest {

    public double sumInUnitDuration(double principal, double rate){

    return principal * (1 + rate/100);

    }

    public double totalAfterUlipDuration (int duration, double principal, double rate) {
        double tempSum=0.0;
        double tempPrincipal= 0.0;
        double totalSum = 0.0;
            for(int i=0; i
            if(i==0){
            tempPrincipal = 0;
            } else {
            tempPrincipal = sumInUnitDuration(tempSum, rate);
            }
           
            tempSum = principal + tempPrincipal;
            //totalSum += tempSum;
            }
            return tempSum;
    }
   
    public static void main(String args[]){
           UlipInterest uInt = new UlipInterest();
           System.out.println(uInt.totalAfterUlipDuration(7,24000,5.5));
    }

}


Comes handy if you want to check if the interest on your investment is matching your interests!

Saturday, November 23, 2013

Radio One (FM 94.3) - eBay Rockers

One of the scary experiences when you have to go with music and yourself to people. I realized you cannot be anyone else but yourself doesn't matter how big or small you are!

http://www.tommyjams.com/radioone/episode/2013/11/17

The band line up goes:
Javed (Our ustaad and lead guitarist)
Amar (Rhythm/Bass)
Ankit (Rhythm/Bass)
Rajat (Drums)
Ishita (Vocals)
Yours truly (Vocals)

Songs featured in the show:
  1. Somebody to love (Vocals: Ishita, Guitar: Ankit) 
  2. Sweet Child of Mine (Vocals: Ishita, Lead Guitar: Javed, Rhythm: Amar, Bass Guitar: Ankit, Drums: Rajat)
  3. Jo Bhi Main (Vocals: Me, Guitar: Javed)
  4. Zombie (Vocals: Ishita, Lead Guitar: Javed, Rhythm : Ankit, Bass Guitar: Amar, Drums : Rajat)
  5. Kholo Kholo (Vocals: Ishita, Guitar : Javed)
  6. Socha hai (Vocals: Me & Ishita, Lead Guitar: Javed, Rhythm : Amar, Bass Guitar: Ankit, Drums : Rajat)
Those who listen to Radio One (FM 94.3) Bangalore would have heard RJ Rakesh. He comes up with this awesome and extremely naughty 'Ulfat Sultan's School of Speech' (You should say 'speech' here like 'spiiichchu' with a wink and stress on second 'ch' like he does). We found it very difficult to match his energy and enthusiasm in the show.

This is the right place to remember some of the cool members I'm fortunate enough to practice and play along with @ eBay : Aruna Shibane (Vocals), Rajat Nigam (Vocals), Praveen Ramesh (Drums & DJ dude!), Om Prakash (Keyboard), Kalyan (Vocals, Pads, Djembe, Canjo - Plays for the band Anveshanam),  Clement Thomas (Guitar - Bass is his speciality), Vidyalakshmi (Vocals), Vedha Kannan (Vocals), Srini (Vocals), Prabu Madhesan (Vocals), Anirban (Lead Guitar), Prasanth Gaurav (Vocals) & Anugrah (Vocals)

How can I not remember my Helios Band: Shalini Shailesh (Vocals & Acoustic Guitar), Suresh (Acoustic Guitar & Vocals), Guru Babu (Vocals), Pravas Panda (Vocals and Keyboard), GNR (Drums - He's drums for Agam now) and Jyo (you still are my one and only Telugu singing duet partner!)

Friday, November 22, 2013

Accomplished?

The maximum views my blog managed to get per day is 2 ever since I started blogging! So, is it high time re-thinking the idea of blogging in the air? Hmm... Let's just blame it on a crazy soft corner in the brain for blogging and go ahead with the topic.

The feeling of accomplishment is more influential than the accomplishment itself. For example, Case (1) you sweat a 2 hour workout routine all by yourself on a day. Case(2) You do the same sweating and stuff with the instructor standing next to you saying 'wow' and 'good job' and 'just one more'. I would tend to have more and more of case(2). I go to such an extent that I would pay and have that person for the mere fact that I'm seeing something moving, something re-inforcing what I'm trying to do and something that pushes me constantly to move along.

Independence of thought, words and action has been a choice I made for myself sometime ago. To me, that gives a sense of freedom and mental space to act as per my will. You can argue that 'the personal breathing space for brain' just an illusion.

How interesting would it be to have somebody draw a line, encourage you to cross the line and celebrate with you after the journey? It very tempting to say all that is really as interesting as it sounds, but the tiny mental space I have created for myself complains. I try to convince saying "It's probably alright to give out some space for a sweetheart". But, that bloody corner in the brain is so strong that it goes restless. That silly section in the heart doesn't accommodate anyone easily. It looks to me like a huge, dark and deep hole. I can't confidently stand by the statement "It's meant for someone who deserves". I sometimes feel it's not mine to start with... I don't know who controls it. It responds sometimes and stays numb sometimes. Sometimes, even when I want it to react, it simply doesn't! I really hate it for this behaviour.

I have a speculation (warning: this is mostly influenced by movies, books, etc., though) : let it respond, then I'm going to be a better person and there's no turning back. But I don't know when it happens or how or why. I only know what happens when I try to control and direct it to someone or something, I start losing myself.

That silly section seems to have a clear vision of it's own. Sometimes, it analyses, it questions, it rationalizes and it evaluates. Sometimes, it just accepts. My conscience doesn't pretend it doesn't exist! When it is ignored, I clearly see that there's something out of place. It's crazy! One pattern I saw throughout is it's always pulling me back to reality. Is this reality true? Should I add my imagination to this reality? When I compare myself to this little corner, I look small and powerless.    

At 28 years of age, I'm happy to spot the life changing corner in my brain.
I have not accomplished anything!
Will start from ground zero again and again till I do.
Are you trying to tell me I should stop announcing this publicly? 

Sunday, September 08, 2013

Aaja re... ( imagine a lady in white saree with a candle)

What is it that I'm doing different this year?
I've never asked myself that question before. Ha.. that's different this year!

Coming to our topic:
I've always romanticized meeting the devil. When I was a kid, watching a horror movie meant a sleepless night. By the time, I reached my late teens, I got more and more intrigued by this idea. As years passed by this idea started haunting me. How would I imagine a devil to be? When I explain, you should imagine everything in low light. For example, as if this character is in a room with lights switched off. Depending on the necessity, you can place a light right on the face for a brief amount of time and switch off immediately. You can also flicker or change the colour of light ( red and blue is ok. I wouldn't recommend green. Let's stick to standard HTML colour coding scheme; RGB). The light shouldn't be too bright.

Somehow, it's easier for me to imagine women in this role than men. Men don't scare me so much as women. The girl sitting right opposite to me in the BMTC bus wearing goggles and with a coloured scarf around her nose can easily send a couple of chill currents down my spine especially if the scarf is in darker shades. Don't even think about this whole thing in the night! Burqa-clad women simply fit right into that spot. They needn't try much. No moving and no talking. I'll start sweating even if they don't look at me!

Imagine a woman in black lipstick, black bindi, heavy kajal (only lower eyebrow lining) and red eyes. Wuhuhuhu.... there were a couple of waves from my spine to neck right when I'm typing this. Slender ladies are scarier than their stouter counterparts. How does "long hair falling on just one eye and just half of the forehead and a couple of scars on the visible part of the face" sound? Scars needn't be prominent actually. Skin colour ranging from light to dark grey is good!

Haa... the next specimen would be bushy hair. Very important characteristic is that the hair has to be curled and messy. Blond hair scares me more than the black. I don't know why! For this character especially, I don't need darkness. Even in wide daylight, I can easily run away and hide in a conference room. These devils have to be in sleeveless costumes be it sarees or just tops.  They are simply super duper scary!

Cool devils don't have that disgusting angry expression as if they are about to eat you. They are very friendly and offer help most of the times. Just that they do that exactly when you least expect them. They may pop out of bath tub or from window pane or from an abandoned well or from the basement or from grave yard or simply behind the door as soon as you open - depends on your imagination and experience actually - and say "Are you looking for someone?" or "Please tell me where David is?" or "Why did you leave me here?".
The scariest ones are those who ask for your help!  Imagine you are driving alone in the night and someone shows a thumbs up on the way. I would stop the bike or car, turn around and take another road.

Cool devils don't screech. They just have a blank expression and look somewhere beyond the camera usually.

Abstract devils don't show up completely. You hear howls, tingling bells, leaves flying with the breeze, cracking twigs, crickets, flapping wings, clouds with less-than-half moon (absolutely no stars), freely swinging cradle and things like that. But you don't see them! You only have to feel them when the camera moves abruptly or when the background music goes intense. 

Sunday, July 07, 2013

Raanjhanaa and religion ...

It doesn't sound odd at all when movies are out in the media for being censored or banned or attacked by groups. It's an added advantage that the distributors get for the publicity. What took me by surprise is the ridiculousness of the reason for which it is banned in Pakistan!

Why is Raanjhanaa banned? How can a person belonging to a community not marry a person from another community? This is not supported by a government. This is not even a real marriage, it's a movie (let's call it an artistic representation). Are we in the century where governments are democratic, secular and respect individual freedom and rights?

I try to understand religion as a (1) process of self-purification through introspection,  (2) means to attain higher levels of spirituality or (3) simply a belief and submission to a greater power. A religion at a broader level should advocate peace, harmony, equality, inclusion, connection and collaboration. Why does some religious practices ignore and sometimes even oppose practices in the other faith? Is it because the religion itself claims the ultimate wisdom in the scriptures? I would say it is those who try to interpret the scriptures and decide the rules. Christopher Hitchens, a famous author and journalist, in one of the debates on intelligence squared argues that any religion which is monotheistic is aggressive and hence is not tolerant to other religions.

Like John in the movie "Man from the earth" puts it, "Piety is not what lessons bring to people, it's the mistake they bring to the lessons." How does marrying a person from other faith or community tarnish the sanctity of the individual or the community to which they belong? 

Wednesday, July 03, 2013

Equals : Java inheritance abstraction leak


if(youKnowJavaCoding) 
startReading();
else 
break;


There is a java class Point2D.
int x, y;
Point2D defines equals which says if x values and y values are equal for two classes, then they are equal.
This is how it happens in the java world.

public void boolean equals(Object obj) {
if(!(obj instanceof Point2D)) {
return false;
else 
return this.x == obj.getX() && this.y== obj.getY();
}
}

Another class Point3D extends Point2D.
It can live upto the name but decides to do a different way.

public void boolean equals(Object obj) {
if(!(obj instanceof Point3D)) {
return false;
else 
return super.equals(obj) && this.z == obj.get(Z);
}
}
 
This breaks symmetry
Point2D says (1,2) is equal to (1,2,3)
Point3D says "No".

We tell Point3D to be the dragon warrior (or the man of steel) and find his parents.

public void boolean equals(Object obj) {
if(!(obj instanceof Point2D)) {
return false;
else if(!(obj instanceof Point3D)) {
return false;
else 
return super.equals(obj) && this.z == obj.getZ();
}
}

obj.getZ() doesn't work for Point2D.
Point3D still doesn't think (1,2,0) is equal to (1,2)

We cannot rely on simply letting super class handle the comparison, correct? 

Programmer(fuming) : Let the hell break loose, all Point3Ds are Point2Ds. Simply return super.equals(obj) , for all Point3Ds also. Sounds great! 

But, wait!

(1,2) equals (1,2, 1) and (1,2,-1). Aren't we being rude to transitivity here, honey?  

We can have another method in Point3D which says canEqual(Object obj) or few if clauses in the equals method which say if your z is 0, you can compare the Point2D and Point3D. Don't even think about it otherwise!

We have to sometimes come out of the abstraction to see the solution.