Tuesday, December 22, 2015

Started with my first "real" django project

Django. I first saw it and used it when I went for my internship at IITB in the summer of 2015. I started with it, and learn pieces of info regarding web frameworks, and django. But I couldn't understand much, and after a while the internship came to an end.

Next time I used it when building a basic chat application, but it was too high a level for me, and I miserably failed in that too.

This time I have started with http://www.tangowithdjango.com and I would be making the web application with the design described on the site. This would surely make me sound with django.

So, that's the task at hand. Get, set , go.

Friday, November 27, 2015

Tamasha!!

What a great timing it was! My last end-sem exam ended at 12 at noon, and 2 hours later, I was watching Tamasha ~ 1st day, 2nd show. From the time, I guess 20 days ago or so, that I listened to the songs of the movie, especially "Agar Tum Saath Ho", and watched the movie trailer, I decided that I am going to watch this movie in theater. I was already addicted to a few songs by the time I went to watch the movie.

Although I missed first 2 minutes or so, thanks to the traffic, I enjoyed the movie. And I mean it. I really enjoyed the movie. By the time the movie ended, I guess it was asking its audience what do they want in their life, will they change a little bit after they step outside the hall, would they still continue in a race they don't know anything about, or would they now do what they want to do?

Asking all these questions myself made me uncomfortable for a moment, I should say, but they were worth asking. And no, it was more that a love story, and this statement of mine goes to all the morons who came out of the hall with the words on their lips like ~ "not that a bad was the love story". I wanted to take them back to the theater and make them watch it again.

The movie talks of some deep issues of life that we simply choose to ignore. One that I also mentioned above is our auto-pilot mode. We are just running, running to somewhere, for something, but just that. No idea of why, where, anything!!

Secondly, the movie talks of this ever-demanding society. Everyone wants you to work their way. Behave like they want. Talk like they want. Study like they want. But in this "like they want", we miss ourselves. We miss what we want.

And then as the years pass on, we lose ourselves at some point behind all the masks that we keep wearing. But what when someone comes, and touches the deeper you? You panic, you react in abnormal ways. Because after all, you have forgotten  yourself. Yeah, that's the base theme of the movie.

But after all this, this dialogue of Ranbir Kapoor is to the point ~ "Kahaani to apni hai na, badal dete hai" ( It's our story afterall, let's change it )

And yes, that's what we should do, and that's what the movie ends with. We are running wanting other people to tell our story. But why? Ask yourself what you want your story to be like, and then make that story come true!!

It was a great movie, I loved watching it, and would recommend it to people of all ages.

Tuesday, November 3, 2015

What's so exciting about "The Martian"?

Wait. I am not writing anything of the movie. I haven't watched yet. How can I? Stupid you. This post regarding the book, after facing all the stormy nights, may finally see the light of the day. No, seriously. I delayed it for a month. How more should I? Actually, I guess there is a reason how I ended up reading this book, though I warn you not to laugh.

I was watching the trailer of the movie "The Martian" before my last mid-semester exam. ( Yeah, I do these sort of things only before the exams, the result of which is then reflected in marks ) Anyways, I got so excited or obsessed with it, you can say whatever you want, that I searched all over the torrents for a good quality link of the movie. But couldn't find one. Fatefully, then I came to know that the novel on which this movie is based, is very popular and it has astronomically high ratings. There was no doubt that I was not going to read it.

So, I decided to study smart and hard for my last exam, and read the novel after that. Result? Well, I screwed up that exam in all possible ways. Maybe I didn't really go for the "hard" part. But then as always, I do what I want to. So, I gave myself the excuse that I need some time to relax after such hard times with the exams. Actually, I needed that!!

And guess what, I finished it in no time. I would say that even if you have watched the movie, you should definitely read this. I was laughing, I was kind of thinking of what would happen to me I ever be so alone, and I was putting my brain in all the science stuff in there. I really enjoyed that.

It was like that guy, Andy Weir, was making me laugh with his style of writing. All the puns and jokes of Mark Wattney, even in those difficult times, is something that I am going to relish forever.

