Sunday, April 26, 2009

Saturday, April 18, 2009

We, the "IT" people

Excerpt from a chat session with a uni friend. This must have happened somewhere in July, August 2008.

Me:"The fact that you are not replying to me and am still talking is prove enough of how boooreedd to death I am"

Dhat: "Yeah... they say Software Engineers go crazy after a while"


I have had my share of IT people, and when I joined my job I promised myself I wouldn't join their league. I have this friend, who because of the pressure he has to endure at work, has become very quiet. He spends his entire day at office, and that's more than the usual 9-6 timing. Then at home too, he sits either in front of the tv or spends his time with his beloved laptop. And this is exactly what I didn't wish myself to get into.

And during the first few months, I held true to my promise. After 4 hard years at university, where even when we were at our homes, we had to spend our time working on the computer as we had a lot of assignments, projects and presentations to get done. So naturally, when I joined job and came back home at about 7, and had nothing to do at all, I felt I had a lot of time on my hands, and I spent it sitting with my father, talking endlessly, then I would go to the kitchen and sit on a stool and talk to my mother, both of them now know everyone I know at my office. And then I don't know what happened, but I went back to my old routine, which includes coming back at home, freshing up and then switching on the computer. Sometimes the excuse is;

"I have to submit this presentation proposal tomorrow."
OR
"I have a long overdue assignment I have to work on"


But they are just that.. excuses, mere excuses. And I too have become a part of the league I was trying to evade in the beginning. It hasn't been one year yet and I have broken the promise I made to myself.
In my university days, when I noticed what that friend of mine (the one I wrote about above) was doing to himself and when I thought that his family must miss talking to him, my resolution not to become like him one day strengthened. But now, I have become just like him. And it's not just me, it's the story of every other software engineer I know.

We all wake up in the morning, as late as possible, get ready for work, go to our offices, sit in front of our machines for 9 hours or more, then come back to our homes and then again switch on our machines, and spend the remaining of our day in front of our Home PCs. The only times we aren't sitting in front of our computers is when we are eating, sleeping, or traveling. We don't have much time to talk to our families, or our friends. We don't know what's going on in their lives, and we don't much care either. We get more worried when our computer breaks down, then we care about when one of our friends is feeling low.

The friendships that have remained since I graduated are with the people who have the same routine I have, and this is because we can chat with each other. The rest of my friends.... I don't know where they are, or what they are up to these days.

To prove my point, this is an excerpt from an actual-talking session with one of my class-fellows and now my colleague;

"I go back home, switch on my machine, log in to MSN, and spend my time doing on one thing or the other(all which involves computer). My mom keeps shouting that I don't spend any time at home, even when I am at home. But what to do? I guess she'll get over it"


The truth has been twisted here a bit. But more or less, this is what we are all doing.

And I have realized that this is the reason, why I am exhausted all the time. I have a life, yes I do, but there is no such quality of life to speak of. I never feel relaxed because even during the time I should be relaxing, I do things that get on my nerves and the funny thing is that I don't even realize it.

The problem lies in our daily routine. And the fact that we are not aware of the problem. We are just spending our lives... just spending it, not actually living it.
We all are a part of a marathon, and we don't even know who we are competing against, are we just trying to prove others that we can spend the most time in front of our computers without having an actual conversation with any one, without having any life?????

How long do we think we can go on like this?????

Saturday, April 11, 2009

Penny for my thoughts......

Prologue
A lot has been happening for the past month or so (why do my posts have to start with this?), and I have had time to think a lot about all that's been happening, this isn't because I have nothing better to do, it's because I can't stop thinking about it all. And my friends have to go through the torture of listening to me and then calming me.. So I decided to save them from the trouble and pour all this on my blog (but I would still make them read it, so there's no salvation for them :P)... so this is sort of a page from my personal diary (which by the way I don't have :P). So here goes....

Penny for my thoughts


...maybe if I could just be able to steal myself away from all this, maybe if I could just learn to forget, maybe then I'll stop feeling like this, maybe then I'll feel a little better... maybe if I could just stop dwelling on the past... maybe...
...maybe if we could just stop the blame game, maybe.... maybe this wouldn't happen.....

The wars inside...


A while ago I received a forwarded sms from a friend and I thought I would write a post on it, but wasn't able to because I didn't get time, and when I did get time, I wasn't in my "writing mood".
I have deleted the sms now, but this is what I can remember:

An old man told his son;

