"A little progress everyday adds up to big results"

Tuesday, 29 May 2012

Our first fellowship story

Confused?
                     One might wonder seeing the title, why I have used 'our' instead of 'my'. Because, Vignesh Jagadeesan, one of my best friends, and me applied for the fellowship together. This article will explain the problems that we faced for our first fellowship.

Preparation:
                     It was the time, when we were just back from International Collegiate Programming Contest Regionals ( ICPC-2012 )  held at Amrita University, Coimbatore during December 2011. We just saw the data to be filled in the application form for the Indian Academy of Sciences ( IAS ) fellowship. Mr. K. Saravanan, my class councellor and Ms. Theetchanya, Vignesh's class councellor helped us for applying to this fellowship. Everything else in the application form, except the list of (5) guides preferred and statement of interest, were easily fillable by us. 

Statement of interest:
                    So, we approached my HOD, Dr. J. Akilandeswari for preparing the statement of interest. She helped us and initially we chose 'Opinion Mining' and had prepared the report. HOD had thought that the fellowship is a team one. But, later when she realized that it's individual, she asked one of us to choose different topic. So, I prepared a report on 'Social Network analysis' ( Finding Similar Users in Facebook ). We have applied for it On-line ( with very less hope ) after getting recommendation letter from corresponding HODs.

Problem with post:
                     Both of us, posted the On-line filled application form, together, on 2nd January, 2012 ( my birthday ). But, Vignesh's post had reached them whereas mine had not. This is still a miracle. On tracking the post, the status was delivered. But, then, I kept on getting remainder emails from the academy to post the application form. So, I got signature in all the required forms from my HOD and resent it.

Selection:
                   Days rolled over and we weren't watching for the selection curiously. We also applied for fellowship at IIT-Delhi. After 3 days of applying to IIT-Delhi fellowship, on March 1st, my department was in the symposium mood which was to be held on the next day. Vinoth Kumar, one of my best friends, was practicing for his dance and I was with him. Unexpectedly, I got a mail alert on my mobile with from address pointing to the academy mail. With much curiosity, I checked mail from Vinoth's laptop and on seeing it I called Vignesh and called him to check the mail. He checked and obviously, he was also selected.

Guides:
                  Vignesh's guide was Prof. Sushmita Mitra, ISI, Kolkata and
                  my guide was Dr. Kishore S. Prahallad, IIIT, Hyderabad.

Happiness:
                  Immediately we told both the HODs. They were really happy. We thought that we have to go to Bangalore for fellowship and our guides will also come there. I went home fearing whether or not my mother will allow me for it. But, she wasn't there when I went home. I went through the mail in depth and realized that we must go to the respective locations of our guides. When my mom came home after 8pm or so, I told her. To my surprise, she accepted and also Dr. Dhanalakshmi ( Homeopathic doctor ) who was residing opposite to my house also asked my mom to send me.

Mother's meeting with HOD:
                  Though my mother had accepted, she had a doubt whether it would be useful or not. I asked her to come and clarify it with HOD. But, then trusting me, she said that it was not necessary. One day, I applied for passport in college. I left out 10th mark list in home and went. But, since, they asked it, I asked my father to bring. My mother brought it. I asked my mom to meet HOD. She did. HOD said that it would be useful and was a wonderful opportunity that one wouldn't easily get. My mother became confident.

Booking the train tickets:
                  As we would be leaving in summer vacation, we would not be able to get the train tickets, if we booked late. So, even before the announcement of time-table, we had to book tickets. Fortunately, when we were in chaos for more than an hour without knowing whom to ask, we happened to meet first year dean, Dr. K. Karunakaran. He gave the mobile number of deputy COE, Prof. S. Radjarejesri. We called her and she told that all the exams would be over by 10th of May. So, we booked the train tickets for the respective destinations. 

The Great Mind Challenge:
               Vignesh and I were doing an IBM project for a web-design contest titled 'The Great Mind Challenge' at that time along with 2 more friends. But, since we wouldn't be able to complete the project, we completed only the design part and didn't do database connectivity. 

Mini-project evaluation:
              I had to do a mini-project with two of my friends ( Ramki and Sasidharan ) for which 2 credits are allotted during the fourth semester and the evaluation dates ( June 11 & 12 ) had been fixed as soon as the college reopens ( June 11 ). So, I asked my HOD, whether anything could be done. But, then, since her reply was in negative, I booked train tickets to come back to Salem on June 10th and return back to Hyderabad for fellowship on July 11th, after confirming to my guide whether the break is acceptable.

