A realization.

It is not a joke when they say life is a teacher. It most definitely is.

In your journey of life, you tend to step on a lot of stones. But when all the stones that you have stepped till now has been firm and ones that have taken you to heights, you naturally tend to forget that there might be some stone that is loosened. Some stone that might give way when you step on it, throwing you down if you are not careful. Always the first time that you encounter these kind of stones will be the hardest. Because you neither expected it nor know how to handle yourself when it happens.

Once the first fall happens and you somehow recover from it kicking and screaming, you pick up a whole lot of maturity and experience from down there where you fell. No matter whether you want it or not, the experience and maturity will rise up along with you while you stand up from your fall. It is inevitable.

Once you stand up, you introspect. You figure out a few things. You see the flaw in certain things and learn a few lessons. After everything, being a better man than you were yesterday, you continue with your life. This post is about a few things that I learned on my first fall, which happened quite recently.

The first and foremost would be that whenever someone else’s life becomes intertwined with something/anything that you do, then you should give care and thought to your actions. You are free to toy, experiment and play with life as much as you want, as long as it is yours. Most of the time, just because of the fact that you won’t give much thought to what you are doing, you tend to forget that your actions could affect other’s lives too. These “others” can be anyone from the low life vermin who is the saddest excuse for a human being on Earth, to someone who is the epitome of goodness and perfection of the human race. The only thing that matters is that it is the other person’s life.

I speak here from my experience. When my fall happened, it was due to me doing something I was passionate about. Me writing my blog. The damage had been done and I was slowly helping myself to stand up. However, a few thoughts popped up in my head that said what I did was right as long as I was passionately following what I did. Giving much thought to that idea, I finally came up with the conclusion that it was not so. The “Let them say what they want, I don’t give a care and I’m going to do what I love” attitude is not the way to go as long as what you do has had an effect on others.

I say so because then, you are using your passion as an excuse for not assuming responsibility for your actions. Whenever anything that you do is used as an excuse for something in the slightest sense, then the genuineness with which you do that is compromised. This applies to a wide range of activities that you do in your daily life and when you think about it, most of times you will be just making excuses, to yourself as well as to others.

Having realized that, the next thing that occurred to me is that whenever you see something that is not right, something that needs to be rectified, diplomacy is the key to making it correct. If the best strategy that you can come up with is to just gripe about it, then that makes you no less different than the others who are doing nothing in trying to rectify that wrong. Although a bit too ideal, the words “Be the change that you want to see in the world” makes sense. If you see something wrong and that something being wrong is actually bothering you, consider it your problem and hack at it real slow instead of griping about no one doing anything about fixing it.

In case you haven’t noticed, everyone is good at griping about no one correcting the wrongs and everyone is a master when it comes to putting the blame on others. If that is basically what you have done too, no matter what approach you took in doing it, then in the end, you’re no different from the rest.

It is rarely the case that you have to approach the problem in an extreme manner. Only the impatient and weak willed adopt that approach as it is expected to bring about sudden changes. I do not know how effective such changes are or how long they would last, but if you really have a strong character as well as a strong will, you slowly, patiently and diplomatically approach it. It will never be easy, but then again, who said life is going to be easy?

Having stepped on the first loose stone in my Journey, I’m still not experienced enough to identify such stones by looking at them. Nor am I experienced in raising myself from the fall. But now I know to expect not all stones that lay my path are firm. Treachery and disguise hides in between. I learn to be more careful.

It is all about attention, and addiction!

As humans, when we are asked why we do something, we have an arsenal of answers ready at our command. We come forth with the “It makes me happy”, “because I think it is right”, “passion”, “this is what needs to be done”, and numerous other answers as well. Basically, what we are all trying to do is to find a reason to justify our actions. The answer to the question, “why?”.

There is another basic instinct that is at work here, which is actually the one thing that we crave for while doing all our actions and yet, the one thing that we are ashamed of admitting that we are after. It is so because admitting to that reason makes you “not cool” or something else of the sort.

What is that basic instinct? Have you ever wondered why criminals are given Jail sentences as punishments? More importantly, do you know what the worst punishment is that can be given to a criminal while in Jail? Apart from all the hard work, bad food and punishing, the most scariest of them all is solitary confinement.

To be in a cell, alone, away from humans, without even being paid the slightest of attention. Prolonged stay in solitary confinement breaks a person down emotionally.

Lack of attention is what channels people’s minds in different directions. When I say people, that includes everyone from a little baby to a kid, boy, a youth, middle-aged and old ones. All of them require attention for their lives to go on.

I have experienced this scenario first hand with a cousin brother of mine, who was entrusted in the care of one of my uncle’s family, because his Mom had to undergo certain treatment and his Dad had to be in another country for work.

This kid was a modest and silent child, sweet and gentle. He was 9 years of age or so. However, his stay at his uncle’s slowly started changing him. He started causing silly troubles, engaging in constant fights, and also started having constant mood outs. He wanted to do something to gain attention. It did not matter what he did nor what kind of attention he gained. Whether it be good or bad did not matter, as long as it provided him with a little of someone’s time.

Almost all of us have other’s attention all the time and thus, as is our nature, we take that for granted and build up huge philosophical mountains on our ego to cover up this basic instinct of ours. If you talk to doctors, you can see that a huge number of patients are coming there to consult him without any real diseases. Especially old people, when they are cast aside without being heard and attended to (attended as in, talked with and heard by), the way that they see to get attention is by conjuring up diseases which do no actually exist so that they can at least visit the doctor. This is true even in the case of young people and not just old ones.

People have connections with people whom they receive attention from. I believe this is the fundamental factor behind love. For when two people are in love, they both give each other their ‘time’ more than anything else in the world. Your time is the greatest gift that you can give one person and time means attention. Also just look at your friend’s circle. Are you friends with anyone who does not pay you attention no matter how much good that guy is? Of course not! You are happy with your circle because they give you attention. No matter whatever greatness and goodness that other fellow has.

I believe that is the reason why certain students get into “bad company” too. Because most of the studious and enlightened students in the class might not have time to tolerate and hear what certain weak students have to say. This basically puts that weak kid in a situation where, in order to gain attention, he tries all sorts of students in his class, and figures out that there is a bunch from whom he can get attention easily. All you have to know are gossips about celebrities and movies. You need not learn math nor do hard work. And since the society nowadays encourages you watching movies and knowing gossips, that weak kid finds that he has an easy way to gain attention and thus, gets into that company.

We talk about ‘passion’ as a reason for doing things. Have you ever thought what would happen if no one notices you when you do the ‘things’ that you claim you are passionate about? In my case, I claim ‘writing’ to be one of my passions. Would I still write if I had 0 hits day and night on my blog after having over 130 posts? Nope. I would have given up way before. Free software, open source, programming being the other things, would you stick to any of those if people did not pay you any attention? Don’t get me wrong here. I’m not saying people do things without any other reason. I’m just saying that the fundamental reason why people do things is for attention.

People are blessed with interests and likes. That is why they pay attention when they see or hear things that they like. That is how attention is passed around.

I had stated in one of my earlier posts that people did not have passion these days because they were not getting bored. However, a more valid argument would be that people do not have a passion these days because they do not have any lack of attention. Because they have the Internet and especially because they have the social networking sites, they get as much attention as they want. They need not do anything creative in order to get attention. They just need an e-mail account and a few clicks on these sites.