"Every day two wolves fight inside us. One wolf is good, joy, happiness.. the other wolf is evil, anger, ego.."


The son asks;

"Which wolf wins?"


And the old man replies;

"The one we feed..."

And if you think about it, this is very true. At the end of the day, what matters is the decisions we made, in fact, the entire day depends upon the decisions we make. We can decide to get angry and not only ruin our mood but also other's, or we could just let it be.


The human aspect

And I wonder sometimes about us human beings.. how we are made.. sometimes in fact, most of the times, we forget all the good a person has done for us, and remember the one bad thing he does, the one mistake he committed.

And sometimes it's because we have had enough, maybe we were forgiving and forgetting things for so long that we can't continue with it anymore. At that time we think that putting an end to it all is a much better option. And sometimes we are right in thinking that.


Forgiving and Forgetting

I read this (also in an sms), and I am not sure whether it's correct or not...

"Learn to forgive people for their mistakes, like you want Allah to forgive you for yours"


But it's so hard to forgive someone, right???
And why should we be the one forgiving others? Why don't they try? Why be the first one to end a petty fight?
And sometimes we even forget what it was all about, how it began, but we still continue living between walls...
And we are so wrong in doing all this. We expect Allah to forgive us for even bigger crimes, and we expect others to forgive us every time we hurt them, but we are not willing to do the same for other people.


And those we love

And then there are times when we vent out our feelings, more specifically our anger, on the people we love. These are our parents, our siblings, our friends, or maybe just someone who's willing to listen. These are the people who had nothing to do with making us angry or depressed. These are the people who have always been there for us, and this is exactly why we take them for granted...


Everything happens for a reason

Now isn't that true? Everything happens for a reason. Isn't that what everyone says, particularly those who at the moment are enjoying the best of everything, their lives couldn't have been any better, and they are the ones to give you advice. What do they know??
But let me tell you, they are right. 100%. Everything does happen for a reason. It's what you do with it that makes all the difference....


And you get what you deserve

And I have finally realized that this is very very true. A while ago, I found myself in a situation where whatever decision I made would leave one of my friends hurt. And one decision would hurt me more than the other. And guess what I did.. I made the decision that would hurt me less, and guess what.. I was wrong, the decision I made did hurt me as well as the other person.

But the thing is, about an year ago, I put one my very nice friends in such a situation. It was for the same event, and the situation couldn't have been more identical. And she, being an intelligent and mature person that she is, made the right decision. And still I was furious with her, and I didn't talk to her at all for (I don't know) a few days, when somewhere in my heart I did know that it wasn't her fault at all, it wasn't her doing, but someone else's, but I still had to show my anger, and I chose this way (silence) to let the anger out of my system. I ignored her, even when she herself came and talked to me, I just passed by, ignoring her. It must have hurt her a lot, I realize now, but at that time I had my own anger to cater to.

And now I understand how wrong I was, when fate put me in the same situation, and when I made the worst decision that I could. I realize now how wrong I was....
But never the less, I don't want time to go back or something, what's done is done..

but...


...maybe if I could just be able to steal myself away from all this, maybe if I could just learn to forget, maybe then I'll stop feeling like this, maybe then I'll feel a little better... maybe if I could just stop dwelling on the past... maybe...
...maybe if we could just stop the blame game, maybe.... maybe this wouldn't happen.....

The Marks Theory

Back in Bachelors we waited for results and dreaded them at the same time. But at least I had a category of good and bad marks. But in Masters the very thick line between what are good marks and what are bad marks has not just gone thin, but it has vanished completely. I don't have any concept in my mind now which defines good marks.
This Tuesday, one of our Professors showed us our Mid-term copies. I sorted through the answer scripts, looking for my roll number, fetched my copy and of course my eyes automatically went to the section where marks are entered.
'Hmm 64 out of 70,, hmm not bad'
(whereas in Bachelors it would have been
'Coollll yaar, I got 64 out of 70, I mean, come on yaar, SEVENTY.. SIXTY-FOUR SEVENTY')
As I walked back to my seat with the copy in my hands, I realized it wasn't 70, it was 90. And still the expression remained the same, 'hmmm, not bad'. Whereas in Bachelors it would have been...
'GOD!!!! 64 out of 90. I have practically FLUNKED my mid term. How would I ever recover in finals? And how many marks would I realistically be able to obtain in Finals, when we would have the entire course, and this time it wasn't even half the course. I would have more to study......'
And the depression phase would have gone for the entire day. And resurface again before the finals.

I don't know if it happens with everyone or not, but it sure is happening with me... Am I normal?? :P Please, don't answer that, I don't even wanna know the answer to that. :P :)

Monday, April 6, 2009

Masterpieces

For some unknown reason, the image I have put on my header doesn't display. Why am I so desperate, that I keep on mentioning it over my blog (you don't know what the people around me are going through these days, they have to listen to me all day long complaining about the header, and the image it refuses to show), is because I got one of my very nice friends to make an image for my header. She visited my blog just for that and then Photoshoped three images for me. As I can't put them on the header, I guess, it's fair enough to dedicate a post on them.. so here are the images people... All created by this talented friend of mine..























