<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mayank Pratap on Medium]]></title>
        <description><![CDATA[Stories by Mayank Pratap on Medium]]></description>
        <link>https://medium.com/@mayankpratap?source=rss-5a18a507a497------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OunLB4vXP6hrCJ8v_r6emA.jpeg</url>
            <title>Stories by Mayank Pratap on Medium</title>
            <link>https://medium.com/@mayankpratap?source=rss-5a18a507a497------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:35:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mayankpratap/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Musings on Dharma]]></title>
            <link>https://mayankpratap.medium.com/musings-on-dharma-cc6d4b1e4ec3?source=rss-5a18a507a497------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc6d4b1e4ec3</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[spirituality]]></category>
            <category><![CDATA[hinduism]]></category>
            <category><![CDATA[sustainable-development]]></category>
            <dc:creator><![CDATA[Mayank Pratap]]></dc:creator>
            <pubDate>Wed, 30 Oct 2024 03:56:05 GMT</pubDate>
            <atom:updated>2024-10-31T10:38:02.029Z</atom:updated>
            <content:encoded><![CDATA[<p>“Dharma” is one of the most repeated words one of the most misunderstood words in Indian context. We often hear sentences like “She is a very Dharmik person” or “One should rise above Jaat-Dharam while voting.” Also we hear Dharma attached to others words like “patni-dharma” or “Kshatriya-Dharma”.</p><p>Thus, a curious mind will naturally have some questions about Dharma. What the heck is Dharma ? Is it the same as “religion” ? What is its significance in life ? What should be its role in politics? Is Dharma a relic of the past or does it have any contemporary significance ?</p><p>Unlike Abrahamic thought processes which restrict discussion on the “truth” or the path to “truth”, Indic philosophies have always encouraged difference of opinion, discussion, and debate. We see this in Vedic message of “एकं सत् विप्रः बहुधा वदन्ति” or the Jain parable of “Blind men and an elephant.” Even the <strong>Nobel laureate Amartya Sen</strong> beautifully emphasises this aspect in his book, <strong>“The Argumentative Indian”</strong>. Thus whatever I write today is not the absolute truth but my humble contribution to the huge corpus of Indic literature.</p><h3>Etymology and origin of “Dharma”</h3><p>“Dharma” comes from “धृ” root verb of Sanskrit which means to hold or to sustain. Thus, the very basic meaning of “Dharma” is something which holds or sustains. The same has been highlighted in Mahabharat as “धारणाद् धर्म:”. Thus, while reading further interpretations of Dharma one should keep this basic meaning in mind.</p><h3>Dharma as ethics or code of conduct</h3><p>“धृतिः क्षमा दमोऽस्तेयं शौचमिन्द्रियनिग्रहः ।<br>धीर्विद्या सत्यमक्रोधो दशकं धर्मलक्षणम् ।।” ( Manusmriti )</p><p><strong>Manusmriti</strong> has propounded 10 characteristics of Dharma as धृतिः ( patience ) , क्षमा ( forgiveness ) , दम: ( self -control ), अस्तेयम् ( non-theft ) , शौचम् ( cleanliness ) , इन्द्रियनिग्रहः ( controlling sensual indulgences ) , धीः ( wisdom ) , विद्या ( knowledge ) , सत्यम् ( truth ) and अक्रोधः ( refraining from anger ). Similar prescriptions are also found in <strong>Buddhist Noble 8-fold path</strong> and Jain mahavratas.</p><p>These virtues help <strong>sustain</strong> both personal happiness and societal harmony. Thus these have been rightly considered as part of Dharma ( one which sustains ).</p><h3>Dharma v/s religion( पंथ / मज़हब )</h3><p>The greatest blunder that our effort to translate every word to English is that both “Dharma” and “Religion” have been equated. Even in common parlance, religious activities such as worship, prayer, pilgrimages, and meditations are considered as “Dharmik” activities.</p><p>But this author is of the view that both are different concepts despite having some intersection.</p><p>In Indian tradition, four most noble pursuits have been called <strong>purusharthas</strong>. These include Dharma, Artha, Kama and Moksha. In my opinion, the puja-path and different forms of worship are ideally directed towards Moksha ( liberation ) rather than Dharma ( ethics ). However, it is also true that many people usually indulge in prayers for fulfilling artha ( material pursuits ).</p><p>This is why we sometimes see very religious persons indulge in horrendous acts. In this context, the example of Ravana comes to mind, who was a great scholar and practitioner of rituals and yet performed unethical acts like kidnapping of women. People also try to perform atonement of sins ( unethical activities ) by performing religious activities like bathing in Ganga.</p><p>However, it is also true that religious activities like meditation or naam-jaap can help us overcome our vices and become more Dharmik ( ethical ). For instance, the repeated chanting of “Rama” transformed the dacoit Ratnakar into Sage Valmiki.</p><p>An interesting understanding that emerges from this is that <strong>even atheists</strong> <strong>can be Dharmiks. </strong>And even those indulged <strong>in prayers can sometimes be Adharmiks.</strong></p><p>Further, going ahead, we must not conflate “Dharma” and “religion”. The apt Indian translations of “religion” are पंथ ( Hindi ) and मज़हब ( Urdu ).</p><p>Keeping the length of this essay in mind, I am stopping my pen here. Let’s meet again in 2nd part.</p><p>Happy Dipavali. Jai Shri Rama.</p><p>References :</p><ul><li><a href="https://www.wisdomlib.org/hinduism/book/manusmriti-with-the-commentary-of-medhatithi/d/doc200653.html">https://www.wisdomlib.org/hinduism/book/manusmriti-with-the-commentary-of-medhatithi/d/doc200653.html</a></li><li><a href="https://www.parentcircle.com/maharishi-valmiki-the-transformation-of-a-robber-into-adikavi/article">https://www.parentcircle.com/maharishi-valmiki-the-transformation-of-a-robber-into-adikavi/article</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc6d4b1e4ec3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What should Computer Science undergraduates do to get placed in their dream company or get a high…]]></title>
            <link>https://mayankpratap.medium.com/what-should-computer-science-undergraduates-do-to-get-placed-in-their-dream-company-or-get-a-high-bbbd873eeea7?source=rss-5a18a507a497------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbbd873eeea7</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Mayank Pratap]]></dc:creator>
            <pubDate>Thu, 14 Jun 2018 06:45:12 GMT</pubDate>
            <atom:updated>2021-05-22T07:02:06.215Z</atom:updated>
            <content:encoded><![CDATA[<h3>What should Computer Science undergraduates do to get placed in their dream company or get a high package placement?</h3><p>From first year onwards students start wondering about the placement statistics of their college. They start dreaming about getting extraordinary placements one day. But they are not properly guided regarding the same.</p><p>Now I have completed journey of 4 years of college and I look back upon my enthusiasm, struggles, competition, disappointments, and success and most importantly the fun ride along the way. Projects, hackathons, competitive programming and technical fests all played an important role in enhancing my skill set and making who I am today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*ApObsJJ2D2LXc3aWgvwDjg.jpeg" /><figcaption>Me at a hackathon. Pic is added just for some swag.</figcaption></figure><p>So I thought of sharing my experiences of my college years so my juniors can learn from my mistakes, success strategies and carve their own path to success. Most of these things will only apply to <strong>Indian engineering colleges</strong> only as I don’t know much about foreign universities.</p><ol><li><strong>Explore :</strong> Freshmen(1st year students) and sophomores(2nd year) must explore various things to find out their interests. For example the technical festival of a decent college has many events related to different fields like web development, app development, software development, machine learning(ML), competitive programming etc. Freshmen and sophomores must take part in as many events as possible. Don’t get impressed by people saying <em>“Competitive Programming is the only way to get a software engineering job”</em> or <em>“Machine Learning is the most important skill now-a-days”</em>. As far as I have experienced most IT companies don’t look for a specific skill set in undergraduates. Most companies want a decent aptitude, problem solving ability, ability to write code, knowledge of basic data structures(ds),algorithms(algo) and knowledge of core CS topics like Operating Systems(OS), Computer Networks(CN). Most of them look at projects you have done but that only shows that you are interested in building things using code. It doesn’t matter much if project you have done is a website which solves a problem or a ML project or a Robotics related project. So <strong><em>explore the hell out and see what you love to do.</em></strong></li><li><strong>CGPA : </strong>This is the most confusing topics as most students do not know until their junior year(3rd year) how important or not CGPA is. All companies have a CGPA cutoff when they come to college placements and internships. Most companies keep a cutoff of ≥7. Some good companies like Directi, Amazon keep it above ≥5 while others like Morgan Stanley keep it ≥8. But these stats are from my college experience. Different colleges may have different cutoffs for placements and internships. Ask seniors in your college regarding pointer cutoffs and try to keep it above a threshold which allows you to sit in most companies. <strong>Once above a threshold it doesn’t matter if you increase it more.</strong> <strong>Like there is not much advantage of increasing it to 9 if you already have 8.5. </strong>You can use that extra efforts in doing some project or participating in online programming contests.</li><li><strong>Competitive Programming (CP) : Competitive programming is a fun way to practice data structures and algorithms. </strong>Most IT companies have a online qualifier test based on ds &amp; algo and also one or two interview rounds based on ds &amp; algo problem. Also there are contests like ACM ICPC , Codechef Long Challenge, Codeforces contests where you can win prizes, goodies and fame(in programming community :P ) if you perform exceptionally well. <strong>However the problems in these contests are generally much harder than those asked in interviews. Also most heavy concepts used in these problems are rarely used in real life job. </strong>How do I know about the real life job part?? Based on my work experience at Oracle India and discussions with other friends and seniors. For a year or so I was also heavily involved in CP. I solved huge number of problems on SPOJ, took part in Codechef and Codeforces contest. But <strong>doing exceptionally well in CP requires so much time and energy</strong> that you won’t be able to explore and master other computer science aspects. I will suggest to try it. <strong>If you love it or have nothing better to do continue it, practice problems and take part in contests. But don’t force yourself just because you have heard that it helps in job interviews. </strong>Even if you are not doing CP you can practice ds &amp; algo based questions from <a href="https://www.interviewbit.com/">https://www.interviewbit.com/</a> and <a href="http://www.geeksforgeeks.org/">http://www.geeksforgeeks.org/</a> and successfully crack qualifier tests and interviews of companies. <strong>Remember that data structures and algorithms (not competitive programming ) are important for being a good software engineer.</strong></li><li><strong>Projects : </strong>Many juniors ask me about the type of project and number of projects they should do to get a decent internship/job offer. Some example questions which I have been asked are : <em>“ Sir, I have started learning Machine Learning. Can you suggest me a project which I can complete in this summer vacations.”</em>,<em> “ Sir, should I develop an android application or a ML project? ”.</em> For most people, the main motivation for doing projects is not to understand a topic better or to solve some problem but to list the project in their resume. I have even seen people copying other people’s projects in their resumes. <strong><em>Good projects show your prospective employers that you are genuinely interested in solving problems and you are self-motivated.</em></strong> So try to think of some problems you or other people in your surroundings face and think if and how that problem can be solved using some code. Lets take some <strong>example problems</strong> and some <strong>possible solutions</strong> :</li></ol><ul><li>You want to download a youtube playlist and the existing solutions like ssyoutube suck at this. So you try to solve this problem yourself and make a youtube playlist downloader and release it for general public. You will learn about web scraping. You will come to know that what works on your system may not work on other. Once you have dealt with issues and many people start using your tool, your confidence will increase. <strong>If an employer is not impressed by a project like this, don’t work for that employer.</strong> Checkout this : <a href="https://github.com/rg3/youtube-dl">https://github.com/rg3/youtube-dl</a></li><li>You like to trade cryptocurrencies and sometimes the prices of cryptocurrencies change very drastically. If you get notified promptly you can either earn huge profits or prevent your huge loss. You decide to create your own app/browser extension that will alarm you in case of large deviation of prices. You may or may not release this to general public :P</li><li>Quiz games like Loco, Cash-show are popular nowadays. These games have time of 10 seconds or so for every question. So typing a question by hand in google search and then looking for answers is not feasible most of the times. You want to increase your chances of winning without improving your general knowledge. Make a script which takes a screenshot of game screen, uses OCR techniques to take question out from the image and do a quick google search. One of my friends made this and we played a few games and earned easy cash. <em>We are of course not releasing this script to public. :P</em></li><li>You want to apply Operating System concepts to make your own OS. Think about how you can differentiate your OS from other existing ones. If you simply try to copy paste some existing OS then it will become very boring very soon (Its not bad to take inspiration and understand working of previous projects ) . Can you think of something that differentiates your project ? Checkout this : <a href="https://medium.freecodecamp.org/how-a-self-taught-teenager-built-an-operating-system-that-runs-in-your-browser-47da735ac919">https://medium.freecodecamp.org/how-a-self-taught-teenager-built-an-operating-system-that-runs-in-your-browser-47da735ac919</a></li></ul><p>Some projects can be done for better understanding of a topic. That is the reason most of the online courses have a project at the end. While those are good to do for learning purpose but not very impressive as many other people have also done that course. Remember that when you are going for an interview you are trying to differentiate yourself from other people ( How you are better than others ?? ).</p><p>I am Mayank Pratap Singh and I write mostly on technology. Clap if you liked this article and follow me if you want to read more articles from me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbbd873eeea7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Excellent Modification Of Breadth First Search]]></title>
            <link>https://mayankpratap.medium.com/excellent-modification-of-breadth-first-search-345efb99bd83?source=rss-5a18a507a497------2</link>
            <guid isPermaLink="false">https://medium.com/p/345efb99bd83</guid>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Mayank Pratap]]></dc:creator>
            <pubDate>Sun, 22 May 2016 10:02:45 GMT</pubDate>
            <atom:updated>2020-01-16T17:30:10.835Z</atom:updated>
            <content:encoded><![CDATA[<p>Its my summer holidays and I have decided to practice topic-wise algorithmic problems. I have started with graph theory problems on <a href="http://acm.timus.ru/">http://acm.timus.ru/</a> . Solving problems here has certain advantages according me. If you have familiarity with basic graph algorithms like BFS,DFS,Dijkstra,Prims, you will almost immediately recognize their application to a problem. But you have to modify the algorithms to great extent to solve the problem. So basically it gives me opportunity to test and upgrade my knowledge of algorithms.</p><p>I recently encountered a problem . <a href="http://acm.timus.ru/problem.aspx?space=1&amp;num=1930">http://acm.timus.ru/problem.aspx?space=1&amp;num=1930</a> .I will like to discuss the problem and my approach to solve the problem.</p><p>Problem is to reach from city A to city B by a car with many cities in between. The roads between cities have slope. On either road we can go either uphill or downhill. But we have to change gear of car if we were first going uphill and now we have to go downhill or vice versa. In starting we can choose any gear mode ( uphill or downhill) . We have to find minimum number of gear changes to reach from city A to city B.</p><p>My first thought was to apply BFS and find out the minimum distance from city A to city B . But soon I realized that a shorter path can have more number of gear changes than a longer path with less number of gear changes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa5b585d1adc5872b871401b346c98ee/href">https://medium.com/media/fa5b585d1adc5872b871401b346c98ee/href</a></iframe><p>Figure above shows a simple graph.1 is our start vertex and 3 is our final vertex . I start BFS from vertex 1 and add its two neighbours 2 and 4 to queue. After that we take 2 and add its neighbours(unvisited) to queue . Here 3 is the only neighbour of 2. So we add it to queue. In this way we can reach 3 by one gear change. But what if we start from 1 and 4 to queue first and then 2. Then we take out 4 from queue and reach 3. In this way we reach 3 with zero gear change.</p><p>So suppose I do BFS and mark a vertex(city) as visited only to realise later that I could have reached that vertex with fewer number of gear changes. So I tried to modify my BFS . I decided to visit a vertex even though it is visited.(An approach similar to Dijkstra).</p><p>I took three containers slope ( To store whether edge from city u to v is uphill or downhill) , howArrived( To store whether I arrived at a vertex by downhill slope or uphill ) , gearChanges ( To store number of gear changes I have done when I reach a vertex).</p><p>In BFS , suppose I reach vertex v from vertex u. There are two cases :-</p><ol><li>If vertex v is not visited :- We see the slope of edge u-&gt;v and update howArrived accordingly. If slope of edge u-&gt;v is downHill (0) then howArrived[v]=0 and if slope of edge u-&gt;v is upHill(1) then howArrived[v]=1 . Also if howArrived[u] is different than howArrived[v] it means we had to change gear to reach from u to v. Thus we update gearChanges[v]=gearChanges[u]+1. Otherwise gearChanges[v]=gearChanges[u].</li><li>If vertex v is visited :- If slope of edge u-&gt;v is different from howArrived[u] it means we had changed gear from u to v. But this time before updating we will check gearChanges[u]. If gearChanges[v]&lt;gearChanges[u]+1 then there is no need to update . Otherwise gearChanges[v]=gearChanges[u]+1 . If slope of edge u-&gt;v is same as howArrived[u] it means we did not change gear to come from u to v. If gearChanges[v]&lt;gearChanges[u] then there is no need to update otherwise gearChanges[v]=gearChanges[u]. Also we have to update level of vertex v accordingly.</li></ol><p>Here is my code :- <a href="http://ideone.com/iLeGnr">http://ideone.com/iLeGnr</a></p><p>This might not be the only way to solve the problem . But I felt so awesome after solving the problem that I felt like sharing it.</p><p>Update ( 16th Jan 2020 ) :-</p><p><strong><em>Proof that the solution works :-</em></strong></p><p>In the problem we want to minimize the shortest distance between two cities and also with minimum number of gear changes. Let the distance between two cities be number of edges between cities + number of gear changes required between cities. We already know and have proved that the BFS gives shortest distance between two nodes in a acyclic graph. Now given this new definition of distance, simply apply BFS to get shortest distance . Voila :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=345efb99bd83" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>