When people do not have attention, they do creative things. Things that others are not capable of doing, in order to bring attention to themselves. I believe that is how passion is born. These days, people who do not entirely succumb to the attention from Social Networking, or for that matter from any other communication media, get to be creative. The lesser the attention that you get, the more creative that you become. This creativity can be for good purposes or bad ones. It does not matter.

You know how people crave for power. How people like to be in the ruling committee no matter how much risk they have to take. What is power if not but attention magnified a thousand times? Attention is more or less like money. You can live decently if you have enough. But you never stop trying to get more. Inspiration, motivation, everything has the fundamental factor of attention attached to it.

So basically what I’m saying here is that everything you do is for attention. Well, everything? Nope. Not everything. You do things for one more reason, and that is addiction!

This is scary. Really scary if you know what I mean. Even if you do not get an ounce of attention, you will go about doing this. Just to mention a few of the common ones – drugs, porn and gaming. You succumb to these even if you do not get any external attention. These are things to watch out for because you would be a lot better if you give your time to almost anything else.

So, don’t be afraid to admit that you need attention. It is something that we all need. Something without which we cannot live. On this, you may create as many pillars of philosophical reasons for the things that you do. It is upto you.

Multitasking? Bah!

In the course of life, I have seen many people get into situations where they need to pay attention to a million things. In order for their loved ones to have a good life, these people, no matter how many things that they have to take care of at the same time, somehow manages through it by staying sane, and finally when the day is at an end, the feeling of soulfulness that they experience is something that words cannot do justice to.

It might be the case that a person is working in a firm where he is under payed and his boss is making him work extra hours with no additional benefits. He cannot quit the job because he won’t be able to find another one fast enough in order to feed his family. So with this tension and pressure, he somehow manages through, and returns home to his kids, who are happily waiting for their daddy to play with.

Sometimes in the midst of such a life, his wife might be pregnant and is admitted at the hospital expecting delivery soon. He cannot be with her all the time because of his job and his first kid is at school. Now he needs to concentrate on his work where, if his response lacks quality, he will be fired. In the middle of that, he needs to find time to go and visit his wife and attend to emergency calls coming from the hospital now and then. Plus, he has to go and pick his elder child from school and take care of his daily activities of washing clothes and making food for him.

In such a state, a man multitasks. That father, just out of love and the feeling of responsibility, performs all his tasks, one interleaved with the other, and pulls through without causing hazard to any of the things that demands his attention. This is where he multitasks. He cannot tell his boss to get lost for the fear of losing the job. He cannot tell his wife to shut up and let him work for he loves her. He cannot let his elder child be, for he means the world to him.

Finally this man accomplishes it. He is a true hero. This is where we say that a person multitasks.

Nowadays we see many among us, including ourselves too, who proudly say that we are good at multitasking. When asked what we are so skillfully multitasking about, it is amazing to hear the answer.

Chatting with some stranger through the computer while answering the phone from his friend who wants to go out for a movie, at the same time watching a youtube video while having one earphone from his ipod plugged into one of his ears plus studying Math with his other free hand!

Goodness me! We seriously know how to rape multitasking. You are voluntarily killing your skill of being able to concentrate! I’m not saying I am free of all this, but when you see a kid or someone younger than you committing the same action, just tell him! Stop him from doing it for it is NOT something to be proud of. And as for us ourselves, let us not voluntarily do this, shall we?  I know it sounds cool and all but I hope you get the idea.

You need to multitask when the situation calls for it. But you need not rape your brain with it when it is not needed at all.

The night sky.

When darkness wraps the infant world in its hands, the humans fear of the chaos outside. They fear the dark for it does not let them see, and what the humans don’t see, they fear. Little do they realize the beauty that exists, within the realm of dark. They do not linger to behold the jewel of Earth, that shines with a light so pleasant, that it soothes one’s heart, like the music of a nightingale.

The moon, he shines like a pearl that reflects the golden rays. He shows the ray of hope amidst all the darkness. Not alone, he is! For his companions soon join him and decorate the heavenly skies, the stars! They are far away, away from the corrupt hands of men, blazing with a fire so strong, that we see a twinkle of what they are.

A silence prevails, and men fear that too. For it makes them feel they are alone, alone in a world so big, which makes them realize, how insignificant they are. But are we alone? Not at all! We forget that we too are a part of the universe, as much as everything else is. If not for them, we wouldn’t be here. So why do you feel lonely, when you are standing among the innocent ones that support your existence?

Men, busy they are! Time, they do not have to think of where they live. They are busy slandering against their fellow beings, without realizing that the pearls and jewels of the universe exists for them too.

Oh bearers of brain, make yourself worthy of the gift of thought. And spare sometime to witness the world around. Look at the skies and behold the shining moon, who smiles at you and shines light upon you, when all around is dark. Be the moon, and the stars shall accompany you. Be the moon and help the ones lost in the dark.

Getting started with the Play! Framework.

Yesterday I attended Pramode sir’s workshop on ‘Introduction to developing web applications in GNU/Linux with Play framework’.

As usual, his energetic way of presenting the material got us all interested in a few seconds. Although we could not cover all the aspects in detail due to the time constraint, this post is going to be about what all he was able to teach us in the time we had together.

INTRODUCTION TO THE SESSION

So, Play! is a framework for writing web applications. What are web applications? Just like we have applications that run on our computer, they are applications that run on the web. And what are frameworks? Frameworks are those software tools that lets you use certain pre-defined functions, that implement the basic network protocols for you. So basically, you just need to concentrate purely on your application and not bother about the lower layer implementations. Hence, it is an abstraction. You can find many of them like Flask, Django, Ruby on Rails, etc.

A web applications has two parts. One, the Client side and the other, the Sever side. The Client side is where you actually see the web application in action and hence it contains our HTML, JavaScript and CSS. The Server side will run a Web Server program that gives out the matter that is to be displayed by the client. So that’s that.

Once that was explained, he got into explaining the difference between statically typed v/s dynamically typed languages. Pointing out Python as an example of a dynamically typed language, he explained the concept by the following piece of code


a = input()
if a == 1:
    a = 'Hello'
else:
    a = 1.2
print a

In the above code, we cannot determine of what data type the variable ‘a’ is at the time of printing it. Because it depends upon whether the ‘if’ or the ‘else’ executes. These kind of languages are called dynamically typed languages.

Whereas in statically typed ones, you can know the data type of variable at any given place. You can understand it better with an example C code:


int main() {
    int c;
    .....
}

When you declare a variable to be of a certain data type, that variable retains that type till the end of its scope. In this case, the opening and closing curly braces. These are called statically typed languages.

Both having their own advantages and disadvantages, there are places where both have their own uses. However, the errors in the code of a dynamically typed language will be visible only when the program is in execution and it reaches that part of the code where the error is present. Even though, static typing might not be a one that gives “error free” code, it helps you catch certain type of errors that a dynamically typed language might not be able to catch.

Then we came to the popularity of the JVM based languages these days. The popularity of such languages was based on the fact that a vast eco-system of libraries will be available at your command at the beginning itself. This is available because Java has been around for a long time and hence a lot of libraries has been developed for it. The JVM based new languages can use these and thus, move forward in full swing from the beginning itself! Clojure and Scala are the two ones that are on a roll at present.