Sunday, April 5, 2009

Parametric Singleton Pattern

We were asked to study Parametric Singleton patterns as an assignment. It was a long time ago, and I just thought today that I can write a post on it... just for the sake of having something new on my blog, if not for anything else. :P

You implement Singleton, when you want that only one instance of your class can be created. A single instance is created the first time, and everytime an instance is requested the same instance is returned. You do this by making the constructor private, and creating a function which takes care of creating an instance when the first request is made and then returning that instance on subsequent requests.

Now what happens when you want to maintain single instances pertaining to particular parameters. You could go with creating multiple Singleton classes, but it would be a complete waste of time if the three classes do the exact same thing but differ only in the parameters.

While searching, the best example I found that explained to me the need of having Parametric Singleton was of Logging.

When you create an application, most of the times you need to maintain a log file, which keeps track of all the things the application is doing. Let's say your application connects with a database and plays with the data and manipulates it depending on certain logic. It iterates through each row and makes a decision on what to do with it. Let's say you wanna keep track of all the rows it iterates through and the decision it takes. And you decide to log it all in a file. For this specific purpose Singleton Pattern will do just fine. In fact it would do just great... But what if your application needs to maintain more than one log. Let's say your application connects with an external interface and it needs to maintain a log for that, then there are things that the application does internally and it needs to maintain a log for that too. So now we have two logs, creating two separate singleton classes for each kind of log is not a very good option because if you get down to it, it's simply writing in two different log files, just the path and the name of the file is different, all the rest remains the same. So why have two different classes which do the exact same work, why not have one Singleton class which could this time return two instances pertaining to each file type (external interface and one for internal working).

So:
  • In a parametric singleton pattern a single instance of a class is created for a parameter.
  • It is based on the Singleton design pattern in which a single class is created. Whenever an object of that class is required the same object is returned.
  • Similarly, in parametric singleton pattern a single object is created pertaining to each parameter.
  • The instances are created and put in a hash table, array list etc. (to keep track of the objects created). When ever an object with particular parameters is requested, this table is checked to determine whether an object containing the specified parameters has already been created or not. If it has, the existing instance is returned; otherwise a new object is created and returned. This new object is saved in the table as well.

The advantages of using Parametric Singleton, I suppose, would include all the advantages you get from Singleton pattern.

You can get rid of creating extra instances of a class now, based on parameters. This couldn't be done with using our traditional Singleton and hence we ended up not-using Singleton and creating multiple instances, though not exactly needed.


Do check out the following sites for better insight:

http://www.c-sharpcorner.com/UploadFile/satisharveti/ParametricSingleton02112009062638AM/ParametricSingleton.aspx (this one's has a good code example)

http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/singlepattern11252008002706AM/singlepattern.aspx
(Singleton Pattern)

http://www.jot.fm/issues/issue_2007_03/column2/

Saturday, April 4, 2009

Accident

Neither was this one imported.....

Originally Posted on: 11/21/07

