Tuesday, January 29, 2013

Multiplication is a horrible thing

In one of my interview, the interviewer was saying multiplication is a horrible thing to do. I thought those days have passed, processor architectures have came a long way since then. Since, I don't work in that area, I don't know what actually the complexity of multiplication compared to addition. Finally, the solution I gave to the interviewer had couple of addition but no multiplication. But I was thinking is it really true that multiplication is still a horrible thing to do. Well, I am not sure, I am sure the answer to this question would be very different in different language. I pursued this problem is java. Here is my small piece of code


public class TryMultiplication {
  public static void main(String[] args)
  {
    Random random = new Random();
    int tryCount = 100000000;
    int buffer = 0;
    long startTime = System.currentTimeMillis();
    while(tryCount -- > 0)
      buffer = random.nextInt()+random.nextInt();
         long endTime = System.currentTimeMillis();
    System.out.println("Total time (ms) : " + (endTime - startTime));
     }
}

Apparently, there is no time difference between addition and multiplication. Well, it was never my intention to say these two takes same amount of time but I am sure in most cases (if not all) the difference is insignificant. Why? because there are other things that takes way more time than arithmetic operation, like load and store. In that case worrying about multiplication, from engineering perspective, is not very pragmatic anymore. Of course, I am aware of the fact that this kind of micro bench marking seldom produces reliable results but there is no observable time difference between addition and multiplication.

Here is a discussion about this issue, http://lemire.me/blog/archives/2010/07/19/is-multiplication-slower-than-addition/

Monday, January 28, 2013

OU campus

Weather is nice today. I am sitting in the patio, fifth floor of Devon energy hall. I think OU looks nice on my cell phone.

Saturday, January 26, 2013

Facebook like

This morning I realized I like something on Facebook called Iran before. That's funny, to my best knowledge I have never clicked like button once I reopen my Facebook account. Yes, I saw a video posted by one of my cousin and I tried to see what is that. But for some reason the video was not played and I gave up.

But then this morning I saw somebody liked that I liked that video, really, seriously? Why would I like a something so political in nature. I read on reddit couple of days ago, there was tons of bogus likes going on in Facebook. But I don't know whether any of them is this kind. Even interesting, all of activities are private, meaning no one would be notified based on my action. Why this like thing was notified to my friends. That's very weird. Unless Facebook thinks, if I wanted to see something means I must like; and I would also like to share my idea with everyone else. Or my account has been compromised?

Wednesday, January 23, 2013

Salesman

This is my fifth year in USA. I am still trying hard to cope up with my new life. The latest buzz is about the job. I am on the verge of my graduation, I need to find a job. So I am trying to prepare myself for the job market. Well, I am not sure why I need to know why I need to know how to sell myself, I am not applying for the salesman position. I am applying for engineering position where I would make things not sell things. I need to know how to makes things right so that they are sellable. But sale is last thing I would do, yet I have to fight with my salesman skill to find a job. Is not it funny?

Phone camera

I think getting habituated with my phone camera. It seems like my phone camera is pretty good. I think it is even better than lower end point and shoot camera. Here is campus view from my Window. I am not a big fan of my office but it has most spectacular view of sunset. My only complain is this Blogger app does not allow me to resize the picture for my blog.

Sunday, January 20, 2013

Life of PI

We watched Life of PI yesterday. How was it? In plain English I hated it. But that's not what all I intend to say. I have a long story to tell. We went to the sleep late the day before yesterday, probably around 6:00 AM in the morning and wake up around 10:00 AM. We pretty much start our day with an Indian movie. It was not all that bad, one pregnant lady searches for her missing husband. I would say it was pretty good in Indian standard.

The real story started after that. So Zafar was on the hot seat of selecting movie for us. So, we start with a stand up comedy show and then some real bizzarely short films. After couple of hours of persuasion we managed to convince him for an anime. So somebody selected "Brave" for us. It was an anime but not meant for adults. And it was a little overdose for us.

Life of PI was next on the queue. Zafar built an hype for the movie. We were suppose to watch that movie the night before yesterday. And it was well reviewed by many critics according to Zafar. We all were excited to watch the movie "life of PI." So we decided not to start the movie without anybody. We eight and it was really hard to get them all together. Finally we managed to get all of us around 1:00 AM in the morning, and start the movie "the life of PI." Then all those craps! It was an overkill. At the end we were so f**ked up that we were desperately hoping for its end.

At the end, the day ends with Zafar's inglorious remark "cold outside and movie inside."

Thursday, January 17, 2013

Facebook

I had to activate my Facebook app. Well why? That's an interesting question. Let's start with a story. Shishu uncle came to our house last Saturday I think. He was saying we don't know how to keep old friends! Well that's an innocent claim but it stuck into my head for quite some time. I was thinking it is very true! I have always failed to keep old friends. I have lost many of my school friends already.

Then it came into my head. Things like Facebook are meant to help us to keep our friends. Yes it is true I suck when it comes to the business of keeping friends. And I am not using the resources I could have to deal with the problem. That's inexcusable to me. Facebook is a tool to keep friends, maybe it can solve some of my problem. Maybe I would not suck from now on. Is it a good idea to nourish your drawbacks? I believe not, so I decided to use the tools that would help me to solve the problem.

So far I have intentionally overlooked the question why do I think loosing old friends is a problem? That's a whole different discussion, but my argument would go as follows. In a world full of beautiful people we are meant to stay along with them not away from them.

Wednesday, January 16, 2013

Golden afternoon

When I was looking outside of my office this afternoon I was amazed by the golden color of the setting sun. The view is truly amazing. I thought may be I better keep this moment on my log.

Wednesday, January 9, 2013

Windows Azure

My advisor decided to teach cloud computing in this semester. So I have prepare all the materials for the cloud computing this semester. She is thinking of one or two assignments for cloud computing. So I am trying windows azure. It is interesting. I have to say the documentations have improved a lot. Almost everything works in first try. So far azure looks pretty straight forward. I am amazed that they offer support eclipse and java, not only that they provide simple instructions for eclipse. I have to say the documentation has came a long way. My early impression is so far good. Most importantly azure provide 90 days free trial for every new account. That's good we can ask for one or two assignments in this semester. I think we will ask for few simple cloud applications.

The boring part of exploring new technology is the waiting time while the software are being installed. I guess this is the time for blogging and that's what I am doing. I think my sp1 for visual studio is stuck :( let's see what can I do.

Sunday, January 6, 2013

Rassel's Wedding

I had to go to Florida to attend Rassel's wedding. My best buddy's wedding! Me and Hasib met in Memphis and went to Florida together to attend Rassel's wedding. It was super fun. Here is our newly married couple. Please wish them good luck!