This post is more of what I learned from that book, and here are those :


  1. "Things won't go as you plan them to". This is the one thing that happened throughout the novel. And that's what happens in real life too. Mark made a lot of plans on how to survive, NASA made a lot of plans to save Mark, but their plans failed; they failed when no one was expecting them to, they failed in ways that can make one hopeless.

    I think there is a lesson out here, that we will plan of things, that we will plan your life, but at many points in life, things fall apart when we won't be expecting them to. And those are moments that test our character, and define us.

    I won't say stop making plans; make them and implement them with all the energy that you have got but also be prepared if they fail. Don't lose hope, rather look out to find what can be done at the moment just like Mark Wattney did.
  2. The character of Mark Wattney, there is hell of a lot to learn from this guy. His words that make you laugh to death ( watch out for "Iron Man" when reading the book ) , his plan to proceed with things, his determination to be back on his planet, all his sol entries make you fall in love with the character.
  3. Rethinking education, again!!
    While reading this book, I realized that I had more interest reading of hydrazine here than back in my class. Which leads me to the other point, what if we get rid of those old boring useless ( you can fit many more adjectives here ) practicals, and better have things like in the book. I get it the "hydrazine" one was really dangerous, but there were many more examples there in the book, be it finding the direction of dust storm, or making different equipment work, or growing food "where nothing grows", or mathematically estimating things that his life depended on. On mistake here and there, and he was done.

    This all, at least for me, points to one thing. That things taught to us should me more of situation based. It would have been more interesting if my teacher taught how to get hydrogen of hydrazine, and most importantly the risks involved, rather than writing a grand formula on the board with hydrogen as the "residual product".

    I wouldn't have survived there. But why would be I on Mars on the first place. I don't know. Maybe someday I just be there.
  4. Don't stop working on what you believe in. Period.
    When the character of Rich was introduced, I thought how careless this guy is. But who knew that 100 some pages forward, this guy would come as a savior and a few more pages forward, this guy would come as one of the heroes.

    This guy was doing a small side-project when the whole of NASA was working this hard with a single aim to complete the project in hand to save the other guy 140 million miles away.

    Often, we too get busy with the tasks given to us that we think that's the only thing what matters right now. Imagine what if Rich also thought that way. Mark would have been dead.

    I guess it will be against the conventional philosophy when I say that it's not a good idea to give 100 percent to a single thing. Save some 5 percent of yours which you can use to come up with alternatives, or work on the alternatives. Alternatives aren't that bad.

    And yeah, if you have the gut feeling for your solution, go for it. People around you might need it soon.

    But I am not telling you why I called this guy a hero; you better read the book or watch the movie for that, lazy guy!!
  5. An ocean of amazing, practical things yet to learn.
    Oh no, I can't count on my fingers how many of the things I have decided to learn or learnt after reading this novel. I know nothing, I must say and that's very bad when you happen to be a science student.

    But it's okay not to know something. It's far worse to not even try to learn after knowing this fact. One of the many examples would be this: Wattney was moving around Mars from place to place by just calculating the latitude and longitude along the way, and that too in a totally mechanical way, no electronic devices used. And here I am, forget about how would I go on to calculate all this with no device in hand, even my theoretical knowledge of these basic terms were blurry when I came across them reading the novel. And that's the reason learning this is at number one on my list.

    Do you know how to make a bomb? One addition. With a can and sugar and some electricity. I was dumbstruck when they did it, and I was like "seriously"!! Guess what, I am planning to do the same in my dorm room. Don't worry, I will do it in an unmanned way just like they did it in the novel.

    Or do you know how to make two systems that can communicate at a 1 cm distance. Okay, I am not saying that Mark Wattney built a system that can communicate from Mars to Earth. But can you make the system I told you to. I can't. And it's very hard, and kind of sucks to accept that when you happen to be an engineer. So, that makes it top the chart of things I have to learn!!
  6. Engineering hacks are cool.
    Every time I come across any engineering hack, and too related to computers, I am like "I am going to do that". There were many moments like that in the novel. Be it when an image was sent to the crew which was in reality had code embedded it in. Or when Johanssen decoded it by looking at assembly code of the file. Or when the guys at NASA configured a device on Mars (I am yet to get it completely). Guess what, I would be doing these things soon enough!!
  7. Before Mark made any contact with NASA, it felt how lonely it would be. But after he made the contact, and then suddenly lost it, it felt lonelier.

    People matter. I might brag that I am an introvert, that I don't like meeting too many people. But still they matter. A lot. It's with them that we enjoy our moments, learn things, and do things that impact all of us.
  8. People matter. Yeah again. But now I am talking of distributed genius. What all of humanity has built, it has been possible because there were so many enthusiastic people involved who cared about all this.

    Just think how many people at NASA were working day and night just to save one person, Mark Wattney. Countless. And same is the case with everything, every machine that we have built, or every voyage that we have taken in space or on earth for that matter, all the scientific innovations that we read of, all the creativity that entertain us, all of this has been built upon the works of countless number of people.

    So, next time when this thought creeps in your mind that what you are doing, or what you are building wouldn't matter in this world. Grin, and continue with your work. Because it matters now, and it will matter in the future. That's the power of distributed genius, my friend!!
  9. Finally, a point regarding the writer himself. How can someone write such a great, awesome and amazing novel? How?! He did communicate science in a very simple yet fingers-crossed way. And he has further strengthened my belief that it's possible to make science engaging, and he just provided a unique way. Thanks, Andy Weir.  
  10. Last point. Problems come. But so do the solutions if we have the patience and determination, the zeal to find them. 

    Wattney came across a lot, and I mean a hell lot of problems. So, did NASA, and the crew members of the spaceship. But they came up with a solution.

    And when that guy can live on Mars, where it's impossible to live; when that crew can face all adversities that might have left Wattney dead, and still save him; who am I to cry and shout that I can't solve my problems.

    Next time, when I think of something stupid like that, I am going to think of that. And I want you to think of that too!! 

