Monday, December 19, 2016

2017 - A STEP TO BUILD THE PERSON I DESIRE TO BECOME


< This is a live post, and will keep on updating till 30th of December 2017 >

It's 19th of December 2016, and I have not done anything of value in the past two days. But then I imagined a horrifying situation - what if the entire year or the entire life went the same way. Something that has disturbed me for quite too long!

As I take a glance at the past few years, I see myself improving over time, but there is no statistics of that. Also, couldn't this improvement be sped up?

I don't believe that a change in year number will change anything drastically, but with 2017, I am starting with measuring my improvement in quantity! :)

..

I will be measuring up myself in 2017 against the following yardstick -

1. My technical goals - It has to come first. There are so many awesome things happening in the world, and I am fortunate to be studying one such field of computer science. In the past years, I have set many goals, be it completing CS50 or Algorithms course, or learning probability or linear algebra, or building a chat app. How many of them have I completed. Rarely any!

With new insights, I would now be setting and achieving real goals, something that I can look up to, when 2017 would be coming to an end.

2. My technical posts - I have written quite a good number of posts this year on this blog, but how many of them are technical. Writing technical posts would force me to learn and explore the new stuff of computer science, and be better at explaining the same!

3. Reading books - This year I have completed less than 5 books, but reading a variety of books only increases our understanding. The goal for 2017 is a mammoth in itself, but my love for reading books should make this journey beautiful. Goodreads will help me keep track of that.

4. Watching Movies - There are so many awesome movies out there to watch, the ones I have a list of, but I don't. I haven't watched more than 20 movies this year. Seriously? A movie, every Friday!

5. Travelling Places - Tagging yourself as a "traveller" doesn't help, going out to places does.

6. MOOCs for self improvement - There are so many online courses that may not come under my technical goals, but I wish to take them for my own pleasure. This one goes for that.

7. Contribution to the society - All my learning becomes more useful, when I contribute back to the society in a useful way. And you know, how strongly I feel for the same.


These are the 7 points I would be looking back a year from now, and I am pretty hopeful that I would then proudly share what all I did the entire year!

I will be placing this post as a page on my blog, and will keep updating the page with my progress.

Happy New Year to all.

Wednesday, December 7, 2016

V for Vengeance


I didn't know what Vendetta mean when I heard the name of the movie. But now I do. I also know its power!

As I write this, a few of the movie scenes flash through my mind - V's crazy introductory monologue, his revolutionary speech, the kind of rebirth of Evey, the fall of the dominoes, and the final fight scene!

The movie, obviously, has the theme of anarchy vs dictatorship. Some would say that is all there is in the movie? But I disagree. Because if that's the case, people will start seeing their own government as a dictating regime, seeking absolute freedom for themselves.

But is it really this, the movie or the novel wanted to convey?

The government shown in the movie back-stabbed their own people. That's the government V is fighting against. One that was so hungry for power, that they killed their own people, to induce in them the fear!

This reminded me of Hitler and Holocaust. I don't know much about it, and this topic is what there is next on my list, with a few documentaries including Third Reich: The Rise and Fall, Banking with Hitler, and Adolf Hitler - The Greatest Story Never Told.

..

But there is more. There are many a elements in the movie that makes it this awesome.

One is the evolution of ideas. The lines in the very first few minutes had me engaged. We all have experienced the power of ideas, at some point. These are the very same ideas that shaped the world, for both good and bad.

I would just quote those lines from the movie!
I've witnessed first hand the power of ideas, I've seen people kill in the name of them, and die defending them... but you cannot kiss an idea, cannot touch it, or hold it... ideas do not bleed, they do not feel pain, they do not love... And it is not an idea that I miss, it is a man..
And then at the very end, these lines by V speaks of the influence of an idea on the people who believe in them!
Beneath this mask there is more than flesh. Beneath this mask there is an idea, Mr. Creedy. And ideas are bulletproof.
..

And then the part of the movie where Evey Hammond is in prison. When V told him that she was not in any real prison, and he made all this up to remove her fear, the feelings of her when she feels the rain reminded me of Batman.

Isn't it the same theme going all around? The only way not to let our fears overpower us, is to face them.

When death was seeing her in her face, she was calm. I felt a little disturbed. She found an idea to cling to, which was more to her than her life!

And then her feelings when V set her free. That reminded V of his own feelings when he became free. To put it simply, God is in the rain.

..

The killings of people belonging to other religions, and homosexuals felt disgusting. The story of Valerie was moving. How come being a homosexual was a crime? These words couldn't feel more real.
I remember how "different" became dangerous.
And the way the news was being fabricated by the media is something even we can relate to. There can't be any other time where keeping our eyes and ears open could be more important.

His remark on the power of words was something to think about.
Because while the truncheon may be used in lieu of conversation, words will always retain their power. Words offer the means to meaning, and for those who will listen, the enunciation of truth.

There were many other lines in the movie that were really deep. I am just quoting here a few of them, just as a reminder to self.
[1] ...A building is a symbol, as is the act of destroying it. Symbols are given power by people. Alone, a symbol is meaningless, but with enough people, blowing up a building can change the world.
[2] Your own father said that artists use lies to tell the truth. Yes, I created a lie. But because you believed it, you found something true about yourself.
[3] Vi Veri Veniversum Vivus Vici. By the power of truth, I, while living, have conquered the universe.
[4] Our integrity sells for so little, but it is all we really have. It is the very last inch of us. But within that inch we are free.