However, both of them uses the Functional Programming Paradigm. He told us that the world was slowly realizing that OOP was not the solution to all the problems and that there were many instances where a functional approach was much better. Those days when people used to get impressed by seeing ‘Python’, ‘Django’, ‘RoR’ on your resume are behind. Now ‘Clojure’, ‘Scala’ and ‘Play!’ are those that make an impression.

During earlier days when PHP ruled the world of web application development, most applications’ code base were designed horribly. This was because all the code for a certain application was fitted into one file. As in, you would write a bit of HTML code, then insert PHP into the middle of that and then a few JavaScript here and there and finally end up making a mess out of your code, even if not your application.

In order to overcome this clumsiness, a certain design philosophy referred to as MVC (Model-View-Controller) was established and people began to follow that in order to structure their code bases better. A quick explanation of what MVC is.

Model stands for Database part of the web applications. As in, how things are stored into and retrieved from it.
View, as you might have guessed, consists of the HTML, JS and CSS. As in, what we see.
Controller defines the business logic. As in, the code that we have written using a certain language.

Now coming to play!, we were going to deal with Play!2. It seems a major difference was made in the succession from Play!1 to Play!2. The difference is that in Play!1, the core of the framework was written in Java. However, in Play!2, the entire thing has been re-written in Scala. Talking further about play!, a thing noteworthy about it is that the entire framework is statically typed! As in, at the time of compilation itself, before actually deploying the application, you will be shown the syntactical errors that you have made. According to him, this is a major (and super awesome) feature of play!.

You do not need to run your application in order to see where you have made a syntax/typing mistake. The compiling stage takes advantage of the statically typed nature of the framework, and shows you exactly the line where the error has occurred. The advantage of this is that, even though the initial learning curve might be bit high, once you get everything correct and deploy the app, the chances of it crashing are really low compared to other dynamically typed frameworks.

Another innovative feature that Play! introduced was that of automatic reloading. As in, usually when we make a change to the code in statically typed languages, we would have to compile it once more in order to run it. Play! got over that hindrance by introducing a feature that automatically detects a change in the code of the application and reloads (recompiles and reruns) it.

Now for the hands on session.

INTRODUCING PLAY!

1. Setting up play!

Always before starting a work, make sure you have the right tools for it. The first thing here would be java. Please install openjdk-7-jdk, or any versions of openjdk. They tell us not to use gcj (which is the default Java compiler on most Linux systems) as it seems to break things while execution. So to install, do:

sudo apt-get install openjdk-7-jdk

The next would be play! itself. You can download it from here. Once you have downloaded the zip file, unzip it and extract it to some location. Include that path in your PATH variable. That is, do:

$EXPORT PATH=$PATH:/path_to_play/play2.0.2/

In order to check if you are good to go, just do:

$play

and hit enter. You should see something like below:

Wonderful. Now let us proceed.

In order to teach us how to get started with it, he had already made a series of applications that took us through small step by step modifications which were really helpful in learning the concept. You can find the code base at my github repository at: https://github.com/harisibrahimkv/Play-tutorial

You can either download it as a zip from there or you can clone it. Assuming you have git and git-core installed, you can do:

$git clone git://github.com/harisibrahimkv/Play-tutorial.git

which will clone the repository for you.

2. Creating your first app

In order to create your first app, do:

$play new app (you can give any name here and not necessarily ‘app’)

You will be asked your app name and also the template you wish to choose. See the figure below:


Now, play! will have created a pretty good working application skeleton for you in a directory called app. If you ‘cd’ into it, you will be able to see 4 folders and a README file. This is the basic structure of any play! application. In order to create your application, you just need to fill in whatever you want. Let us try running the app huh?

3. Running your first app

Alright. Just do:

$play

and hit enter. Now you will see your memory and processor being eaten up! It will take a while before the application starts working. However, this seems to be the case in development mode only. A deployed play! 2.0 app is not that memory intensive.

Once it is done, you will be given a prompt. Type “run” there and hit enter. Once it says “Server started”, you are good to go. Access your browser and head over to:

http://localhost:9000/

It will take a while for the page to load as the code only starts to compile once you send the server a request. This is the case only in development mode. While in production mode, compilation will be done beforehand itself. See the web page loading? Wonderful. Do not try out anything written in that page for now. Let us proceed with Pramode sir’s example. Your terminal will be looking something like this now:

In order to stop the program, hit Ctrl+c.

Just a quick explanation of the different folders:

app: This contains your application. If you cd into it, you can see the sub folders ‘controllers’ and ‘views’. Inside ‘controllers’ you will a ‘Application.java’ file, which is the code that you write. It will be already filled with a basic application. The ‘views’ folder is where your templates go. What are templates? Templates are files that contains HTML code. But it is not purely HTML. You can write Scala code in a template thereby allowing you to use features like “for loops” and “variable declarations” inside it. Usually, the “models” sub folder should also be present here. But there is no need for a database for a minimal application. Refer to the figure below:

conf: The conf directory contains two files. A ‘application.conf’ file and a ‘routes’ file. We did not cover what the former one was for. But the latter one is the important one for now. The ‘routes file specifies which function in your /app/controllers/Application.java file should be triggered corresponding to a given URL. You’ll understand this better once we go the tutorial.

project: It contains the play build tool called sbt (Simple Build Tool). Much like the Makefiles we use. We did not concern ourselves with that.

public: This contains the images used in the web app, the javascript codes and the css scripts.

Now, get into the ‘part1’ folder which you cloned from my github repository earlier. We will walk you through all the steps one by one.

4. Through the Tutorial

This tutorial is aimed at providing a basic idea about how the play! framework works. It does not include explanation of the syntaxes of neither Java nor Scala. Hence, if you know either of those two, you’ll be able to improvise quickly. Otherwise, you will have to learn them. During the workshop, we were only able to go through ‘part1’ of the entire tutorial. ‘part2’ was covered only vaguely.

How we move about in the tutorial is by visiting the folders of each app, checking the README there, then the /conf/routes file, the /app/controllers/Application.java file and to the end, the /app/views/index.scala.html file.

We first go into the folder ‘part1’ and explore the different ‘app*’ folders there.

app1

This is the same one that we made ourselves earlier by creating our first app. Hence we won’t look into it further.

app2

Remember the flow, the README file, then the /conf/routes file and so on. This app is to show the most fundamental idea of how a play! app works. We can see in the ‘routes’ file that there is a “GET / controllers.Application.index()” line. What does it mean?

That line defines the rule that, if ever a “GET HTTP” request comes that corresponds to ‘/’ (In a URL, simply a / denotes the domain name itself. As in ‘google.com/’, ‘facebook.com/’, etc. Note the trailing slash at the end of both the domain names), then the function “controllers.Application.index()” should be executed. In case you haven’t already figured out, that functions resides in the file “/app/controllers/Application.java

You can see the method index() there with a “return” statement in the body. The “ok”, it seems is an object that everything is fine in the execution of the code, and the plain text “Hello, world, again!” maybe sent to the client. Since it is simply passed as a string, it will be displayed as plain text in the browser.

Now try running the app as we said before in the “Running your first app” section. However after typing in”play” and you are given the prompt, do not directly type “run”. This is because the code you cloned from my repository at github has been run by me once. As such, the class files will be present already in the application. First remove them and then “run” your application. In order to remove the class files, type in “clean”.

