Tuesday 29 May 2012

Coding Week 1: Roller Coaster Ride,C++

Fun-filled and exciting Ride with c++

A roller coaster is a popular amusement ride  that turn the rider briefly upside down. Roller coaster are not self-powered rather run on mechanism of conservation of energy. Potential Energy by height is converted to Kinetic Energy and vice verse for the roller coaster ride.

Similar was my experience with the first week of coding thrilling. I was inclined toward choosing title as roller coaster ride. While coding there were areas where i had experience in coding and was working fairly easily and fast those area were enriching me with more of a kinetic energy to tackle grey area of difficulty and inexperience and obviously solving difficult one gave me potential energy to work even faster with easy coding areas.This shift of Potential and Kinetic energy is giving me experience of roller coaster ride.

What more fun one can ask for summers ??

Okay i must not forgot blog is primarily meant to share what i did with people interested in my work with less emphasis on how i felt.So here how i spent first coding week

This week i extending the prototype of UnigramLMWeight class build as a patch for GSOC Selection. four type of Smoothing was implemented with ability to api user to select the type of smoothing he wants. A
Brief  discussion on Smoothing techniques to be implemented took place and finally decision on implementing four smoothing scheme Dirichlet prior smoothing,Absolute Discount Smoothing,Jelinek Mercer Smoothing,Two Stage smoothing.

So Main task of week was to include smoothing in UnigramLMWeight Class and update prototype with technique discussed to handle negative value from log,Bounds for optimization,Ability to user to select type of smoothing used.

First i started with handling negative value of log,bounds for optimization which was pretty easy based on discussion on IRC and Mailing List.

Then another major task was to parameterize the constructor to provide user ability to select smoothing and parameter  to clamp negative value of log.Adding constructor is a fairly simple task and shouldn't have taken long for me to make them working.

But after implementing when i was looking at the constructor and trouble shooting them i found always default constructor is called what ever parameters i give.SO i tried around fiddling with parameter and with experience tried to make changes to parameter etc.But no luck always default was the final call and was stuck on the issue.Then i posted the question on Stackoverflow and discussion there came to know that when i make object of weight class and put it in set_weighting_method then weight object is clone and it calls the default constructor at last.

Then major hurdle i felt was about an  adding extra per document statistics in xapian architecture number of unique term in the document to be accessed in the Weight class. Initially i got confused in Rset and Mset and with discussion i tried getting this statistic in weightinternal class and we get document id there for Rset.But i needed it for Mset so whole implementation was wasted and had to reset to last commit and add the nouniqterm for document in database and make a new constructor for function get_sumpart for Weight class with extra per-document statistics.

Then Switching to Brass backend created some hurdles and i thought i would be something to disable chert while configuration and since chert is default Backend it created problems in disabling Chert . But believe what you just need to change namespace of open function to Brass:: while calling constructor for database and it will automatically start using Brass backend.

So this week working around some of these problem due to under-experienced in programming gave me fun-filled joy rides.

Hope i will catch up speed and cover-up lagging parts till end of next week.


About Crossing the entry barrier to World of FOSS


Yes, finally i started contributing to Free and Open Source Software.From long i had this urge to be one and contribute to open source software.But one of my pesky attributes "procrastination" pulled me from this worlds of bliss.Morosely same attribute delayed this blog post.

My entry barrier to FOSS
  For the first time i was having discussion on IRC and mailing list of organization and enjoying a lot.Then Olly  asked for a patch which i could show them and make them confident about my familiarity with Xapian and other tools.Bewildered as i was just in thoughts about making a patch and submitting but procrastinated it till then.So, i prepared my back and started working for the prototype of my implementation for UnigramLMWeight and as i believe once started nothing is difficult(if you have patience) worked on patch with full thrust and within less than 48 hour made a working patch and submitted to Xapian. Submission of patch gave me immense pleasure and joy.

 Overall i used to feel before in era of procastination that IRC discussion,Git,Patch,discussion for a open source tool were something out of league and used to maintain a distance with them but now i really enjoy them and feel used to.Applying for GSOC initself was a colossal learning experience, That i cannot find words for defining my learning experience as project progress. And really excited about more experience that come in this remaining coding period.
 
Motivation for working
 I was really doubtful about getting this project being novice and moreover maintaing distance from tool and ettiquette of Open source.But i feel reason for selection in GSOC was only that i maintained a spirit "I don't care about selection in GSOC,I just want do this project and will anyhow do it selected/rejected.So dont hesitate or be bewildered about things just do it in the wright way you think".



Overall i would really like to thank Xapian Community esp. Olly Betts for giving me chance to enter in world of FOSS and helping me constantly learn ettiquette of FOSS.Apart from Xapian Community would like to thank my special Prof. Prasenjit Majumder for Introducing me to Infromation retreival and really more than half of Credit for to him,All my firends who help,motivated me during Proposal stage Abhijeet,Ranveer,Khushboo di,Nitesh,Anurakt,kushal,swair,anna and many more.I was always on Door of Abhijeet and Ranveer with all boring task of reviewing mails and Proposal and they were mostly ready to review it with little resistance.

Having fun-filled and enjoyable Summer(Best Summer) with