HackerEarth Chapter: Month 1


Working at a startup is always exciting. Its even more fun at HackerEarth. I have been working at HackerEarth as an intern for 1 month now, and have 1 more month to go. Over the last month, I have learnt so many new things, learnt a lot of good practices to write maintainable code and had a great time here in Bangalore.

Although, my health was not quite good the previous month (Jan 2014), but the month was very productive. Vivek Prakash, the Co-Founder of HackerEarth has been guiding me all the way from Dec 27th, 2013 when I started with my internship.

My first two tasks were pretty simple. For the first task, I had to write a git hook, a pre-commit hook to check if Python files that are to be committed are free from syntax errors (easily done using python-lint), and the second task was implementing a countdown timer on the HackerEarth challenge page.

The third task was an exciting one. I had to implement the HackerEarth Analytics page. Initially, it took some time to get acquainted with their codebase, which was much bigger than I initially thought. But, within a few days, I knew what I had to do, and with immense support from Vivek, Sachin and Sayan, I was able to pull this off. The page consists of useful graphs (1 bar and 1 multiline graph) , some tables and a cohort analysis which depict user activity and behaviour on the HackerEarth website. I had to work hard on minimizing the database queries and make the task efficient as the user base is huge. I used d3.js to plot the graphs and the backend was done using  Python and Django.

For the next task, I had to learn what django middleware does. The task was simple enough, I had to log all the non-ajax requests into the database. This data would be extensively used to get important stats on the incoming and outgoing traffic through the HackerEarth website. Had to write custom django middleware to do the task.

That was my first month’s work at HackerEarth, and I have already started working on another task, implementing the HackerEarth Logging Framework, its almost done, in fact, I have plans to complete this in a few days. With 4 weeks left, I hope I can make the most out of this.

Here are some snapshots of the HackerEarth Analytics d3.js graphs and the cohort analysis table. I obviously had to blur the data. 🙂

This slideshow requires JavaScript.

Python Month workshop @ BCREC


PyCon India 2013 is celebrating this month of August as the Python Month. Colleges all over India are organizing python workshops in the occasion of this Python Month.

We are some students, who love python and love helping other students to learn. This Python Month appeared to be the perfect way to organize the python workshop.

The volunteers were  Avik Ghosh ,Subhendu Ghosh, Sudip Maji, Atish Kumar, Bodhiswattwa Tewari, Biraj Karmakar, Shantanu Sarkar, Sheesh Mohsin and myself.

The workshop started with a “WHY PYTHON” introductory speech by Avik Ghosh. Avik described why we should use python, how efficient it is and the scope of python in different fields of programming and other related stuff.

This was followed by the hands on workshop, conducted by me. The hands on workshop covered the basics of python.

We wanted this workshop to be exciting and wanted to show the participants some awesome real life applications of python.

So I wrote 5 small, yet interesting codes, which were:

1. Downloading a file (I made them download Kushal Das’s Python for You and Me book using python’s urllib module)

They were amazed to see the code was only two lines.

2. Posting a status in facebook ( using fbconsole)

3. Sending an email ( i used python smtplib to do this)

4. Downloading PyCon US 2013 videos from a python script.

5. A python crawler.

The crawler starts searching “pycon india” in google.com, loads the pycon india page, and clicks and ends up opening the python month page.

The participants were very excited on seeing the above codes and how small they were.  Heres the link to the codes: https://github.com/desouradeep/Python-Month-BCREC

Here is the link to the slides: https://slid.es/desouradeep/python-month-workshop-bcrec


Overall, the event was a success.

This slideshow requires JavaScript.

My first mozilla patch


Sometime in November last year, Sayan Chowdhury told me to find and fix bugs from the mozilla codebase. All he told me, was to google out the procedure (I couldnt do it then coz my laptop display was broken). When I finally fixed my laptop, I started to google on fixing bugs. Found out about the mozilla developer network in no time. The site was cool but, I had to read through a number of guides.

Finally, after a lot of reading, I came across the guide, “Contributing to the Mozilla codebase“. This guide was interesting and helped me find a bug right-away.  It provided me with some very helpful pages like whatcanidoformozilla.org and joshmatthews.net/bugsahoy/

Mozilla categorizes bugs as :

1. Mentored bugs, which are easy to solve
2. “Good” first bugs, which are a bit stale
3. Student Projects, which are as good as  a final year project

I took up a good first bug on the 12th of April, (this is the link), and started working on it. :whimboo was my mentor and others like :davehunt and :jfrench helped me while i was fixing the bug.

:whimboo gave me the link to the mozmill git repository, i cloned it onto my system, and started working off the master branch. Finally, when the code looked good, i made the commit, rebased it and made the patch. Now, since I didn’t have permissions to push to the master branch, I attached the patch on to the bug, and set the review flag as ?.

Finally, today,  when the patch looked good enough, :whimboo merged it to the master branch.

Link to my commit : https://github.com/mozilla/mozmill/commit/fd25d7252fc5f1d560438b1019e2b7f4ee32b5e4
Link to the bugzilla page : http://bugzilla.mozilla.org/show_bug.cgi?id=859589