Now “run” and head over to “localhost:9000” (our domain name in this case) in your browser where you should be able to see the plain text “Hello, world, again!” displayed.

Mind you, run the command “play” from within the directory that contains the “app”, “conf”, “projects”, “public”, etc folders.

Got it? Cool. Let us proceed soldier.

app3

It is time to add more URLs. Check the README and then the “routes” file. You can see that two more URLs are defined. Things that come after the first ‘/’. You have seen “facebook.com/user” right? Similar to that. Two new functions are mentioned in the  “routes” file. So check them out in the Applications.java file.You can see those functions defined.

Try running the code. If you head over to “localhost:9000”, you will be greeted by the return value of the index() function, if you check out “localhost:9000/docs” you will be greeted by the return value of the docs() function and correspondingly for “fun” too.

That was easy now, wasn’t it? Let us move on.

app4

README. Don’t forget the flow in each app.

We are introducing an error into the “routes” file. Instead of giving the function name as docs(), we are giving it as doc(). It is a common mistake that could happen to anyone. The point that you should understand here is that, since this is a statically typed framework, everything is checked for consistency beforehand. So in production code, even before you run the app, you will be shown the error which, according to him, is a great feeling of relief while switching from dynamic ones to static. However, since we are running development code, the compilation will be done only once you have sent the URL. Hence, we might feel no difference yet.

Try running the application (don’t forget to run “clean” at the prompt) and go to “localhost:9000”. You need not go to /docs to get the error because the compilation is done once you have activated the first URL itself. You will be greeted by a friendly, cool looking error message in the browser. Do NOT look into the terminal! It will be shouting at you with a lot of stuff. Don’t be scared and don’t be discouraged. Did you get the error message in your browser? Awesome. Forward March!

app5

We are simply playing with the syntax of the definitions in routes. Instead of the URL /docs, we are giving /docs/one. Now if you run the app and check out “loalhost:9000/docs/”, you will get an “Action not found” error message. In order to invoke the docs() function, you have to type in the defined URL “/docs/one” itself.

Let’s move on.

app6

Continuing with testing the syntax of URLs, suppose you want to pass a variable to your web application through your URL. How would you do it? We see that now.

In the “routes” file, you can see that the /docs/ is followed by a “:num”. This states that whatever comes after /docs/ in the URL that you specify, it will be treated as variable with the name “num”. The type of the parameter is specified in the argument part of the corresponding function. You can see that in this case, it is “num: Long” which is of integer type.

Check out the corresponding function definition at the Applications.java file. You can see that the docs() function is receiving ‘n’ as a parameter and you can use it inside your ‘return’ statement as give there.

Now try running the app and checkout “localhost:9000/docs/37” in your browser and see the magic working. Got it? Let’s keep pushing my men!

app7

Suppose you make a mistake in declaring the type of your URL parameter. What happens then? You can see that the ‘routes’ file is same as before. But checkout the /app/controllers/Application.java file. In there you can see that the parameter has been declared as a String. So there is a type mismatch.

Try running the app and head over to “localhost:9000”. You will be greeted by our good old friendly and cool erro message. As before, don’t look at the terminal lest you should black out. Check the browser. You will see:

Saw it? Then let’s get going.

app8

What if we want to pass two URL parameters to the application? That is what this app demonstrates. In the “routes” file, you can see that there is a rule /:student/:mark. So you can specify two parameters after “localhost:9000”. No, you MUST specify two parameters after “localhost:9000” if you want the second rule to be invoked. If you pass just one parameter in the URL, you will receive an “action not found” error. If you pass the parameters in wrong format, as in if you give a string instead of marks, you will get a “bad request” error too.

If you check the corresponding Applications.java file, you can see that we can use the parameters passed as we like. In the corresponding evaluate() function, we care comparing the marks with 80 and executing one of the statements based on the comparison. Try running the app. Experiment with passing marks less than 80 and greater than 80. Feel the difference! Your URL can be something like “localhost:9000/wolverine/67”.

Felt the difference? Excellent. The end is in sight, let’s move on.

app9

Now we come to query strings. You can read upon what query strings are here. If you check the “routes” as well as the Application.java file, you can see that we don;t have to do anything special in order to make the application accept a query string. All we have to do is to put an extra parameter in the function definition. In this case, that is “mark: Long”. Once that is there, we can pass query strings to the applications as follows:

“localhost:9000/wolverine?mark=35”

Try running the app and check it out with the above query string or with one of your own. Gave enough marks to wolverine? Great. Next one!

app10

Till now, we have only displayed plain text in out browser. But as you all know, it rarely the case that you get to see plain text in websites. Almost all the content is of HTML type. So how do we display HTML? Let us get to it.

This is where the “views” folder under /app/ comes into life. We had explained earlier that the “views” folder would contain the templates. Templates are not purely HTML. But for this example, we use a purely HTML template.

Check out the HTML code at /app/views/Application/hello.scala.html . It is a straightforward code and you can understand how it will be displayed in the browser. How is it displayed? Whenever we use the /hello URL, the corresponding function hello() in Applications.java file get executed. It returns a function (views.html.Application.hello.render()) value. That “hello” in that string is the name of our HTML file in the “views” folder. We named out file hello.scala.html right? That .scala.html extension should be there for all the templates.

Try running the code and visit “localhost:9000/hello” to view your first HTML output using play! in your browser.

Happy? Pat your back but no time to wait! Let’s keep going.

app11

How do you pass variables to your template in order to display them as HTML in your browser? The “routes” file is the same. We pass a parameter through the render() function that we saw above. Check the Applications.java file and you can see that render() has a parameter “Arun”. Alright, we understand how to pass an argument to functions, but how is it possible to get that variable in an HTML file? That is why we said that we are using “templates” and not HTML files. The templates here can contain Scala code in it.

So, checkout the template under app/views/Application/hello.scala.html

You can see that the first line is “@(name: String)”. This is the part that accepts the argument that we passed through the function into the template through a String variable “name”. Now, the template will replace wherever it sees “@name” in that file with the parameter passed, in this case “Arun”.

You don’t believe me? Then try running your app and visit “localhost:9000/hello”.

Ah ha! Now you believe me right? Hmph! Next..

app12

Now we couple two things that we learned above. Passing a parameter to the application via a query string and then passing that variable to the template in order to display it as an HTML output. So you can see that we have declared a parameter for the hello() function in the “routes” file. Now you can pass a query string such as “localhost:9000/hello?name=wolverine”. So “wolverine” will be there in ‘name’.

Then the hello() function in the Applications.java file is invoked. There, it has a parameter name, which will now contain what we passed. We use that parameter in the render function and thus, pass it to our template. The template is the same as last one and accepts the passed argument into “@name”.

Run the application and try passing the above URL. Greeted Wolverine? Swell! Now for the final app of part1!

app13

Here we learn to send multiple items through a query string parameter, to split those items and finally display them as a bullet list HTML page.

The “routes” file does not have anything new. It just accepts a String variable called “namelist” which is passed to it as a query string. The corresponding hello() function in Applications.java is invoked.

In the hello() function, we declare an array of strings (String t[]) and pass it the query string values (now in “names”) one by one by splitting them at the commas. Once we finish doing that, we pass the array “t” into the render() function to be accepted by our template. Now let us take a look at our template.

