OnSwipe redirect code

Sunday, May 13, 2007

Open Source - Use and Contribute

Open source software is one of the classic concepts in the field of software development and computer science in general. The best part of this way of software development is freedom to have your own version of anything that you like, we can start developing any of our favorite applications and this development can start at the very moment when we determine to do. And this development will teach us things that most of the classrooms or several of the books can't teach. Of course there are several other bonus profits like many of the open source softwares giving freedom in terms of money also. And another awesome thing is the ultimate community support that any interested guy would get.

But its very sickening to know that such a beautiful concept is not properly known by a majority of my fellow classmates and other students of my college. The first and probably the only thing that comes to mind when FOSS is mentioned is that the software or the application is freely available for download. The development and learning part is no where in sight. In many cases having a version/flavor of Linux Installed and running it is a big thing. Running it very often for non-programming things like listening to songs or watching videos or movies is really a godly thing. But those very few who do that know the fun and the simplicity involved.

Anyways that apart, there are some greener patches also. There are many intelligent people out here who have understood the basics pretty well and are very much capable of doing a proper software development. But unfortunately they do not know the ways to contribute thought they want to. Most of the open source applications have massive code bases and freshers generally get lost into that and eventually lose interest when they are unable to figure out ways. And this blog post tries to address this issue. I recently got into open source development and I hope to continue forever. Now I will try and put in ways to get started based on what I have tried and understood. So here it is, The path for new open source developers.

If you want to do proper software development then either you can develop your own application right from scratch or get involved with one of the several wonderful applications already being developed.

The first one is pretty difficult. Many a times people start with development of new applications but fail due to lack of support. An application built by a single person does not become a really useful application. I have myself seen several NEW Open source stopping at pre v1.0 and just hanging at a point where it is not really useful. This happens with most of the new projects unless its a totally revolutionary idea, in which case you will get a good community following and eventually good developers also. But that is a total different ball game. Here I would like to talk about the second case - Getting involved with one of the several big things already going on in the OSS community.

There are a lot of stable open source communities with you which you can start your work. One good place to look for the list of such communities is the Google Summer of Code homepage. Once you start exploring you will surely find many more. Now the steps to poke your nose:

1) Get used to the application first. Use the application and explore the various things that it provides.

2) Familiarize yourself with the community. Generally they have a dedicated IRC channel on Freenode network. (Check out my other blog entry for using IRC). Go and hang around in that channel. Or find out if they have got a mailing list and if yes then subscribe for that. Look at the forums. Interact there. Watch out for the people and the discussions that go on. Ask sensible doubts at times. Make yourself identified in the community.

3)Along with this ask those people for resources to get to know more about the application. Use those resources appropriately and understand the working of the application.

4) Look at the bugs and the feature request listing for the application. (Popular applications will have plenty of both). Try and learn more about the issues causing the bugs or lack of a particular feature.

5) The best place to start actually contributing is probably bug fixing. Because not all can start with major feature additions and all that stuff. Bug fixing will narrow down your problem to a very specific thing and hence as a fresher you will not be scared at the various things associated which you encounter when doing feature addition.

6) Once you start your work with bug fixing you will understand a lot of intricate details of the application and also get excited at the amazing things. You will meet the core developers (whom you probably had just heard about or the pictures of whom were printed in a technical magazine.. cool.. ah).

There you are, An Open source contributor. You have formally started developing applications.

After the bug fixes you will be well known in the community and developers will probably start delegating work to you. If not you can probe them and offer to work on something that they need. And it will go on.

All along this PERSISTENCE is the only challenging thing. Never ever lose hope and never ever be afraid of starting. Your mistakes are not going to cost you much. So just get in, but with appropriate tools and attitude. Because the incompetent can't have a place and those lacking passion are not given a place.

Thats the end of the story and the theory part. Get to the practicals and give back something to the open source community which has given you and the world so many things.

"Happy Hacking"

Saturday, May 12, 2007

Using IRC : The one place for answers to all questions

Encyclopedia is said to contain answers to almost all the questions, but many people are unaware of another place which is hell lot faster and much more lively than any encyclopedia. You find answer to almost any damn thing under the sky. Your doubts are cleared. You are not only given answers but also tools to find answers yourself and also techniques to learn and create such tools(only if you are proven worthy of it - which is really not a big thing).

This is Internet Relay Chat, better known as IRC.

You can use IRC through various networks hosted on few servers each having many channels. But few are as described above and those are networks dedicated for technical discussions and this post is about using such networks.

The very purpose of writing this post is the lack of knowledge of IRC amongst the majority of students in my engineering college. Students here can't get answers for their questions when the doubts arise, because of which the search for the solution is postponed and postponed things never actually happen. The doubt remains a doubt forever.

Apart from this, the exposure to Open source is very very bad. And in my opinion IRC would fill in this gap. So here are the details of using IRC (and a few tips).

A known analogy to understand what IRC is.

IRC is something similar to Yahoo Chat.

For using Y! chat you log on to the Yahoo server using a client, which is the Y! messenger. In a similar way for using IRC chat you need to log on to an IRC server using a client. But unlike Y! here you have a lot of clients available and you can choose(the open source power) any client that you want. Here is something that can help you.