.. Every inch of me shall perish. Every inch, but one. An Inch, it is small and it is fragile, but it is the only thing the world worth having. We must never lose it or give it away. We must never let them take it from us.

I couldn't resist myself from quoting the mentioned quotes of Shakespeare.


V: [V interrupts the three policemen about to rape Evey, whips out a dagger, and quoting the sergeant from Macbeth Act I Scene 2] "The multiplying villainies of nature do swarm upon him
[skips 4 lines from the original Shakespeare]
V: disdaining fortune/with his brandish'd steel, which smoked with bloody execution...?

..

V: [Quoting Polonius from Shakespeare's Hamlet Act 3, Scene 1] We are oft to blame in this, - / 'Tis too much proved - that with devotion's visage/ And pious action we do sugar o'er/ The devil himself.

..

V: And thus I clothe my naked villainy / With old odd ends stolen forth from holy writ/And seem a saint when most I play the devil.
[quoting Shakespeare's Richard III, Act I Scene 3]

..


V: [Quoting Viola from Twelfth Night Act I Scene 2] Conceal me what I am, and be my aid For such disguise as haply shall become The form of my intent.


and finally the lines that even I have to say the generations that went by, and the ones who remain in the future, the people I will never meet.
Even though I do not know you, and even though I may never meet you, laugh with you, cry with you, or kiss you. I love you. With all my heart, I love you.


Friday, October 21, 2016

A few simple graph problems, and their interestingly cute solutions!


Recently, I was solving a few graph problems from here, and I found the questions to be simple yet challenging! By this, I just mean that the questions didn't ask for any advanced knowledge from my side, and yet it was a challenge to come up with simple solutions for them.

There were many questions, for which I too came up with my answers, but they were complex. On the other hand, the given solutions were quite simple, and they had an aesthetic beauty that only an algorithmist can understand. Hence, the cuteness.

I am just providing the questions here in brief, and the underlying thought process that led to those cute solutions. For a detailed study, which you must do, go here.



  1. Design an algorithm that finds all bridges in undirected, connected graph G in O(V · E) time.

    Actually this is the third part of one question. They beautifully and thoroughly made the students think over the solution. The key idea is to think of the BFS tree of the graph.

    First, they asked to prove that all the bridges will be present in the BFS tree of the graph. Then, to examine the running time of checking whether a given edge is a bridge or not. And finally they stated the problem that I mentioned.

    What an amazing way to teach students how to solve problems!

  2. To find an efficient algorithm to find the number of paths in directed acyclic graph G from s to t.

    Topological sorting, and storing the number of paths to all the vertices, using the previous counts to build the next ones!

  3. Suppose you are given a city map with unit distance between each pair of directly connected locations. Design an O(V + E)-time algorithm that finds the number of shortest paths between the source vertex s and the target vertex t.

    Always remember, BFS finds the shortest path to all the vertices in an unweighted graph. And then again, we can store the number of shortest paths to all the vertices, using the previous counts to build the next ones.

    But remember, we are finding the number of shortest paths in an unweighted graph!

  4. Consider a connected weighted directed graph G = (V, E, w). Define the fatness of a path P to be the maximum weight of any edge in P. Give an efficient algorithm that, given such a graph and two vertices u, v ∈ V , finds the minimum possible fatness of a path from u to v in G.

    Amazing question, and what a cute solution! A good reminder to self regarding what value does d[u] store for all the vertices. A simple change in RELAX method of Dijkstra's algorithm. Seriously, this never crossed my mind before I read the solution.

     
  5. Given four vertices u, v, s, and t in a directed weighted graph G = (V, E) with non-negative edge weights, present an algorithm to find out if there exists a vertex vc ∈ V which is part of some shortest path from u to v and also a part of some shortest path from s to t. The algorithm should run in O(E + V log V ) time.
    This is my favourite of all. The solution just requires understanding the basic definition
    d[u,v] = d[u,vc] + d[vc,v]. And there you have it.
I found all these questions to be quite mind-stretching, and yet looking out for only the elements of understanding in me!

 

Sunday, October 16, 2016

Waiting!


I really enjoyed watching this movie Waiting last night. It has something in it which most of us ignore.

If I am asked to summarize the message of this movie in a few sentences, it would go on something like this. Anything can happen in your life at any point of time. You might not accept it, but there is a good chance that someday something very bad will happen. You will be helpless. You will curse others for they have not felt your situation. But life moves on, and so should you!

If you ever face a situation where things are not in your hands, say just like in the movie, a very near one of you has met with an accident, crying doesn't help. Ofcourse, I agree it is easier said that done! But Naseeruddin Shah coveys it concisely - "However bad the situation may be, three things should never stop - eating, sleeping and bathing."

The movie also touches upon the issue of quality of life. And the opinion varies greatly, both in the movie and in real life. I am of the opinion that no one except the victim should have the right to decide what quality of life he wants to live.

But what if the affected person himself is depressed? I guess the doctor in charge should take over the rights. But how come we decide when shouold this be done. What if the quality of life for that person has really gone downhill just like it was depicted in Guzaarish? Conflicting!

I would love to hear your opinions in the comments!

..

While writing all this, two people and their quotes did cross my mind. And I guess quoting those down would be better than attempting to put it down in my own words.

Stephen Hawking has this great line in the end of the movie The Theory of Everything - "There should be no boundaries to human endeavor. We are all different. However bad life may seem, there is always something you can do, and succeed at. While there's life, there is hope."

This person has always been my inspiration. You ask, why? Read the lines in the previous para again. If this person whose quality of life worsened so much, could show this level of optimism, there should and must never be any point in my life where I should be sad or depressed about something bad going on with me!

Saturday, October 15, 2016

Lakes in Berland : Why coding your solution is a good idea?


I write about my solutions to the coding competition problems only for myself. For the problems that stretched my mind a little more. To bring myself a clarity of thought of what i did in the code. To understand my mistakes. Do not read it unless you have really nothing else to do in this awesome universe!

The question : Lakes in Berland. As simple as it could it be. I guess it didn't take me more than 10 minutes to figure out how to solve it. But there awaits the demon. The one everyone talks of. The implementation.

There is a reason why great programmers ask to code your solution. Because just knowing the solution isn't enough! And that is what happened in my case.

It took me quite a good long time, almost a day to get to a working solution! And no, it wasn't anything hard to code. It just reflects my weakness in implementing a solution.

..

While coding the solution, I was noting down all the mistakes that I did, due to which my test cases failed. Here they are in a proper format just to make myself realize my fallacies, and why I need to think a little more before submitting my solution all over again.

MIstake #0 : It took a lot of time to implement the dfs, and the lines of code that I wrote was way more than for the accepted code in C++; always a red signal.

Mistake #2 : I made a very big mistake as my code was allowing the non-starting vertices to be on the border, had to refactor my code to find the connected components!

Wednesday, October 12, 2016

Polycarp At The Radio - Importance of maths in programming!

Many people argue among themselves whether maths is important or not, when it comes to programming. I don't indulge in these arguments, neither this post is going to do anything similar.

But recently I tried to solve a problem which made me realize the importance of mathematical intuition when it comes to programming.

I started to solve this problem on Codeforces, Polycarp At the Radio, and hit sort of a dead end for more than a day.  But something got me hooked to this question. There was nothing special about it. No difficult algorithm tags. And still I was finding it difficult to code.

But I went on to code what I thought to be a good enough code to pass all the test cases. And no, I just didn't start monkey-typing on my keyboard. Yet the end result was around 200 lines of python code, with a lot of comments and debugging statements hidden within it.

And it doesn't stop there. My code still failed on a test case I knew of, I wasn't sure if there still exist other test cases it might fail upon, and just when things seemed to make sense, I realized I had no idea in hell or heaven how to change my code to pass this particular test case.

..

Finally, I gave up, and read the tutorial given for the same. And I just couldn't express how beautiful the solution is. So simple, so intuitive. I can't even say it to be mathematical. But something definitely mathematically intuitive.

And the code was just 40 lines long, with complete surety that it will work for all the test cases, whatever it may be! And this is why, my boy, mathematical intuition is important in programming.

I am linking a github gist here, containing both the buggy and the correct codes, to show how complex a program can get because of the lack of simple mathematical intuition.

Just give this puzzle a try before you hop on to another post of someone else! :)



Sunday, August 7, 2016

Sunday Times : Finally watched "The Intern"


Another week flew by, although this one would have its own place in my memory lane for a good long time. Reason? The week started off with me getting placed in a super-dream company. Yes, I am placed, and yes, it's hard for me too to believe that. It's hard to believe that I have a full year with me, with the chance to do whatever, seriously whatever I want to do with it.

To be honest, when I was sitting for this company, I wasn't even serious, because I didn't believe I could qualify their requirements. But with every step, I got lucky, and at the end, I was one of those who were selected by the company. Want to hear something better? I am just one of 5 who have been selected for this company, including Pranav and Sourav.

The next two days then just passed by, in celebration. I am in still in disbelief, really!

And finally, by the time Sunday arrived, I was thankfully once again clear with my head, and with what I want to do in the next few weeks. And yes, although I am not used to enjoy an entire day doing things I love, I would be certainly doing this more boldly from the next time.

And this is an irony. I can easily go on to waste the entire days of mine, but it's hard to enjoy the same. But one thing that I have realised with time is it's very important to find time for yourself, and I chose Sundays for the same.


----------


And finally, I watched the movie "The Intern" on the Sunday evening. This movie was on my wait list from the time it arrived in October last year, and finally it felt really great to watch it.

Ben was a real inspiration in the movie. So old, and yet so energetic. Definitely, I would be someone like him. It takes lifetime experience to become a person like him. But the truth is most of us are like Jules. Confused of our abilities, short on time, and trying our best to manage work-life balance.

The movie has many learning embedded in it including but not limited to "believe in yourself", "the importance of real-life conversations", and "take time for yourself". The last one is something I talked of, a few paragraphs above.

It also talks of one thing that I haven't said till yet, and that is the importance of senior people in our life. However advanced we get in technology, we will always be short of experience that they have. And I am not saying we should take all their advice, but what I am trying to say is we shouldn't just simply ignore them. They have a value of their own.

And yes, nothing beats real-life conversations. It's your way out to everything. To create bonds, to maintain them. Maybe we are getting away from this as our world is getting digitized and we race for everything, but we still have time to get on track. Hope that some of us do, including me!

But the core of the movie is to believe in oneself. In the words of Ben, if you can start a company on your own and grow it from 40 employees or so, to 250 something, you can also go on to manage the same. So, just believe, that you can.

And yeah, now I also know why men should carry handkerchief.

I would end this post with a very motivating quote I read today - "If you don't prioritize your life, someone else will".

Goodbye. See you all next week!

Wednesday, June 29, 2016

Learning the open source way at dgplug!


I still remember a first-year college student who, in 2014, somehow got to know of dgplug through Quora, and just jumped on the ship.

I still have that post that I wrote that time just like this one! https://thisisashwanipandey.blogspot.in/2014/07/my-experience-with-dgplug-summer.html

But I couldn't attend more than 5-6 sessions as I had to go to college then, and I was using chatzilla, and I got stuck with proxy problems. And that was a very big problem for that kid. I tried it a few times, but by then a lot had already happened in the training sessions. I have to leave it then!

Fast forward 2 years, and here you see the same boy writing this post while determined enough to not leave in between this time whatsoever!  And yes, to learn a lot more this time.

..

Regarding the current session going on, I got to have a virtual session with one core python developer, and I got to know about rst, bash and sphinx. I already was a little bit familiar with rst, but sphinx and bash are totally new and cool things for me. I would be reading and learning more about them as many related things are not yet clear to me!

Many other things did happen too in the sessions, and you can read about them at the link that I gave at the very starting.

..

I am really excited to see and learn the upcoming things in the training session. If all this excite you too, do join us at dglpug. And a big thanks to the dgplug team, who take out their precious time to teach others all this exciting stuff.



Sunday, June 19, 2016

No more Quora for the rest of the rest of the year, and a few more stuff !


I discovered Quora sometime in 2013, and from then till now, I have been highly active on it. Not in the sense of writing many answers, but reading loads of them!

But recently, I didn't really like my feed which was full of life experience related questions. And plus even if I unfollow that topic, I am not really interested in knowing how to learn X, or the resources for something.

For the past few months, the only people whose answers I have reading thoroughly are Balaji Viswanathan and Richard Muller. That's it.

I am not interested in knowing how to get started in open source development or competitive programming, or what life lessons have you learnt, or your most embarrassing moment. Damn, I am not even interested in random facts.

As of now, I am more interested in learning novel facts, and I realised I would get more of it by reading some awesome books. So, the rest of the year would be full of books. The one I am reading right now is "The Little Schemer".

So, does that mean I am going to sacrifice the great articles by Balaji. Not at all. I have started using feedly for the same, to read from time to time, the contents of my favourite blogs.

So, this was all with Quora. See you next year!


...

Now for the second part of the title - "a few more stuff". Basically, this is about my final decision to post all my writings on Blogger only.

In the past few months, I have tried a lot of things, including a blog on Quora, a wordpress blog, one on Medium, and so on.

But it's just not possible to maintain all of them. And since I was able to fix the problem of commenting on Blogger with Disqus, and it happened to be the major problem that forced me to look for other option, I am only going to write here from now on. No more mirrors!

As for the concern of followers, I don't yet write something that anyone would like to follow. And if anyone wants to follow this blog, one can just follow by email as per the option given on the main blog page, or with feedly.

I mainly write for myself. And for people, who might someday land on and like this unknown part of the web! :)