Yesterday could be categorized as a bad day for us - our class. A friend of ours, had a bad accident. All we got to know in the morning was that she had an accident. God knows why I didn't think it was serious. I just can't understand this attitude of mine. An accident is an accident. it's just that yaar.
Anyways, i heard my friends saying that it was a serious accident. but it didn't hit my stupid-self until i saw her. and that was that. I was horrified to see her like that, couldn't even recognize her. :( and then today i got to know the details. a car hit her and she flew and fell a few feet away. the guy who hit her, who by the way is younger than us (is a student of matric) had atleast the decency to take her to the hospital. when her father came back to the site, he only saw her shoes there. isn't this all horrible. difficult to contemplate.

a friend of mine in college met a horrible accident too. a truck hit the bike his brother was riding, she was sitting behind him. you haven't heard the horrible part yet.... her brother died. she was in a critical situation, but she survived....

but if you ever go through such situations, would you ever be able to forget, be the same again....
you might become a better person after that or you might become a worse person, but can you ever be the same again????

Searching

Didn't import this one either..... :( :(

Originally Posted on: 11/21/07

Don't need to make a post for this... but what the hell....
these days we (my group members and i) are trying to make some sense out of codes written by other people. we mostly fail. sometimes we just succeed in understanding what a particular functions is supposed to do without putting much thought in how it does it. :P

I have found a treasure on the internet :D

I am trying to do something about the comments that Blogger failed to import to my new blog.. and I found that I might be missing a post or two as well. I tried to search for this post on this new blog of mine, and I couldn't. Though this post is not a very interesting one, but I still wrote it.. so here I am pasting it here... :) :)

Originally Posted on: 1/25/08

You can find everything on the internet."
"Internet can really help you in a lot of things."

That's all very true.
I knew it to be true for a very long time.
When I learnt a few things by reading the tutorials on the internet.
Like I learnt to work on Macromedia Fireworks by reading tutorials provided by a website called www.entheosweb.com.
When the internet helped me in studying for some of my courses.
When the internet helped me in completing research assignments, presentations and stuff etc.

I knew for a very long time that Internet can help you in a lot of stuff.

But I never loved it like I do now.

For some time now I have gotten this strange urge to collect as many ebooks as I can.
On as many different subjects as I can. (but these different subject must have to do something with the computers).

It wasn't until I found a treasure of ebooks on internet that I fell completely in love with it.
Internet really is a treasure.
And it wasn't when I found the ebooks of infomational material like books on Software Engineering or Data Mining when I started enjoying the internet. It was when I found a reservoir of Stephen King novels that I realized how useful internet can be.
I found books on the net whose titles I have only read on other books but never saw then in any book store or book fairs. Like The Dead Zone.
And if you can get them for free on the internet then why wouldn't you like it haan?

Before I found the ebooks on internet I used to go through the "net storage" of my institute and found books there. But ofcourse they only provided course or reference books. What else would you expect from a university? Novels?


So here are the websites you can find good books on:
www.dbebooks.com
www.esnips.com (this one has novels too).

Aur bhi ghum hain zamanay mein.....

For quite a while now I have been trying to upgrade my blog's theme, adding more widgets (which actually work). I can't find my way around CSS and I am bad at designing, and I mean really bad. Girls are supposed to be good at choosing colors and contrasts sort of things, but guess what, I am different!! :P
So I got this friend of mine, who is a complete cheeti in Photoshop (next thing I am calling her up to tell that she got mentioned in my blog, maybe that would get her to visit it), to design some good images for my header.
And she sent me three brilliant designs, loved all three of them, and picked up the one I thought was the best... NEWS FLASH!!!! Blogger uploads the image all fine, saves it all fine, but when it comes to displaying it on the blog... THERE IS NO IMAGE THERE TO SPEAK OF...

Then there is this other thing going on.. Blogger introduced "Reactions" to posts thing, which I think is pretty cool.. But.. it doesn't work on my blog either. Any guesses why?

The only reason I could come up with is "They HATE me".. Why? I don't have any answer to that.
Maybe they are just angry, why?? I don't know that either.

So I got another blogger to upload an image on his header.. maybe there wasn't anything wrong with my blog, maybe things were going not-so-well at blogger people's end.. but not prizes for guessing, the image uploads and displays on his blog, but refuses to do so on my blog (so maybe they really do hate me).

I decided to put my rantings on Google's help forum, thinking that I would get some answer, some solution, or just some sympathies.... ohhh I was so so wrong.. Uptill now there hasn't been any answer there.. just my lonely lonely post....

And there was the problem of my comments not getting imported on this new blog :( :( sigh, sigh.... tears, tears.....

So I again started searching for themes. And couldn't find anything good on internet. I want some thing that is simple and which doesn't take ages to load.

I am quite happy with my current theme, if it would just allow me to upload a decent image.. I only want to upload an image, for crying out loud, is that too much to ask for????

I finally found a working code for "Most popular posts". Appartently, it's working fine.. let's see for how long that remains true.

I checked "Google's help forum" yesterday, to see if someone had answered my post there, but what I found there was not an answer to any of my problems, but a lot of other problems... and thought "Yaar, aur bhi ghum hain zamanay mein.. yahan to sirf aik image hee nahi upload ho raha...."