Check the app/views/Application/hello.scala.html file. We can see that it accepts the array ‘t’ that we passed into an array of Strings called names. This is what the “@(names: Array[String]) does. Now, since “names” is an array, we need to take each element from it individually right? That is what that funky looking “for loop” does.

The “@for(name <- names)” iterates over the array “names” and assigns each string in the array into the variable “name”. This is displayed as a list by the “@name”. So, basically, that for loop pastes that contents of the array into the file as an HTML code and then our render() function renders and return it to the browser.

Try running the app and pass the following URL in the browser:

“localhost:9000/hello?namelist=wolverine,haris,batman”

Saw all the superheroes being listed? I know you did. Thank you!
———————————–

This concludes part1 of the tutorial. We did not get enough time to discuss part two entirely. Hence I will share what I know.

One of the most important parts of a web application is the Database part. MySQL is one of the most popular relational Database models. However, here he mentioned about ORM – Object Relational Mapping. ORM is a programming technique that is used to convert a relational database into an Object Oriented model with the first field as the object and the rest of the fields (columns) as their attributes. But it seems that this abstraction is a leaky abstraction.

Leaky abstraction refers to those abstractions that fail to let us use that abstraction without knowing what happens underneath it, at some point of time. As an example, in Python, he told us to try inserting elements at the beginning of a list as well appending at the end of a list. When you try the above two approaches with a million items, you  will find that the former one takes a heck lot of time than the latter. In order to understand why this happens you will need to dig into how lists are implemented in Python using C. Hence, what lies beyond will be revealed, piercing the abstraction.

Refer to the following article for a hilarious description of the Law of Leaky Abstractions:

http://www.joelonsoftware.com/articles/LeakyAbstractions.html

Now enter into the folder ‘part2’ and let us explore the ‘app*’ there.

app1

Up until now, all that we have done are GET requests. GET requests are those HTTP requests that do not change the state of the server program and the database. It simply requests a resource which the server sends back to the browser. By default, all the URLS in a browser are GET requests. On the other hand, a POST request is what we use in order to change the state of the server side program and database. But how can we invoke a POST request if the browser sends all the URL as GET request by default? Let us see.

If you check in the ‘routes’ file, you will find that a new rule has been added. “POST /add additem()”. In order to test whether the function additem() works, we need to send a POST request with the URL /add. We cannot directly type in a POST request in the address. So we use a command called “telnet” to test our application. First of all, run our app. Once it has started running, and you see the “Server started” message, open a new terminal.

Install telnet on your system. It must be there by default on Ubuntu systems. Type in:

$telnet localhost 9000

and hit enter. You will see a few messages and then the cursor will stay below it, blinking. Type “POST /add http/1.0” and hit enter twice. You will see the return statement of the additem() function printed on your terminal. Refer to the following figure. After running the application in one terminal, in the other terminal:

That highlighted line is what you should type in and HIT ENTER TWICE. So our application is working in receiving POST requests and in responding to it. Let’s get to app2.

app2

Here we see how we can trigger a POST URL from our browser. For this purpose we create a “form” in HTML. You can see that the ‘routes’ file has not been changed. However, the index() function in ‘Applications.java’  renders a template called ‘index’. Let us take a look at that template under /app/views/Applications. The ‘index.scala.html’ file.

If you know basic HTML, you can understand that we are creating a form, which is a submit button, whose action is ‘/add’ and method is POST. Thus, if you click that submit button, it will ivoke the URL ‘/add’ with a POST request, which, according to our ‘routes’ file, will trigger the additem() function.

Try running the app and visit “localhost:9000”. You’ll be able to see the “submit” button. Click on it and you can see the additem() function getting invoked.

Cool? Let us proceed.

app3

This is where you actually POST some data and the server responds according to the data you have posted. However, by this time, the session was at an end and we could not discuss in depth what was going on.

First of all, the index.scala.html file is rendered which gives you a text box named “task” along with a “submit” button. When you type something in the box and hit “submit”, that data will be sent as a POST request on /add. Thus the function additem() will be invoked. That function extracts the data we sent and stores it in a String called ‘task’, and then sends back the response as plain text which includes the “task” String.

Try running the application. Enter something and hit the “submit” button. You will see the String under the additem() function being printed on your browser appended at the end with the task that you entered. So now you know how to issue a POST request.

—————————

Unfortunately, we did not have time to discuss the further applications. We directly went to app6 and tried running that app to see the output. With that, the session came to an end.

A small discussion was there regarding how sessions were established. He explained that each HTTP request is independent from other HTTP requests. Hence it has no way of identifying whether the requests are coming from the same user. So the concept of session is done by implementing cookies. What are cookies? When a user “logs in” to a website, that site sends with the response of the user’s request, an exclusive data that will be stored temporarily in the user’s computer. When making the next request, if the user has not logged out, his browser will take this data and send it along with his HTTP request. When the Server sees this exclusive data, it understand that the new request comes from the same user itself. This is how sessions are established.

The session came to an end with us having a few friendly chats. It was a really informative and practical workshop. One ofthe best ones that I have ever attended. Hoping for more in the future!

Let’s play!

Enabling graphical display by switching user from the terminal.

First of all, the guys at smc (Swathanthra Malayalam Computing) is so totally cool. They are like, waiting for helping you out with something. Really helpful people there. Ershad, Rag Sagar (whom I got to know yesterday just because of the doubt I posted in their mailing list), Jaseem, Praveen, only to mention a few.

Not only that, but it is wonderful to see how easily the world is connected today. Within a few seconds, people from Pune, Bangalore, Calicut and Malappuram talked together and solved a certain Linux administrative problem, which I am going to describe below.

I was trying to learn git and as such, wanted to experiment on managing pull requests. I did not wish to bother anyone else with the task of sending me a pull request and hence, I created a new user in my system. There were two options for me to do it. Whether to use useradd or adduser.

useradd, it seems, is the primitive Unix command of creating a user. I guess you could put it like “raw create user”

On the other hand, adduser, was a perl script that used useradd, and also other informations to create your new user account for you.

Hence, I went along with the latter and created my user. I switched to my new user account using

$su newuser

However, when I tried to open/create a file within the home directory of the newuser with the command

$gedit test.c

I got the following errors:

No protocol specified
No protocol specified
Cannot open display:
Run ‘gedit –help’ to see a full list of available command line options.

Which meant that the graphical display was not working for the new user. Without much delay, I posed the question on the smc mailing list and got two answers:

1. The twisted way proposed by Ershad. He he…

To ssh into the new user account with the -X parameter so that you can use the graphical display. For this, you need to install openssh-server and do:

$ssh -X newuser@127.0.0.1 (Or you could use ‘localhost’ instead of ‘127.0.0.1’ if the mapping is there in your /etc/hosts file)

You are good to go. However, he mentioned that this was not the right way to do things and wanted to find how to do it right. It was then that Rag Sagar pinged me online (since he was not able to reply to the thread due to some technical difficulties). He provided me with the second way, which was the ‘right’ way it seems!

2. The right way by Rag Sagar.

As root, run the following

$xhost local:newuser

Switch to newuser account

$su – newuser