Bye!




Monday, June 13, 2016

Why you should not study CSE at NIT Silchar?


One reason!

Because it's awful when it comes to academics!

Now before the alumni and present students of NITS jump on to post some hateful comment, I just want to make it clear that all I am talking about here is related to academics and the quality of faculty, nothing else.

I do agree that NITS has got pretty good infrastructure, it is getting better every year when it comes to placements, or any other thing you can come up with in favour of NITS.

And if you are going to college just to get a job, or "enjoy your life", I will say that you go anywhere, it doesn't really matter.

But if you are dreaming of learning something in CSE, NITS is really a bad choice to be! You are not going to learn anything.

Only one or two faculty in the CSE department do have Phd, and the rest just go on to take random subjects every semester, and teach first few chapters of the course, and anyone can complete the entire course the night before the exam. Yeah, it sucks that much.

I can surely go on to rant of the professors targeting them one by one, but presently being a student in college, that would do more harm to me than anyone else. But I promise you I will do that once I get out of here.

To those who are attacking me with the argument that same is the case with all the institutes, you are wrong buddy.

If you, the one reading this, happens to be applying to colleges, follow this advice, and you can verify this by talking to some good seniors of yours. So here it is :


  • If you are having the option to select NIT Silchar, I am assuming you have a very good rank in JEE-Mains or AIEEE, whatever you call it, if you are coming from other state.

    Look out for a few private colleges. I mean, seriously. I am not joking. When you are just out of high school, most of us just care about the IIT or NIT tag. Trust me, it doesn't matter even a bit.

    I can't give you a list of all colleges, but colleges like DAIICT, BITS Hyderabad, Thapar University, Anna University are way better than government college like NITS.

    You might not have heard these names, so you might be feeling I am talking shit but I am not. And as I said, you can also talk with some "good" ( focus on the word ) seniors of yours.

  • Don't give too much priority to NITs. A few of them are awesome but the rest of them sucks.
    I have met students from NIT Allahabad, NIT Delhi, NIT trichy, NIT Warrangal, and NIT Surathkal, and all of them were awesome at their domains. I can't say anything about the rest.

    I might have forgotten to name a few good NITs. Ping me if that's the case.