Special Interest evaluation:
            Later we came to know that the special interest ( which had no credits, yet cleared/not cleared was based on it ) evaluation, which is common for all departments, is also going to be conducted after the reopening of the college ( June 15th and 16 ). Upon requesting, my HOD asked principal and COE, to reschedule the entire evaluation dates on June 13th and 14th just for me ! ( since I will be here for mini-project evaluation on June 11th ). So, again I booked the train ticket to return to Hyderabad on July 14th. Though I felt, that it was okay, I felt really bad about Vignesh's situation as he had to come all the way from Kolkata ( via Chennai ) which would take around one week ( for his arrival, evaluation and departure ). Even he booked the train tickets for his return and departure to Kolkata.

An unexpected turning point:
           During the study holidays, Vignesh's class councellor, Ms. Theetchanya, who helped us a lot in applying for the fellowship, called me and asked to tell Vignesh that the Special Interest evaluation had been postponed to some other date. As the college reopening date had been postponed to June 18th, the mini-project evaluation was postponed to June 19th and 20th whereas special interest evaluation was postponed to June 21st and 22nd. We felt too bad. I called my microprocessor sir, Mr. Ilanchezian, who was also working as Assistant COE, and conveyed our situation. I just told him the situation ! He had requested Deputy COE, to advance both the mini-project and special interest evaluations for both of us before we leave Salem for our fellowship ! We felt really happy and canceled the unwanted tickets. Vignesh and I had successfully completed the evaluations and then, departed to Kolkata and Hyderabad respectively, for our fellowship.

People whom we should thank:
            During that period, a lot of people helped us both directly and indirectly. Here I am listing the people who helped us a lot for our fellowship and without whom, our fellowship could not have been peaceful.
Dr. J. Akilandeswari,
Dr. B. Sathyabama,
Dr. B. Saravanen,
Dr. K. Karunakaran,
Ms. Theetchanya,
Mr. K. Saravanan,
Mr. P. Ilanchezian

"Apart from these, we faced some more problems, which I am unable to post publicly".

My coding conventions

                                  When I started programming, I didn't follow any conventions in naming the variables and functions. But, as days passed by, I started using standard conventions for naming. The naming conventions I use for programming are

class - Every word in title case - standard Java convention

method - Every word except the first one in title case - standard Java convention

variable - Every word in lower case, each word separated by an underscore '_'

non-final, non-static, member variable - Every word in lower case, each word separated by an underscore '_' and prefixed with 'm_'

non-final, static, member variable - Every word in lower case, each word separated by an underscore '_' and prefixed with 's_'

final variables - Every word in upper case, each word separated by an underscore '_'

Other conventions used by me:
Task pending - // TODO: - Convention followed by Eclipse IDE

Optimization possible - //::

Test code which has to be removed later - surrounded by lines // TEST //

My programming journey

Before starting to learn programming:
                                  I started programming ( of course 'C' )  in late 2009, when I was studying in my 11th standard. Before I was taught programming, I just went through the text book ( two volumes for Computer Science and C was in the second volume ) given to us. In the exercises part of the 'C' lesson, I saw a numerous problems ( to convert Fahrenheit to Celsius, to find the number of days between two dates, to find the perfect number, etc ). As Computer is not a subject in school days ( though I had studied Computer during my 8th standard in Matriculation ), I was wondered to see those problems and was admired how one could solve them.

Initial programming classes:
                                   Later, the most awaited day came. We were taught C. But, then, initially we were taught the history of C and then theoretical parts like keywords, tokens, etc. Then, we were taught how to program. At this point, I must thank my Computer Teacher Mr. Yuvaraj. Initially I was very blank.

A program written on a paper:
                                   Then, my cousin ( Ms. Usha ) got married to Mr. Shivaraman. He asked me to write a simple program which calculates the total, average, result, etc of a 10th student. It was the time when there was no system in my house. I tried to write that program in a notebook. It went to 2 or 3 pages. After that, one day, I went to my cousin's ( Mr. Kannan ) house and typed that program by seeing the notebook ( and it was the time, I didn't know typing ). I searched for every letter and typed. I didn't compile the program, till I finish typing the entire code.
                          
Type-over mode and compile-time errors:
                                   Moreover, the cursor was in 'Type-over' mode. I didn't know how to correct it. If I had left any line, I typed everything once again starting from that line. After I completed typing the entire code, I compiled. I got 25 errors ( Turbo C compiler ). I couldn't trace out the problem and I left it on that day.

Run-time errors:
                                  Later, in school, when I was telling this story, my friend , Vikram, told that it was not 'studio.h' and it's 'stdio.h'. Then, I changed it, some one or two errors were there. After I correct, I ran it. But, the results produced were not as expected. I checked all the conditions. When I asked for help from my cousin ( Mr. Kannan ), he gave me a program and asked me to use it. But then, I was not completely satisfied. I came to know that I had missed '&' in scanf statements. Then, I started learning programming little by little.

                                And later, I learned C++ in 12th. Again C was taught in 1st and 2nd semesters. C++ in depth in 3rd semester. I must thank Mr. K. Saravanan and Mr. S. Lakshmanan for making me understand the coding concepts deeper. I learned Java during my 4th semester on my own and at the end of second year, during my fellowship, I started developing android applications.
                                  