Voila! Now you can use the graphics as you wish. Note the ‘‘ sign in the su command. It stands there for giving the environmental settings for the new user as expected when logging in directly with the new user account. Need to dig up more information on how that works.

And xhost, it seems, is the program that decides/allows who all can access the X server. (What!?). Got to get more info on this as well.

Well, that is the adventure that I had yesterday. Now gitting back to git.

We need good teachers.

It is no secret that the standards of teachers nowadays in colleges and schools are pretty low. Since most of them consider teaching as just a process to earn money, the ethics and true meaning of being a teacher has been ignored and cast away by them. That being the case, numerous people are out there to take up teaching as a profession.

These days, whenever I talk to someone about teaching, they tell me that it is one of the most easiest jobs in the world. Do you know their reasoning for that remark? They say that you’ll have to work only 2 to 3 hours per day, you will have lots of vacations and if you get a Government teaching job, then swell, you can slack off as much as you like.

Slack off? You have to be kidding me. This is the common man’s view regarding teaching and unfortunately, the views of most of the teachers nowadays too. Since both the teachers and common ma agree with the same idea, there are more and more people trying to get into the teaching profession so that they can ‘slack off’.

However, the funny thing is that there are good teachers among us. But they neither make it to school nor to colleges. I talk from the perspective of a fresh Computer Science graduate here and hence, my views maybe restricted to this field only.

These ‘good teachers’ among us are those who are passionate about what they do and have got an extremely good talent in teaching others what they know. Unfortunately, none of these people have their profession as teachers. from what I have seen, most of these people are in the IT industry, working for a software firm or something of the sort.

What I’m saying here is that the society, and more importantly the students, need people like these. People who have passion and people who actually know what they are talking about. People who can guide the young ones on the right path. People who can be followed.

Alas, these people are unavailable. They work in the industry on technologies they are passionate about and earn a lot more than a teaching job. So what need do they have to teach a few? I think there is a need because otherwise, the coming generation is going to have a hard time thinking straight.

I think it takes an enormous amount of will to dedicate one’s self to teach the new generation just by understanding the situation the young generation is in. I don’t know if it is a responsibility as such, but I definitely know that it is a service only those people can give. I guess no one can blame them for not doing it, but I believe that they can make the world a much better place to live, they can make a change and bring forth a ray of hope.

However, assuming that these people do come to teach, they are not going to do much of a good job if they have egoistic superiors breathing down their neck. The institutional politics is something that they don’t need to put up with because they are there to offer a service. Not to “show” that they are offering a service. Hence, there should be other outlets for these kind of people to come forward once in a while and to be able to share what they know with the young ones.

Pramode sir is one person I have seen as such. He realized he had something to give to the society. He teaches, and the beauty is that he teaches on his own, without any “department politics” or “bossing around”. He took a risk upon himself by doing what he did. To stabilize one’s self in such a way by establishing his own institution. I wish the society or the Government supported such initiatives so that we would have more people like him.

My aim is to become a teacher. I want to learn well and then teach about what I know. I have seen many knowledgeable people in the IT industry who say that they will teach/train if they get paid a huge amount of money. It might be true that what they teach is worth that much, but I believe they are forgetting the deserving ones out these, who cannot afford it.

I agree money is important, but money simply is not everything. I wish, hope and pray that those people who have the skill and knowledge to make the difference in the society, to set aside at least a little of their time to teach those young ones, who deserve to be guided.

A cook’s grief.

Trying to wipe tears off her face, Namita realized the hard reality of life… She had felt it for the first time. No matter how hard she tried, the tears wouldn’t stop. She paused for a moment to think where she had gone wrong. Hadn’t she paid proper heed to what her mother said? “Sigh…!!”, she said as she wiped her tears… Her eyes were now searing with pain. But the tears alas, wouldn’t stop! It was as if the dam had  broken, giving way to a turbulent and ever flowing river….

But amidst all this, her eyes were focused on the single thing that had caused her to suffer. The thing which, lay there as lifeless and motionless, and the only thought that remained in her mind was..

“Why the hell do they put onions in every dish!?”

————————————

Sent to me by my friend Namita, while she was making her “Bengan ka bhartha”!

Pachelbel’s Canon.

There are times when your heart fills with an unexplainable joy upon something that happens around you. It may happen when one of your dreams turn into reality, or maybe when you see the happiness of your loved ones, or maybe..

Maybe when you are sitting there, alone, thinking about how lovely the world is, enjoying the pitter patter of the rain, pampering yourself with the green around you, hoping, wishing and praying for the world to be good, for it to become better with each passing breath…

The arrogant humans.

Arrogance, is not a good quality. Unfortunately, when you go deep enough, all humans are, to an extent, arrogant. The arrogance breeding from the belief that they have the capability to understand everything.

I do not state facts here but merely put forth reasons that more or less, vaguely, points out that we don’t have the capability for eternal understanding. As such, this post is assumed to be controversial. You may voice your opinion without being offended.

We believe that there is nothing beyond certain fundamental beliefs that we hold dear. One such belief is the concept of creation. Many of us believe that for something to be in existence, it has to come from something else. Like the concept of “Energy can neither be created nor be destroyed. It can only be changed from one form to another”. Sometimes we take that concept, and go with it to the extreme end. To the supreme power of creation and question that power’s existence. The arrogance of thinking that you have the capability to figure everything out, is what comes into play there.

I mean, the words, languages and thoughts we have are incomplete. It is not so hard to understand that. I don’t know if the following analogy will clarify my point, but let’s see. Consider that we are making robots. The ideas and knowledge that we feed them defines their understanding. They can reach at logical conclusions based on their observations. However, whatever they have, they are never going to understand what ‘intuition’ is. As much as you improve your robot into being a human, you never are going to get a perfect human robot.

I’m not comparing God and humans on the basis of being a creator. What I’m implying is that what we humans know,  are things that are fathomable to us. That does not mean there is nothing else that we cannot understand. After some point, faith comes into play. That is what the essence of this post is. At some point or the other, you’ve got to have a blind belief because the things we perceive are within a framework that we have. A framework containing physics, chemistry, biology, mathematics, astronomy, etc. Is it so hard for you to make yourself believe that there are things other than all these? All we know regarding those things are that we can refer to them by the word ‘other’. We cannot even start to imagine in what form or nature the ‘others’ are.

I’m one who believes that there are no “one solution fits all” method for anything in the world. Some people say that they always have to be happy, some say they always have to be optimistic, some say you should never ever give up. I’m not saying these are wrong. What I’m saying is that there are specific areas that these are applicable to. As such, when one point is reached, I’m ready to give myself up and submit to faith.

If you were able to get my drift, then do leave your thoughts.

I’m not a FOSS fan boy.

“FOSS fan boy”. That term is really scary. It says in a single breath that the person described by that term is nothing but attitude.

“FOSS fanboys will never understand that, because they need to believe that they’re freedom fighters in a revolutionary war, like characters in their favourite animes”

This is what provoked me to write this post. Trying to draw an analogy, during my college life, I have seen a lot of students getting involved in politics. I have always wondered what got them so interested and dedicated to the cause. I used to find it absurd that they spend time on useless discussions, strikes and fights. I even have discouraged many of them from going after politics and “ruining” the time they had at college. As far as my analogy goes, the belief that something great or superior is there to be achieved by our little actions, is what drives the people, and I believe that there is something free software is destined to achieve.