Your Y! email-id is your identity on Y! chat. And here it will be your nickname. You will be noticed based on your nickname. So you choose a good one and maintain that same nick.

Just like you register the first time you login for Y! chat you got to register your nick. Its much simpler here. No form filling and such redundant stuff. Unless somebody has already picked up your nick you can start off using it right away. As it is obvious you will get a password which you will provide for further logins.

Once you login in Y! you would probably choose a chat room. Analogous to these chat rooms we have channels here. As you have channels like Hobbies, Romance, TeenChat we have channels like #C, #kernel, #slackware and many many more. There are channels for almost all of the open source stuff. You can choose any of the channels. You can be in multiple channels simultaneously. Channel discipline is very important. You discuss only C in #C, not even C++.

Once you are in a channel you will see the list of people who are in that channel just like you see the list of people in a chat room. Different clients provide this in different ways. Certain GUI based clients have a separate tab where as console based clients expect you to use a command to give you that list.

You can now start interacting with the people in the channel. Ask your questions and if it is a proper one and people there know the answers you will get instantaneous replies. You can have private chats also but that is not really encouraged as many others will lose the conversation that you will have. It might have been useful to someone else also and may be if there were errors a better person would have corrected you. (Its Open source.. remember that)

Thats for the analogy. Now about how to actually do all this.

1) Selecting a client.

The link above presents you with several clients. I would suggest these.

For Linux
Irssi - A console(text only) based client. It really does its job very well.
Kopete - The default KDE multi-protocol communication client. Its beautiful.
GAIM - A GUI client. For those who can't take their hands off of the mouse.
X-Chat- Ok to use.

For Windows

HydraIRC - A real good open source client. Has many features.

Cross-Platform
ChatZilla - A firefox extension. Its really cool man. The notifications are the best part of this one. This would be the best option unless you are command line freak, in which case you can use Irssi.

Download and install any one of these clients and run it.

2)Selecting a Network

As I said the developers (or the Gurus) are distributed across few useful ones amongst the several networks. Here they are.

Freenode - irc.freenode.net - The most comprehensive server. Encompasses almost everything.
Moznet - irc.mozilla.org - The mozilla developers network. One of the best place for web related stuff.
GimpNet - irc.gimp.org - As it says, for gimp related discussions.

To connect to any of these servers use this command

/server server name [port no [password nickname]]

Port no is generally 6667.
In IRC a statement starting with "/" is considered as a command.


DO NOT LOG ON TO IRC AS ROOT USER OR ADMINISTRATOR(in case of windows). USE A SUBSIDIARY ACCOUNT


So to join freenode network you would do this:

/connect irc.freenode.net 6667 password nickname

Initially you will not have a password so leave that and the nickname field empty. Your username will be taken up as your nickname. You can change that later. You will get a notification when you are connected and logged on.

On GUI based servers you can use the buttons and menus to connect. Like in HydraIRC you can press Ctrl+S to bring up a dialog to select server and enter your nick and password.

3) Registering your nickname

To register your nickname you have to contact a bot called NickServ (Nickname Server).
/msg NickServ HELP REGISTER
would tell you how to register.
You can change your nick using the "nick" command.
/nick new nick

For further logins you don't have to register, you just need to IDENTIFY yourself.
/msg NickServ HELP IDENTIFY
would tell you how to do that.

4) Joining a channel

To join a channel use this "join" command

/join #channel name


Every channel name starts with a '#'. So to join the C channel on the freenode server that you just logged on to you would do this.

/join ##c

There you are. You can start chatting or rather interacting.

Certain Tips:

1) Use English and proper English.
2) No slang or SMS type language.
3) Always google out your queries before asking it at IRC. They will help you only if you show to them you have indeed done some work. No spoon feeding.
4) Two most common abbreviations
--- STFW - Search the F*****g Web -- Means google it out.
--- RTFM - Read the F*****g Manual -- Read the man pages or related documentation.

When these are told, they really mean them. So watch out for these.

Thats it. Just go in and have fun.

Sunday, May 6, 2007

Thinking C: Behaviour - - Undefined or Unspecified?

C has been my cherished programming language right from the time I was hooked up with computer engineering and I still love.

Now here is discussion and a concept that I recently got to know through a discussion in IRC. ( server: irc.freenode.net channel: ##C).

I was aware of the concept of sequnece points and undefined behaviour in C. But it was during this discussion that I got to know about the Unspecified Behaviour.

Generally both Unspecified and Undefined behaviour occur because of the side effects not being cleard off until a sequence point is reached.

In case of Undefined behaviour nothing is mentioned about that kind of situation in the C standards. The implementors are free to do anything for those situations. They can simply leave it unimplementd or they may just flash up an error or they may follow there own conventions regarding that. We ll, in no position, be able to predict the behaviour and hence the name.

Eg: int a[10],i;
/* The array a is filled with some values */
a[i]=i++;

In case of Unspecified Behaviour the C standards give certain options to handle the situation. The implementors are expected to follow any of those options. Unlike undefined behaviour they donot have complete freedom. They have freedom of choice. Hence the behaviour of a code being classified as Unspecified can be predicted on a particular compiler on a particular platform.

Eg: int a=5;
a=scanf("%d",&a) + a;

Here we are not sure whether the scanf is first executed or the second operand a is first evaluated. Hence the Unspecified behaviour.