Okay, bye. Finally, the long post has come to an end. Thankfully. Time to go on a new journey!!

Saturday, October 17, 2015

Log Entry : 17/10/2015

Okay, I decided writing logs a few days back but I am starting now. I guess it's much better than tweeting all day around; although I still like tweeting a lot.

So, today I slept a few extra hours, but it was amazing so to see so many dreams. I mean I felt good after I woke up, actually someone else woke me up. I had started playing a game of basketball, and a throw from one of my teammate was there, and I missed it. And then I woke up. But I am going to play basketball in the coming days for it's all holidays around. Atleast I am thinking of that.

Yesterday, I spent most of my time, actually all of it, trying to implement  closest pair of points problem. Right now I suck at implementing C++, note to myself to improve on that. But hey, it felt great after I got my answer for the first time. I played music and sang for the next half an hour. Crazy me!! Although I ma yet to know why the algorithm takes 7 as its limit. I will open up and hopefully close this mystery today only.

Also, I have come up, accidentally only, with a very very great idea to make me remember that I need to do competitive programming. No, I am not going to disclose it unless it becomes successful. But remember Sandeep Maheshwari, he told that to eat less, he made a cut in his plate that said "32". I just did something like that. I also changed the wallpaper of my lappy to the file where I wrote what I need to do today. I am thinking of doing it everyday. Keeps me away from all the hassle of thinking of things that I won't be doing right now, and hindering me in doing things that I am indulged in at the moment.

Other than that, I was just waiting for a meeting. Got delayed by about half an hour. So, I thought why not write my first log entry. Yeah, and here it is.

Saturday, September 5, 2015

This week of mine : Goldman Sachs internship preparation ends

Okay, so a few hours before, the result for the aptitude test of Goldman Sachs was given, and I couldn't clear that. And yeah, that's bad and I can spend a good amount of time from now on, sitting idle and feeling bad about that, or I could just focus on what went wrong, and deliver my best to be much better the next time.

So, what went wrong? Well, everything. I couldn't solve more than 5 questions out of the given 15 general aptitude questions on my own, and that's really bad. And I mean it.

But there is no point being sad about that. The thing is such aptitude tests have always given me hard time when given to solve in a restricted amount of time. It's not like that I can't solve that. The problem with me is to have the speed and accuracy at the same time, where my speed has always knocked me down.

