<?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 Nabanita Sarkar on Medium]]></title>
        <description><![CDATA[Stories by Nabanita Sarkar on Medium]]></description>
        <link>https://medium.com/@nabanita.sarkar?source=rss-dad86f82f5ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SjNb5EcyCJCUbd6f6zGYsQ.jpeg</url>
            <title>Stories by Nabanita Sarkar on Medium</title>
            <link>https://medium.com/@nabanita.sarkar?source=rss-dad86f82f5ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:23:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nabanita.sarkar/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[React Query: Beyond the Basics]]></title>
            <link>https://javascript.plainenglish.io/react-query-beyond-basics-f43149c7a36a?source=rss-dad86f82f5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/f43149c7a36a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nabanita Sarkar]]></dc:creator>
            <pubDate>Tue, 08 Feb 2022 07:42:24 GMT</pubDate>
            <atom:updated>2024-07-10T19:54:21.900Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*ouyHRR8FBxpdLFB1LR3qJw.png" /><figcaption>Photo by <a href="https://unsplash.com/@vorosbenisop?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Benjamin Voros</a> on <a href="https://unsplash.com/s/photos/mountain-night-sky?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Various articles over the internet have already discussed the benefits of using react-query. The ease of use of useQuery/useMutation i.e. basically one-liner, to get access to loading, fetching or error state and the response data, has already been iterated over and over again. But the more advanced and niche features have hardly been discussed. So here I am, delving deeper into some of the features of the react-query world.</p><p>I will give you an example of a simple todo list app, where a list of todos is shown. And when the user wants to create a new todo, a modal form is opened. After the todo is successfully created, the todo list will be refetched. In the todo list, if the user clicks on a todo, it would go to a new page, where the details corresponding tothe todo will be shown.</p><h3><strong>1. onSucces &amp; onError</strong></h3><p>Both useQuery and useMutation support various configuration options. Two of them are onSuccess and onError parameters, that accept a function. These two options can be helpful, especially if we would like to perform some non data rendering logic. In the todo list example, if we would like to throw a success or error message chips, that aren’t necessarily a component, use can use these. (<em>In case rendering component is needed, we are better of with </em><em>isSuccess or </em><em>isError</em>). Basically this can act like the callback function inside.then that we use in api fetching. Better use case would be to dispatch some redux state. It can be done here too, without fumbling around useEffect.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af27ffba4c76280c3be4ed8bdcd00c9c/href">https://medium.com/media/af27ffba4c76280c3be4ed8bdcd00c9c/href</a></iframe><h3>2. Query Invalidation</h3><p>In out todo-list example, as we have discussed that we would like to refetch the list of all todos, on successful creation of a task. So here comes the magic of query invalidation. We have to use the previously discussed, onSuccess function. In the function we can use queryClient invalidation to invalidate i.e to ask react-query to refetch one or more query/queries.</p><p>In our todo app, when our create todo is successful, we would invalidate the query that is fetching our all todos list.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/444030cf3d9b5bcaa1fbc09f43d35965/href">https://medium.com/media/444030cf3d9b5bcaa1fbc09f43d35965/href</a></iframe><blockquote><strong>👉Also learn how to fetch API data with React Query with this quick guide:</strong></blockquote><p><a href="https://differ.blog/p/how-to-fetch-api-data-with-react-query-29772f">How To Fetch API Data with React Query</a></p><h3>3. Query Retries</h3><p>This can be small one, but can come handy when situation demands. React query comes with some preconfigured default values corresponding to each configuration option. For example cache time is 5mins and stale time is 0. So one of the many options,is retry option. Its default value is 3. That is if a query is not successful in fetching the query in first attempt, it will continue trying 3 times before declaring isError to be true. In some cases, you might not want that behaviour. You can always change that to some other number denoting the number of retries that you would like to happen. Another way is, retry also accepts true and false as value too. What does that mean? If retry is true then react query will fetch the query until it is successful and if it false, then no retry happens after any unsuccessful attempts.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6215a2ee16ac3c84d8d9daf7874fc04a/href">https://medium.com/media/6215a2ee16ac3c84d8d9daf7874fc04a/href</a></iframe><p>All of this options can be changed per query basis. But you might want to declare your own configuration options for all the queries (unless you specify otherwise in some particular query). Then you should consider doing that in the query client.</p><h3>4. Enabling query conditionally</h3><p>In some cases, you might want a query to run only if some condition is met. useQuery and all of the other goodies of react-query, being hooks, can’t be used directly in some if-else statement, as that would break the basic rule of react hooks. For these type of scenarios, react-query comes with an option called enabled. We can always hard code them to be true or false, but where it really shines is when a variable is passed. Now according to that variable value change the query would be enabled or disabled. How cool is that!</p><p>For example, in our todo-list app, when user goes to individual todo, the todo_id is passed as param in the url (using react-router or other routing library). And according to the todo_id, the details are fetched. Now we would like to fetch the query, only if param is not null. We can do it this way then -</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51492a25f7ba44a15ae70a54695820a7/href">https://medium.com/media/51492a25f7ba44a15ae70a54695820a7/href</a></iframe><h3>5. Custom hooks for Query</h3><p>It is more of a personal opinion rather than being a react-query specific feature. So if you need to customise the behaviour beyond the preconfigured options or need to access the onSuccess or onError options, very soon you might end up with something like this. Some might prefer that one can see what is happening in the query right away. But if you ever need to access the same query across multiple components, you might want to make your own custom hook wrapped around the whole react-query logic. And I assure you, it is not some high-end jujutsu. If we consider the previous example it would go something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f172d53ddf6d8b2ad791b17ad7adadf/href">https://medium.com/media/1f172d53ddf6d8b2ad791b17ad7adadf/href</a></iframe><blockquote>Some pro tips</blockquote><ol><li>If you consider writing custom hooks, you might also consider declaring a variable where we simply hold that data or if you need status code for some reason then you can abstract it away too here and pass as single value and making the data that that we need to map upon or take other actions. A well defined variable makes more sense than generic data.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/734a61ae92d6d5e2a93b02200a830476/href">https://medium.com/media/734a61ae92d6d5e2a93b02200a830476/href</a></iframe><p>2. In case of renaming data as something else, you can do it directly in react-query too. And not only data, you can rename isLoading or isError to something else too. It is especially needed if you need to access two or more queries in one component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/88df597ea77bc90bddafafb0759423d1/href">https://medium.com/media/88df597ea77bc90bddafafb0759423d1/href</a></iframe><p>3. You can use api routes as query names. It will make a lot of sense if abstract away your query function elsewhere. It might also help, if you find that you need to access that particular query, that you think you have used in some component already. And now you would to like to use it in some other component. Naming in that way, you will easily get away from finding what was the name of that particular query. After all, the query names is crucial to utilise the benefit of react-query fruitfully(e.g, query invalidation). I have followed this style throughout the article.</p><p>4. If using custom hooks, you can consider keeping them in separate files according to their main route. And keeping them all inside services folder itself, the same structure you might already be using with axios.</p><pre>src<br> — components<br> — pages<br> — services<br>  — todo.js<br>  — user.js</pre><p>It is not meant to be something exhaustive. Just a few, that I am using daily.</p><p>Some of the last parts have been purely personal hacks, that you might not agree with or I might be actually doing wrong. Please feel free to tell me so.</p><p><em>More content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><em>. Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Follow us on </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><em> and </em><a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a><em>. Join our </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>community Discord</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f43149c7a36a" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/react-query-beyond-basics-f43149c7a36a">React Query: Beyond the Basics</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[অন্তিম আশা]]></title>
            <link>https://medium.com/@nabanita.sarkar/%E0%A6%85%E0%A6%A8%E0%A7%8D%E0%A6%A4%E0%A6%BF%E0%A6%AE-%E0%A6%86%E0%A6%B6%E0%A6%BE-81c1c03b1a81?source=rss-dad86f82f5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/81c1c03b1a81</guid>
            <dc:creator><![CDATA[Nabanita Sarkar]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 20:30:57 GMT</pubDate>
            <atom:updated>2019-12-22T20:35:21.037Z</atom:updated>
            <content:encoded><![CDATA[<p>।। ১।।<br>নাঃ। আর পারা যাচ্ছে না। ব্যাগটা চেয়ারের ওপর ছুঁড়ে একটা দীর্ঘশ্বাস ফেলল নিয়াশা। কলেজের নিত্যদিনের চাপ, বন্ধুদের টিটকারি, বাবা মায়ের মাত্রাতিরিক্ত আকাঙ্খা --- সবকিছুর ভার নিঃশব্দে গুটিগুটি পায়ে এসে নুব্জ করে দিয়েছে নিয়াশাকে। &quot;ক্লাসের চেয়ে মনটা বাইরে কেন বেশি থাকে?&quot; &quot;ইস্, তোর ড্রেসিং সেন্স বলে কিছুই নেই, কী যাতা!&quot; &quot;এত টাকা খরচ করে পড়ানো হচ্ছে। বাবা মায়ের নামটা উজ্জ্বল করতে হবে তো নাকি?&quot;। টুপ করে একটা জলবিন্দু নেমে এলো ওর গাল বেয়ে। শরীর টা এলিয়ে দিল হোস্টেলের বিছানায়। &quot;আচ্ছা আমি যদি হঠাৎ অদৃশ্য হয়ে যাই এই দুনিয়া থেকে খুব কি ক্ষতি হবে....?&quot; দরজাটা ধড়াম করে খুলে গেলো। &quot;এই জানিস নিয়াশা, আজ না কলেজে....&quot;। উফ্ আবার। রুমমেটের নিত্যদিনের কচকচানি শুনতে চায়না ও। অবশ্য তিতলির তাতে ভ্রুক্ষেপ নেই। ও বকেই চলেছে। লঘুপায়ে বাথরুমের দিকে চলে গেলো নিয়াশা। ছিটকিনি লাগিয়ে দিল। মুখে জলের ঝাপটা দিয়ে যাচ্ছে। আর মনের মধ্যে ভাঙা রেকর্ড প্লেয়ারের মত বেজে চলেছে রোজকার বাঙ্গবিদ্রুপগুলো। বাইরে জোর চিৎকার হচ্ছে না? এ আর নতুন কি। হোস্টেলে প্রায়ই হয়। ও জলের ঝাপটা দিয়ে চলেছে। আর মাঝে মাঝে আরশিতে দেখছে নিজের ক্লান্ত মুখটাকে। হঠাৎ যেন ঘোর কাটল ওর। মেঝেটা খুব জোরে দুলছে না? সর্বনাশ! ভূমিকম্প! লাফ দিয়ে দরজা খুলে বেরোলো নিয়াশা। ছুট লাগলো। কিন্তু হঠাৎই একটা সিমেন্টের চাঙড় ভেঙে পড়লো ওর পাশে। তারপর আরও কয়েকটা পড়লো সামনে। সিঁড়ি পর্যন্ত যাওয়া যাবে না। সঙ্গে সঙ্গে সিদ্ধান্ত নিল ও। নিজের ঘরে ছুটে গেলো। কী মনে হল ফোনটা নিল আর ঢুকে পড়লো খাটের নীচে। ঘরের মধ্যেও প্রলয় শুরু হল। হঠাৎ মনে হলো মেঝেতেও বুঝি ফাটল ধরছে। তারপর সব অন্ধকার।<br>।।২।।<br>--- &quot;আজকের ভূমিকম্পটা কী জোরালো ছিল বাপরে!&quot;<br>--- &quot;আর অনেকক্ষন ধরেও হল , বল।&quot;<br> অশোক আর বৃষ্টি---- ভূমিকম্পের সময় বাইরে বেরিয়েছিল। তারপর পাড়া- প্রতিবেশীদের সঙ্গে আলোচনা করে এই সবেমাত্র বাড়িতে ঢুকল।<br>---&quot;আমি নিয়াশাকে একটা কল করি।&quot;<br>---&quot; হ্যাঁ করো। আমি একটু টিভিটা চালিয়ে বসি।&quot;<br>ব্রেকিং নিউজ : দুর্গাপুরের একটি কলেজের গার্লস হোস্টেল ধূলিস্যাৎ হলে গেছে আজ সন্ধ্যার ভূমিকম্পে।<br> চমকে টিভির দিকে নজর ফিরলো বৃষ্টির।নিউজ রিপোর্টার ঘটনাস্থলে পৌঁছে গেছে। টিভির পর্দায় ফুটে উঠলো অকুস্থলের ছবি। আরে এ যে নিয়াশারই হোস্টেল! অকস্মাৎ বজ্রপাত হল অশোক আর বৃষ্টির মাথায়।<br>---&quot;তু- তুমি নিয়াশাকে ফোনে পাচ্ছ না?&quot;<br>---&quot; রিং হয়ে চলেছে । ধরছে না।&quot;<br>--- &quot;আহা ধরবে কী করে। ছুটে বেরিয়েছে ওই সময়.....&quot; একটা হাঁফ ছাড়ল অশোক &quot;..... ফোন কী আর নিয়েছে।&quot;<br>---&quot; কিন্তু ওর সব বন্ধুগুলোকে তো টিভিতে দেখতে পাচ্ছি। ওর রুমমেট তিতলিকেও দেখলাম। নিয়াশাকে তো দেখলাম না।&quot;<br>---&quot; আছে ওই ভিড়ের মধ্যে। সবাই তো বাইরে খোলা মাঠে জড়ো হ.....&quot;<br> না, কথাটা শেষ করতে পারলো না অশোক। কারণ তার আগেই নিউজ রিপোর্টার বলে উঠেছে &quot;এখনও পর্যন্ত একটি মেয়েকে খুঁজে পাওয়া যাচ্ছে না। নাম নিয়াশা মুখার্জী। ওর রুমমেটের কথা অনুযায়ী ভূমিকম্পের কিছুক্ষণ আগে ও রুম থেকে বেরিয়েছিল। কিন্তু তারপর থেকে তাকে আর দেখা যায় নি।&quot; একটা করে জলবিন্দু গড়িয়ে পড়লো বৃষ্টি আর অশোকের গাল বেয়ে।<br>।।৩।।<br> ওর ফোনের রিংটোন টা বেজে চলেছে না অনবরত? আস্তে আস্তে চোখ খুললো নিয়াশা। চারিদিকে নিকষ কালো অন্ধকার। নড়বার চেষ্টা করল। না বেশি নড়াচড়া যাচ্ছে না। হাতে মুঠো করা আছে ফোনটা। ফোনটা কিছুক্ষণ আগে বাজছিল না? কোনরকমে হাতটা কাছে নিয়ে এলো। মা - ৩ টে মিসড কল।<br> বাকরুদ্ধ বৃষ্টি ধপ করে বসে পড়েছে সোফায়। কিছু ভাবতে পারছে না ও। হঠাৎ ফোনটা বেজে উঠল। নিয়াশা! ঝটতি ফোন তুললো বৃষ্টি। <br>--- &quot;মা.....&quot;<br>---&quot; নিয়াশা.....তুই কোথায় মা?&quot; ফুপিয়ে উঠল বৃষ্টি। নিয়াশা বুঝে গেলো খবরে ঘটনাটা দেখিয়ে দিয়েছে আর ওকে যে খুঁজে পাওয়া যাচ্ছে না সেটাও মা জানে।<br>---&quot;ভেরি ফানি মা।&quot; একটু হাসলো নিয়াশা। &quot;আমি ধ্বংস স্তূপের মধ্যে।&quot;<br> ততক্ষণে বৃষ্টির কাছ থেকে ফোনটা ছিনিয়ে নিয়েছে অশোক। &quot; মা, তোর কষ্ট হচ্ছে নাতো?&quot;<br>---&quot; একটু তো হচ্ছে। বাট তোমরা কাজের কাজটা আগে কর।&quot; নিজেকে স্টেডি করল নিয়াশা। &quot; তিতলিকে ফোন করে বল আমাকে যেন কল করে। সেই আওয়াজে আমার পজিশন বুঝতে পারবে আর রেসকিউ টিম উদ্ধার করতে পারবে। এক্ষুনি বল।&quot;<br>---&quot; হ্যাঁ, বলছি মা। তুই একটু ধৈর্য ধর।&quot;<br> হুম্। ধৈর্য ধরতে হবে ওকে। শ্বাস নিতে একটু কষ্ট হচ্ছে না? অক্সিজেন কমে আসছে বোধহয়। না সবটা শেষ হওয়ার আগে ও মুক্ত প্রাঙ্গণের খোঁজ পাবে। আশায় বুক বেঁধে অঘোর ঘুমে ঘুমিয়ে পড়ল নিয়াশা।<br>।।৪।।<br>আজকের আকাশটা বড্ড বেশি নীল। সূর্যের কিরণ ও ঝিকমিকিয়ে উঠেছে। এমনই একটা সূর্যরশ্মি জানালার কাচ ভেদ করে এসে পড়ল নিয়াশার চোখের পাতায়। চোখ মেলল ও। ওই অতলস্পর্শী অন্ধকারের পর এমন উজ্জ্বল সকাল ! চারদিকে চেয়ে বুঝল ও কোনো নার্সিং হোমের বেডে শুয়ে আছে। পাশের টেবিলে একটা সুন্দর ফুলের তোড়া রাখা। নীচে একটা চিরকুটে লেখা &quot;ফ্রম ইওর ক্লাসমেটস্ &quot;। আর একটা চকলেটের বাক্স &quot;ফ্রম তিতলি&quot;। আবছা একটা স্মৃতি ভেসে উঠলো ওর মনে। ওকে উদ্ধার করার পর তিতলি এসে জড়িয়ে ধরেছিল। ঘিরে ধরেছিল অন্য বন্ধুরাও। হঠাৎ দরজা খুলে গেল। ছুটে এল অশোক আর বৃষ্টি। নিয়াশাকে বুকে চেপে হাউমাউ করে কেঁদে ফেললো বৃষ্টি।<br>&quot;মা, আর কোনোদিন আমাদের এভাবে ভয় দেখস না।&quot; রুমাল দিয়ে চোখ মুছতে মুছতে বলল অশোক।<br> জানালার দিকে চোখ ফেরাল নিয়াশা। হ্যাঁ ওই গহন কালো আঁধারের পর এমন রবির কর মাখা প্রভাতও আসে --- ঠিক জীবন প্রবাহের মতোই।</p><p>----- © নবনীতা সরকার</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81c1c03b1a81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[অসম্ভবের হাতছানি]]></title>
            <link>https://medium.com/@nabanita.sarkar/%E0%A6%85%E0%A6%B8%E0%A6%AE%E0%A7%8D%E0%A6%AD%E0%A6%AC%E0%A7%87%E0%A6%B0-%E0%A6%B9%E0%A6%BE%E0%A6%A4%E0%A6%9B%E0%A6%BE%E0%A6%A8%E0%A6%BF-4c8128b6730d?source=rss-dad86f82f5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c8128b6730d</guid>
            <dc:creator><![CDATA[Nabanita Sarkar]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 20:29:21 GMT</pubDate>
            <atom:updated>2019-12-22T20:29:21.008Z</atom:updated>
            <content:encoded><![CDATA[<p>আজ বোধ হয় ট্রেনটা মিস্ হবেই।&quot;.....আপ তিস্তা তোর্সা এক্সপ্রেস পাঁচ নম্বর প্লাটফর্মে আসছে....&quot; যাক এখনও আসেনি। হাঁফাতে হাঁফাতে স্টেশনে ঢুকল তৃষা। হাতঘড়িতে দেখলো দশটা। একটু দম ফেলে হাঁটা লাগলো ওভারব্রিজের দিকে।আজ মালদা স্টেশনে ভিড় টা একটু বেশিই মনে হচ্ছে না? আহ্, নিজেকেই আলতো করে বকে দিল তৃষা। কাল মহালয়া না! ওর মতো আরও যে অনেকে বাড়ি ফিরছে। একটা মৃদু হাসি ছুঁয়ে গেলো ঠোঁটের কোনায়। ওভারব্রিজের কাছে পৌঁছাতেই কেও যেনো হালকা টান দিল ওর হাতে। পিছন ঘুরে দেখে এক বৃদ্ধা।<br>&quot;আমাকে একটু পাঁচ নম্বর প্লাটফর্মে পৌঁছে দেবে? খুব ভিড়, উঠতে পারছি না।&quot;<br>&quot;হ্যাঁ, নিশ্চয়।চলুন।&quot; আস্তে আস্তে ভিড় ঠেলে ওনাকে নিয়ে পাঁচ নম্বর প্লাটফর্মে নামলো তৃষা।<br>&quot;তোমাকে যে কি বলি, তুমি না থাকলে আমি এখানে আসতেই পারতাম না।&quot; একটা চওড়া হাসি খেলে গেছে বৃদ্ধার মুখে। &quot;আরে না না, একজন মানুষ হিসেবে আর একজনকে সাহায্য করা তো কর্তব্য।&quot; হালকা হেসে বিদায় নিল তৃষা। গিয়ে দাঁড়ালো একটা ফ্যানের তলায়। বড্ড গরম আজকে! ওই বৃদ্ধাও কাছাকাছি একটা বসার জায়গায় এসে বসলেন। ট্রেন এখনও আসেনি। কিছুটা অস্থিরভাবে ঘোরাঘুরি করছিল ও। তবে চোখটা মাঝে মাঝে চলে যাচ্ছিলো বৃদ্ধার দিকে। উনিও যেনো বার বার ইতস্তত ভাবে ওর দিকেই তাকাচ্ছেন। শেষে আর থাকতে না পেরে ওনার সামনে গিয়ে প্রশ্নটা পেড় এই ফেললো তৃষা।<br>&quot;আপনি কী আমাকে কিছু বলবেন?&quot;<br>&quot;না মানে, তুমি কি তিস্তায় যাবে?&quot;<br>&quot;হ্যাঁ&quot;<br>&quot;বি - ওয়ান কামরা টা কোথায় দাঁড়াবে একটু বলতে পারবে?&quot; তৃষার কামরাও বি ওয়ান। &quot;আপনি এখানেই কাছাকাছি থাকুন। আমিও বি - ওয়ানেই উঠবো। আপনাকে তুলে দেবো।&quot;<br>&quot;অনেক বড় হও মা।&quot;<br> ট্রেন এলো কিছুক্ষণ পর। বৃদ্ধাকে নিয়ে ট্রেন উঠলো তৃষা। দেখা গেলো ওনার আর তৃষার একই কুপ। তাতে একটিমাত্র লোক সাইড লোয়ারে বসে বাসি খবরের কাগজ পড়ছে। জানালার এক দিকে গুছিয়ে বসলো তৃষা। বৃদ্ধা বসলেন উল্টো দিকে। ট্রেন ছেড়ে দিল। <br>&quot;তুমি কোথায় যাবে?&quot;<br>&quot;জলপাইগুড়ি&quot;<br>&quot;ওখানে বুঝি তোমার বাড়ি?&quot;<br>&quot;হ্যাঁ&quot;<br> বৃদ্ধা থামলেন একটু। তৃষা আড়চোখে দেখলো ওই দিকে বসা লোকটাকে। খবরের কাগজ থেকে মুখ তুলেছেন। একটা অদ্ভুত দৃষ্টিতে তাকিয়ে আছেন তৃষার দিকে। বিরক্ত হলো ও। মুখ ঘুরিয়ে নিল জানালার দিকে।<br>&quot;আচ্ছা তুমি কি এখানে চাকরি করো?&quot;<br>&quot;না, পড়াশোনা করি।&quot;<br>&quot;কী পড়?&quot;<br>&quot;ডাক্তারি পড়ছি।&quot;<br>&quot;আমার মত বুড়োবুড়ি গুলো যেন আর কিছুদিন বেশি আয়ু পায় একটু দেখো।&quot;<br>একটু হাসলো তৃষা। জিন্সের পকেট থেকে ফোনটা বের করলো। মাকে কল লাগালো।&quot; হ্যাঁ মা ট্রেনে উঠে গেছি। কাল সকালে পৌঁছে যাবো। তুমি চিন্তা করো না।&quot; তৃষা দেখলো বৃদ্ধা হাসছেন।<br>&quot; আচ্ছা তোমার বাবা করেন?&quot;<br> একি! ভদ্রমহিলা আরও প্রশ্ন করবেন! ওনার প্রশ্নবান যে থামছেই না।<br>&quot; বাবা ইঞ্জিনিয়ার&quot;<br>&quot; আর মা?&quot;<br> না! এই প্রশ্নটা যখনই কেও করে খুশি না হলে পারে না তৃষা। অধিকাংশ মানুষ বাবার পেশার খোঁজ নিয়েই ক্ষান্ত দেন। মায়েরাও যে কিছু করতে পারেন তা তাদের চিন্তার পরিসরের বাইরে। তবে ওনার মত বৃদ্ধা যে এই প্রশ্নটা করতে পারেন তা ভাবতেই পারেনি তৃষা।<br>&quot;মা ব্যাংকে চাকরি করেন&quot;<br>&quot;কী পোস্টে আছেন?&quot;<br>&quot;এই কিছুদিন আগে ম্যানেজার হয়েছেন।&quot;<br>ভদ্রমহিলা আবার একটু যেনো মিটিমিটি হাসছে না? মন ভালো করা একটা অন্য রকম হাসি। এবার পাল্টা প্রশ্ন না করে পারলো না তৃষা। &quot;আপনি কোথায় যাচ্ছেন?&quot;<br>&quot;আমিও জলপাইগুড়ি যাচ্ছি। ওখানে মেয়ে থাকে আমার। দীর্ঘদিন দেখিনি। ভাবলাম এবার পুজোয় একটু খবরাখবর নিয়ে আসি।&quot;<br>আবার ক্ষণিকের নিরবতা। &quot;পুজোতে করা শাড়ি হলো তোমার মায়ের?&quot; প্রশ্নটা শুনে রীতিমতো অবাক তৃষা। অচেনা অজানা একজনকে এই প্রশ্ন যেন কতদিন না চেনেন উনি ওর মাকে। তবুও উত্তর দে তৃষা। &quot; পাঁচটা&quot; &quot; বাহ্ খুব ভালো।&quot;<br> কথার ফাঁকে কখন যেনো ঢুলুনি এসে গিয়েছিল। চোখ মেলে দেখলো বৃদ্ধা একমনে উল বুনছেন। উল বোনার এই ধরনটা চেনে ও। মা ওর জন্য এই ধরনের বোনা একটা সোয়েটার বানিয়ে দিয়েছিল। ঘড়িতে দেখলো বারোটা। নাহ্ এবার টানটান হয়ে শোওয়া দরকার। নিজের আপার বার্থ টায় উঠে ঘুমিয়ে পারলো ও।<br> সকাল হয়ে এসেছে। সূর্যের ছটা এসে আলোকিত করেছে গোটা কামরাকে। ঘুম ভাঙলো তৃষার। নীচে নেমে এলো। ট্রেন এখনও এন জে পি পৌঁছায়নি। অথচ ভদ্রমহিলা নেই। উনিও তো বলছিলেন জলপাইগুড়ি যাবেন। তাহলে নামলেন কোথায়? আগের রাতের খবরের কাগজ পড়া ভদ্রলোকটি চা খাচ্ছিলেন।<br>&quot;এখানে যে ভদ্রমহিলা ছিলেন উনি কোথায় বলতে পারেন?&quot;<br>&quot;আপনি কার কথা বলছেন ম্যাডাম?&quot; লোকটি যেন আকাশ থেকে পড়লো।<br>&quot;যিনি আমার সাথে মালদা থেকে উঠলেন।&quot;<br>&quot;আপনার সাথে আর তো কেও ওঠেনি।&quot;<br>&quot;কী পাগলের প্রলাপ বকছেন?&quot; <br>&quot;পাগল তো আমি আপনাকে ভাবছিলাম ম্যাডাম। নিজের মনে কথা বলে চলেছেন। তবে এখন তো দেখছি আপনি বদ্ধ পাগল&quot; একটু থামল লোকটা &quot; আমার কথা বিশ্বাস না হলে কামরার যেকোনো লোককে জিজ্ঞেস করুন এই কুপে আমি আপনি ছাড়া আর কেও ছিল কী না।&quot;<br> না বিশ্বাস করেও যেনো করতে পারছে না তৃষা। হতভম্বের মত বসে পড়লো ও। ট্রেন এন জে পি পৌঁছে গেছে। <br> ঘন্টা খানের পরে বাড়ির দরজায় কড়া নাড়ল ও। ওর মাথায় একটা চিন্তা ঘুরছে। ঘরে ঢুকেই হাঁক পাড়ল মায়ের উদ্দেশ্যে &quot;মা, তোমার পুরনো অ্যালবামটা বের কর না।&quot; তৃষার মা তো অবাক &quot; এসে এসেই অ্যালবাম দিয়ে কি করবি?&quot; &quot;আরে বের কর না&quot; <br> এক এক করে পৃষ্ঠা উল্টে চলেছে। দিদা গত হয়েছেন অনেকদিন। ও ওর দিদাকে দেখেনি। দিদার ছবি আছে এই অ্যালবামে। তবে এই অ্যালবাম বেশিবার খোলা হয়নি। খুললেই মা কেঁদে ফেলে যে। অবশেষে চোখ এসে আটকেছে দিদার ছবিতে। শূন্য দৃষ্টিতে তাকিয়ে রয়েছে তৃষা। ওদিক থেকে মা বলেই চলেছে &quot;কী রে, কী খুঁজছিস বললি না তো!&quot; কী বলবে ও? ও যে চিনতে পারেনি পুজোর আগে দিদা এসেছিল ওদের খোঁজ নিতে! <br>----© নবনীতা সরকার</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c8128b6730d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shards of Other Mind]]></title>
            <link>https://medium.com/@nabanita.sarkar/1-i-can-see-the-light-2b394f353bcb?source=rss-dad86f82f5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b394f353bcb</guid>
            <dc:creator><![CDATA[Nabanita Sarkar]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 20:20:00 GMT</pubDate>
            <atom:updated>2019-12-22T20:21:15.695Z</atom:updated>
            <content:encoded><![CDATA[<p>||1||<br>I can see the light. It’s far above me. I’m struggling to reach. But I’m drowning. I’m drowning in a pitch-black hollow..… deeper and deeper. Oxygen is less. To breathe is becoming harder. Extending my hands, I’m trying to grab something but failing. My eyes are closing on their own accord.<br>Suddenly I flutter open my eyes. am in my room. It was just a dream rather should I call a nightmare. A nightmare that is haunting me periodically. I can feel sweat drops all over my face. I glanced at my bed-side table. The clock is showing 5.34am now. I still have time to open my book shop. The lamp on my work table is still on, luring my attention to the blank pages of the notebook. An unfinished novel is calling me. My feet found their way towards it. Time to get some work done.<br>||2||<br>Black puff balls have clouded over the sky. Rain drops are drizzling and dancing with the wind and pricking the face with its cold touch. Puddles of mud can be found here and there. Overall, a gloomy atmosphere has prevailed outside, which contrasts drastically with the inside of my bookstore. It’s cosy. It’s warm and full of books. Basically, during the rainy season, it’s a haven for any book lover. I’ve created a reading corner and stacked some popular books for a rental basis. They can read the book here and I charge them for that length of time. The store is never very busy, neither I require it to be so, as it isn’t my main source of income. I write stories and novels behind a false name. I like the book shop to observe people for building my story characters.<br>Currently, I am sitting behind my table, scrolling through a random magazine and observing customers. A content smile pressed across my lips. “Ah! My life is perfect!” I sighed dreamily. A man in his late twenties walked up to me with a book tucked in his hand. A Hercule Poirot classic it is.<br>“It’s a wonderful book.” I can’t help but comment.<br>“Have you read it?”<br>“Yes, of course. I’ve read most of the books in this store. You can say the store is almost my hand-picked collection.”<br>His eyes suddenly lit up. They were shining for a reason; I can’t put my finger on. “Hi, I am Toru Sengupta.” He extended his hand. “I’m an IT professional, recently posted in this town. You know reading books give me such joy I can’t express in words......”. And this way our conversation started. And a beginning of an uncanny friendship was established.<br>||3||<br>The dark gloomy black colour of the sky has been replaced by a muted hazy grey. Dried leaves are swirling in the cold wind. As I looked through the window, it seemed as if the colours have been drained from nature and got locked up in a box. I sighed.<br>It has been months since I have met Toru. Every Saturday after his work he comes to my store. We talk about so many topics. Sometimes even after closing the shop, we would go upstairs and continue our conversation even until midnight. It astonishes me how much our views match.<br>But for some days I’m noticing him to be thoughtful. It seems as if he wants to tell me something but is hesitating. Last day he confessed that he has some things that he would like to discuss with me. Well, he is coming today. I don’t know why I am feeling uneasy like it will not be something good.<br>I heard a knock at the door. It must be Toru. As soon as I opened the door he entered as if he had to abate a hurricane to come over here. He hung his hat behind the door and then sat on the sofa with a matching murky expression on his face. His eye balls were transfixed at the floor and hands were busy popping the knuckles. Watching his silence, I decided to intervene into his reverie.<br>“You were saying last day that there is something you would like to tell me.”<br>He raised his head. He seemed to be reading my face, searching for some kind of notion. Then he uttered slowly. “Well, it is actually something I would like you to see.”<br>Curiosity gripped me as he handed me a DVD. I frowned.<br>“I would be glad if you please watch the video tonight. That was all I had to say. Okay bye.” He jumped off, grabbed his hat, and left within a blink of an eye. I stood there bewildered. I looked at the DVD and decided that I would watch it after dinner.<br>After having dinner, I ducked the DVD in the DVD player and switched the TV on. The video began.<br>It was showing a two-storeyed house with a small backyard. Have I seen it before? Suddenly a crippling headache crawled into my head. I closed my eyes in pain. Then everything went black.<br>||4||<br>Ah! It’s too much light. My eyelids are itching. As I slowly opened them, I saw vast blue sky, pouring glaring sunshine on to me. After getting up I realized I am standing in the backyard of the very same house which I saw in the DVD. What is happening? One moment I was watching a DVD, next moment I am in the DVD? Maybe I fell asleep watching the DVD and now I am dreaming about it. Yeah! that must be it.<br>Suddenly, I saw a boy of 9 or 10 years chasing a butterfly in the yard. It seemed that he wasn’t aware of my presence. When the butterfly sat on a flower, he was observing so keenly. The colours of its wings were reflecting in his eyes and mixing up with his curious glow. He was devouring it, cherishing it. But when I noticed his face ----- hey, he is a smaller version of Toru!<br>“Toru!” A female voice screeched from the inside of the house. “Don’t waste your time playing in the yard. Start studying now.” A lady in her late 30s came out and forcefully took him inside.<br>“Hey let him play......” I tried to protest but my voice didn’t reach them. A spell of silence prevailed and I stood there like a statue.<br>Suddenly the view started to swirl, making me feel like I am going into oblivion. All the colours which were making the scenery earlier, are now inter weaving with each other. Place of the colours and proportions are changing rapidly. Helpless I stood still. The roll of colours finally stopped. Now I am in a school corridor. There is Toru of about 14. His teacher was talking to the same woman from the backyard. I presume her to be his mother.<br>“Mrs. Sengupta, your son is talented no doubt. Just if he stops daydreaming in the class and instead of reading story books, consult reference books in the library, he can have a great future.”<br>As his teacher was commenting, a lone tear escaped Toru’s eyes and a torn piece of paper slipped from his fist.<br>Now I have come to a realization that nobody is aware of my presence here. Everyone is going in their own direction without casting a single glance on me. So I decided to act on my own instincts. I picked the torn paper left by Toru. What is it? Some handwritten scratched note may be? Hell no! it’s some sort of short story. And as far as I can assume it must be original!<br>The scene is changing again. Now it is a hostel room. The table clock is telling 2am. In front of Toru is piles of books. He is studying diligently. But his eyes which used to be eager to express so much is now hollow. Seeing his almost lifeless demeanour, a bubble of pain lumped in my throat.<br>The view changed into a multi-storeyed building now. I can see the stretch of the city from this top floor.<br>“Mr. Sengupta, you’re not understanding. You’ve to be more imaginative. You must bring some creativity to your work. You’ve potential. If you just work according to my words....” An elderly man patted Toru’s back. May be his boss. That curious sparkle of his younger age has been replaced by a serious undertone. I can see his entire day in front of me. Every day he wakes up at 6.30am, eats breakfast, goes to office, work all day long, return to his apartment, takes dinner, goes to bed. And the cycle continues every day.<br>Now I am standing by a road. Across the road stands Toru sipping coffee. In his hand there is a chunky folder. It has been months after he was kicked out of his job as his company was cutting down the number of employees and he was one of the victims. After that today, it was eleventh time when he was rejected in an interview. The interviewer told him that he can’t see anything fancy or different noteworthy quality in him. His personality is also quite dull. Toru sighed.<br>Toru is standing in front of his parents in his old house. “How much we may have tried; you’ve brought nothing but shame to us. At the age of starting your own family, taking care of us, you’re now living on your retired father’s money.” His father ranted.<br>Now he is in his childhood room. He flips through his school books. Suddenly a few loose pages escaped. It’s his handwriting-----stories------ written by him. Seeing those, churns a tingling pain in my chest, but it seems that those pages didn’t affect him much. He picked them up and neatly placed them between the pages and closed the book.<br>We are at the terrace of his apartment now. The clouds are pouring down. The heavy rainfall had drenched him thoroughly. Toru seems to be in a trance. I can see all the taunts, disappointments he has faced all throughout his life. He is nearing the edge of the terrace. “No-o-o-o.....” I shouted and as he was about to fall, I grabbed his hand.<br>The whole world just stopped. The pieces of the scene were crumbling down and then shattered into darkness.<br>I opened my eyes slowly. It’s pristine white, it’s blank. Ceiling may be? I looked around the room. It’s a hospital cabin. The last time I was awake I was in my house watching that weird DVD given by Toru. Then how did I land in a hospital? <br>Well am I still dreaming? I pinched my arm. Ouch! Nope. I am totally in sense indeed. A nurse peeped into the room. Seeing me up her eyes went as round as saucers. <br>“Doctor! Please come. Mr. Sengupta is awake.” the nurse shouted. A doctor rushes in. “It’s magic. How can this happen?” he mumbled. “Mr. Toru Sengupta you’ve proved miracle happens.”<br>Toru Sengupta? Why is he calling me Toru?<br>So many questions. My head is throbbing in pain.<br>||5||<br>5 years later,<br>A black car stopped in front of the TV Studio. A man in black t-shirt and jeans got off the car. And a swarm of people with autograph books surrounded him. He signed some of them and went inside after all a reporter and numerous audiences are waiting for him.<br>Next day in a corner of a sprawling apartment a sleek new LED tv was shouting......<br>“So, now we are going to present our interview with the young and talented ‘Writer of the Gen-Y’ Mr. Toru Sengupta. His very first novel ‘The Dreamcatcher’, published three years ago, won millions of hearts and turned into a buzzing sensation within a few weeks. The story is about a dying man who imagines the life he wanted to have while in a coma induced dream. And his new novel ‘The Glimpses of The Other World’, published a few days back, is about a boy for whom the line between real and subconscious mind got blurred due to a few days stay in coma. It was rumoured that Mr. Toru himself was in coma for a year after he tried to commit suicide by jumping off his apartment roof. And yesterday in his interview with us, he confessed that it was true indeed. And he also stated that he got locked in his coma world. He loved it so much, he actually didn’t want to come to real world. He didn’t want to lose the comfort zone he created in that world. But there he met his other self who was brave, who wanted to take a chance himself and of course wanted to give him a chance to live. And that part of him resurfaced him again in this world, so the world can get a great new writer like him. Now listen to the whole story in his own words......”<br>©Nabanita Sarkar</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b394f353bcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating Amplitude Modulation using Python]]></title>
            <link>https://medium.com/@nabanita.sarkar/simulating-amplitude-modulation-using-python-6ed03eb4e712?source=rss-dad86f82f5ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ed03eb4e712</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[communication-engineering]]></category>
            <category><![CDATA[analog-communication]]></category>
            <dc:creator><![CDATA[Nabanita Sarkar]]></dc:creator>
            <pubDate>Tue, 01 Oct 2019 17:19:51 GMT</pubDate>
            <atom:updated>2019-10-01T19:53:57.405Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_mHWGPruJ_uOKDiPmd7qQ.png" /></figure><p>In communication labs in our colleges we all generate amplitude modulated signals using CROs. But the same can be performed by using Python and few of its additional libraries and the end result can be equally dope.</p><p>At first let’s revise the formulas needed to generate amplitude modulated signal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*DgNI74lLsU1FgNfagS2XJQ.png" /><figcaption>Message Signal</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/208/1*xyk6EMQEhhomCqaDMfDfjA.png" /><figcaption>Carrier Signal</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*G4XpBxqMOL6cm7RH1bzWQQ.png" /><figcaption>Amplitude Modulated Signal</figcaption></figure><p>Now to simulate the signals in python first we have to import 2 python libraries: <a href="https://numpy.org/">numpy</a> and <a href="https://matplotlib.org/">matplotlib</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*b3_IHdTtr5oQ87PSr3nY6Q.png" /></figure><p>Then we have to take carrier amplitude, carrier frequency, message amplitude, message frequency and modulation index as inputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*PktiZUxhAJYw0Pty9wfHAw.png" /></figure><p>The built-in <strong><em>input</em></strong> function in python returns string value. So we have to convert them to integer or float. Now float is preferred because amplitude or frequency can be in decimal too.</p><p>The time function in analog communication is continuous function. To replicate its behavior we will use <strong><em>linspace</em></strong> function which will provide large number of discrete points which will act almost similar to continuous function. The <strong><em>linspace</em></strong> function will generate evenly spaced numbers within a given interval. The first argument of <strong><em>linspace</em></strong> is starting point, second argument is ending point and third argument is number of breakpoints between the given interval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*c1BWLer5QAzKfO1CJg4Jug.png" /></figure><p>Now we will create our carrier, modulator(message), and product function. Here we will use <strong><em>sin </em></strong>,<strong><em> cos</em></strong> and <strong><em>pi</em></strong> from <strong>numpy</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*mWk_Z_66Omlc3iQh8yNWqQ.png" /></figure><p>Here comes the plotting part. We will utilize <strong>matplotlib</strong> library functions. The <strong><em>subplot</em></strong> function creates more than one plot in the canvas. The <strong><em>plot</em></strong> function plots the given function. In <strong><em>plot</em></strong> function we can pass color names or their acronyms to plot the graph in any color we wish. The <strong>‘g’</strong> , <strong>‘r’</strong> stands for green and red respectively. The <strong><em>xlabel</em></strong> and <strong><em>ylabel</em></strong> prints the x-axis and y-axis variable names. And the <strong><em>title</em></strong> function prints the title of the over all plot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*2Xj1umsLXUJ8U9vG30PuYg.png" /></figure><p>Now we can customize the plot as much we want. We can change the space between plots, font, size etc. And if we want to save the picture we can easily do so by <strong><em>savefig</em></strong> function where dpi means dots per inch which in today’s world, can be inter-changeably used with ppi(pixel per inch). More of such functions can be found in official <a href="https://matplotlib.org/">matplotlib</a> documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*fHDdvVDw4MQr6b4mKT0y7A.png" /></figure><p>Thus we can create simple amplitude modulation plot in python just using two external libraries only.</p><p>The full code is here:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a64eb26ce6368f889b7d599e769f7203/href">https://medium.com/media/a64eb26ce6368f889b7d599e769f7203/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ed03eb4e712" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>