<?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 R on Medium]]></title>
        <description><![CDATA[Stories by R on Medium]]></description>
        <link>https://medium.com/@magnusram?source=rss-8e53fa7d1c07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9NrDplcz41PHfR8t0aFauQ.jpeg</url>
            <title>Stories by R on Medium</title>
            <link>https://medium.com/@magnusram?source=rss-8e53fa7d1c07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:09:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@magnusram/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[Personal Finance]]></title>
            <link>https://medium.com/@magnusram/personal-finance-cf4aeff8747f?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf4aeff8747f</guid>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Sun, 06 Nov 2022 02:55:42 GMT</pubDate>
            <atom:updated>2022-11-06T02:55:42.438Z</atom:updated>
            <content:encoded><![CDATA[<h3>Baby Steps into Personal Finance</h3><figure><img alt="Personal finance — money tree" src="https://cdn-images-1.medium.com/max/1024/0*6FfA7r2cP34gdoFK" /><figcaption>Photo by <a href="https://unsplash.com/@micheile?utm_source=medium&amp;utm_medium=referral">micheile dot com</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Scenario</strong>:</p><p>My salary is credited to my savings account every month. I spend from my savings account. At the end of month, the amount remaining after spending just sits there.</p><p><strong>Problem</strong>:</p><p>Value of money sitting in savings account reduces every day because of inflation. So if I had Rs. 100 at the start of the month, its value is not the same anymore at the end of month.</p><p><strong>Explanation</strong>:</p><p>What is inflation?<br>Increase in price of goods and services is called inflation.</p><p><strong>Why do price of goods and services rise?</strong></p><p>High production cost translates to higher price.<br>Production cost increases because of increase in raw material cost or increase in wages. Wages tend to increase when the labor market is strong and unemployment is low. Companies will have to pay more to attract and hire/retain talent. This increases the cost to company. So, company passes this cost to the customers.</p><p>Easy availability of money<br>When loans are available at cheaper interest rates, more people will borrow money and spend more on goods and services leading to increase in price</p><p>Increase in consumer demand for goods, leads to increase in price<br>When number of people looking for rental places increase, then the rent increases correspondingly. Similarly,</p><p>Decrease in supply of goods, leads to increase in price as demand is not met by supply; naturally resulting in increase in cost of goods and services<br>When raw materials become scarce, industrial output reduces leading to increased demand resulting in increased prices</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YycrE9hYBOvZFODy" /><figcaption>Photo by <a href="https://unsplash.com/@jackprichett?utm_source=medium&amp;utm_medium=referral">Jack Prichett</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>So, Why is inflation bad for my savings?</strong></p><p>Onion was selling for 10/kg on 1st of this month. At the end of the month, cost of onion has increased from 10 to 12/kg. Does the value of my savings increase proportionately?</p><p>Let’s see — Typical interest rate for savings bank account is 3%/year. So, if I have 100 in my account today, it will appreciate to 103 in a year. That is, it will appreciate in value equal to 0.25 (3/12) rupees per month.</p><p>So, Rs. 100 that I had in my savings account 1 month ago, is now worth Rs. 100.25/-</p><p>I was able to buy 10 kgs of onion for Rs. 100 a month ago.</p><p>How much onion can I buy with my 100 rupees now after a month?</p><p>I can only buy (100+interest)/cost of onion = (100+0.25)/12 = 8.35 kgs. <strong>1.6 kgs less onion!!</strong></p><p>Ok, let us take another example. I wanted to buy a plot of land last month. Cost of the plot was 1,00,000 last month. I had 1,00,000 in my savings account. Now, at the end of month when I wanted to pay and seal the deal, the cost has increased by 1% to 1,01,000.</p><p>But my 1 lakhs in savings is now worth only 1,00,250 (3%/year or 0.25%/month). I am short of Rs. 750. My expectation was that I had enough to buy the plot. But now I am short.</p><p>Reason — Rate of rise in price of plot was faster rate than the rate of appreciation of my savings. Effectively, <strong>decreasing the value of my savings</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ug0bBuYgSmlDZQtR" /><figcaption>Photo by <a href="https://unsplash.com/@nicotitto?utm_source=medium&amp;utm_medium=referral">nrd</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>How to avoid this situation and in turn beat inflation?</strong></p><p>By investing in assets that has a rate of return higher than the rate of inflation. In other words, look for investments where money grows faster than cost of goods (onion, home prices) and services (dining out, bus/train/air fairs, medical costs).</p><p>If onion price increases by 2% monthly, I should look for investments that gives me 2% rate of interest monthly or higher so that I can afford cost of living! Savings account is definitely not an option. Think, Research and Act!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a4dJcEfjGeRva_Py" /><figcaption>Photo by <a href="https://unsplash.com/@alecimages?utm_source=medium&amp;utm_medium=referral">Chenyu Guan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Disclaimer: This is based on my personal experience and my knowledge. This is not a professional advice. Do your own reasearch and own your life!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9UekukBFWOGBssA7" /><figcaption>Photo by <a href="https://unsplash.com/@lindsayhenwood?utm_source=medium&amp;utm_medium=referral">Lindsay Henwood</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf4aeff8747f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Multithreading Demystified]]></title>
            <link>https://medium.com/series/java-multithreading-demystified-5627b1d4aba7?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/5627b1d4aba7</guid>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 07:56:51 GMT</pubDate>
            <atom:updated>2020-03-10T07:56:51.438Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Overview</strong></p><p><a href="https://blog.usejournal.com/java-multithreading-part-1-ec0c42bbead6">https://blog.usejournal.com/java-multithreading-part-1-ec0c42bbead6</a></p><p><strong>Race Condition</strong><br><a href="https://blog.usejournal.com/java-multithreading-part-2-race-condition-ba34b5dddeba">https://blog.usejournal.com/java-multithreading-part-2-race-condition-ba34b5dddeba</a></p><p><strong>Thread Pools</strong><br><a href="https://blog.usejournal.com/java-multithreading-threadpools-part-1-2-836e5cd97364">https://blog.usejournal.com/java-multithreading-threadpools-part-1-2-836e5cd97364</a></p><p><strong>Blocking Operation</strong><br><a href="https://blog.usejournal.com/java-multithreading-what-is-a-blocking-operation-187a7304ccd1">https://blog.usejournal.com/java-multithreading-what-is-a-blocking-operation-187a7304ccd1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5627b1d4aba7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reading inspires writing. Writing inspires living]]></title>
            <link>https://medium.com/@magnusram/reading-inspires-writing-writing-inspires-living-759b0c0fc60?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/759b0c0fc60</guid>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Fri, 17 Jan 2020 05:07:17 GMT</pubDate>
            <atom:updated>2020-01-17T05:07:17.578Z</atom:updated>
            <content:encoded><![CDATA[<h4>Grow. Inspire.</h4><p><strong>Why must we read at all?</strong></p><p>All of us would have asked this question at some point in our life wondering the riches that reading might bring home. After all — knowledge is power. But how do we attain that power? How do we use it for our personal growth and help others grow too?</p><p>I will share with you how I started reading and how it became a habit. And what do I do to share my knowledge with others and how that helps me in my quest for a meaningful and satisfying knowledge experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kym7eGObDSbDwVCu" /><figcaption>Photo by <a href="https://unsplash.com/@clemensvanlay?utm_source=medium&amp;utm_medium=referral">Clemens van Lay</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>It all started with a desire to articulate my thoughts as clearly and impactfully as I can. I have seen orators connect with the audience at a deeper level and writers leaving a lasting impression in their readers. Some of them are gifted but most of them have just been good readers throughout their life — a gift that they gifted themselves. The amount of reading they had under their belt was directly proportional to their knowledge level and the mastery of their craft.</p><p>Having had that knowledge, I was inspired and motivated to start reading which eventually became a habit. It started with purposeful reading — looking up meanings of words, noting down interesting idioms, phrases and language usages — of newspapers, fiction and non-fiction books, technical books, and blogs as I progressed and found my way through the vocabulary and other language hurdles.</p><blockquote>I had to first learn to read purposefully before I can read for pleasure and personal growth.</blockquote><p>Thus, having a purpose that was born out of seeing others succeed in life who owed their success to their reading habit, has made me a reader and naturally a writer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N3PDkrHnCvswO-wi" /><figcaption>Photo by <a href="https://unsplash.com/@randalynhill?utm_source=medium&amp;utm_medium=referral">Randalyn Hill</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I owe my writing skills to my reading. Patient and purposeful reading helped me in digesting the content despite the complexity of the text that I read. Some texts, literature and technical texts, are difficult than others and to digest them I re-read the texts. And teach what I read and write a blog on the topic before it finally gets committed to my long term memory.</p><p>Reading and particularly re-reading calls for patience which I developed only through consistent reading. The more I read, the better I got at reading. There is no other way around to develop the habit but to invest time and effort and be patient before realizing the benefits.</p><p>Like with anything else in life, we need to make a conscious effort by investing our time and effort consistently to become good at what we are doing or what we want to achieve — reading is no different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LpoWaU2z8IATfZ8z" /><figcaption>Photo by <a href="https://unsplash.com/@larisabirta?utm_source=medium&amp;utm_medium=referral">Larisa Birta</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In addition to empowering us with knowledge, reading helps us communicate better through writing.</p><p>If I have got something to share, I will not hesitate for a moment before putting my thoughts in a paper — I just start writing. It is both a documentation for my future reference and a way of sharing what I know with others.</p><p>The inherent motivation in the pleasure that we derive when our actions help others is what fuels my blog posts and my writing in general.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b3DjxoPKHZaskfFN" /><figcaption>Photo by <a href="https://unsplash.com/@cristofer?utm_source=medium&amp;utm_medium=referral">Cristofer Jeschke</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Reading must be a worthwhile activity. So I make it a point to stick to that guideline whenever I write. Before I publish my writing, I will make sure that what I have written is meaningful and that it is worth the reader’s time.</p><p>I had to do the research, come up with the initial draft, edit the draft and let the edited draft sit overnight so that I can come back to it, not as a writer but as a <strong>reader</strong>.</p><p>And I re-read it the next day as a reader and feel the writers’ voice and soul of the content. If I cannot find it, I will not publish it. If I can salvage it, I will do my best to infuse life into it.</p><p>This way, I can make sure that the writing works. All my writings that had very good audience engagement are the ones that I took time to re-read — either while resting on a sofa, or while sipping coffee the next day or simply out of impatience in the intervening period between submitting the draft to a publication and waiting for them to review and publish — like the intervening period between ordering a book and it’s delivery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SkpM89PyUNokCRuz" /><figcaption>Photo by <a href="https://unsplash.com/@redcharlie?utm_source=medium&amp;utm_medium=referral">redcharlie</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>With time, effort and patience — reading has given me the freedom to express my ideas through writing. It allowed me to share and experience the joy of reaching people through writing — which is the foremost intrinsic motivation for me to write which in turn is the motivation for me to read.</p><p>Through writing, I retain the information that I digest from my reading. And I become responsible and accountable and live by what I write. Both reading and writing have been my invisible guru and life coach that made me strong and resilient. It had set me up for success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7rXDJec-ZDKlTts1" /><figcaption>Photo by <a href="https://unsplash.com/@technobulka?utm_source=medium&amp;utm_medium=referral">Stanislav Kondratiev</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I hope that this content was digestible and you are ready to put it to good use. I believe that you have found this motivating enough to continue your reading habit or become a consistent reader or start a new chapter in your life as a reader or a writer.</p><p>Fact that you have read till the end is proof enough that you are blessed with patience and perseverance. Cheers to that and all the best. Keep reading and keep writing — because knowledge is power and sharing that knowledge through writing is the best way to use that power.</p><h3><strong>Summary</strong></h3><ul><li>Read purposefully so that you can find your way through the starting hurdles and develop the necessary patience</li><li>Read consistently so that it becomes a habit</li><li>Write consistently to retain the knowledge gained through reading</li><li>Write honestly to share, inspire and hold yourself accountable — to live a life that reflects the values that shine through in your writing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I2W1kfBe9gjtBVLi" /><figcaption>Photo by <a href="https://unsplash.com/@californong?utm_source=medium&amp;utm_medium=referral">Nong Vang</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=759b0c0fc60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 simple tips for beginners to start the running routine]]></title>
            <link>https://medium.com/runners-life/3-simple-tips-for-beginners-to-start-the-running-routine-1afc16ad7be6?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/1afc16ad7be6</guid>
            <category><![CDATA[growth]]></category>
            <category><![CDATA[running]]></category>
            <category><![CDATA[wellness]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[motivation]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Fri, 27 Dec 2019 13:31:01 GMT</pubDate>
            <atom:updated>2019-12-27T13:31:01.767Z</atom:updated>
            <content:encoded><![CDATA[<h3>Do you want to start running?</h3><h4>3 Simple steps for you!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VWGyc_SQGTeEM_ch" /><figcaption>Photo by <a href="https://unsplash.com/@huckster?utm_source=medium&amp;utm_medium=referral">Tomasz Woźniak</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>I started running 9 months back and I am going strong - you can too!</h4><p>I chose running as the primary form of workout because it was totally within my control — I can choose the day, time and place. Also, but for a good pair of shoes, it doesn’t cost much.</p><p>And I was motivated by seeing my marathon running friends. They have been busting the physical barriers that existed only in my mind, of long-distance running through their consistent effort.</p><p>They are a happier lot and they are proud of their feats and why not! The more distance they conquered, the stronger they have become.</p><p>Physical fitness leads to mental well-being which in turn leads to emotional well-being. So it’s only imperative that we take care of ourselves by following an active lifestyle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FrDPDvmq3Fqe3KsF" /><figcaption>Photo by <a href="https://unsplash.com/@clarktibbs?utm_source=medium&amp;utm_medium=referral">Clark Tibbs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I have been consistent and running for the past 9 months. I ran my first <a href="https://blog.usejournal.com/from-miserable-stamina-to-5k-in-6-months-9eb0d5ad4105?source=friends_link&amp;sk=b03cf5a53721553aa217f442878ae01d">5K in September</a> this year and <a href="https://medium.com/@magnusram/my-first-10k-run-61c5c57b6fcf?source=friends_link&amp;sk=ec40c1d70f016106dc9de64fb6165b5d">10K last week</a>. The following tips are from my personal experience.</p><h4>#1: Just start</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fgXD-5beCHScj4Ty" /><figcaption>Photo by <a href="https://unsplash.com/@dsmacinnes?utm_source=medium&amp;utm_medium=referral">Danielle MacInnes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you haven’t run before in life and you are sitting on that idea for as long as you can remember but have been wondering how to go about it, then stop right there. Think no further. Just start the routine — a routine you will come to look forward to.</p><p>To ensure the longevity of running as a workout routine and for it to become an inseparable part of your daily routine, we must take it slowly and steadily. So start by walking for 30 minutes in the morning or whenever you can find time.</p><p>Do this for a week to get yourself into the routine. Carry your phone with you so that you can track the distance covered and the calories burnt. Or if you have a fitness watch, well and good. I used to use Strava/Google Fit before I gifted myself a Garmin. Choose whichever works for you. With Strava you can network with other runners to stay motivated.</p><h4>#2: Be consistent</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lZdLQ6IQU3vOFMIa" /><figcaption>Photo by <a href="https://unsplash.com/@fitmasu?utm_source=medium&amp;utm_medium=referral">Fitsum Admasu</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Once you get past the first week, you can mix up the short runs and walks. Continue this for another two weeks. Now you would be completing 3 weeks and would have gone past the critical testing period. You will certainly feel good about it. But don’t get greedy and start overdoing it — you might end up hurting yourself.</p><p>Going into the fourth week, try to extend the runs and shorten the walking part of the routine. Once you are comfortable, you can run as far as you can without walking. Now it’s time to learn something important: strength training exercises — squats, planks, etc. (You can find a couple of links related to strength training at the end of this post)</p><p>It’s very important to balance running and strength training to avoid injuries and feel good after every run.</p><p>Also, do some stretching before and after the run. I do Surya Namaskaram (Sun Salutation) 5 times and squats 5–10 as a warm-up before the run. Post-run, I do general stretching. Choose what suits you.</p><h4>#3: Seek and look for advice and foster a growth mindset</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jn-dYuCUhQ7S7CcX" /><figcaption>Photo by <a href="https://unsplash.com/@scutal?utm_source=medium&amp;utm_medium=referral">Alexei Scutari</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This happens rather naturally as you keep progressing towards your goal and setting new running goals. But make it a point to seek advice and suggestions from like-minded friends who are already into running. Things like how they nailed their first race and race training.</p><p>I ask my running friends for their suggestions all the time — which fitness watch to buy, how to pick the right pair of shoes, what to eat before and after a run etc. If you are the first one among your friends and family to take up running as a workout, then follow running blogs and runners in Strava for gaining insights and motivation. You can then inspire and mentor your friends and family.</p><p>Do the basics right and Keep moving forward. You will do well. Cheers!</p><h4>Advice from my personal experience:</h4><p><strong>General</strong><br>* Buy a good pair of shoes<br>* Balance running and strength training<br>* Keep yourself hydrated during the runs<br>* Generally eat well</p><p><strong>While Running</strong><br>* Focus on your breathing while running. * Synchronize your steps with your breath.<br>* Run mindfully and land your feet softly. <br>* Don’t exert. Stop when you are not feeling good or when you are still feeling good.<br>* Keep a tab on your heart rate. Based on your age, you are supposed to stay within allowed limits. The general guideline is 180 minus your age. If you are 35, then you must stick to 145-ish BPM — <a href="https://www.heart.org/en/healthy-living/fitness/fitness-basics/target-heart-rates">https://www.heart.org/en/healthy-living/fitness/fitness-basics/target-heart-rates</a><br>* Endurance is more important than speed when you are just starting. (My friend, a marathoner, told me to first run continuously for 30 min before thinking about improving the pace.)</p><p>Above all, enjoy running. It keeps you fit — physically and mentally. Every run and every effort towards continuing your running routine — strength training, training for races, races, socializing with fellow runners — is a victory. Savor it every single day.</p><p>It’s only a matter of time before you start falling in love with this beautiful sport. 🏆🏃🏽‍♂️🧗🏽‍♂️</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FioELqxr-Q_w%3Ffeature%3Doembed&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DioELqxr-Q_w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FioELqxr-Q_w%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e10fb0411526886e5b23d8a1ba05c3b/href">https://medium.com/media/7e10fb0411526886e5b23d8a1ba05c3b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*S9U1wKkskALzhEKT6XpRRA.jpeg" /><figcaption>Courtesy: <a href="https://www.runnersworld.com/training/a20805692/10-essential-strength-exercises-for-runners/">www.runnersworld.com</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1afc16ad7be6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runners-life/3-simple-tips-for-beginners-to-start-the-running-routine-1afc16ad7be6">3 simple tips for beginners to start the running routine</a> was originally published in <a href="https://medium.com/runners-life">Runner&#39;s Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My first 10K run]]></title>
            <link>https://medium.com/runners-life/my-first-10k-run-61c5c57b6fcf?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/61c5c57b6fcf</guid>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[fitness]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[running]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Sat, 21 Dec 2019 14:26:13 GMT</pubDate>
            <atom:updated>2019-12-26T18:41:41.550Z</atom:updated>
            <content:encoded><![CDATA[<h4>9 months after I started running</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDx4Y3PBguXlJJ2nfQRLWg.png" /></figure><p>Running my first 10K happened 3 months after I ran <a href="https://link.medium.com/L2zsFzHoB2">my first 5K</a> and 9 months after I started running. Though I used to run every single day, I realized after a routine medical test that I may end up losing muscle mass if I am not balancing running with strength training.</p><p>As my weight is a tad below the minimum BMI recommended for my height, I became conscious of not losing any more weight. That&#39;s when I was researching about strength and weight training — to avoid injuries and to put on some much-needed weight.</p><p>I have never set my foot in a gym before in my life. So, I was wondering if I should just let go of the inhibition and start gyming. I went to the gym in my apartment complex to do dumbbell routines after watching some YouTube videos.</p><p>As I entered the gym, I was told that I cannot enter unless I carry a pair of dedicated gym shoes. Fair enough. My first lesson in the gym training. It made sense as they wanted to maintain gym hygiene. Just then I saw a gym attendant — Prasad, a well-built man, coming out near lobby where I was being educated of gym etiquettes.</p><p>Instinctively, I asked him if he would train me. He looked a little baffled at first. Since he is a local who seemed to understand English but can&#39;t speak, he seemed a little reluctant or simply doesn&#39;t know how to convey what he wanted to convey. So I repeated my requirement again and he told me to come regularly before we talk about formal training and fees.</p><p>He was reasoning that people would just stop coming after a couple of days. I thought that is a general code among gym trainers to not jump at the business prospect immediately. Anyway, I started going to the gym every other day, alternating running and weight training.</p><p>Yesterday, I was supposed to do my routine 4K today after the day before yesterday&#39;s strength training. That was the plan until I ran 2K. After that, I stopped for a water break for a minute. Feeling refreshed, I started running at the same slow pace. As I set the heart rate in my watch at Zone-4, it kept beeping to remind me that my heart rate was too low. I said that&#39;s fine and kept running at a slow pace.</p><p>Endurance is more important than speed. Thus, I ran and ran. I was going to complete the 4K mark. I told myself to push further and make it a 5K. When I reached 5K, I was determined to take to 7K. All the while stopping for just a minute every 2K for rehydration.</p><p>After having run 7K, my form was still intact though the upper part of my feet started paining a little. I could cover 7K with little to no discomfort because I made sure I was rehydrated at regular intervals. And after rehydration, I did simple stretching — bending forward to touch the ground with my fingertips, standing straight and bending legs backward till it touched my butt.</p><p>Now, only 3K to complete my first ever 10K. That was motivation enough to continue the run and achieve the milestone. I was simply following what I have been doing throughout 7K — run at a slower pace (Zone-3 to 4), rehydrate and stretch every 2K and think only about the kilometre I am currently on.<br>This made it simpler and easy.</p><p>I went past 10K in just under 9min/km - 8.58min to be precise. Though it is not a good pace, I was happy that I could run for 1.5 hrs in a single go. Post that, I continued to do the customary 100m finishing stretch to account for stoppages during the run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtzytMrsH07ejczTH8wgzQ.png" /></figure><p>Thus I completed my 10K — 9 months after I started running with nothing more than miserable stamina. But with the growth mindset fueling my consistency and my consistence snowballing into a 10K, it was and is always going to be a forward march.</p><p>Every kilometre I add to my running rally, the fuel is only going to well up leading to an ever-expanding horizon of possibilities - replenished by <strong>consistency</strong> motivated by the <strong>growth mindset</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Y9ozbNWSViiCmal1TT32w.jpeg" /></figure><p>Photo courtesy of:<a href="https://unsplash.com/photos/IuLgi9PWETU">dsmacinnes@unsplash</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61c5c57b6fcf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/runners-life/my-first-10k-run-61c5c57b6fcf">My first 10K run</a> was originally published in <a href="https://medium.com/runners-life">Runner&#39;s Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kovalam, Kerela]]></title>
            <link>https://medium.com/@magnusram/kovalam-kerela-1dc4e184d71b?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dc4e184d71b</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[vacation]]></category>
            <category><![CDATA[nature]]></category>
            <category><![CDATA[peace]]></category>
            <category><![CDATA[india]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Fri, 29 Nov 2019 04:28:11 GMT</pubDate>
            <atom:updated>2019-11-29T09:29:46.832Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kovalam, Kerala</h3><h4>Peaceful and relaxing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNeF9V9-O_8yzbxO06t6LA.jpeg" /></figure><p>The steady roar of the sea at dawn reminded me how close to nature I was.</p><p>As I stood there, leaning on the wooden balcony railing, sipping away freshly brewed coffee, dawn was just breaking; revealing the frothy pristine waves in the white sandy beach.</p><p>As chirpy birds lent their voices, a multitude of flowers sang in full bloom and morning dew glistened in the golden rays that trickled through the foliage, our vacation mornings floated peacefully in the calming symphony — ebbing and flowing to the musical notes of the elemental nature.</p><p>As I let the scene sink in, it calmed and healed my bruised senses.</p><p>The scene is now complete with the sun bright and shiny revealing the coconut groves, a chapel, umpteen fishing boats, and fishermen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9poM7KtrHDv5ItjzQiL0Q.jpeg" /></figure><p>As I took the last sip of coffee, I headed for an unhurried shower before walking and climbing the slopes of the landscaped resort garden that overlooked the panoramic expanse of the humming sea.</p><p>I have only used the panorama mode, of my smartphone, 3–4 times in the few years that I have been using smartphones — primarily because I didn’t travel much and to destinations that inspired a panoramic shot. This time though, the inspiration was well and truly there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48NcoDsXE4ta8Bpyqvp4sQ.jpeg" /></figure><p>As I finished climbing the slope, I was at the dining area that overlooked the clean, blue-tiled swimming pool with the spotless sky that mirrored the azure brilliance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dy7iXhUCiXzqC4SUdYcyew.jpeg" /></figure><p>Sumptuous breakfast spread of cereals, pastries, toasts, idlis, dosas, parathas, upma, traditional Kerala dishes, fresh-cut fruits, fresh fruit juices, tea, and coffee was a little overwhelming and exciting at the same time.</p><p>Since time was not a constraint, we had a leisurely breakfast that filled our hearts as much as our appetite.</p><p>There were foreigners from different countries trying out the local cuisine served as part of the breakfast. It was amusing to see them trying to get a taste of the traditional South Indian cuisine.</p><p>Quieting sounds of dawn with refreshing coffee followed by an unhurried shower and a filling-tasty breakfast marked our mornings throughout our 4-day vacation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9poM7KtrHDv5ItjzQiL0Q.jpeg" /></figure><p>Following the breakfast, we hopped onto our rental car and headed out, with childlike excitement that made us feel like the same age as my nephew and niece, to check things off our site-seeing list.</p><p>The terrain was steep and slopy. Few of the stretches felt like a roller-coaster ride. All of us gripped tightly onto whatever we could hold on to inside the car and let out a sigh of relief once we were in the plains again. The diesel car that we were driving in did a pretty good job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rtmoWGeL569M3bcAiOvLMQ.jpeg" /></figure><p>As we manoeuvered the tough terrain, we invariably ended up being surprised by clean beaches, placid lakes or simply the soothing green cover that embellished the blue horizon.</p><p>As we spent quality time chatting, snapping pictures and playing frisbee on the beach, our consciousness savored the novelty and beauty.</p><p>It had slowly but surely seeped into our subconscious which will surface time and again to be fondly reminisced and cherished — to sail over the demands of routine till we recharge and rejuvenate the following year.</p><p>It was a well-deserved vacation — both for the kids and us adults alike.</p><p>Experiences are what make us wiser. It prepares us for handling situations that would have otherwise been sudden and unfamiliar when we encounter them.</p><p>Travel, be it for leisure or otherwise, teaches and nourishes us with values and life skills. Above all, it inspires us to see the world in a different and better perspective.</p><p>It was all worth it — weeks of planning, resort and rental car bookings, air, train ticket reservations, the travel and the trip back to routine.</p><p>Another year, another vacation to look forward to. Till next time we vow to make it count.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-uzO9eBQzhxGijQNpkgwrg.jpeg" /></figure><h3>Sightseeing list</h3><h4>Day-1</h4><p><strong>Azhimala Shiva Temple</strong></p><p>Just under a kilometer from the resort, the temple was atop a cliff that overlooked the majestic Arabian Sea. We did a quick darshan of Lord Shiva and Parvathy before reaching the vantage point to take in the view and snap pictures with night mode on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQ6XeoKaUOxE9wmhKIAlQg.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/8f989bef015c">Raji V</a></figcaption></figure><h4>Day-2</h4><p><strong>Pier</strong></p><p>Sun was beating down and the pier was deserted. A cop came up to inform us that the pier is closed for the public. We were a little disappointed but happy to take a couple of pictures with ample natural lighting before heading over to Vellayani Lake.</p><p><strong>Vellayani Lake</strong></p><p>Lake was hiding away from the main road. We asked the locals for the way to the lake, through sign language and rudimentary Malayalam. We found ourselves awestruck by the view. There were a couple of folks, with their fishing rods, enjoying the solitude sitting at the banks of the lake before we broke in for the plunder. Lake view was spectacular and we were awestruck. A pair of eyes for the bountiful plunder wasn’t enough but plunder nevertheless that didn’t deplete the source; that which filled our souls with contentment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*31JqUUUT-cvYK5TXOLXE3Q.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/8f989bef015c">Raji V</a></figcaption></figure><p><strong>Samudra Beach Park</strong></p><p>Then we headed over to Samudra beach park. Sun was lingering just above our heads. We ventured into the beach with gusto unmindful of the flooding sunlight. We made good use of the frisbee and had a fun time though for a brief period before heading out to Kovalam lighthouse beach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHsw1UGqaIzC5OpdS3pccA.jpeg" /></figure><p><strong>Kovalam Beach and Lighthouse</strong></p><p>After finishing our lunch in one of the beachside restaurants, we visited the lighthouse. The view of the beach from the lighthouse was spectacular.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z6Iw0OCmUqr-buf9FNydCQ.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/8f989bef015c">Raji V</a></figcaption></figure><p>The ascent to the top of the lighthouse was adventurous in itself.</p><p>Path to the top was through the steep staircase or the elevator. Elevator and the fight of stairs stop at one level below the top. To reach the top, we had to climb a steel ladder that led up to a hole through which people were descending — rendering it one-way traffic. After maneuvering this rather scary climb of ten rungs of the 75° ladder, we were out in the open atop the lighthouse. We were welcomed by refreshing cool winds rustled. I circled the perimeter and took in the 360-degree view. I reminisced a similar setting, atop the Eiffel tower exactly a decade back, briefly before getting back to the present.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*FfGCv662VXdyKruZ2FsrUg.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><p><strong>Grove Beach</strong></p><p>We reached there around 3.30 pm. We saw a humble tea shop just opposite to where we parked our car. As we approached it, we were invited by the smiling tea shop owner who was busy preparing tea for other customers. We ordered tea and stood there seeing him moving swiftly from the boiler to paper cups mixing the tea decoction, milk and sugar. After tea, we spent time standing on the beach. Kids enjoyed the waves that played hide and seek with their feet. As the waves submerged their feet and revealing it again as it receded, kids were shrieking in excitement which was as pure and joyous as the scenic beauty of the landscape and seascape that we have been witnessing throughout our vacation.</p><p>We visited local shops that sold garments, cheap jewelry, jute bags, etc. before heading back to the lighthouse beach.</p><p><strong>Seaview point</strong></p><p>We were again in the lighthouse beach stretch looking for some bakery to satiate our pastry cravings. After a quick Google search, we were sitting on the first floor of one of the restaurants that overlooked the beach. We shared a pot of masala tea with tea cake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*vMOhz3oioJy7ncenlnHeQQ.jpeg" /></figure><p>As the sun started its descent painting the waves with pale twilight orange, we savored the scene and our cup of tea with gratuitous relish.</p><p>Before the nightfall, which happened without notice, we rushed to the Seaview vantage point to bid farewell to the sinking sun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbgyYFy7Q2-qHfpR9oHpzA.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/8f989bef015c">Raji V</a></figcaption></figure><p>Lighthouse beacon is now on, revolving 360 degrees every couple of seconds or so. We snapped a couple of picks with the beacon in the backdrop before heading out to have dinner and retiring to our serviced resort rooms with the gratification and satisfaction of a day well spent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZ-Vht9Qu92J-yngGIHxKA.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><h4>Day-3</h4><p><strong>Poovar</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2S4eLVrXCzXhgeMHxOdGw.jpeg" /></figure><p>Backwater boating is the main highlight here. There are numerous boating services available throughout the entire stretch of the backwater. Each of these businesses in their zealous efforts to seal the deal with the prospective tourists had almost spoiled our day. In their two-wheelers, boating services’ employees hound the tourist vehicles trying to guide them to their boarding points. We tried avoiding them by driving back and forth before we could finally lose them. It sent our heart rates up in a frenzy. Being stalked in an unknown land, though we know no harm may come off it, is an unsavory experience. I was so furious yet it was kind of funny. Finally, we surfed the internet and found a boating service that quoted 200/- per head. We meandered in the backwaters for one and a half hours — with our eyes and ears filled with scenic beauty that one would come to expect in Kerala. We even met one of the stalkers as he passed our boat in another boat carrying unsuspecting customers. A thrilling car chase followed by a relaxed nature tour — an impromptu adventure tourism 😀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xu0zusWIonlZq-MqlmARmw.jpeg" /></figure><p><strong>Cave Temple</strong></p><p>Lord Dhakshinamurthy at the center flanked by Lord Siva and Sakthi and Lord Ram were sculpted in a single rock that is said to have drifted from the neighboring state of TamilNadu is a protected historical monument maintained by The Archaeological Survey of India. We spent some 15 min there before heading for lunch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmin_eD-u6k0RYw7Kt7q3Q.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/8f989bef015c">Raji V</a></figcaption></figure><p><strong>Beach behind the resort</strong></p><p>The resort was built on a cliff. Our rooms were on the third level from the bottom of the cliff. We had to take an elevator to reach the ground floor. Just 100m from there, we can reach the beach by walk. We had a fun time playing frisbee, snapped pictures of the setting sun and I have even done an impromptu 1K barefoot-run in the wet beach sand with waves occasionally kissing my feet. I’ve experienced runners high every step of the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2U7fH4NhLDoBZr2sm5a14A.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/8f989bef015c">Raji V</a></figcaption></figure><p>There were a couple of elderly foreigners running with their shoes on. Following our beach escapade, we spent some time in the resort pool before heading for an a-la-carte dinner at the resort restaurant. We ordered a few traditional sides for our rotis and headed to our rooms. We would come back again before back to dine there the next morning and fill ourselves up with delicious and filling complimentary breakfast spread for one last time before bidding farewell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*M_2kkfiVx4_PPfdZVLWuCw.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><h3>Day-4</h3><p><strong>Connemara Market</strong></p><p>We found a paid parking (Rs 12/- per hour) just beside the market. Right outside the parking lot, a vendor zealously tested my resolve to sell the Kerala lottery. I, for a moment, thought of buying it but decided against it🧘🏽‍♂️. We did a quick shopping for cheap jewelry and toys for kids before heading over to the famous Padmanabha Swamy Temple.</p><p><strong>Padmanabha Swamy Temple</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*EdtwXGmWc-vvcKVJxPlaeg.jpeg" /><figcaption>Photo by: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><p>We changed into traditional clothes before entering the temple. Sun was beating down on our bare chests and heads. As we entered and stood in front of the sanctum, the entrance to the sanctum complex was blocked for 45 min before reopening for the public — to perform the mid-day rituals. We thanked our luck and prayed sincerely to Lord Padmanabaswamy who gave darshan reclining sideways. The mammoth Temple tower inspired awe as we circumscribed along the circumference of the paved Temple complex. We applied the divinely fragrant Sandal paste on our foreheads and completed the darshan. The crowd has now built-up outside in a long serpentine queue for the sanctum to reopen for the darshan.</p><p><strong>Udupi hotel</strong></p><p>Right outside the temple complex, our search for authentic Kerala meals, in our whole trip, has finally ended at this place that served Kerala feast in a plantain leaf — Avial, Vendaikai Thayir pachiri, Vazhaikaai Kari, Koottu, typical Kerala Matta rice. We wiped the plantain leaf plate clean.</p><p>We stopped at <em>Maha chips</em> store and stocked up on <em>Nendhran kaai and Nendram pazham chips, the native</em> banana wafers deep fried in coconut oil is unique to Kerela, as it is customary for folks visiting Kerala.</p><p>We boarded the train to Chennai in the evening, reluctantly bidding adieu to Kerala that filled us with an enriching experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4WjbKT-UxRrEtHhLJwYXQ.jpeg" /></figure><p>Till next time, cheers!</p><p>പിന്നെ കനോം (Pinne kanom — See you later!)😊🙋🏽‍♂️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dc4e184d71b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: Multithreading — What is a Blocking operation?]]></title>
            <link>https://medium.com/@magnusram/java-multithreading-what-is-a-blocking-operation-187a7304ccd1?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/187a7304ccd1</guid>
            <category><![CDATA[resource-management]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[multithreading]]></category>
            <category><![CDATA[concurrency]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Sun, 29 Sep 2019 08:50:09 GMT</pubDate>
            <atom:updated>2019-10-01T17:24:34.662Z</atom:updated>
            <content:encoded><![CDATA[<h4>~~Demystifying Multithreading~~</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XTmOZiYB68QcpqPL" /><figcaption>Photo by <a href="https://unsplash.com/@timcollinsphoto?utm_source=medium&amp;utm_medium=referral">Tim Collins</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Metaphorically speaking</h3><p>A Cinema that has only one ticket-booking counter will be able to serve <strong>only one</strong> customer at any given time.</p><p>When a customer is being served, other customers will be <strong>blocked</strong>.</p><blockquote>Customers = Threads</blockquote><blockquote>Ticket Counter = Shared resource</blockquote><p>Shared resource is a locked a.k.a protected block of code</p><ul><li>For the correctness of an object’s state or</li><li>For resource management — such as to manage I/O, Memory or CPU</li></ul><p>When Customer1 is at the counter, he/she virtually locks the counter. Other Customers will have to wait till Customer1 is done booking the ticket, in other words, <strong>releases</strong> the lock.</p><p><strong>Resource Management</strong></p><p>Having just one counter serve the customers is inefficient — both in terms of throughput (# of requests served per unit of time) and resource usage. Because, despite having multiple counters, if the management decides to open only one counter, it will lead to resource underutilization.</p><p>Also, it doesn’t make sense to keep increasing the counters unchecked. As the <strong>overhead </strong>of maintaining the unused counters doesn’t make sense.</p><p><strong>The ideal</strong> scenario is to increase the counters as the traffic increases and decrease them as the traffic reduces.</p><p>Or, just have an optimal number of counters that serve the traffic irrespective of the load.</p><h3>Technically speaking</h3><p>When a <strong>shared resource</strong> becomes unavailable (locked), the program execution in the respective threads halts. When the resource becomes available again (lock released), the program execution resumes.</p><blockquote>When a thread (t1) attempts to acquire a lock that’s currently owned by some other thread (t2), then t1 is said to have been blocked. t1 will be in WAITING state till the lock is released by t2 and then t1 gets scheduled to run again</blockquote><p><strong>Question</strong></p><p>Why would threads t1 and t2 attempt to acquire the lock in the first place?</p><p><strong>Answer</strong></p><p>Consider the following example use case</p><blockquote>A queue gets filled with messages continuously but it can only hold 100 messages for resource (memory) management as described above.</blockquote><p>In this scenario, the shared resource is the <strong>queue</strong>. It is shared between the following threads</p><ol><li>Producer thread (1 or more)</li><li>Consumer thread (1 or more)</li></ol><p>These threads are responsible for filling up and emptying the queue respectively.</p><p>If the queue is full (100), the producer thread will NOT be able to <strong>put</strong> anymore task in the queue — so the Producer <strong>blocks</strong>.</p><p>If the queue is empty (0), the consumer thread will NOT be able to <strong>take</strong> anymore task from the queue — so the Consumer <strong>blocks</strong>.</p><p><strong>Summary</strong></p><p>When we say that a thread blocks, we mean that the method (operation) that the thread calls, <strong>put or take</strong>, is blocking the thread from proceeding to execute the next line of code until some condition is met — the queue is <strong>not full</strong> or queue is <strong>not empty</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qr8YpJSAK91ym16_fqj-Xw.png" /><figcaption><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/ArrayBlockingQueue.html">ArrayBlockingQueue.java</a></figcaption></figure><p>Thanks for reading. Cheers! 🙂</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=187a7304ccd1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From miserable stamina to 5K in 6-months]]></title>
            <link>https://medium.com/@magnusram/from-miserable-stamina-to-5k-in-6-months-9eb0d5ad4105?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eb0d5ad4105</guid>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[running]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Sun, 08 Sep 2019 16:59:39 GMT</pubDate>
            <atom:updated>2019-09-12T00:23:38.104Z</atom:updated>
            <content:encoded><![CDATA[<h4>My first 5K run!</h4><p>In March, I reluctantly enrolled in a 5K event organized by my company at the behest of my well-meaning colleague. Every year, my company organizes this running event to promote healthy living. Yeah, right! Healthy living. Everyone wants to lead one but are too busy or too lazy or both. 🧘🏽‍♂️</p><p>Though I enrolled for the event, I did not go. On the morning of the event, I was supposed to get up at 5 A.M. I did get up as soon as my alarm went off.</p><p>But there I was, sitting and thinking the same question that has been running through my mind ever since I registered for the event — “Will I be able to run?”. I told myself ‘no’ and went back to bed.</p><p>Having enrolled and giving it a miss at the last moment was too much to ignore for my self-esteem. That was shameful enough for me to start my running practice the very next day.</p><p>I vowed to myself that by next year this time, I will run a half-marathon. Might sound like a crazy idea, but I have got nothing to lose.</p><p>I scouted for a good track to start my running routine. I found a curated ‘park kind of place’ just adjacent to my rental apartment complex in Mumbai. The winding walking track was made of concrete. The park was somehow always deserted and I used to wonder why! Except for the gardener who waters the plants; one who also doubles up as the guard.</p><p>I was happy though — entire park to myself, yay! I started walking for 30 mins for the first few days. On the third day, I started running. Wearing a pair of sneakers, a jersey that I used in Banglore for our early morning Badminton game and a pair of cotton track pants.</p><p>Running though was not a walk in the park. I was panting after running just 100 meters😯. I stopped at the 150-meter mark and walked the rest of the 30 minutes on the third day. The same routine was repeated for the next two days.</p><p>On the second week, I started mixing things up. I ran 150 m and walked 150 m. I repeated this pattern and slowly increased the running distance to 300 m. This went on for the next 3 weeks.</p><p>But, I could not continue this routine as I started feeling pain in my groin area due to mild hernia. I must have lifted something heavy and that was reason enough for the hernia to crop up.</p><p>I consulted a general physician. He suggested muscle strengthening exercise — <em>lift-hold-lower</em> both the legs repeatedly. After 3 weeks, I started running again.</p><p>Not before a not-so-funny reminder that told me to take good care of my health. 😊 That curated-deserted-park-kind-of-place, that I mentioned earlier, was in fact, a <em>cemetery</em>! The track in which I was walking/running all the while was encircling a 20-meter-long tin-sheet-covered cemetery; hidden from plain sight! 😮</p><p>After using that track for 3-weeks, I switched and started running within my <strong>lively</strong> apartment complex. 😃 As I live in a different part of this huge apartment complex, I realized the existence of the below tracks a little late; after <em>the morbid reminder. </em>😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDzNrY6sCzKemhFIk1t2nA.jpeg" /></figure><p>I was slowly but steadily increasing my running distance. I was reading <a href="http://medium.com/">Medium.com</a> blog posts on mental fortitude, power of routines, physical exercise’s positive effect on cognitive function, etc.</p><p>I was also highly motivated by my college mate who runs consistently. His name is <a href="https://medium.com/u/3303de7a0c2d">Nandakumar R</a>. We call him ‘Nandu’. He inspired many of us. He has completed The Mumbai Marathon in Jan ’19. He has been a constant source of direct/indirect motivation. I follow him on Strava. A social networking site having a positive impact on me — unbelievable, but I love it! (Thanks to Suruli Balaji and <a href="https://medium.com/u/e6b12fef1b00">Devaraj Kuppusamy</a> as well.)</p><p>Since I was running consistently and my mileage has now improved to 1K, I wanted to get myself a fitness watch🎁. I wanted to go for an entry-level GPS-enabled watch for accurate run-distance measurement. I also wanted to keep track of other running metrics. Importantly — heartrate. After consulting with Nandu, I narrowed down on Garmin Forerunner 35.</p><p>I promptly messaged my buddy Maharaja, who lives in the US, to check if he has got any plans to visit India in the coming months. He said yes and I said ‘wow’! A friend indeed😊!</p><p>My wife did the usual research and sent me the U. S. website links where I could get the watch for the best price. I forwarded the links to Maharaja. On the 2nd week of May, I was holding the watch in my hand. Thanks to Maharaja! I have one more source of motivation on my hand.⌚</p><p>On 31st May 2019, I went past a new milestone — a 3K in a single activity @ 7.02 min/km. But I could not maintain this mileage for long. So, I went a bit easy on the distance but made sure that I was consistent.</p><p>In Mumbai, the monsoon typically starts in June. For an outdoor runner like me, this means that I can not run. But if one is determined to be consistent, rain or shine can hardly make any difference. But my determination was tested by the monsoon. I wasn’t determined enough and started slacking a bit. I did not run most of the days of the week.</p><p>Then again, my constant source of motivation — Nandu and friends, a generous serving of self-help <a href="http://medium.com/">Medium.com</a> articles and my Garmin watch made me get my butt off the couch. I was in my sneakers again.</p><p>Though I lost many days due to rain, I seized the non-rainy days — Carpe non-rainy Diem! 😁I can’t go easy on my fitness routine anymore. I could have run in the treadmill — but I loathe it.</p><p>Towards the end of monsoon, I found a way around the monsoon disruptions — finally! I started running in my apartment parking lot. The cross-ventilated parking lot was a blessing. GPS wouldn’t work in the parking lot so I switched to step count.</p><p>On one of the days in the past week, during my usual run, I was still going comfortable even after the 2.5K mark. I started getting greedy or should I say ambitious! I started nurturing the secret wish of doing a 5K.</p><p>Wait, what!</p><p>I had my doubts. But I persisted.</p><p>Exactly six months after I started running — starting with just 150 meters, after that shameful no-show running event, here I am, on the 4th of September 2019 — completing my first 5K in a single activity and earning a Garmin badge for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-lUOww2xBnG_G3SPOEI5A.jpeg" /></figure><p>This was my first ever 5K run. I was elated is an understatement. I was famished yet felt nourished. I did two more 5Ks back to back. Three consecutive 5Ks in the heart zone-4 (recommended heart rate according to age) is something I am proud of.</p><blockquote>As I constantly seek motivation and put in the effort, I inspire myself. Being mindful of what I am doing and what I want to do in life is liberating.</blockquote><p>Just six months to go to fulfill my vow. Whether I fulfill it or not, I will be happy as long as I am consistently doing what I am doing.</p><p>Cheers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*je2QdvQVI31rd0l6" /><figcaption>Photo by <a href="https://unsplash.com/@dsmacinnes?utm_source=medium&amp;utm_medium=referral">Danielle MacInnes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=wellness&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=wellness&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>🍎 Wake up every Sunday morning to the week’s most noteworthy stories in Wellness waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-wellness/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=wellness&amp;utm_content=guest_post_text">Read the Noteworthy in Wellness newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eb0d5ad4105" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java: Multithreading — ThreadPool & Executor Framework]]></title>
            <link>https://medium.com/@magnusram/java-multithreading-threadpools-part-1-2-836e5cd97364?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/836e5cd97364</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[multithreading]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[resource-management]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Sun, 30 Jun 2019 09:37:07 GMT</pubDate>
            <atom:updated>2019-07-03T01:29:09.870Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java: Multithreading — ThreadPool &amp; Executor Framework</h3><h4>~~Demystifying multithreading~~</h4><p>If you are new to multithreading or if you need a refresher, please read — <a href="https://blog.usejournal.com/java-multithreading-part-1-ec0c42bbead6">https://blog.usejournal.com/java-multithreading-part-1-ec0c42bbead6</a></p><blockquote>Pools help in effective resource management</blockquote><h4>What do the non-functional requirements mean in a software system?</h4><p>“Broadly, functional requirements define <strong>what</strong> a system is supposed to <em>do</em> and non-functional requirements define <strong>how</strong> a system is supposed to <em>be “ — </em><a href="https://en.wikipedia.org/wiki/Non-functional_requirement"><em>wikipedia.org</em></a></p><p>There is a long list of non-functional requirements that you can look up in the Wikipedia page linked above. As far as thread pools are concerned, we are concerned about the following two — <strong>availability and reliability.</strong></p><p><strong>What is Availability?</strong></p><p>Percentage of time that an application is up and running from when it started. Downtime due to an unexcepted application crash because it ran out of memory, CPU, file handlers and/or other resources, affects availability and quality of service.</p><p>By running the application in more than one instance behind a load balancer will avoid single point of failures and ensure high availability.</p><p><strong>What is Reliability?</strong></p><p>When one of the load balanced instances goes down, the requests that it was serving at that moment would fail, affecting service reliability.</p><p>Multi-threaded applications are prone to failures due to improper and unchecked utilization of available resources causing application unavailability and loss of reliability.</p><p>Thread Pools help us avoid these pitfalls as described in the following sections.</p><h4>Thread Pool</h4><p><strong>Background</strong></p><p>Servers have <strong>limited</strong> memory, CPU and other hardware resources. In turn, our Java application process running in the server has limited resources at its disposal.</p><blockquote>Whether our application process has fewer or unbound resources, we should be able to serve the clients all the same — without compromising on the availability and reliability guarantees by effectively managing the available resources.</blockquote><p>This is the prime motive of any kind of pools in software applications — managing resources efficiently for better service quality — a thread pool is no different.</p><p>To reiterate — in order to ensure high availability and reliability, which in turn reflects on the quality of service and our commitment to clients, we need to better manage server resources available to our application processes among other things.</p><p><strong>Example Scenario</strong></p><p><em>Problem Statement</em><br>Our web application had seen a sudden surge in traffic. Because of this, it had crashed; thereby causing downtime.</p><p><em>Cause</em><br>Upon analysis, it was found out that for serving each incoming user request, we were creating a new thread. This ultimately led to hundreds of thousands of threads being spawned. That’s a problem because thousands of thread consume memory and vie for CPU time thereby draining the limited memory and CPU resources available to the process.</p><p><em>Solution</em><br>Usage of the thread pool was recommended as a solution because a thread pool can be configured:</p><p>1. To reuse and not create new threads infinitely by bounding the no. of threads (worker threads) that will serve the user requests within the pool</p><p>2. To queue the additional requests, when the no. of worker threads exceed the bounds, in a<em> blocking queue.</em></p><p>Depending on our use case, we can make use of various thread pool implementations available out-of-the-box in Java SDK or extend the ThreadPoolExecutor SDK class to create our own custom implementations.</p><h4>ThreadPoolExecutor</h4><p><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/ThreadPoolExecutor.html">ThreadPoolExecutor</a> class in java.util.concurrent package <strong>extends</strong> <a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/AbstractExecutorService.html">AbstractExecutorService</a> which <strong>implements</strong> <a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/ExecutorService.html">ExecutorService</a>. Effectively, the ThreadPoolExecutor is an ExecutorService</p><p>What does this mean?</p><p>This means, Java supports ThreadPool out-of-the-box via ThreadPoolExecutor and it provides functionalities defined in the ExecutorService interface.</p><p>Let us explore this in a little more detail using the following example use case:</p><blockquote><strong>Use case:</strong> Implement Linux <strong>grep </strong>command using the ThreadPoolExecutor</blockquote><p><strong>Approach</strong></p><p>Given a filesystem path and a search string, we should return all the matching lines in the files found in the path</p><ul><li>Create a thread pool with pre-defined no. of threads that will execute the search tasks</li></ul><p><strong>Sizing the thread pool:</strong> We need to decide on the number of threads that will be part of the thread pool. To identify this, we can follow this simple technique* —</p><blockquote>For computation intensive tasks in a Ncpu processor system, Ncpu<strong>+1</strong> threads will provide the optimum performance.</blockquote><blockquote>Since each thread runs in a CPU core, we can configure our thread pool to have 9 worker threads if our server has 8-core processor</blockquote><blockquote><strong>+1</strong> because even the computation intensive threads will pause for some reason or the other. When this happens, we don’t want to waste the available CPU time. So, we can have one extra thread, more than the total no. of CPU cores, running in the pool.</blockquote><ul><li>Find the list of files in the given filesystem path and create search tasks for each of them</li><li>Submit the list of search tasks to the thread pool executor and wait for the execution of the tasks to complete</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*a7a8w09KgOIjjKbByCzQ1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*tb9gXug-0jW1LxBGYo8YCA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*i0S5x8bDbGn5epXwY92WAw.png" /></figure><h4>Java SDK support</h4><p>Java platform started supporting thread pools out-of-the-box from version 1.5, which has seen further improvements in later releases. <strong>Executor framework</strong> is the solution that the platform provides which internally uses a thread pool. Executors handle thread creation and management for us while we concentrate on application code a.k.a business logic.</p><blockquote>“..in large-scale applications, it makes sense to separate thread management and creation from the rest of the application. Objects that encapsulate these functions are known as <strong><em>executors</em></strong><em>” — </em><a href="https://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html">docs.oracle.com</a></blockquote><h4>Executor framework</h4><p>The Executor framework is the official Java support for ThreadPools. It provides the following <strong><em>interfaces</em></strong> that outline the functionalities supported by the corresponding implementation classes for different use cases.</p><p><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/Executor.html"><strong>Executor</strong></a><strong> </strong>(since Java 1.5)</p><p>Traditionally, asynchronous (running a task in a thread separate from the main application thread) task execution is done as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*1_53zhmolmqiGCjRxFfekg.png" /></figure><p>If we implemented our web application using this approach to serve the incoming user requests, this would have created a new thread for each request leading to uncontrolled thread creation as seen in the previous blog.</p><p>From 5.0 and above, this is how we should be executing asynchronous tasks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EufhjogOAokdQ8mMQKjceA.png" /></figure><p>We are asking the executor to execute a runnable task. Creating the thread that runs the task and its management is now delegated to the framework.</p><p>Since we told the executor to execute the tasks submitted to it using only one thread — <strong>newSingleThreadExecutor()</strong>, it will make sure that one thread (worker thread) is always available for asynchronous task execution. If the worker thread terminates due to exceptional conditions, Executors.newSingleThreadExecutor() will create a new one automatically.</p><p>Thread creation and management are not the concerns of our application logic anymore. If we have to do this ourselves, then these concerns would stay alongside our application logic leading to additional maintenance overhead. By using the well-tested executor framework, we can save a significant amount of time and effort.</p><p><strong>OK, What is going on inside this factory method — </strong><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/Executors.html">Executors</a>.newSingleThreadExecutor()?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBVMAsOiAYq9j7TheEFwDw.png" /></figure><p>Just make a mental note of the <strong>ThreadPoolExecutor </strong>seen above that you can explore on your own later on. I have described it above. All the executor implementation classes use it internally.</p><p><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/ExecutorService.html"><strong>ExecutorService</strong></a><strong> </strong>(since Java 1.5)</p><p>ExecutorService improves Executor by adding the following main features</p><ul><li>Submit a runnable to be executed that <strong>returns a Future object </strong>representing<strong> the</strong> <strong>task status</strong></li></ul><pre>ExecutorService exeService = <strong>Executors.newFixedThreadPool</strong>(10);</pre><pre>Future&lt;?&gt; task = exeService.submit(<strong>runnable</strong>);</pre><pre>System.out.println(&quot;Has the task completed? &quot; + <strong>task.isDone()</strong>);</pre><p><strong>What is going on inside this factory method </strong><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/Executors.html">Executors</a>.newFixedThreadExecutor(10)?</p><pre>public static ExecutorService newFixedThreadPool(int nThreads) {</pre><pre>return <br>    <strong>new ThreadPoolExecutor(<br>      nThreads,<br>      nThreads,<br>      0L, <br>      TimeUnit.<em>MILLISECONDS</em>,<br>      new LinkedBlockingQueue&lt;Runnable&gt;())</strong>;</pre><pre>}</pre><ul><li>Submit a callable to be executed and <strong>return a Future object</strong> representing the <strong>status and result</strong> of a task.</li></ul><pre>ExecutorService exeService = <strong>Executors.newCachedThreadPool</strong>();</pre><pre>Future&lt;String&gt; result = exeService.submit(<strong>callable</strong>);</pre><pre>System.out.println(&quot;Result: &quot; + result.get());</pre><p><strong>What is going on inside this factory method </strong><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/Executors.html">Executors</a>.newCachedThreadPool()?</p><pre>public static ExecutorService newCachedThreadPool() {</pre><pre>return <br>    <strong>new ThreadPoolExecutor(<br>      0,<br>      Integer.<em>MAX_VALUE</em>,<br>      60L, <br>      TimeUnit.<em>SECONDS</em>,<br>      new SynchronousQueue&lt;Runnable&gt;())</strong>;</pre><pre>}</pre><p>Broadly, it also supports the following features:</p><ol><li>Submit a collection of tasks and wait for the results</li><li>Executor shutdown</li></ol><p><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/ScheduledExecutorService.html"><strong>ScheduledExecutorService </strong></a>(since Java 1.5)</p><p>ScheduledExecutorService improves ExecutorService by adding the following features</p><ul><li>Schedule a one-shot task that will start after the specified initial delay</li></ul><p>Eg.: Process this file in 3 hours from now</p><pre>ScheduledExecutorService exe = <strong>Executors.newScheduledThreadPool</strong>();</pre><pre>exe.schedule(callableOrCallable, initialDelay, delayTimeUnit);</pre><ul><li>Schedule tasks with a specified initial delay and interval</li></ul><pre>ScheduledExecutorService exe = <strong>Executors.newScheduledThreadPool</strong>();</pre><pre>exe.scheduleAtFixedRate(runnable, initialDelay, period, delayTimeUnit);</pre><p>Eg.: Start processing files in 6 hours from now and repeat it every 15 min.</p><ul><li>Schedule tasks with a specified initial delay and schedule a subsequent task with the specified delay interval</li></ul><p>Eg.: Start processing files in 6 hours from now; after processing a file, wait for 15 min before processing the next one.</p><pre>ScheduledExecutorService exe = <strong>Executors.newScheduledThreadPool</strong>();</pre><pre>exe.scheduleWithFixedDelay​(runnable, initialDelay, delay, delayTimeUnit)</pre><p><strong>What is going on inside this factory method </strong><a href="https://docs.oracle.com/javase/10/docs/api/java/util/concurrent/Executors.html">Executors</a>.newScheduledThreadPool()?</p><pre>public static ScheduledExecutorService newScheduledThreadPool(<br>        int corePoolSize, ThreadFactory threadFactory) {<br>    <br><strong>  return <br>    new ScheduledThreadPoolExecutor(<br>      corePoolSize, <br>      threadFactory);</strong></pre><pre>}</pre><h4>Code Snippet</h4><h4>References</h4><ul><li>Java Concurrency in Practice, a book by Brian Goetz, Doug Lea, Tim Peierls, David Holmes</li><li><a href="http://tutorials.jenkov.com/java-concurrency/thread-pools.html">http://tutorials.jenkov.com/java-concurrency/thread-pools.html</a></li><li><a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html">https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html</a></li><li><a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html">https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html</a></li></ul><h4>Courtesy</h4><ul><li>Diagrams created with <a href="https://www.draw.io/">https://www.draw.io</a></li></ul><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://blog.usejournal.com/r/?url=https%3A%2F%2Fusejournal.com%2F%3Futm_source%3Dmedium.com%26utm_medium%3Dnoteworthy_blog%26utm_campaign%3Dtech%26utm_content%3Dguest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://blog.usejournal.com/r/?url=https%3A%2F%2Fusejournal.com%2Fnewsletter%2Fnoteworthy-in-tech%2F%3Futm_source%3Dmedium.com%26utm_medium%3Dnoteworthy_blog%26utm_campaign%3Dtech%26utm_content%3Dguest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=836e5cd97364" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA['Filter' Coffee and Culture]]></title>
            <link>https://medium.com/@magnusram/filter-coffee-and-heritage-7d7eeb7276cb?source=rss-8e53fa7d1c07------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d7eeb7276cb</guid>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[kumbakonam]]></category>
            <category><![CDATA[tamil-nadu]]></category>
            <category><![CDATA[coffee]]></category>
            <dc:creator><![CDATA[R]]></dc:creator>
            <pubDate>Sat, 29 Jun 2019 15:36:30 GMT</pubDate>
            <atom:updated>2019-07-02T15:13:17.190Z</atom:updated>
            <content:encoded><![CDATA[<h4>South India</h4><blockquote>Mornings are great. Mornings are refreshing.</blockquote><p>Unless you fix your own coffee, can you utter these statements with confidence?! I bet, not! 😎</p><p>I am from South India. I belong to a community which is capable of surviving on coffee the entire day.</p><p>As I grew older, I started fixing my own coffee. I completely stopped drinking coffee outside of my home just because it won’t be right unless I make it my way — sugarless and dark — I know my taste buds better.</p><p>The version of coffee that I grew up with, the one that I and million others identify ourselves with is the famed ‘Filter Coffee’ of Kumbakonam — the renowned temple city of the Indian state Tamil Nadu.</p><p>It is in the land of great Chola Empire of yore. The temple architecture, arts, culture, paddy fields, river Kaveri and the glorious filter coffee are tightly woven into the DNA of the people of the region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*boU1jt7YU_p0Ik6_gS7cRA.jpeg" /><figcaption><strong>‘Brihadisvara’ temple at Tanjore, Tamilnadu, South India</strong> — built in between 1003 and 1010 AD, the temple is a part of the UNESCO World Heritage Site. Photo Courtesy: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><p>I was born in a place called Thiruvarur near Kumbakonam. My DNA can’t be any different, right?!— Coffee and culture are very much an integral part of me.</p><p>Making filter-coffee at home, like how they always used to make, has been passed on from generations. The aroma of filter coffee mixed with the wood-smoke-laden village kitchens is still a romantic and nostalgic image that teleports one to the quaint village life.</p><p>Though the scene is different in villages today, that way of life is encoded deep inside the cultural fabric of the community of the region — the roots of which makes the city-dwelling bearable.</p><p>I distinctly remember my loveable grandfather standing in front of the pooja (prayer) room of my house, holding davara in one hand and the filter-coffee filled tumbler, on the other hand. As he raises it towards the Gods in the room as an offering, early in the morning, before taking his first gulp (elder’s don’t sip, they pour it in their mouth), I would watch the ceremony in awe ❤</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DTMB8EkRKErJqKudPbJPPw.jpeg" /><figcaption>One of the many sculptures in the ‘Brihadisvara’ temple. Photo Courtesy: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><p>Coming back, the process of making filter coffee is an art that’s easy to master. All we need is a ‘filter’. It’s a humble kitchen utensil with two parts —</p><ul><li>top perforated one where the ground coffee goes</li><li>bottom one that collects the filtered goodness.</li></ul><p>There are three distinct and easy steps in making a filter coffee. I will try to explain the process along with the pictures that I had taken when I was fixing my morning coffee:</p><p>1. Boil water and milk separately at the same time to speed up the lead time to take your first sip. 😇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a2qD5N3IfzwrFaV89xcBKg.jpeg" /><figcaption>Milk ready for the boil</figcaption></figure><p>2. Fill-up the top part of the filter, till halfway mark, with ground coffee. Press it gently so that the coffee powder is stuffed with only a very little airspace. If not, the filtered decoction would be watery and blasphemous. 🧘🏽‍♂️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKKrwq_nGm_ef_gkdVY_-Q.jpeg" /><figcaption>Humble ‘filter’ with coffee powder</figcaption></figure><p>3. Now the water would have come to a boil. Pour it gently, in a thin stream, on to the stuffed coffee powder till the brim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQQh5ircww4bGjC-kQ-FNQ.jpeg" /><figcaption>The Brew — Boiled water in Coffe powder. The ‘filter’ silently working its magic!</figcaption></figure><p>Now, you have to bear the excruciating waiting period of close to 7–8 min. In the meantime, you are bound to feel fidgety but the aroma of the brewing coffee should elevate your mood. If you are still feeling restless, take a deep breath standing closer to the filter and count till 100 while meditating on the coffee filled breath. 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LkKGJ2-ClK3FvBP3q1cGQ.jpeg" /><figcaption>The ‘desire’ for coffee was spiritually waived off from sin list by Gowthama — or so I heard 😇😇Photo courtesy — <a href="https://unsplash.com/photos/jbrR_ESWK2A">mattiafalo@unsplash</a></figcaption></figure><p>Once the short meditation session is over, you can now lift the top part of the filter to check if enough magic potion has accumulated in the bottom part of the filter. But be careful while lifting the top part as it will be hot. You should now see the decoction — the filtered coffee. Your pupils will dilate. Take in the view. Savor your creation. Thank the Gods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m2GL5uRCKBbfmcSgpf54ug.jpeg" /></figure><p>Now, the milk would have come to a boil too. Take a tumbler, pour in the decoction that you patiently and eagerly minted following the meditation session. Now pour milk in the tumbler but don’t fill it up till the brim. Stop when you are at the 3/4th mark — this is important, read on to know why.</p><p>Now make sure that the color is right. Or else, add more decoction. Now add a little milk. Repeat this a few more times till you are fine with the color consistency of the coffee-milk mix.</p><p>The coffee still needs thorough mixing. This is a crucial step. For this, we have to pour the contents from tumbler to another container called ‘davara’, from davara to tumbler and so on till you see the froth kissing the brim of the tumbler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pl34LrfP72h8bFJ2557OdQ.jpeg" /><figcaption>Davara &amp; Tumbler with the filter coffee</figcaption></figure><p>You are all set now. Find a comfortable seating and sip away to glory.</p><p>Cholas and my ancestors would be proud. Art, culture, and heritage live on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hAGp-znDag6W2agT4IxeTA.jpeg" /><figcaption>Photo Courtesy: <a href="https://medium.com/u/76cb5e5e48a0">Aravindhan Raghunathan</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d7eeb7276cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>