And the other thing, for which I guess I am pretty much upset from myself, is that only 4 out 20 test cases could pass for the only coding question that was given to us. The problem I see here is I need to be faster. Faster in coming up with a good algorithm, faster in implementing that. Because the problem is I had no time to generate my own test cases, which might have reflected why my answer was failing for so many test cases.

So, finally all boils down to practice, practice and practice.

To prepare for aptitude tests, I was looking at the answers given here.

And the answers seems to point to good resources. Do comment if you know of some other awesome resources to prepare for general aptitude tests.

Then remains the part of coding questions. Well, I think I am doing good in this area. I regularly solve questions, and in some time I will be fast enough to have spare time to have a good look at it once again.

At last I am ending this post with a part of one quote that happens to be my inspiration all the time.


If you know what you're worth, then go out and get what you're worth.
And I know what I'm worth of :)
    

Wednesday, August 26, 2015

Resources for Competitive Programming

This is a live post where I continue to add the resources that I find useful.

Bit Manipulation:

Slides for programming contest discussions : http://www.cse.iitk.ac.in/users/aca/lop12/

Codeforces blog posts : http://codeforces.com/blog/entry/13529

Another great resource ~ http://e-maxx.ru/



IIITH resources :

Implementation of algorithms :
Quora answers : 

Friday, August 21, 2015

What computer science things I am going to learn in the next 2 years ?

Although I study in a college, but most of the times, I consider myself as a self-taught programmer, who learns from the net along with his friends, and don't bother to depend on the boring college classes.

This answer on Quora made me realise how awesome and vast the field of computer science is, and hopefully I will get my hands dirty in these subjects in the next two years.

Thanks Ryan Witt.
Read Ryan Witt's answer to What skills do self-taught programmers commonly lack? on Quora

Tuesday, August 18, 2015

This week of mine : HackerRank CodeAgon 2015

So, two days back, I participated in this contest and in my own words, I have to accept that I performed miserably. I could solve only the first question out of the five given, and two of the rest were actually based on segment trees, a data structure that I hadn't heard of till then.

So, of course this week I am going to learn this and spend my time reading and figuring out how to solve the rest of those questions.

I wish that was it. But there is another part of story. There happened to be a test yesterday of Computer Architecture, and out of the given two questions, I solved one which even a 10th grade student can solve, and the second one, which made the game level-play ,but I couldn't even understand the question.

What all this means is I need to give focus on my semester subjects also, because I am not able to understand much in the class in any of the subjects, be it this one, or Microprocessors, or Finance.

Which simply means I need to restructure my time management, otherwise I may not be able to enjoy these subjects, which in my opinion are pretty cool.

Tuesday, July 7, 2015

What did I do in my Eklavya summer internship at IITB ?

Right now, I am in the train, having befriended one ma'am who happen to be a lyricist and a script-writer. Can you imagine she knows seven different languages, and guess what? This is after leaving behind English and Hindi. Well, after this I was thinking how many languages do I know. Zero, damn sure. Okay, I also know other a lot of other languages. The only difference is I write code in them.

And yeah I am finally going back to home. So, I woke up this morning, and couldn't think of anything better than writing this post which is an answer to a question that I have been asking myself for quite a few days now that whether my choice to join the Eklavya internship at IITB was right.

I don't know. I have no answer. Or may be I do have a lot of answers, or bits of those answers. I would like to collect and freeze those bits here and now forever.

First question : Did I really learn something in IITB ?
Well, the answer depends on what is your definition of learning. If you are like me, having spent quite a few years now solving logical questions on paper, then I must agree that many a times I did feel what a bullshit and mundane sort of work I was doing. Many a times. Once I even thought of leaving my internship midway. But I didn't. I don't know why.

But now I will say I did learn many a things, some about others and a lot about me at each of physical, mental and spiritual level, as James Altucher always puts it.

So, breaking all the suspense surrounding the title, let's talk from the start.

When I first came here, there were presentations regarding various projects, and I took the project named "Big Data and Analytics". Later I will tell you whether my decision to take such a project with sucha big name was good or not.

But after the project selection, we spent the next week in the lab tying to learn these things, because we were told that later there will be a test in the weekend on topics of Python, Java, MySQL, Django, and Javascript.