Monday, 28 May 2012

நடப்பதெல்லாம் நன்மைக்கே !

ஒரு நாள் ஒரு அரசர் தன் அமைச்சர்களுள் ஒருவரை அழைத்துக்கொண்டு காட்டிற்குச்  சென்றார். அந்த அமைச்சர் எப்பொழுதும் 'நடப்பதெல்லாம் நன்மைக்கே' என்னும் எண்ணம் கொண்டவர். காட்டில் சற்று நேரம் இளைப்பாற அவர்கள் ஒரு மரத்தடியில் அமர்ந்தனர். அரசர் ஒரு மாம்பழத்தை ருசிக்க அதனை அறுக்கும்போது தவறுதலாக கை விரலை அறுத்துக்கொண்டார். அமைச்சர் 'நடப்பதெல்லாம் நன்மைக்கே' என்றார்.

மன்னருக்கு கோவம் வரவே மறுநாள் அந்த அமைச்சரை சிறையிலிட்டு தனியே காட்டிற்குச் சென்றார். அப்போது சில காட்டு மிராண்டிகள் அவரை சிறை பிடித்து கொல்ல முயற்சித்தனர். ஆனால் அவர்கள் உடலில் காயம் உள்ளவர்களை கொல்ல மாட்டார்கள். அரசனின் கையில் விரல் அடியைப் பார்த்தவுடன் அவரை விடுவித்தனர்.

உடனே அரசர் அரண்மனைக்குச் சென்று அமைச்சரை விடுவித்து நடந்ததைக் கூறியதுடன் நன்றியும் கூறினார். மன்னர் மன்னிப்பு கேட்டபொழுது அமைச்சர் 'தாங்கள் என்னை சிறையிலடைத்தடும் நன்மைக்கே' என்றார். எவ்வாறு என்று வினவிய அரசரிடம், தான் வந்திருந்தால் அந்த காட்டு மிராண்டிகள் தன்னை கொன்றிருப்பரகள் என்று விளக்கினார். 

மன்னரும் மட்டற்ற மகிழ்ச்சியுடன் 'நடப்பதெல்லாம் நன்மைக்கே' என உணர்ந்தார்.

Sunday, 27 May 2012

Me as a part of power cut

I was developing 'Speaker Recognizer' application for android as my fellowship project at IIIT, Hyderabad. It was the time when power cut was a major problem in Tamil Nadu as well as in Andhra Pradesh. Students working in my guide's ( Dr. Kishore S. Prahallad ) laboratory used to just turn off the monitor and leave every day ( without shutting down the system ). But, I used to shutdown everyday.

Due to some reason, my monitor contents were shaking on every boot ( even after replacing the monitor ). Though it was corrected after restarting several times, it suck nearly one and half hours every day. I was very interested in developing the app and so, I had no other go. I had to turn off the monitor and leave the lab every day.

I felt very bad for being a part of power scarcity.

Android: NullPointerException with findViewById

I was developing an android application for 'Speaker Recognition' at IIIT, Hyderabad under the guidance of Dr. Kishore S. Prahallad as my fellowship project. I was very new to the android development ( approximately one and half weeks ).

I had a scenario where, I had to show a custom toast with differing text when the Name field is empty or the name entered is existing. I wrote a function as follows and called it with the resource ids from R class. The application crashed unexpectedly on running.

    private void notifyError(int id)
    {
    LayoutInflater in = getLayoutInflater() ;
    View layout = in.inflate(R.layout.toast_layout, (ViewGroup) findViewById ( R.id.toast_layout_root ) ) ;
   
    ImageView im = ( ImageView ) findViewById ( R.id.image ) ;
    im.setImageResource(R.drawable.warning) ;
   
    TextView warn = ( TextView ) findViewById ( R.id.message ) ;
    warn.setText ( id ) ;
   
    Toast toast = new Toast ( getApplicationContext() ) ;
    toast.setView(layout) ;
    toast.setGravity(Gravity.CENTER, 0, 0) ;
    toast.setDuration(Toast.LENGTH_SHORT) ;
    toast.show() ;
    }

When I debugged, I found that null is being assigned to the im and warn objects. But, couldn't know what was the problem. I google it for about 3 hours, but of no use. Later on having a closer look, I found out, View.findViewById() is different from Activity.findViewById(). So, I changed the code to:

    ImageView im = ( ImageView ) layout.findViewById ( R.id.image ) ;
    im.setImageResource(R.drawable.warning) ;
   
    TextView warn = ( TextView ) layout.findViewById ( R.id.message ) ;
    warn.setText ( id ) ;

And then, it worked.