tag:blogger.com,1999:blog-52975013428593934572024-03-14T10:50:46.562-07:00221BAshwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.comBlogger57125tag:blogger.com,1999:blog-5297501342859393457.post-57407754255911386052017-01-28T07:10:00.000-08:002017-01-28T08:59:53.214-08:00The Alchemist - The winds will never feel the same again! ;)<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
When I began to read this book during my flight, the person next to me told me that I would see this book with a different perspective 10 years from now. I don't know about that, but I really found this book quite awesome.<br />
<br />
There are a few recurring themes in the book.<br />
<br />
..<br />
<br />
The very first, and one around which the story revolved is of the treasure. The treasure that the king told him of. The treasure that his dreams told him about. The very same treasure that took him from Spain to Egypt.<br />
<br />
But when I was done reading this book, I asked myself if the treasure really mattered to him at the end. If you really ask the soul of Santiago this question, his answer is going to be no.<br />
<br />
You know what his real treasure was - his journey. The journey that evolved him in so many different ways. He came to know other businesses, understood the language of the world, met the woman of his life, and realised so many different things.<br />
<br />
So, once I completed this book, I didn't need a dream to happen to find my treasure. Neither do you! We just need to seek more than our routine life we are accustomed to, like Santiago was being a shepherd, and boy, that's where you will find the treasure.<br />
<br />
..<br />
<a name='more'></a><br />
Then, there is the recurring theme of the fear of losing what we already have, the fear of leaving behind the comfort zone. Santiago initially feared losing his sheep, and that he had to get out of his comfortable life of being a shepherd.<br />
<br />
Then he feared being in an unknown land with people speaking a totally new language. Next, when he was leaving the merchant's shop. Then, the same thing happened when he had to leave behind Fatima for the treasure. <br />
<br />
The crystal merchant had the same fear. The story simply shows that you can achieve things only when you face this fear, and it does convey this quite beautifully by showing the contrast in between the two characters.<br />
<br />
Only when we face our fear of getting out of our comfort zone, we can expand our horizon.<br />
<br />
..<br />
<br />
Next, you will find this word "MAKTUB" written throughout the book. The crystal merchant told that it means - "It is written". What does "it" refer to? I was confused initially, but then I kind of realised what it means.<br />
<br />
You know what it means? It simply means that it is written that the results are out of your control. They are out of my control. We can only focus on the present, and surrender the control that we are so egoistic about. That's what it means to me! :)<br />
<br />
..<br />
<br />
We also see Santiago and many others referring to omens so many times in the book. But hey, omens are just an illusion. Isn't it so?<br />
<br />
But if you look deep through those lines, what's there is nothing but intuitions behind those omens. Things we know can happen, things that show subtle signs of future. We ignore them. Santiago, fortunately, didn't.<br />
<br />
And then, how can we forget the person who has been the title of this fable too - the alchemist. You know who he was. He was the very same person, who understood all the themes that I just discussed. He knew life!<br />
<br />
While writing of the alchemist, I remembered the Englishman. His character displays this delightful concept of focusing on learning and understanding. His, on the other hand, was to make gold. But isn't it true that most of us are like the Englishman only. The only thing we care about is name, fame and money, which happens to be the gold of the present.<br />
<br />
So, the fable conveys to be the alchemist. <br />
<br />
But then what's the difference between the Englishman and Santiago. Wasn't Santiago also looking for treasure? Yep, he was! Even then, the alchemist said that he was ready, but the Englishman wasn't.<br />
<br />
What I could reason out is that Santiago was not just after the treasure. He was enjoying his journey. He wasn't trying to control what lies in future. If it had to be put in the words of the alchemist, it would be - "They were looking only for gold. They were seeking the treasure of their destiny, without wanting actually to live out the destiny."<br />
<br />
..<br />
<br />
The book also talks regarding the language of the world, which couldn't get more fascinating having seen the movie Arrival a few days back. It's true that words don't hold any meaning of their own, and yet we rarely ponder over this. It's all our emotions!<br />
<br />
Language, indeed, is very interesting in itself.<br />
<br />
There are many other things in the book, that I couldn't get my head around for now. Especially the part where Santiago talks with the desert, the wind and the sun; and also the piece where the alchemist talks about the matters of heart, and of the Soul of the World with him, while on their way to the Pyramids.<br />
<br />
The only thing I could understand a bit is the last line of this piece of fable and that is, the soul of God is my own soul. That I could perform miracles!<br />
<br />
Perhaps the fellow flight passenger was right in what he said. Understanding all this will take time, just like the shepherd took his time. Perhaps years from now, on my journey to some of my very own Pyramids! :)<br />
<br />
But one thing is for sure. The winds will never feel the same again! ;)<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/16015126121638862878noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-68906606540644044482016-12-19T09:55:00.001-08:002016-12-19T10:15:19.857-08:002017 - A STEP TO BUILD THE PERSON I DESIRE TO BECOME<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
< This is a live post, and will keep on updating till 30th of December 2017 ><br />
<br />
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!<br />
<br />
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?<br />
<br />
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! :)<br />
<br />
..<br />
<br />
I will be measuring up myself in 2017 against the following yardstick -<br />
<br />
1. <b>My technical goals</b> - 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!<br />
<br />
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.<br />
<br />
2. <b>My technical posts</b> - 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!<br />
<br />
3. <b>Reading books</b> - 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.<br />
<br />
4. <b>Watching Movies</b> - 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!<br />
<br />
5. <b>Travelling Places</b> - Tagging yourself as a "traveller" doesn't help, going out to places does.<br />
<br />
6. <b>MOOCs for self improvement</b> - 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.<br />
<br />
7. <b>Contribution to the society</b> - 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.<br />
<br />
<br />
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!<br />
<br />
I will be placing this post as a page on my blog, and will keep updating the page with my progress.<br />
<br />
Happy New Year to all.<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-42474137273716094222016-12-07T07:28:00.000-08:002016-12-07T17:54:41.851-08:00V for Vengeance<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I didn't know what Vendetta mean when I heard the name of the movie. But now I do. I also know its power!<br />
<br />
As I write this, a few of the movie scenes flash through my mind - <b>V's crazy introductory monologue, his revolutionary speech, the kind of rebirth of Evey, the fall of the dominoes, and the final fight scene!</b> <br />
<br />
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.<br />
<br />
But is it really this, the movie or the novel wanted to convey?<br />
<br />
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!<br />
<br />
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 <a href="http://www.imdb.com/title/tt1855924/">Third Reich: The Rise and Fall</a>, <a href="http://topdocumentaryfilms.com/banking-with-hitler/">Banking with Hitler</a>, and <a href="http://thegreateststorynevertold.tv/">Adolf Hitler - The Greatest Story Never Told</a>.<br />
<br />
..<br />
<br />
But there is more. There are many a elements in the movie that makes it this awesome.<br />
<br />
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. <br />
<br />
I would just quote those lines from the movie!<br />
<blockquote class="tr_bq">
<i>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..</i></blockquote>
And then at the very end, these lines by V speaks of the influence of an idea on the people who believe in them!<br />
<blockquote class="tr_bq">
<i>Beneath this mask there is more than flesh. Beneath this mask there is an idea, Mr. Creedy. And ideas are bulletproof.</i></blockquote>
..<br />
<br />
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.<br />
<br />
Isn't it the same theme going all around? The only way not to let our fears overpower us, is to face them.<br />
<br />
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!<br />
<br />
And then her feelings when V set her free. That reminded V of his own feelings when he became free. To put it simply, <b><i>God is in the rain.</i></b> <br />
<br />
..<br />
<br />
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.<br />
<blockquote class="tr_bq">
<i>I remember how "different" became dangerous. </i></blockquote>
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.<br />
<br />
His remark on the power of words was something to think about.<br />
<blockquote class="tr_bq">
<i>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. </i></blockquote>
<br />
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.<br />
<blockquote class="tr_bq">
<i>[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. </i></blockquote>
<blockquote class="tr_bq">
<i>[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.</i></blockquote>
<blockquote class="tr_bq">
<i>[3] Vi Veri Veniversum Vivus Vici. By the power of truth, I, while living, have conquered the universe.</i></blockquote>
<blockquote class="tr_bq">
<i>[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.<br /><br />.. 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></blockquote>
<br />
I couldn't resist myself from quoting the mentioned quotes of Shakespeare. <br />
<i><br /></i>
<br />
<blockquote class="tr_bq">
<div class="sodatext">
<i><a href="http://www.imdb.com/name/nm0915989/?ref_=tt_trv_qu"><span class="character">V</span></a>:
[<span class="fine">V interrupts the three policemen about to rape Evey, whips out a dagger, and quoting the sergeant from Macbeth Act I Scene 2</span>]
"The multiplying villainies of nature do swarm upon him </i><br />
<i>
[<span class="fine">skips 4 lines from the original Shakespeare</span>] </i></div>
</blockquote>
<blockquote class="tr_bq">
<div class="sodatext">
<i><a href="http://www.imdb.com/name/nm0915989/?ref_=tt_trv_qu"><span class="character">V</span></a>:
disdaining fortune/with his brandish'd steel, which smoked with bloody execution...?</i><br />
<br />
..<br />
<i><br /><a href="http://www.imdb.com/name/nm0915989/?ref_=tt_trv_qu"><span class="character">V</span></a>:
[<span class="fine">Quoting Polonius from Shakespeare's Hamlet Act 3, Scene 1</span>]
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.<br /><br />..</i><br />
<div class="sodatext">
<i><a href="http://www.imdb.com/name/nm0915989/?ref_=tt_trv_qu"><span class="character">V</span></a>:
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. </i><br />
<i>
[<span class="fine">quoting Shakespeare's Richard III, Act I Scene 3</span>]</i><br />
<br />
..<br />
<i><br /></i>
<br />
<div class="sodatext">
<i><a href="http://www.imdb.com/name/nm0915989/?ref_=tt_trv_qu"><span class="character">V</span></a>:
[<span class="fine">Quoting Viola from Twelfth Night Act I Scene 2</span>]
Conceal me what I am, and be my aid For such disguise as haply shall become The form of my intent. </i></div>
</div>
</div>
</blockquote>
<br />
<br />
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.<br />
<blockquote class="tr_bq">
<b><i>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.</i></b> </blockquote>
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-29034672294397658092016-10-21T11:34:00.001-07:002016-10-21T11:34:23.992-07:00A few simple graph problems, and their interestingly cute solutions!<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Recently, I was solving a few graph problems from <a href="https://ocw.mit.edu/courses/xx%20%20and-computer-science/6-006-introduction-to-algorithms-fall-2011/recitation-videos/MIT6_006F11_rec18.pdf">here</a>, 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.<br />
<br />
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.<br />
<br />
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 <a href="https://ocw.mit.edu/courses/xx%20%20and-computer-science/6-006-introduction-to-algorithms-fall-2011/recitation-videos/MIT6_006F11_rec18.pdf">here</a>.<br />
<br />
<br />
<br />
<ol style="text-align: left;">
<li><b>Design an algorithm that finds all bridges in undirected, connected graph G in O(V ยท E) time.</b><br /><br />Actually this is the third part of one question. They beautifully and thoroughly made the students think over the solution. <b>The key idea is to think of the BFS tree of the graph.</b><br /><br />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.<br /><br />What an amazing way to teach students how to solve problems!<br /><br /></li>
<li><b>To find an efficient algorithm to find the number of paths in directed acyclic graph G from s to t.</b><br /><br />Topological sorting, and storing the number of paths to all the vertices, using the previous counts to build the next ones!<br /><br /></li>
<li><b>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.</b><br /><br />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.<br /><br />But remember, we are finding the number of shortest paths in an unweighted graph!<br /><br /></li>
<li><b>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.</b><br /><br />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.<br /><br /> </li>
<li><b>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.<br /></b>This is my favourite of all. The solution just requires understanding the basic definition <br />d[u,v] = d[u,vc] + d[vc,v]. And there you have it.<br /></li>
</ol>
<div>
I found all these questions to be quite mind-stretching, and yet looking out for only the elements of understanding in me!</div>
<div>
<br /></div>
<div>
</div>
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-23176668897993568402016-10-16T00:05:00.002-07:002016-12-07T17:55:48.973-08:00Waiting!<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I really enjoyed watching this movie <a href="http://www.drishyamfilms.com/films/waiting.php">Waiting</a> last night. It has something in it which most of us ignore.<br />
<br />
If I am asked to summarize the message of this movie in a few sentences, it would go on something like this. <b>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!</b><br />
<b><br /></b>
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."<br />
<br />
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.<br />
<br />
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 <a href="http://www.imdb.com/title/tt1438298/">Guzaarish</a>? Conflicting!<br />
<br />
I would love to hear your opinions in the comments!<br />
<br />
..<br />
<br />
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.<br />
<br />
Stephen Hawking has this great line in the end of the movie <a href="http://www.imdb.com/title/tt2980516/">The Theory of Everything</a> - "<b>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.</b>"<br />
<br />
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!<br />
<br />
<a name='more'></a>The other quote comes from <a href="https://en.wikipedia.org/wiki/Gregory_House">Gregory House</a>. Oh, please don't say that you don't know him. But he has a lot to say on this topic, and here was one little <a href="http://www.imdb.com/title/tt1274484/quotes?item=qt0461888">piece</a> from him on this to Thirteen - "<b>Almost dying changes nothing, Dying changes everything.</b>"<br />
<br />
I would just repeat the last sentence of Hawking because that's where the essence lies - <b>While there is life, there is hope!</b><br />
<b><br /></b>
..<br />
<br />
Then the movie speaks of <b>the four phases that we go through when we are going through a bad situation : denial, bargaining, depression, acceptance.</b> Interestingly, they all come in this order only.<br />
<br />
And the talk of positivity that everyone showers on us in difficult times is useless. You really want to make the other person feel better? Make them talk, and better listen. It might work.<br />
<br />
While both the main characters in movie conveyed all these things quite beautifully, we might tend to forget the role of the doctor here. The one whose emotional intelligence is of utmost importance while dealing with the patients.<br />
<br />
I always have a great respect for doctors. How come someone be so good at managing their work life balance? The doctors are the best people to learn from! He was the one in the movie who knew what was a better for the patients, and their family members. And this is what the ending reflected.<br />
<br />
Speaking of the ending, their final decisions reflected how powerless we are. Our limited knowledge of medicine can't help our dear ones. <b>We can just have a faith on good doctors and "wait"! </b>:)<br />
<br />
..<br />
<br />
And yeah, I feel better with this blog as my noticeboard, rather than some social media site. At least, I am proud of what I write here! :)<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-20311652000214419222016-10-15T05:21:00.000-07:002016-10-16T00:08:33.449-07:00Lakes in Berland : Why coding your solution is a good idea? <div dir="ltr" style="text-align: left;" trbidi="on">
<i><br /></i>
<i>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!</i><br />
<br />
The question : <a href="http://codeforces.com/contest/723/problem/D">Lakes in Berland</a>. 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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
..<br />
<br />
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.<br />
<br />
<b>MIstake #0</b> : 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.<br />
<br />
<b>Mistake #2 :</b> 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!<br />
<br />
<a name='more'></a><br />
<b>Mistake #3 :</b> I was using a function parameter to decide whether to change water to land, and I forgot to change its value to 1, so in my answer, water cells that need to get converted didn't get converted<br />
<b><br /></b>
<b>Mistake #4:</b> Now, I was pretty sure that my code worked, and so I submitted it again, and BAM it failed again, and this time for the test case<br />
<br />
<div style="text-align: center;">
<b>1 1 0</b></div>
<div style="text-align: center;">
<b>.</b></div>
<div style="text-align: center;">
<b><br /></b></div>
<div style="text-align: left;">
Seeing this, I was like, what the hell. Why didn't I think of this. And then the cure I proposed was a quick if else condition if the test case consisted of single row or single column!</div>
<br />
<b>Mistake #5 :</b> The solution I proposed above is a perfect example of why I should not see the failed test case as an exception, but rather a glitch in the code itself.<br />
<br />
Why?! Because it failed failed again at another test, and it was this time I saw the fault in my code.<br />
<br />
I was basically accessing the first element of one of the arrays every time even when it was quite possible that the array may contain nothing. And the array will definitely contain nothing, when there exist no lakes in the map.<br />
<br />
The fix I proposed this time was better, and especially not an exception.<br />
<div>
<br /></div>
<div>
<b>Mistake #6 :</b> This time one test case failed as maximum recursion depth had reached, although the test case was very simple. Since I used recursion, my code was reaching a depth of around 2500, and therefore the runtime error occurred. I reset the recursion depth limit to fix this.</div>
<div>
<br /></div>
<div>
At this point, I noted down 2 things in my mind. One, when using recursion, make sure you know how much depth your recursion can travel based on the constraints, and set the limit accordingly.</div>
<div>
<br /></div>
<div>
And secondly, better use iteration in DFS instead of recursion. I realized it later last night only that it is quite simple to code the iterative version. </div>
<div>
<br /></div>
<div>
And that's how I spent my morning today, coding the iterative version.</div>
<div>
<br /></div>
<div>
..</div>
<div>
<br /></div>
<div>
It was quite a good time solving this question. Quite a good way to make myself realize that just knowing the pseudo code of an algorithm is not enough. Implementation has its own importance!</div>
<div>
<br /></div>
<div>
I am now going to jump over to another problem on HackerEarth, <a href="https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems/algorithm/kingdom-of-monkeys/description/">Kingdom of Monkeys</a>. It's quite similar to this one, and hopefully I would code it sooner that this one, without any need to introspect my mistakes.</div>
<div>
<br /></div>
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-82524139281046454622016-10-12T10:43:00.001-07:002016-10-12T11:01:52.925-07:00Polycarp At The Radio - Importance of maths in programming!<div dir="ltr" style="text-align: left;" trbidi="on">
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.<br />
<br />
But recently I tried to solve a problem which made me realize the importance of mathematical intuition when it comes to programming.<br />
<br />
I started to solve this problem on Codeforces, <a href="http://codeforces.com/contest/723/problem/C">Polycarp At the Radio</a>, 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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
..<br />
<br />
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.<br />
<br />
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.<br />
<br />
I am linking a github gist <a href="https://gist.github.com/ashwani-pandey/3bac9c254308ae83e528c5bdd0c44097">here</a>, containing both the buggy and the correct codes, to show how complex a program can get because of the lack of simple mathematical intuition.<br />
<br />
Just give this puzzle a try before you hop on to another post of someone else! :)<br />
<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-89788103781128572772016-08-07T14:55:00.001-07:002016-10-12T10:49:48.603-07:00Sunday Times : Finally watched "The Intern"<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
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.<br />
<br />
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.<br />
<br />
The next two days then just passed by, in celebration. I am in still in disbelief, really!<br />
<br />
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.<br />
<br />
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.<br />
<br />
<br />
----------<br />
<br />
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
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!<br />
<br />
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.<br />
<br />
And yeah, now I also know why men should carry handkerchief.<br />
<br />
I would end this post with a very motivating quote I read today - "If you don't prioritize your life, someone else will".<br />
<br />
Goodbye. See you all next week!<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-11798489571244272212016-06-29T10:06:00.002-07:002016-06-29T11:50:50.561-07:00Learning the open source way at dgplug!<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I still remember a first-year college student who, in 2014, somehow got to know of <a href="https://dgplug.org/">dgplug</a> through Quora, and just jumped on the ship.<br />
<br />
I still have that post that I wrote that time just like this one! <a href="https://thisisashwanipandey.blogspot.in/2014/07/my-experience-with-dgplug-summer.html">https://thisisashwanipandey.blogspot.in/2014/07/my-experience-with-dgplug-summer.html</a><br />
<br />
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!<br />
<br />
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.<br />
<br />
..<br />
<br />
Regarding the current session going on, I got to have a virtual session with one core python developer, and I got to know about <a href="http://docutils.sourceforge.net/rst.html">rst</a>, <a href="https://www.gnu.org/software/bash/">bash</a> and <a href="http://www.sphinx-doc.org/en/stable/">sphinx</a>. 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!<br />
<br />
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.<br />
<br />
..<br />
<br />
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 <a href="https://dgplug.org/">dglpug</a>. And a big thanks to the dgplug team, who take out their precious time to teach others all this exciting stuff.<br />
<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-60363274404756451382016-06-19T09:37:00.001-07:002016-06-19T09:40:27.366-07:00No more Quora for the rest of the rest of the year, and a few more stuff !<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I discovered <a href="http://quora.com/">Quora</a> 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!<br />
<br />
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.<br />
<br />
For the past few months, the only people whose answers I have reading thoroughly are <a href="https://www.quora.com/profile/Balaji-Viswanathan-2">Balaji Viswanathan</a> and <a href="https://www.quora.com/profile/Richard-Muller-3">Richard Muller</a>. That's it.<br />
<br />
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.<br />
<br />
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".<br />
<br />
So, does that mean I am going to sacrifice the great articles by Balaji. Not at all. I have started using <a href="http://feedly.com/">feedly</a> for the same, to read from time to time, the contents of my favourite blogs.<br />
<br />
So, this was all with Quora. See you next year!<br />
<br />
<br />
...<br />
<br />
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.<br />
<br />
In the past few months, I have tried a lot of things, including a <a href="http://thisisashwani.quora.com/">blog</a> on Quora, a <a href="http://thisisashwanipandey.wordpress.com/">wordpress blog</a>, one on Medium, and so on.<br />
<br />
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 <a href="http://disqus.com/">Disqus</a>, 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!<br />
<br />
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.<br />
<br />
I mainly write for myself. And for people, who might someday land on and like this unknown part of the web! :)<br />
<br />
Bye!<br />
<br />
<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-21027079281360803682016-06-13T06:45:00.000-07:002016-06-18T06:34:30.509-07:00Why you should not study CSE at NIT Silchar?<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b>One reason!</b><br />
<b><br /></b>
<b>Because it's awful when it comes to academics!</b><br />
<br />
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 <b>I am talking about here is related to academics and the quality of faculty, nothing else.</b><br />
<br />
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.<br />
<br />
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.<br />
<br />
<b>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.</b><br />
<br />
<b>Only one or two faculty in the CSE department do have Phd</b>, 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.<br />
<br />
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.<br />
<b><br /></b>
<b>To those who are attacking me with the argument that same is the case with all the institutes, you are wrong buddy.</b><br />
<br />
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 :<br />
<br />
<div>
<br /></div>
<div>
<ul style="text-align: left;">
<li>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.<br /><br />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.<br /><br />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.<br /><br />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.<br /><br /></li>
<li>Don't give too much priority to NITs. A few of them are awesome but the rest of them sucks.<br />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.<br /><br />I might have forgotten to name a few good NITs. Ping me if that's the case.</li>
</ul>
<div>
<br /></div>
<div>
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.<br />
<b><br /></b>
<b>But well, one can get these "outside-the-classroom" learning opportunities in other colleges too. Why risk your academics?</b></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-6715564378992623882016-05-29T23:17:00.000-07:002016-05-29T23:19:31.192-07:00IITH Internship Diary - Week 2 : Troublesome Implementation<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
<br />
<ul style="text-align: left;">
<li><a href="https://github.com/soumith/cvpr2015/blob/master/Deep%20Learning%20with%20Torch.ipynb">https://github.com/soumith/cvpr2015/blob/master/Deep%20Learning%20with%20Torch.ipynb</a></li>
<li><a href="https://web.archive.org/web/20160216003701/http://code.madbits.com/wiki/doku.php?id=tutorial_basics">https://web.archive.org/web/20160216003701/http://code.madbits.com/wiki/doku.php?id=tutorial_basics</a></li>
</ul>
<div>
<br /></div>
<br />
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.<br />
<br />
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.<br />
<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-26155966020101286242016-05-23T00:14:00.000-07:002016-05-23T00:15:21.486-07:00IITH Internship Diary - Week 1 : Getting the basics slowly<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Well, the week started with a meeting with my mentor professor <a href="http://www.iith.ac.in/~vineethnb/">Dr. Vineeth</a> 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.<br />
<br />
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 <a href="http://neuralnetworksanddeeplearning.com/chap1.html">here</a>. <a href="http://michaelnielsen.org/">Michael Nielsen</a> 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 <a href="http://www.ted.com/talks/michael_nielsen_open_science_now">his TED talk on open science</a>.<br />
<br />
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.<br />
<br />
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.<br />
<br />
Sunday was a day well spent, learning about LSTMs. <a href="http://colah.github.io/">Christopher Olah</a> 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.<br />
<br />
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!<br />
<br />
Bye!<br />
<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-68997314977112197202016-05-15T23:08:00.000-07:002016-05-15T23:08:49.962-07:00IITH Internship Diary - Week 0 : Health Problems<div dir="ltr" style="text-align: left;" trbidi="on">
Week 0 is nothing, but about the week just before I arrived at IIT Hyderabad.<br />
<br />
And I wish I had some title other that than "Health Problems". But this is the truth, the hard one.<br />
<br />
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.<br />
<br />
I hope the next diary entries will be mostly related to my first research experience and not something stupid like this.<br />
<br />
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.<br />
<br />
Also I had some strange feeling when I first arrived here. I wrote more about it here : <a href="http://thisisashwanipandey.blogspot.in/2016/05/strange-feeling-of-loneliness-at-iith.html">http://thisisashwanipandey.blogspot.in/2016/05/strange-feeling-of-loneliness-at-iith.html</a><br />
<br />
Thankfully things are back to normal now. And there are a lot of mountains to climb.<br />
<br />
Bye!<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-79458946869883105812016-05-15T22:30:00.002-07:002016-05-15T22:30:25.773-07:00Strange feeling of loneliness at IITH<div dir="ltr" style="text-align: left;" trbidi="on">
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.<br />
<br />
I am writing this post to make myself understand what actually happened.<br />
<br />
So what actually happened? What made me feel like I should go back to my home as soon as possible?<br />
<br />
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.<br />
<br />
Then, the sweeper lady knew only Telugu, and it was a hard moment making her understand what I want to say.<br />
<br />
But this language barrier couldn't bring all this strange feelings. Let me see what else happened.<br />
<br />
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.<br />
<br />
I guess this was one trigger.<br />
<br />
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.<br />
<br />
I guess these two things mainly triggered the fear.<br />
<br />
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.<br />
<br />
Thankfully, things seemed normal by evening.<br />
<br />
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.<br />
<br />
But remember, it's not gone. It's there. I just got to see a sight of that and it was horrifying.<br />
<br />
It was the fear of the unknown that troubled me yesterday.<br />
<br />
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.<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-65019030070581748052016-03-27T13:08:00.002-07:002016-03-27T13:17:33.382-07:00Resources for loads of Linux fun<div dir="ltr" style="text-align: left;" trbidi="on">
I am very weak as of now in my understanding of Linux, but I am hell bent to be awesome at it.<br />
<br />
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!<br />
<br />
<br />
<ul style="text-align: left;">
<li><a href="http://eudyptula-challenge.org/">http://eudyptula-challenge.org/</a></li>
<li><a href="https://practicalunix.org/stanford-course-logistics">https://practicalunix.org/</a> : I will only touch any of the other listed links once I finish this one!</li>
<li><a href="http://linuxsurvival.com/linux-tutorial-introduction/">http://linuxsurvival.com/linux-tutorial-introduction/</a></li>
<li><a href="file:///home/little_pirate/Documents/TLCL-13.07.pdf">file:///home/little_pirate/Documents/TLCL-13.07.pdf</a></li>
<li>There were some pretty good questions here <br /><br /><a href="http://web.eecs.utk.edu/~plank/plank/classes/cs360/lecture_notes.html">http://</a><a href="http://web.eecs.utk.edu/~plank/plank/classes/cs360/lecture_notes.html">web.eecs.utk.edu/~plank/plank/classes/cs360/lecture_notes.html</a><br /><br /><a href="http://web.eecs.utk.edu/~plank/plank/classes/cs360/">http://web.eecs.utk.edu/~plank/plank/classes/cs360/</a></li>
</ul>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-21908936875349463332016-03-27T12:54:00.002-07:002016-03-27T13:09:41.655-07:00Resources for Capture The Flag<div dir="ltr" style="text-align: left;" trbidi="on">
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!<br />
<br />
This post is live and resources will keep on adding as I work through this :<br />
<br />
<br />
<ul style="text-align: left;">
<li><a href="https://trailofbits.github.io/ctf/index.html">https://trailofbits.github.io/ctf/index.html</a></li>
<li><a href="https://www.hackthissite.org/">https://www.hackthissite.org/</a></li>
</ul>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-77618326535543013142016-03-21T12:37:00.000-07:002016-03-21T12:37:23.793-07:00Olympic Athlete mindset !<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<span class="quora-content-embed" data-name="Studying/How-can-I-study-for-10+-hours-a-day-without-getting-depressed-and-how-can-I-make-myself-get-used-to-it/answer/Benjamin-Gregory-6">Read <a class="quora-content-link" data-width="559" load-full-answer="True" data-key="ffdb7707167fdc0e70dc3a6ef694972b" data-id="15299971" data-embed="kzyfOBw" href="https://www.quora.com/Studying/How-can-I-study-for-10+-hours-a-day-without-getting-depressed-and-how-can-I-make-myself-get-used-to-it/answer/Benjamin-Gregory-6" data-type="answer" data-height="250"><a href="https://www.quora.com/Benjamin-Gregory-6">Benjamin Gregory</a>'s <a href="/Studying/How-can-I-study-for-10+-hours-a-day-without-getting-depressed-and-how-can-I-make-myself-get-used-to-it#ans15299971">answer</a> to <a href="/Studying/How-can-I-study-for-10+-hours-a-day-without-getting-depressed-and-how-can-I-make-myself-get-used-to-it" ref="canonical"><span class="rendered_qtext">How can I study for 10+ hours a day without getting depressed and how can I make myself get used to it?</span></a></a> on <a href="https://www.__nousername__.main.quora.com">Quora</a><script type="text/javascript" src="https://www.quora.com/widgets/content"></script></span>Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-75673051808171584372016-03-21T09:32:00.002-07:002016-03-27T12:50:05.105-07:00Useful resources I found while making a web spider<div dir="ltr" style="text-align: left;" trbidi="on">
For the past few days, I have been trying to implement a javascript-enabled web spider, and finally I successfully implemented it yesterday.<br />
<div>
<br /></div>
<div>
Actually, it was an internship challenge task given by SocialCops, and I finally submitted it today. Fingers crossed for the results !</div>
<div>
<br /></div>
<div>
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!</div>
<div>
<br /></div>
<div>
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!</div>
<div>
<br /></div>
<div>
Have a look on them!</div>
<div>
<br /></div>
<div>
<ul style="text-align: left;">
<li>**<a href="https://www.reddit.com/r/dailyprogrammer/">https://www.reddit.com/r/dailyprogrammer/</a> ~ lots of interesting programming challenges</li>
<li><a href="https://opensource.com/life/15/6/2015-summer-reading-list">https://opensource.com/life/15/6/2015-summer-reading-list</a> ~ a great list of interesting books</li>
<li><a href="http://www.obeythetestinggoat.com/">http://www.obeythetestinggoat.com/</a> ~ a great blog and book on test driven development, understood its importance while making the web spider</li>
<li>**<a href="http://newcoder.io/tutorials/">http://newcoder.io/tutorials/</a> ~ superb tutorials on interesting projects</li>
<li><a href="https://jeffknupp.com/">https://jeffknupp.com/</a> ~ again, a great book cum blog on Python !</li>
<li>**<a href="https://automatetheboringstuff.com/">https://automatetheboringstuff.com/</a> ~ hands down, a very interesting book to read !</li>
<li><a href="http://simplystatistics.org/">http://simplystatistics.org/</a> ~ a great blog on statistics, even I don't remember how I landed on this while making the spider</li>
<li>**<a href="http://effbot.org/zone/about.htm">http://effbot.org/zone/about.htm</a> ~ a blog with lots of new and great python stuff !</li>
<li><a href="http://blog.stephenwolfram.com/2012/03/the-personal-analytics-of-my-life/">http://blog.stephenwolfram.com/2012/03/the-personal-analytics-of-my-life/</a> ~ a great blog post by Stephen Wolfram on how he use data analytics in his life!</li>
<li>***<a href="https://www.recurse.com/">https://www.recurse.com/</a> ~ a great place I would love to be someday!</li>
<li><a href="https://www.recurse.com/blog">https://www.recurse.com/blog</a> ~ a nice blog to hang around, for sure!!</li>
<li><a href="http://szeliski.org/Book/">http://szeliski.org/Book/</a> ~ haven't read it yet, but will read it to get some understanding of computer vision</li>
<li><a href="http://www.kristenwidman.com/blog/33/how-to-write-a-bittorrent-client-part-1/">http://www.kristenwidman.com/blog/33/how-to-write-a-bittorrent-client-part-1/</a> ~ a nice place to start with the basics!!</li>
</ul>
<div>
<br /></div>
</div>
<div>
Too many of them, but all of them are kind of gems!</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-83022623972501607462016-03-04T21:44:00.001-08:002016-03-04T21:44:18.399-08:00Self-realization : Why I have not been able to do what all I want to do?<div dir="ltr" style="text-align: left;" trbidi="on">
First things first !<br />
<br />
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.<br />
<br />
Problem?!<br />
<br />
I haven't done anything as of yet, and I am nowhere even near to anyone of these.<br />
<br />
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.<br />
<br />
Solution?!<br />
<br />
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.<br />
<br />
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.<br />
<br />
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.<br />
<br />
<br />
Another problem?!<br />
<br />
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.<br />
<br />
Quick glance!<br />
<br />
So, what I have been doing till now to achieve what I want to?!<br />
<br />
2 things -<br />
<br />
<br />
<ul style="text-align: left;">
<li>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.</li>
<li>I try to adjust two, three of four things together, making a routine, and all those shitty stuff.</li>
</ul>
<div>
<br /></div>
<div>
None of them work, and they won't ever.</div>
<div>
<br /></div>
<div>
Time to change the approach.</div>
<div>
<br /></div>
<div>
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.</div>
<div>
<br /></div>
<div>
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.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
So, what I am going to now?!</div>
<div>
<br /></div>
<div>
Here is the list, and I am going to strictly adhere to it. And I mean it.</div>
<div>
<br /></div>
<div>
<ul style="text-align: left;">
<li>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.</li>
<li>As a task enters your to-do list, it gets completed no matter what. There is no turning back from now on.</li>
</ul>
<div>
<br /></div>
</div>
<div>
And this is all what I meant when I made this tweet in the morning.</div>
<div>
<blockquote class="twitter-tweet" data-lang="en">
<div dir="ltr" lang="en">
this time i have got the neck of the base problem, wohoo; thanks to mid-sems <a href="https://twitter.com/hashtag/solve?src=hash">#solve</a></div>
โ ashwani pandey (@thisisashwani) <a href="https://twitter.com/thisisashwani/status/705943783876087808">March 5, 2016</a></blockquote>
<script async="" charset="utf-8" src="//platform.twitter.com/widgets.js"></script>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
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.<br />
<br />
Time to reach the sky !</div>
<br />
<br />
<br /></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-28980633241552762392016-03-02T00:07:00.001-08:002016-03-02T00:08:45.029-08:00A great Quora answer from Richard Muller on giving up !<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<span class="quora-content-embed" data-name="What-do-you-do-to-motivate-yourself-when-you-are-about-to-give-up/answer/Richard-Muller-3">Read <a class="quora-content-link" data-embed="kzyfOBw" data-height="250" data-id="19333651" data-key="1a780f770952a1c172a83d7e3f3f4fdb" data-type="answer" data-width="559" href="https://www.quora.com/What-do-you-do-to-motivate-yourself-when-you-are-about-to-give-up/answer/Richard-Muller-3" load-full-answer="False"></a><a href="https://www.quora.com/Richard-Muller-3">Richard Muller</a>'s <a href="https://www.blogger.com/What-do-you-do-to-motivate-yourself-when-you-are-about-to-give-up#ans19333651">answer</a> to <a href="https://www.blogger.com/What-do-you-do-to-motivate-yourself-when-you-are-about-to-give-up" ref="canonical"><span class="rendered_qtext">What do you do to motivate yourself when you are about to give up?</span></a> on <a href="https://www.__nousername__.main.quora.com/">Quora</a><script src="https://www.quora.com/widgets/content" type="text/javascript"></script></span></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-11413331597318535782016-03-02T00:02:00.001-08:002016-03-02T00:08:56.593-08:00A great piece from Andrew Ng to keep learning !<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<span class="quora-content-embed" data-name="What-is-one-piece-of-advice-you-would-like-to-give-to-students/answer/Andrew-Ng">Read <a class="quora-content-link" data-embed="kzyfOBw" data-height="250" data-id="19267060" data-key="e9ba3096be8775935986cb576043b805" data-type="answer" data-width="559" href="https://www.quora.com/What-is-one-piece-of-advice-you-would-like-to-give-to-students/answer/Andrew-Ng" load-full-answer="False"></a><a href="https://www.quora.com/Andrew-Ng">Andrew Ng</a>'s <a href="https://www.blogger.com/What-is-one-piece-of-advice-you-would-like-to-give-to-students#ans19267060">answer</a> to <a href="https://www.blogger.com/What-is-one-piece-of-advice-you-would-like-to-give-to-students" ref="canonical"><span class="rendered_qtext"></span></a></span><br />
<div class="qtext_para">
<span class="quora-content-embed" data-name="What-is-one-piece-of-advice-you-would-like-to-give-to-students/answer/Andrew-Ng"><a href="https://www.blogger.com/What-is-one-piece-of-advice-you-would-like-to-give-to-students" ref="canonical"><span class="rendered_qtext">What is one piece of advice you would like to give to students?</span></a></span></div>
<span class="quora-content-embed" data-name="What-is-one-piece-of-advice-you-would-like-to-give-to-students/answer/Andrew-Ng"> on <a href="https://www.__nousername__.main.quora.com/">Quora</a><script src="https://www.quora.com/widgets/content" type="text/javascript"></script></span>
</div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-89303404229465378582016-02-11T01:46:00.000-08:002016-02-11T01:47:38.848-08:00How could my focus power improve?<div dir="ltr" style="text-align: left;" trbidi="on">
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.<br />
<br />
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.<br />
<br />
<br />
<ul style="text-align: left;">
<li>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.<br /><br />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.<br /></li>
<li>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.</li>
<li>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.</li>
<li>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.</li>
</ul>
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 !<br />
<br />
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.</div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-41121868099855901162016-01-17T05:34:00.002-08:002016-01-17T05:34:54.264-08:00Break time : Starting my journey to Chennai tomorrow !!<div dir="ltr" style="text-align: left;" trbidi="on">
Time for a break.<br />
<br />
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.<br />
<br />
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 )<br />
<br />
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.<br />
<br />
See you all on the Republic Day of India.<br />
<br />
Till then, ek break to banta hai yaar ! </div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0tag:blogger.com,1999:blog-5297501342859393457.post-89294468141433522032016-01-16T04:57:00.002-08:002016-01-16T04:57:34.340-08:00UVA 10258 : Contest Scoreboard<div dir="ltr" style="text-align: left;" trbidi="on">
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.<br />
<br />
Mistakes I did :<br />
<ol style="text-align: left;">
<li>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.<br /></li>
<li>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 !</li>
</ol>
<br />
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.<br />
<br />
I also learned a few new C++ features, namely, stable_sort, peek, get. I am yet to understand how to use stable_sort properly.<br />
<br />
[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.<br />
<br />
I also got to know of stringstream, although I haven't used it yet.<br />
<br />
Here is my solution for the same : <a href="https://github.com/ashwani-pandey/UVAoj-solutions/blob/master/10258.cpp">https://github.com/ashwani-pandey/UVAoj-solutions/blob/master/10258.cpp</a></div>
Ashwani Pandeyhttp://www.blogger.com/profile/09629580972154099734noreply@blogger.com0