Alas, I knew only one thing there : Python.

Okay, no lies. I knew Java and MySQL too, but not that much.

So, I spent that week learning Django from their own documentation. And I was kind of feeling great because I was playing around with web frameworks for the first time, although I had no idea what I was doing.

Finally arrived the day of the test. And guess what I got around 60 percent. Actually 59.57. Otherwise they wouldn't have asked me for a retest. And yeah, I failed in Javascript. I got around 10 percent, I guess. But no shame. I was not alone there. Plus, you couldn't expect from me to learn all this in a week.

But I did complete my Django tutorials there. It felt good.

Then the project that I chose, I hope you do remember "Big ..", there were subprojects within it. I chose "Study and Integration of edx Insights". So, was it a good choice ? There is no right answer here, but yeah, we got to interact with Phatak sir more than any other group. Actually most of the other groups didn't get to interact with him other than on initial and final days. It was always inspiring to listen to him, when he used to tell us what are his thoughts on different things, or when he would share a story of his life with us. It was always great to listen to him, and everyone would want to listen more from him. At least I did. Don't get jealous now.

But pausing here for a moment, I would say that one important thing that I learnt here is how one should select their project based on presentations only. Why so ? Because I made judgemental errors, not once but many a times. May be one learns from their mistakes only.

Then, in one of our interactions with Phatak sir, he gave us the assignment to find out the necessary code changes to get a particular feature in the edx. Ah, the problem was that the code was 250,000 lines or more. I never counted. Everyone just says this number.

So, the next week, I remember, 15 students none of whom ever looked at this amount of code, spent their time trying to figure out how to get this feature. And finally we did find it out. At least we thought so. We never tested it. Who was going to install edx on his local machine. But it was a proud feeling to tell Phatak sir that we had completed the assignment, and our efforts were appreciated.

No other group got to study this much amount of code, other than the LTI group.

Then we started on with our real project. It's then I realised that my project was not of writing code, but there is code already there, actually four different pieces of them doing different jobs. Our task was to study it and then integrate them so as to make them work together. I got to realise that it's not all about writing code but also there are many many other aspects related to a product development.

But I didn't know what to do. It's then when we started with hadoop and hdfs. I remember one of my friends doing such things in college only. I couldn't understand what he was doing then. I do understand it now. Although I did only basic tasks with Hadoop and MapReduce, it has given me enough confidence and excitement to continue playing around with it. I did played a little bit there, and I will continue with it for sure.

One more thing I did learn or should I say relearn here is to stick with the one thing that you are doing. You will benefit. Actually there has been a lot of changes in my learning patterns in the last few years. And one thing I am learning now is this. Stick around and play with one thing, and complete whatever you have decided before moving on to the other thing.

While we were doing this, one day a meeting was called and Phatak sir told us that for the next 10 days or so, our project has been changed and we will working on making SRS as well as user documentation for the blended MOOCs. It was a fun time doing that, learning about hierarchical database design. Since I still didn't have the database design course, it was all new for me, and I enjoyed it.

Once it was completed, we were back to our project. But then one day our mentors came and told us that a new group is being formed for the blended MOOCs development, and asked us whether we would like to shift to this another group.

This is where I feel that I made a mistake. I should have moved to that new group. I realised this once the work started in that group. It's not like I didn't work in my group. But there work was more of development, and I do agree for once I did feel bad. They did learn Django development. It's not like I didn't. I also did, and I continue to do. But the difference may be they did learn it while working on a real project.

But still it's okay. Sometimes you do make bad decisions. It's part of life. It makes you understand how to make better decisions. How to better analyse a situation. I feel I got better at this thing too.

A few days after that we got to know that our group mentor has been changed. There I think that those mentors related with Eklavya internship should decide their projects clearly beforehand. I guess it was a lot of mess, and not just for me, but for many other groups.

So earlier we were working with Tushar sir, Mitali ma'am, and Aditi ma'am. It was nice working with them. But then we moved to the group of Shukla Nag ma'am. Our first task was to convert their data cleaning code written as Java Servlets to python scripts. Huh, I can't tell you what a boring task it was.