I’m not sure so as to how this belief is instilled in the young minds. I don’t exactly know how even I got into that mindset. But somewhere along the way,  I did.

People always like to make themselves believe that they are important. They do that by mingling with the ones  who make them feel that they are important. Once they realize which group of people makes them feel important, they will start actively working for it.

I believe that is the truth to getting followers. In some aspects it is easy to provide the motivation because the actions of the group are easy to be imitated. That is the case with political parties as it is easy to be one in a crowd and shout. You can always get attention and feel important without doing much. You just have to make some noise and be somewhere by the side of the mob.

Don’t get me wrong. I’m in no way implying that politics is bad. On the other hand, what I’m talking about is the “Fan” attitude. A more meaningful (and unparliamentary) way of putting it would be “All fart and no shit”.

Another observable example are the “fans” of celebrities. It is one thing liking a certain superstar and it is completely another treating them as God, spending time on putting banners and posters of them everywhere and picking fights with anyone who says he sucks. Most of the youth these days, sadly, involuntarily falls into this trap. The seriousness with which they “fight” to support the celebrity is rather… admirable?

There are still many examples like football fans and cricket fans where all they do is talk without ever having kicked a ball or having held a bat.

Now coming to FOSS. I entirely agree that the ‘fan’ culture is there for that too. Basically, it means that you keep on talking about philosophy without an ounce of technical knowledge. The “keeping on talking” would be fine if you would only spend a little time on it. However, with fan boys that is not the case. They keep at it day and night.

You see certain ‘free software enthusiasts’ commenting about Linus Torvalds and Richard Stallman saying that they are not right. These ‘fans’ would not have even cloned the kernel source code yet and they say “Torvalds was wrong to do that, he was wrong to say this” and stuff. I mean, the Linux kernel is such a huge project being maintained by one guy collaborating thousand of developers from across the whole world! You have no clue what that management is like nor any idea regarding its implementation. All you have done is to sit comfortably at your home, open your laptop, read some stuff from here and there and there you go! Somehow you are man enough to advice others. XKCD depicts this wonderfully. Take a look below.

What do you want me to do? LEAVE? Then they'll keep being wrong

As far as I can see, that attitude is not something to feel proud about regarding FOSS. Let me mention a few people who love FOSS and have done much for it and yet are humble.

The first one would be my brother, Noufal Ibrahim K V. He neither talks philosophy nor tries to correct the “wrong person” on the internet. He lived his college life by tinkering with the internals of the Linux OS and thus learning much about how a computer works. He says that it was the Free Software Movement that brought about the freedom for this kind a thing to happen and thus he respects its existence. He works for the internet archive which is a non-profit NGO dedicated to archiving the whole of internet (as crazy as that sounds!) and yet he does not simply criticize others.

The next would be Ershad. He is just so enthusiastic about computers that he would give his life in exchange for it (Just kidding!). He gets to voice his opinion because he has done much for the society due to his love for FOSS. Not only has he a really good technical knowledge but he has contributed much with it. Both through programming as well as teaching. Personally speaking, he was the main reason for the small light of hope that was lit at our college,

Then comes Praveen ettan whom I have gotten to know over the past few months. Nothing more need be said about him other than that he is a Debian developer! Which means that he spends his time and effort, without any return whatsoever, for maintaining packages for the Debian Operating System. That, my friends, is how you contribute to society. He has strong philosophical beliefs which he puts forward and there is nothing wrong with that because he is one person who tries heart and soul to keep the spirit of Free Software alive not only through words but also through actions.

Now coming to the essence of the post. Am I a fan boy? To an extent I am for my contributions are questionable. Also, since I have been a great ‘fan’ of comic book superheroes like Batman and Wolverine, I’m pretty easy to get excited about “fighting for the goodness of the world”. So the comment at the the beginning of this post applies in my case.

Thanks Sharat for opening my eye. I am not going to be simply “one among the crowd” and shout. Till now all that I have done is to make chances for a few people to come together and learn a little but I see that is not enough. I will try to better myself and one day, I shall speak.

In love with my Lenovo S10-2, ideapad.

Ah, where would I be without it? More importantly, it was more than enough. I’m talking about my netbook, my cute little laptop. I got it while doing my S3. In 2009 middle roughly. That makes it almost three years now.

I must say that this is one heck of a piece of hardware. It comes with the configuration of 1GB RAM, Intel Atom dual core CPU @ 1.66GHz plus a 160GB HDD. It came with a pre-installed version of Windows XP which is still there only to have been disturbed for about 15 times all through the entire three years. The other sockets being three USB ports, a serial port, microphone and audio jacks, LAN port, an SD Card slot plus a pseudo SIM card slot.

I call that pseudo because one fine day I had inserted my mother’s SIM card into the provided slot. It kept on going and finally decided to stay within. I had to give it for servicing which cost me 300 bucks and the guy told me that this version had just the slot. Only the next version shipped with the hardware inside that slot. That taught me not to get too excited about stuff I guess.

The keys are a bit close. People having used normal sized keyboards have always found it hard to type on mine. Besides, me swapping my ‘ctrl’ and ‘Caps Lock’ did not help this cause at all. However, since I started typing on this, I haven’t had much trouble typing on other keyboards. One of the most irritable things that happen to me at times are the small dust specks that go underneath the keys. These things make it almost impossible to press the keys. Sometime I get angry and crush them with hard strokes and at other times I strategically tilt my netbook to get them out.

This might seem controversial, but I do believe that this is more than what an average college student needs. Let me list what all I have used my laptop for and see if it comes in the scope of a college students.

  • Watching movies.
  • Listening to music.
  • Accessing the Internet.
  • Photo editing.
  • Sound processing.
  • File conversions.
  • Viewing photos.
  • Storing data.
  • Skype.
  • Chatting.
  • Playing video games.
  • Compiling Linux Kernels.
  • Creating web applications.
  • Writing and learning Programming languages as well as other tools. C, Java, Python, etc. So compilers for the same. Latex, git, make, etc.
  • Watching youtube videos.
  • Installing Operating Systems. I have had 6 of them in one shot. Ubuntu 10.04, 11.04, Fedora, Arch Linux, Debian squeeze 2.6 and 3.0 kernels and finally Windows XP.
  • Connecting USB devices. Thumb drives, Mobile phones, card readers, External HDDs, BeagleBoard – XM, Internet Dongles, etc.
  • Connecting phones via bluetooth.
  • Leaving the system on for almost a week downloading and seeding torrents.
  • Traveling. This babe has been in my bag under the seats on a KSRTC transport bus almost every week for the past three years. You can hold it just like a college notebook and take it anywhere anytime.
  • 4 to 5 hours battery life on an average.
  • Wireless connectivity as well as Broadcasting.
  • Networking.
  • Slide shows, presentations, etc.
  • Most importantly, it has lasted.

That’s about it I guess. One major drawback that you could point out is that it won’t run Crisis 2! Then again, it takes a manly system to run Crisis.

Jokes apart, it has no CD drive. But that has seldom been a drag for almost everyone uses a thumb drive these days. Plus, my system gets heated up. It does not turn off due to over heating or anything but you could try and make a bulls-eye on it.