Make your choices wisely. I learnt quite many a things in NITS, but not a single thing from any of the professors ( actually it's a shame to even call them a prof ! ). I learnt mainly from a few friends and seniors of mine, and thankfully "outside-the-classroom" learning opportunities that I got.

But well, one can get these "outside-the-classroom" learning opportunities in other colleges too. Why risk your academics?





Sunday, May 29, 2016

IITH Internship Diary - Week 2 : Troublesome Implementation


Week 2 passed by like a flash with nothing much done from my side. And if this continues on, I guess I would have achieved at the end of my internship.

On Monday, I met my PhD mentor Aarghya sir, and he made a lot of basics clear, and also made me understand the basics of research paper, and what actually I need to do on the implementation side. And it was followed by a short meet with Vineeth sir on Wednesday, with almost nothing done from my side in between these two meetings.

Then, I started with the basics of Lua, followed by that of Torch. I am currently reading and trying to understand ML implementation with Torch from these two sources.




On weekend, I went to visit Hyderabad, but due to such long commute to reach there, I probably won't be going anywhere in the city for the next few weeks. It was tiring.

For the next week, I would mainly continue with the above mentioned links and speed up my work with my main focus on this only, which I wasn't able to give for the past week.



Monday, May 23, 2016

IITH Internship Diary - Week 1 : Getting the basics slowly


Well, the week started with a meeting with my mentor professor Dr. Vineeth sir for the first time on Tuesday. I was really excited about it, and my excitement for the project and machine learning in general only increased after meeting. He is really an enthusiastic person to meet. He basically told all of the interns more about their work, and what all new things are happening in the field of ML.

After that day, I started with learning logistic regression from the Ng's course. But then switched on to learning the basics of neural networks from here. Michael Nielsen really made the concepts very clear in the first go! But somehow, it still took me around three days completing the first chapter only. Later I also saw his TED talk on open science.

I guess it took me three days because I was not having any feedback loop to tell myself what all I have achieved everyday. I have already included this thing in my list from now on, so things will hopefully speed up from now on.

On Saturday, I raced through the later end of the first chapter. I would come back to the implementation discussion that he did, later on.

Sunday was a day well spent, learning about LSTMs. Christopher Olah has a really awesome blog. You must definitely check that out. And later part of the day was spent reading research paper. Although only bits of the paper were clear, I was happy that atleast something was clear this second time.

Also, I somehow landed on some of the amazing pages on the web, and I have saved all those links and I am definitely gonna read all of them soon. I would share them as I go on reading them one by one!

Bye!



Sunday, May 15, 2016

IITH Internship Diary - Week 0 : Health Problems

Week 0 is nothing, but about the week just before I arrived at IIT Hyderabad.

And I wish I had some title other that than "Health Problems". But this is the truth, the hard one.

Although in the past few weeks, I learnt the basics of regression, and gradient descent, and also watched a video on neural networks, this was far less than satisfactory.

I hope the next diary entries will be mostly related to my first research experience and not something stupid like this.

My health took a toll around two weeks back which started as normal fever, but then turned into heat fever causing a lot of weakness. And the best was yet to came, and it was the great grand eye infection that brought tears to my eyes for no reason.

Also I had some strange feeling when I first arrived here. I wrote more about it here : http://thisisashwanipandey.blogspot.in/2016/05/strange-feeling-of-loneliness-at-iith.html

Thankfully things are back to normal now. And there are a lot of mountains to climb.

Bye!


Strange feeling of loneliness at IITH

Yesterday when I arrived at IIT Hyderabad, a strange feeling crossed my body, and to tell you the truth it was very strange and horrible.

I am writing this post to make myself understand what actually happened.

So what actually happened? What made me feel like I should go back to my home as soon as possible?

Actually my room-mate who is from NIT Trichy went to the city, so there was no one in the room. And even when he was there, he was talking to his other friend in Telugu, and most of the people here communicate in their native language only when talking among themselves. Obvious, it is.

Then, the sweeper lady knew only Telugu, and it was a hard moment making her understand what I want to say.

But this language barrier couldn't bring all this strange feelings. Let me see what else happened.

In the morning, I had a meeting with an M.Tech student, who made me question my decision of coming here for research internship. He asked me what I know in Machine Learning already, and what sort of project and research work I would be doing. And I was completely blank.

I guess this was one trigger.

Then, in the afternoon, I wasn't feeling very well. I had eye infection a few days back, and I guess the eye drops that the doctor prescribed has taken a toll on my eye sight. It was a lot blurry yesterday, although it's better now.

I guess these two things mainly triggered the fear.

I couldn't do anything after that. So, I went to sleep after that. But alas, the heat and the lack of mattress didn't allow that. I was all sweating when I woke up.

Thankfully, things seemed normal by evening.

But all this has made me realize the importance of why human form relationships. Maybe we do so evolutionary, because it suppress the fear of the unknown, that there would be someone if something bad happens. We start enjoying our time with the people, and so the fear hides insides.

But remember, it's not gone. It's there. I just got to see a sight of that and it was horrifying.

It was the fear of the unknown that troubled me yesterday.

But, what can be done for that? I don't know right now. It came and went by. I hope my future would have the answer for the same.


Sunday, March 27, 2016

Resources for loads of Linux fun

I am very weak as of now in my understanding of Linux, but I am hell bent to be awesome at it.

Lately, on my exploration of the net, I stumbled on a few great resources, and I am saving them for the upcoming summer or whenever I want to have some fun while learning Linux!





Resources for Capture The Flag

Just two days ago, I didn't even know what CTFs are. But after reading about them I am really excited to go on and solve the puzzles in this new arena!

This post is live and resources will keep on adding as I work through this :





Monday, March 21, 2016

Olympic Athlete mindset !


Read Benjamin Gregory's answer to How can I study for 10+ hours a day without getting depressed and how can I make myself get used to it? on Quora

Useful resources I found while making a web spider

For the past few days, I have been trying to implement a javascript-enabled web spider, and finally I successfully implemented it yesterday.

Actually, it was an internship challenge task given by SocialCops, and I finally submitted it today. Fingers crossed for the results !

This post is not about how to make web spider or any resource provider of some sort for the same. Sorry if you landed here because of the misleading title!

I am writing this post, so as to keep a list of all the great links that I found while making the web spider, the ones that I would visit frequently from now on. Almost all of them are programming related, and I assure you that they are just awesome!

Have a look on them!


Too many of them, but all of them are kind of gems!


Friday, March 4, 2016

Self-realization : Why I have not been able to do what all I want to do?

First things first !

I want to do a lot of things, and I mean it. Loads of stuff. I want to be a good competitive programmer, I want to implement my ideas and I have to learn full stack development for that, I want to learn a lot of maths around me, I want to many of the physics concepts that I never understood in my school time, I want to make many science projects, I want to learn to play guitar, to learn about machines, to design, to work on distributed systems, to make contributions to open source, to read research papers, to understand those papers, then to come up with my own ideas, to learn the hell of everything in my computer system, and the list goes on.

Problem?!

I haven't done anything as of yet, and I am nowhere even near to anyone of these.

This should be very clear to anyone who look at my recent posts as all of them have been related to what all problems I am facing when focusing on any particular thing, and all the solutions that I have tried so far.

Solution?!

Yesterday I gave the my last mid-semester paper, and that opened my eyes to the real root of the problem, and what could be done for that.

When I was preparing for this exam, I was procrastinating to such an extent that I started studying for this subject only hours before the exam.

So, why did I stop procrastinating at some point before the exam? Because the exam time was fixed. It could not be delayed. If I had the power to delay it, I would have continued with my procrastination.


Another problem?!

Most of the things I want to do, don't have a fixed deadline. Okay there is one, my death. But I guess I am nowhere serious about it. Maybe I have forgotten that I am a mortal being.

Quick glance!

So, what I have been doing till now to achieve what I want to?!

2 things -


  • One, I start with one thing, but after some time I switch to another thing, never to see the face of the previous one most of the times.
  • I try to adjust two, three of four things together, making a routine, and all those shitty stuff.

None of them work, and they won't ever.

Time to change the approach.

One good thing that I started doing lately is mark the things that I want to in my phone calendar, and I don't add something like "I will do X in 1 year", but something I can do in a few days.

But because of procrastination, I end up delaying it, just to remove it from my to-do list after some time without even doing it.


So, what I am going to now?!

Here is the list, and I am going to strictly adhere to it. And I mean it.

  • Combine the short tasks with short rewards. Complete your small task, and get rewarded. A movie, or an episode from House M.D. works well.
  • As a task enters your to-do list, it gets completed no matter what. There is no turning back from now on.

And this is all what I meant when I made this tweet in the morning.


I thought it would be great if I make it clear to myself what I would be up to from now on. This article helped me do that.

Time to reach the sky !



Thursday, February 11, 2016

How could my focus power improve?

Okay, I have already described in my earlier posts how difficult it has been for me to focus at a single task. I still remember how difficult it has been. But lately, I have sensed something strange with me. Even I am surprised how it could be. In the past days, I have been able to focus on my current tasks almost effortlessly.

I am writing this post to document what all changes have come in my lifestyle, intentionally or not. This will help me understand what is that thing that is working for me.


  • First, I have stopped sleeping early. I have tried this for 3 semesters now, and it didn't work. So, this semester I have started waking up till late at night ( around 2 am ) and I wake up at around 8-9 am.

    Now, two things are here to be noticed. Firstly, I am sleeping late at night, and secondly I am now sleeping for only 6-7 hours a day. While earlier, I, many a days, used to sleep for 9-10 hours. So, forcibly reducing my sleep has done this good to me? May be.
  • Secondly, I now use a calendar, where I mark the tasks that I have to do, and once I complete those tasks that I move on to other tasks.
  • May be this is just an after effect of first point but right now I am doing a lot of hard work, and I mean it. I can feel it, seriously. Which in itself makes me happy.
  • Earlier, I used to start a task and not finish it, but now I take a task, and I finish it most of the time. This makes sure that there are no dangling pointers in my head. This may be a key ingredient here.
I can think of all this only. I will update it if I realize that there is something more to all this. Till then, keep going !

And yeah, I have not yet written my experiences of ACM ICPC Chennai regionals. I will write that one too in the next few days.

Sunday, January 17, 2016

Break time : Starting my journey to Chennai tomorrow !!

Time for a break.

Not exactly, as I would still be solving algorithmic problems. But not from UVAoj. I would be leaving tomorrow from here for ACM ICPC Chennai regionals.

Guess what I didn't know a day back what I would be doing during all my journey. During an interaction with a junior, I realised the contest problems given for IITB internship are quite challenging. ( My definition of challenging is a problem that I can't think of a solution for in a few seconds )