I would like to add one more thing here that I was really lucky to get friends who were very good. I can tell you with the example of Sagar. It's because of him that the two of us could complete the code conversion. Had I been alone, forget that it would have been completed.

So, this internship was not just about learning from doing the project. It was learning from your friends too. I can say I learnt a lot from them. I learnt about UNIX, and at least I have got a start there. Plus, I did learn about completing things while learning on the way only.

So, the code conversion thing. We were talking about that. Yeah, it would seem boring to you, and it was in fact. But it made me, once again, read a large amount of code, and understand it thanks to the lack of documentation of this code. I learnt about JSON, and how to use it with python, something otherwise I only heard of, or read about on Quora.

Then I did wrote a few R scripts for visualisation purposes. Yeah, I did that too. It was fun doing that. And I also learnt a fair amount of R while doing it. But then, I didn't stay doing this for long.

I was moved again for the testing of the python scripts that we have written. I would say that I now prefer using a debugger, rather than writing a lot of print statements cluttering around in my code. So, I still don't know how to call R scripts with python, but I will learn that too. It should not be that hard, given that I got the opportunity to read that code and play around.

And while doing all this, I never realised that I was in the last week of my internship. It was time to go home, but I guess there was more to happen. So, then everyone was assigned to do their part of documentation and while doing so, I did learn a little bit of LaTex too. Hurray, I am going to make my CV in that only.

It should have ended then only with the documentation ready. But the last day before the presentation, ma'am said that she wanted the dashboard to be similar to that of insights, but it was not. She wanted someone to work on the required jQuery and JavaScript. Remember I failed in this only. And so I along with two of my friends was trying to do something that I had no idea of how to do.

Initially I felt like better to leave, but by the time it was midnight, I was enjoying doing this too. By the time it was 5 in the morning, I wanted to complete this and didn't want to leave, although we had reached halfway only till then, and the presentation was that day only.

So, we left and went for the sleep. So, do I know JavaScript now ? No, not at all. I will still fail on an exam like that. It's just that I have never used it before, but since now I did and I enjoyed doing this, I may later go on to play around with it. I guess that's how we start with anything. When I had basketball in my hands for the first time, I played too bad, but two years after that, I was playing fair enough, if not good enough. Same thing with chess, or the code that I wrote for the first time in my life in BASIC, or the my very first PowerPoint presentation.

But since I enjoyed my time while doing these things, I became better and then sometimes good enough. The same may happen with JavaScript too. Who knows, I don't.

But that day later in the noon, the presentation went well. And came to an end the internship.

So, was it good? I don't know. I felt good after writing this. What do you feel like after reading this? That may be your answer.


Saturday, January 10, 2015

the half-open door..

Awakened from his deep sleep
lied on the bed, on the ball;
with eyelids shut, body still
dwelled in his soul, invisible to all
an impression, a face,
a face now gone!

This unknown and newborn absence
punching him
as if waves hitting the rocks,
wide opened those sad eyes;

all around, desolate and bereft
with just memories left;
was peeking into the room, the daylight
permeating the dark dearth
through that door, the half-open door!

the door left in this state,
may be in some hurry
but to him, a mark, a token
supplementing the bitter fact, in vain!

Standing tall, remorseful
for not waving a good bye,
realized that gone with his friend
are those scolding and surprises
that he got attached with;

Reaching for the door,
remembered the friend,
who edified him to an extent
no one ever did before
in his long past, coming to the fore;

hard to accept the exclusion,
harder to bear the exclusion
for more was to be done,
for more could have been done!

But time was gone, like always
splashing cold water on his face
but putting him in unusual case
awakening him to his mistake

as if shouting to its loudest
as if whispering to the deepest
"Beat your hard luck
with harder work"

ever, he might not meet
his friend, his roomie,
the rav boosting him
with some magical, infinite fuel,
the stimulus being his imagination

driving inside him,
a regard, a high esteem,
for those soft and harsh ways,
for that smart and amazing sense,
for those mesmerizing and funny acts

with this vista and with a vow,
a vow to meet that face somehow
in some cold morning, somewhere
in some city, from nowhere;

to manifest the image,
not that of a douchebag again
but that of a mind inquisitive;
left the room, did he
through that door, the half-open door!