The paint has come off from certain parts. I guess it is because of the heat. Apart from that it makes a ‘throat-squeezing’ sound while powering up and I have had to replace my battery once. That’s all the problem that it has had.

I think it is a bit sad that almost all the students who have a laptop with them (and most of them really powerful with multiple cores, 4GB+ RAM and Terra Bytes of storage) use them only for watching movies, listening to music and browsing the net. I’m not saying that I do a lot more than that but what I am saying is that you don’t need that much powerful systems to do these.

When you look at the laptops of many students these days, you can see 2 to 4 drives all completely filled and the guys hunting for more space. But poke into it and what do you see? Movies, movies and movies. Plus the other term that people use these days. “Softwares”. Another craze is pdfs. Truck loads of them and the funny thing being that not a single one of them would have been read. With all these stuff in their drives, they are walking around trying to “back up” their systems.

You must be thinking why I did not mention games. Frankly, very few do play games compared to how much they use their systems for movies, videos and music. But the ones who do play games, they are like glued to it.

I think there are things that are taken for granted when a computer science student comes to college. Self-learning is fine but it almost always screws up many basic ideas that are important. I guess a student should be taught how to use a laptop. It simply is absurd taking it for granted that he will learn to use it on his own. This is obvious from the people around us. The use that they find are the above mentioned “Watching movies” and stuff. I guess at least Computer Science students should be taught how to use it.

I guess I deviated a bit there. I should save it for another post. Right now I’ve brushed up my hard drive. I’m using Ubuntu 12.04 and that old XP is still there. An awesome piece of hardware that played one of the most important role in making me what I am today. Thanks to my brother for buying it for me.

The farewell speech.

I thought I would not get a farewell to give my “all-too-prepared” farewell speech. But I did get a farewell. As for my farewell speech, I guess everyone was in a merry mood and did not hear anything that I said which all ended up in me performing my awesome moonwalk in front of my class as well as my juniors!

So I’m writing this post in the hope that some of my juniors will read it and take it to heart. The following is the speech that I wished to give.

——————————-

I remember the time when ICC (Islamic Cultural Center) was in existence in our college. I was doing my second year back then and we were giving the final years a farewell party. There was a person named Niyaska in that batch from mechanical. He was one person that I respected and loved in college. A person with a soothing personality, one who had above 70% aggregate for his B. Tech, Kung-fu black belt, college football team player, a person who was there for almost everything good around us.

The words that he said that day comes to mind. He said, “Motivation is an important factor that can change your life and can help you discover skills within yourself that you would never have dreamed that you had. But you won’t find that factor in this college. Therefore, in order to understand and realize yourself, you have to be self-motivated.”

I had listened to that and forgotten it. Now it comes back to me. So what I have to tell you guys is to realize the importance of giving motivation as well as being motivated. As once I had written in my blog, if you are a human, you have the power to give motivation. So help your friends and do them a favor. If they are trying out something, motivate them and help them to realize the skills that they have. That’s what friends are for.

Now that was just the icing of the cake. Let me get to what I’ve been preparing for the last six months.

What all kinds of advice can a person give? I’d say three. One, to preach about something that he practices. Two, to advice others on the mistakes that one had made so that the people hearing won’t make them. Three, the advice that all of us are familiar with. Free advice, which basically means to blabber on about something that guys has no clue about.

Of the above three, which would you say was the most effective one? In my opinion, I would say it was the first one. I say so because the person giving that advice had undergone the hardships and the tests in order to do what he was talking about. He could be a guide to what he was advising others to do. Most important of all, he would have felt what it was like to do that.

As for the second one, it would be effective but much lesser than the first one. That is because the people who are hearing the advice can ask us, “You had all the fun, so why can’t we?”. You cannot tell them how it is possible to not make that mistake.

The third one, well, need I say more about the third one? Anyone, anywhere and at anytime can give it. I don’t know if it will have any effect at all.

Now since we have, more or less, agreed to the fact that the first kind of advice would be having the best effect, that wold be the one I’m giving. Neither the second nor the third.

I have three advice to give you.

One, find something that you are passionate about and follow it. Most of the people nowadays have no passion. They do not have something that they do just for the sake of doing it. You can ask yourself the question whether you have something that you are doing no matter what others say. Something creative.

The reason why most people don’t have a passion is because they do not give their minds the time to find it. You know why? Because you want to be entertained all the time. It is either music, or movies, or gossips, or chit chat or mobile phones. You do not give your mind the time to find something. So “sit bored”. Boredom is one of the ways to let your mind show you what creativeness you have within you.

Of course, boredom is not guaranteed to bring out the creativeness in you, but it helps. It will definitely make you try out something you have never tried in your life and that just might be the thing you are good at. That being said, most of the times, it happens at a certain blessed moment. This is my first advice.

Now, as for my second advice, I won’t say it. If you really really want to know it, you can come and ask me personally. Isn’t that right Manu?

Now the third one. Help and support your friends. This point stems from the fact that not all of you will be interested in the technical aspects of Computer Science. Most of you would just want academics to go by while you are interested in sports, politics or whatever you are interested in. I do not blame you for that is your choice.

But there will be your friends who are, at least a little, interested in learning new technologies as well as programming. Just make sure that you do not discourage them. Do not make fun of them. Instead, support them. So even if you are not interested, do not be a hindrance to others. That applies to Abacus as well. Even if you are not interested in its activities, do not discourage your friends who spend time to keep it alive. Support them.

If you remember a year earlier, you’ll know that most of us made fun of Shalin Jain saying that he was boasting. But now I realize he was giving us the best advice that he could, telling us about something that he did and was doing. He was a role model and he was definitely the person who made a major milestone in my life.

This is what I wanted to tell you. I hope you’ve been able to grasp it. If not, this is not the end, feel free to mail or call me if ever you find that you’ve stumbled upon your passion. I’ll help you work it out.

So enjoy your college life. I sincerely say that no one could have asked for a better bunch of juniors. All of you have given me the strength and courage to face life’s challenges. Many of you, I know personally. Anand, Ashiq, Aravind, Vasudev, Nithin, Ranjith, Ajay, Manosh, Harikrishnan, Jijo, Jibin, Sruthi, Aparna, Aaliya, Sreelekshmi, Hari, Sree Hari, Anjana, Suhaira, Ajumal, Charu, Aksin, Arun, Shyam, Divya… I’m not going to forget any of these guys in a hurry. So keep rocking and all the best!

—————————–

I guess that sums up my farewell speech. I had timed it for ten minutes. However I’ve made it a bit elaborate in my writing. As always, take what you feel is good. But don’t dump the rest. If you think some of what I said was not right, then try to understand why I said it and try to see it from that perspective.

Cheers guys!

Farewell.

The juniors did it. In spite of the pessimistic HOD as well as the ever in-favorable circumstances of our department, our juniors managed to give us a farewell. I’m not going to make this post long by going into all the tiny weeny details, but I’m just going to say that one couldn’t ask for a more wonderful bunch of juniors.

People coming together is always nice and I hope this goes on.  Anand, Vasudev, Jijo, Ashik, Ranjith, Nithin, to mention few of the names. Many more are there who have given me the strength and support to enjoy as well as learn a lot during my last year at college.

By the way, today I got my first ever trophy in my entire life and it was written on it, “Haris Ibrahim K. V. – A constant support and a helpful guide”.

All is well that ends well. 🙂