So, yeah those are challenging. So, I would be spending my time with them only, and ofcourse how can one forget the Cormen book. And I guess these two are more than to make the journey lively.

See you all on the Republic Day of India.

Till then, ek break to banta hai yaar !

Saturday, January 16, 2016

UVA 10258 : Contest Scoreboard

This problem will always remind me how important it is to read the problem carefully. Very carefully. Most of the mistakes that I did could have been avoided, had I read the problem statement with patience.

Mistakes I did :
  1. I didn't read what was required in the output correctly. They asked for all those who have made a submission, I rather gave the output only for those contestants who made a correct submission.
  2. I didn't take care of the test case where the user will submit the correct output for the same problem more than once. I thought of it while starting to program, but then ignored it. Big mistake, indeed !

One mistake that I was going to do, was I didn't yet got what to do if user submits wrong answer after a correct submission. Guess what?! It was clearly mentioned what's needed to be done in the question itself. My first mistake saved me from this one.

I also learned a few new C++ features, namely, stable_sort, peek, get. I am yet to understand how to use stable_sort properly.

[5:57 PM] And yeah, I made another mistake just now. Foolish me!! Once again I have to say that I didn't read the problem properly because I missed the case that there is no penalty for unsolved problems. Damn it, it look a long time to correct this mistake.

