exebit

This is a post publicizing exebit, the computer science department festival of IIT Madras. It will be conducted in the month of February next year. As I am one of the cores for the event, the web-ops core, I am posting this blog.

header_black

The first event was held this february and there was a decent turn-up for all talks and events. This year it is expected to be much bigger.

Here are a list of events that will be held in exebit.

Online events

Onsite events
Huge cash prizes will be given away for all the events. The description for the events can be found in the links. For more information about exebit visit http://www.exebit.org
Last year had big sponsors like nvdia, mac, maples, Ericcson, cadence … sposoring it. The events last year included
Online events
Onsite events
Hope exebit is going to be a big success this time. The cores for exebit are striving hard for that.

Coding@Shaastra2009

I am back after 2 months. This post is about the various coding events at Shaastra 2009. There were 6 of them, I took part in 5 out of 6 as I could not participate in Search 3.0.

First on the list is Frugal. A competition that was supposed to require minimal knowledge of coding and algorithms. The participants were expected to solve problems like finding square roots of a long long integer without using multiplication, division and bit shifting. Quite easy a n00b would say but all that 10000 times, in 1 second, no n00b can achieve that. After a whole day of coding I managed to submit 3 problems successfully. I did attempt 2 more problems but got small errors which I couldn’t fix in time. I finished at the 9th position, sadly no consolation prizes :(.

Here is some code that I wrote. No divisions or multiplications, calculates sqr root of a long int :-
The code is supposed to be as short as possible, have as few key words, semicolons, commas as required, should include only stdio.h and worst of all, should be written only in C.

frugal

I was one of the coordinators for HackFest. It was a non-competition hands on event. It was one of the biggest successes this Shaastra. It had two speeches, one by Atul Chitnis on FOSS and technology and the other by Shreyas Shrinivasan on FOSS Foundry on the first day of Shaastra. The two above speeches were targeted at a general audience with little knowledge on the open source world. It was supposed to kick start people who were ambitious to get into the world of FOSS.

In the evening were lighting talks by the pro-hackers at hackFest. The organizations that were invited included the linux kernel, firefox, KDE, GNOME, sugar and FFmpeg. In the night people hacked the software that they had chosen. The hacking nights were scheduled to start at 10:00 but we started it at 9:30 and taught people about xchat and the IRC. A lot of unregistered participants turned up and had to be allotted to the organizations that were free.

The three kernel hackers where the most enthusiastic people in hackfest. They taught the students from the basics and gave out free T-shirts for people who answered questions. They retained their enthusiasm till 5:00 in the morning consuming just 1 expresso shot somewhere in the midnight.

Firefox hacking was done by sid0 from IITK, he used jet-pack to help people create their own add-on which checks for unread messages in gmail. Gnome and KDE hacking brought up some potential contributors. Around 5 patches were submitted in Gnome and KDE. Vimzard took care of GNOME hacking and KDE was taken care by kstar, praaksh and yours truly. I made people create basic Qt applications, the other two took care of building KDE and hacking KStars a desktop planetorium software. Other organisations like FFmpeg and Sugar were also hacked.

The next event, the OPC was what I felt was one of the most challenging programming contests I have ever seen. It was tougher than google code jam round 1 or the ACM ICPC and the questions were tougher than most problems in spoj, Euler, uva and usaco. I teamed up with friends Garimella and RajKishan. We got the algorithms for a couple of problems. We actually solved one of them. The problem called power. At the end we stood at position 25. Sadly again, no consolation prizes.

opc

The next contest was polyglot. We had to write a single file program that would get compiled by different compilers successfully. There were a lot of languages which we could use. We solved 7 out of 8. Unfortunately we had trailing white-spaces in a few of our solutions so only 3 were considered to be correct. We won the 3rd prize at the end (team rocket Kashyap R Puranik and RajKishan G).

Here is a program I wrote that prints POLYGLOT in C++, python, perl, brainf**k and ruby.

polyglot

Here is a program we wrote that reverses a string in 3 languages. python, brainf**k and C++

polyglot1

As I said, I couldn’t participate in search 3.0 which was the most generous among the events, gaving out 25K to 3 people.

Simulation Championship was a great contest where the coordinators had selected 16 teams for the finals. 6 teams for Ant colony simulation, 5 each for Rescue bot and Viral marketing. Me an Rajoo decided to attempt both the ant simulation and the rescue bot problem statements.

We used Qt and C++ for both the problem statements, we did not have time to finish the rescue bot program. Our entry won the first prize for the ant simulation problem statement. Here are some screen shots of the same.

simC

Here you can see the trails left behind by ants, and you can see some ants following the food source.

simC1

Here is a picture of the rescue bots UI we made.

simC2

Kalzium-GSoC-2

Hi everyone,

I am updating my blog again. This time I have added the molecular mass Calculator. I have merged my work in the kalzium branch back to the trunk. I have changed a few files from libkdeedu/libscience for this.
After attempting to use the Gnome Chemical utils in vain, I used the calculator already present in Kalzium and improvised it.
Here are a few screenshots of the molecular mass calculator.

Screenshot

The calculator displays molecular mass and composition of the compound you input.

I have entered the formula CaSO4 (Calcuim Sulfate) here. I get the molecular mass as 136. I get the percentages of the elements too.

Screenshot-2

I have also used the idea of aliases for example Me ( Methyl group ) = CH3 and Et ( Ethyl group ) = C2H5 and so on.

In the following case, I have entered the compound toluene, which is Me-Ph which expands to ( CH3 ) ( C6H5 ).

molcal

We can also add our own aliases. Use the aliases tab of the molecular mass calculator widget, add a valid alias.
The picture shows default aliases that are available. I haven’t added many though.

Screenshot-1

Kalzium-GSoC

I am making this post after 1.5 months after beginning my GSoC project and exactly 1 month after its official commencement.  I have basically completed most of the work that I had planned. I have finished 3 calculator widgets and added them to the calculator widget along with the mass Calculator and the equation balancer which were already present.

Here are some screenshots where I have used the various calculators to solve a simple chemistry problem. (The problem is intentionally made very simple to attract a larger audience.)

Consider the following question :-

(Sodium Carbonate)Na2 CO3 on reacting with (HydroChloric acid) HCl gives

(Common Salt) NaCl and (Carbon Dioxide) CO2 and (water)H20.

If 1 mole of Sodium Carbonate is consumed, find the volume of Carbon Dioxide that is released at 1 atmosphere and 273 K. ( Assume CO2 is ideal.)

If a solution of common salt occupies 1 liter. What is its concentration of common salt if 117 grams are added..

The first step would be to balance the equation using the equation balancer in kalzium. ( The usage of this widget involves typing the equation in the form

eqn

! mole of Sodium Carbonate produces 1 mole of Carbon Dioxide and 1 mole of Salt.

Next step would be to calculate the molecular mass of Carbon Dioxide. (The usage of this widget is trivial, just enter the formula get the results)

CO2

Next we use the gas Calculator to find out the volume occupied by CO2 at the given conditions.

gas

( Usage of the widget : seleect what you want to calculate using the radio button eg. volume, then enter required and relevant data. Not everything is compulsary. Select among the many units that are present)

Vand der Vaals constants have been set to zero because the gas is considered ideal. We get the volume of Carbon Dioxide.

We now use the concentration Calculator to calculate the concentration of the solution. First calculate its molecular mass.

NaCl

Now for the concentration.

conc

(Usage: specify all the data you have, not all are compulsary, eg density is unnecessary. You can select the way in which you specify amount (mass / volume / moles) You can specify a number of relevant units.)

There is also a nuclear Calculator that can answer questions simillar to the following one.

If initially 4 grams of Uranium-235 are present, after what amount of time will it reduce to 2 grams. ( Again the question is too simple but the calculator can do better problems.)

nuke

( Usage: select time from the radio buttons to calculate time. enter other data (initial and final amounts), selecting Uranium 235 automatically gets the halfLife from kalzium data. Thus we get the time required.)

You can also calculate final / initial amounts. You can specify time in halfLives using the slider which can vary from 0 to 10 half-lives.

I have gone through the plasma API FAQ and I have after some difficulty created plasmoid widgets for the same. These widgets are more difficult compared to the Qt ones because there is no equivalent of the awesome “Qt designer” for Plasma although it will be out soon.

The following is a plasmoid for the nuclear Calculator mentioned above. Looks cool doesn’t it?

nuke1

Apart from that, I tried to use the Gnome Chemistry Utils library and create a new library called freeChem but it failed because, it wasn’t very easy to eliminate GTK from the code and put Qt instead. Now I plan to use the files in Kalzium itself to complete the molecular mass calculator.

Please feel free to ask any questions regarding the functioning / layout / ease of use of these widgets. Any suggestions are welcome. I have time for more Chemical calculators. If you have any ideas so comment.

20 days into SoC

21th April 2009 00:40, that was when my SoC results were announced. Because of the net cuts in my hostel after 11:59 PM, we are forced to turn off our computers and go to sleep. (Well they are trying) I had to go all the way to my Department Computing Facilities to find out my results. In the darkness of the night I slowly cycled and went to the DCF.  People like Akarsh Simha (kstar) felt I would obviously get in, but for me it was butterflies in the stomach as usual. It felt more like frogs in my stomach because what was about to be announced was a really big thing in my life. At 12:45 I some how managed to get into the site despite all its internal server errors and finally got to see a new link that wasn’t there before saying ‘student projects’. I quickly clicked on it to find out what it was about, and there came another 500. My friend Virus ( SuryaKiran ) messaged me and congratulated me, only then I felt relieved. I waited there for another 15 minutes patiently and found out that it was my application for the molecular calculator project that had been accepted. And now 22 days after the unofficial start of my project ( 9 days after the official start ), I am making this post to brief about my progress.

Now to get technical, I started off with the design of the user interface of the various calculator widgets. The current user interface file can be found in the kde branches at http://websvn.kde.org/branches/kalzium/gsoc2009/kalzium/src/calculator/ along with the other files that I have created. The user interface was done using the Qt designer / Qt creator. The design is simillar to the kstars calculator design which consists of a single calculator main widget that loads all the different calculators and shows them on selection. The design is not yet complete and can be further improved; please feel free to comment.

After that I started writing the classes for the various calculators. I have written the nuclear Calculator, gas Calculator and the concentration Calculators (sources in the above link ). I had to use the unit conversion library for the same. I found it really tough as an amateur noob to use a library without having any reference  / documentation about it. I gradually figured it out through some little help I received in the IRC. A person in the kde-devel channel showed me how to fix the problems I had with the CmakeLists.txt to include the library. I still did not know how to use the library.  Not a single page could I find after hours of search. I finally got the author’s name and started googling the name. I found his blog here but it was of no use as it had only descriptions of the unit conversion widget and not the library. Only this mail with just one line of info managed to teach me, how to use the library. I managed to finish of the calculators last week with unit conversion. Any new tabs that you would like to see in the calculator, please go ahead and make a request.

I have now begun my second phase, the plasma phase. I managed to create the hello world plasmoid widget using python, and now even as I write, am trying to make it work in C++. Not even in my worst night-mares had I realised it would take this long. Python hello world was like copying a couple of files from the tutorial, zipping them using plasmapkg and directly running that using plasmoid viewer.
Although C++ version is also easy, I have been facing a lot of difficulty. Firstly I faced an error during compilation saying “libphonon not found”. When I installed it ( sudo apt get ) everything worked, and now I have segmentation faults with no backtraces. After several hours of loafing around in the kde-devel/plasma channels disguised as n00b_max, I have found out the problems. I am now downloading the entire kdelibs / pimlibs / support etc, will build it and try to eliminate the segfault.