I also got to know of stringstream, although I haven't used it yet.

Here is my solution for the same : https://github.com/ashwani-pandey/UVAoj-solutions/blob/master/10258.cpp

Thursday, January 14, 2016

Some more motivation for goals v2 !!

Ah, these second versions. I don't like to write them, but they do happen to be a reflection of the flaws in the previous version.

In my previous post, I talked of my desire to buy bean bags. I still do want them, but the point is the ones that are available in the nearby market right now aren't good enough for the price I might be paying.

Thus, it made me think of what might be more desirable than this. Seriously?! And then it hit me. I also really want to see many a television seasons, and what could be a better reward than this.

So, the goals remain the same as in the last post, but what changes is the prize money. Actually it's not money, you know. It's the first 3 seasons of Friends. Boom!! Boy, what more could you have asked for.

I thought for a moment to just go with prize of one season, but then if the work is so hard, then the prize should be a bigger one too. Isn't it so?

Now, what you are thinking and why the hell am I typing all this rubbish?! Just go, and get it, remember laughter is at stake this time.

Halla Bol !! 

Monday, January 11, 2016

Some more motivation for goals!!

Ah, I started with this "goal" thing two days back, and wohooo guess what?! I haven't studied a single thing in the past two days. Going really fast towards my goal, doesn't I. Shit man, I want to slap myself but I have got a better idea.

Actually today I went to the market to buy bean bags, and boy, I seriously want those. When I was trying those bags, this "awesome" idea struck my mind.

I want this, right. But how badly do I want this?! The answer is I wanted to get it packed at that very moment only. And the next question is what's the most important thing I need to do right now? Well, I know in my mind and ofcourse in my blood-pumping heart too, that I need to solve those three chapters of CP book before I start with a full-swing participation in coding competitions. Even my first goal is related to this : http://thisisashwanipandey.blogspot.in/2016/01/goal-1-moving-some-steps-forward-in.html

Huh, then I guess trade is simple. At least for me. Solve the three chapters : Data structures and libraries, Problem Solving Paradigms, and Graphs. And get ready to enjoy the comfort of bean bag.

I am going to do every thing that it takes to get it done now.

Halla Bol !



Saturday, January 9, 2016

Goal #1 : Moving some steps forward in competitive programming

Ah, this is one thing that I want to do the most, and I have delayed the most. So, no more delays.

The goal is simple : to solve the starred questions from the second chapter of the CP book by Steven Halim sir.

It's going to be awesome when you wake up excited to finish your task, and sleep thinking of your task. No more hassles or melodrama of making any schedule of what I will do when!!

Just adventure!! De Dana Dan Goal !



Resolution 2016 v2

Well, I wrote a resolution for myself a few days back here : http://thisisashwanipandey.blogspot.in/2016/01/resolution-2016.html.

Although it is a good one to have a healthy lifestyle, I didn't address the problem that haunted me the entire 2015. And that is : how I am going to improve my focus. Yes, this single word "focus" has been a trouble for too long now.

I need a solution now, right now.

And what I have found is that the best way to deal with the situation is to change the way I approach my work, rather than changing one of the so many daily tricks that I have applied to improve my focus.

If I change my approach towards work, focus will damn search for me itself.

What I have noticed is I have a long to-do list, a really long one with so many things to do that only I can imagine right now. And, what I do is I divide my daily time for a few activities, and my mind keeps on adding so many other stuff that I want to do in my daily activities.

Result?! I can't focus on any single thing, and nothing gets done, plus I feel sad that I did nothing.The quote fits quite perfectly here that you can dig a well only when you dig at the same place the whole day, instead of digging at so many points on the land. It will lead to no result.

So, what I am going to do now? From now on, I will write of a task, not-so-big and not-so-small, and will pursue that one only until I finish it to the level that gives me some satisfaction. And then only I will start with another task.

This will make me feel good as I could see my accomplishments, further boosting the energy in me to do more, rather than contemplating what time should I allot to which task.

Good luck, my boy. De Dana Dan Goal !

Monday, January 4, 2016

North-East earthquake experience on Jan 4, 2016 : The need for the practical education of disaster management

Ah, the second earthquake of my lifetime that I felt. And this one was powerful.

A few facts beforehand, I study in Silchar, and the epicenter of the 6.7 magnitude earthquake was just around 200 km away. That's why, as I said, it was powerful.

I was sleeping in my dorm room, but suddenly my eyes opened. I could feel myself shaking on the bed quite heavily. A distant light also seemed to be moving a lot. Microseconds later, I noticed voice of Pranav, my roomie, shouting of the earthquake, and so was the other roomie.

And I, without any sleepers and coat in this winter time hopelessly ran for the main gate. But is it all?!

No, that's not why I wrote this blog. I wrote it because I chose the worst possible path to escape the building. Had the building fallen, I was certainly going to be badly injured, in worst case, I won't be alive to write all my stupidity.

So, I ran thorough the narrow corridor of atleast 100 meters before reaching the main gate. And that was really too much, plus I didn't even consider that the building might fall.

What I could have done?! Well, firstly I should have waited beneath the table or bed till the earthquake stopped. I rather chose to run, as soon as I got to know it was an earthquake. That was the first stupidity.

Secondly, I ran more than 100 meters to reach the main gate. Guess what?! I have a balcony attached to my room, and my room is on ground floor. The safe zone was at most few meters away from me, but I rather foolishly chose the distant one, and that too this much.

All this made me accept that I am stupid, and foolish, and seriously a hell lot of foolish. But I feel it is good to accept all this and not to repeat the same hurried actions again, rather than repeat all this.

Remember, luck favors the bold !

Further, I noticed after the incident, that most of the students were just like me, stupid and ignorant, whether they accept it or not. This brings to attention the need to provide practical education of disaster management, to one and all.

We, as students, only learned the theory for this, and that too as a secondary subject. Not much importance is given to this subject, mainly to the practical aspects, in India. People sitting in the education ministry should take note of this, and I say all this with the Indian education in primary focus.

Till the next earthquake or any such natural disaster hits me, I would love to know more of what to do before, during and after such events, and I am surely going to know that, learn that, and be prepared, so that even if the luck choose to go against me the next time, I have my knowledge to keep me alive !




Sunday, January 3, 2016

UVA 11340 : Newspaper

 Ah, this question led me to learn new things, strangely.

It is pretty easy to implement this one, but I was getting WA. And then when I went on uDebug, I found this link : http://www.redgreencode.com/solving-uva-11340-in-java/  and I thought may be character encoding/decoding would be the reason I am stuck.

So, I read this article followed by another good article : http://www.joelonsoftware.com/articles/Unicode.html. I really enjoyed reading both of these articles. It's always great to learn something you don't know of, and I certainly didn't knew of unicode and all the stuff.

But alas, I still got a WA even after doing all the implementation corrections as mentioned in the articles. Later, I found out that the reason I am getting WA is because after finding the answer in cents, I was doing something as I have shown in the code uva11340-wrongway.cpp

You see the stupidity I was doing?! Well I was mixing up the strings with floating point values, and that's why all those WAs.

Simply the following has had to be done, as shown in the code uva11340-rightway.cpp!!


See if you have done some silly mistake like that, it was a big lesson that I learned today.


Friday, January 1, 2016

Resolution 2016

I always think of writing my resolution at the start of the year, but never really write it. May be that can be one resolution to do what you want to do.

But no, my resolution is something different. It's not related to what I want to become or anything of that sort, but rather what I want to do.

It's very simple.

I just want to wake up everyday from now on early in the morning, and go for a walk or run, and also not to sleep more than 7 hours on any given day.

Simple, isn't it?!

The adventure is in the next part. To be consistent. Don't miss the "everyday" that I mentioned in my resolution.

That's it. Yeah.

And yes, that's the only resolution I make this time. All the best.