<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Arijit Bhattacharya</title>
    <description>The latest articles on Forem by Arijit Bhattacharya (@hoodwink73).</description>
    <link>https://forem.com/hoodwink73</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F51430%2Ffba0745f-7ffe-4744-8517-125376aa01ec.png</url>
      <title>Forem: Arijit Bhattacharya</title>
      <link>https://forem.com/hoodwink73</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hoodwink73"/>
    <language>en</language>
    <item>
      <title>Launching deepwork.today</title>
      <dc:creator>Arijit Bhattacharya</dc:creator>
      <pubDate>Thu, 01 Aug 2019 11:48:45 +0000</pubDate>
      <link>https://forem.com/hoodwink73/launching-deepwork-today-22mf</link>
      <guid>https://forem.com/hoodwink73/launching-deepwork-today-22mf</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; - &lt;a href="https://deepwork.today" rel="noopener noreferrer"&gt;deepwork.today&lt;/a&gt; helps you to keep a tab on your day. Always know how much time you have to get work done. Decline unnecessary meetings. &lt;a href="https://deepwork.today" rel="noopener noreferrer"&gt;Sign up to save time&lt;/a&gt; and improve your productivity.&lt;/p&gt;

&lt;p&gt;I made the app in the open with React and Firebase. I used React hooks. I felt I could express operations like accessing firestore, firebase authentication, using media queries to adapt layout etc. to be quiet concise and readable. I encourage you to check out the repo especially if you are interested in a reference codebase with React hooks and Firebase.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href="https://github.com/hoodwink73/my-week-in-meetings" rel="noopener noreferrer"&gt;deepwork-today-client&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://github.com/hoodwink73/my-week-in-meetings-firebase-app" rel="noopener noreferrer"&gt;deepwork-today-firebase&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Hello folks! &lt;/p&gt;

&lt;p&gt;Our last employer was a large corporate and we recognised our collaboration efforts were unorganised — absent agendas, unclear goals, too many participants. These ambiguous meetings not only came at the cost of productive time but it also informed our disengagement and made us question our own agency to do good work.&lt;/p&gt;

&lt;p&gt;I had been using &lt;a href="https://thepracticaldev.s3.amazonaws.com/i/ek7yhqnj47mn4qtcpp9h.jpg" rel="noopener noreferrer"&gt;Pomodoro technique&lt;/a&gt; for over four years. It made my daily efforts more consistent. But no matter how well I planned my day, ad hoc meetings and other distraction within my organisation left me unfulfilled.&lt;/p&gt;

&lt;p&gt;When we quit our jobs, we had some time to ourselves. We did some thinking to improve our personal collaboration efforts.&lt;/p&gt;

&lt;p&gt;And &lt;a href="https://deepwork.today" rel="noopener noreferrer"&gt;deepwork.today&lt;/a&gt; is the outcome of these thoughts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7q9c57q5dwzx1g39ktvc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7q9c57q5dwzx1g39ktvc.jpg" alt="deepwork-app-view"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It provides&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;⏲️ &lt;strong&gt;Deepwork clock&lt;/strong&gt;  is aware of your daily schedule. We have experienced that focus cannot be turned on and off like a switch, so we set aside some cool-off time for every meeting. The clock constantly keeps you updated on the time you have left to get work done.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;📗 &lt;strong&gt;Bite sized guides&lt;/strong&gt; to help you gauge the importance and relevance of a meeting. And if you find a valid reason to decline the meeting we provide you with a &lt;em&gt;template&lt;/em&gt; response.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;💁 &lt;strong&gt;Tips&lt;/strong&gt; to help you improve meetings. We read a few articles on how to do meetings better and condensed them to easily readable takeaways.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;📈 &lt;strong&gt;Meeting Analytics&lt;/strong&gt; to give you an overview of your meeting habits over time. These figures will help you decide &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; whether collaboration to personal work ratio is lopsided&lt;/li&gt;
&lt;li&gt; can meeting durations be made more effective&lt;/li&gt;
&lt;li&gt; busiest day of the week&lt;/li&gt;
&lt;li&gt; top collaborators&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lets open a discussion
&lt;/h2&gt;

&lt;p&gt;This is an early release.  We chose to share this &lt;strong&gt;first&lt;/strong&gt; with dev.to community because as programmers we are required to strike a balance between our personal priorities and priorities of our collaborators. So we need interventions to shine clarity on our intentions.&lt;/p&gt;

&lt;p&gt;I would like you folks to join the discussion and help me understand&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; top 2 things that you would do daily to maintain balance between collaboration and productivity&lt;/li&gt;
&lt;li&gt; how often do you decline meetings? what are the usual reasons? If you have any polite ways to say &lt;em&gt;no&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please try out the &lt;a href="https://deepwork.today" rel="noopener noreferrer"&gt;app&lt;/a&gt;. And share your feedbacks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; do you think if we allow you to rate meetings(or a simple 👍 👎), would that be helpful?&lt;/li&gt;
&lt;li&gt; if you would like add more reasons to our decline meeting guide&lt;/li&gt;
&lt;li&gt; if you would like more tips&lt;/li&gt;
&lt;li&gt; any particular meeting analytics you would like to add and why&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can leave your feedbacks here in the comments or &lt;a href="https://twitter.com/hwk73" rel="noopener noreferrer"&gt;DM me on twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also, if you like the app, please share it with your friends and colleagues. It’s a free app. We want to genuinely understand how to make collaborations more impactful while not trading off personal productivity. If we get more feedback, the app can get better at supporting diverse work life habits.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

&lt;p&gt;Illustration Credit - &lt;a href="https://absurd.design" rel="noopener noreferrer"&gt;absurd.design&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>discuss</category>
      <category>productivity</category>
      <category>react</category>
    </item>
    <item>
      <title>Concurrent Iteration</title>
      <dc:creator>Arijit Bhattacharya</dc:creator>
      <pubDate>Sat, 16 Jun 2018 11:16:11 +0000</pubDate>
      <link>https://forem.com/hoodwink73/concurrent-iteration-3c57</link>
      <guid>https://forem.com/hoodwink73/concurrent-iteration-3c57</guid>
      <description>&lt;p&gt;The concept of iteration intuitively seems to be synchronous — when the iteration completes we will have our results ready.&lt;/p&gt;

&lt;p&gt;There are many native array methods which helps us iterate over an array.&lt;/p&gt;

&lt;p&gt;Lets say we have an array of student details. Each student has a field which states their date of birth and now we want to calculate their age.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ageOfStudents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;studentDetails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt;&lt;span class="nx"&gt;dob&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;calculateAgeFromDOB&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;ageOfStudents&lt;/code&gt; will be ready for us immediately.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;calculateAgeFromDOB&lt;/code&gt; is a synchronous operation. So, we will calculate the age of each student &lt;em&gt;strictly&lt;/em&gt; one after the other.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But what if the operation to be applied to each student does not resolve synchronously&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Lets say, we need yearly performance record for each student. And each yearly performance record of a student is a network request.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;studentPerformanceRecordsPromises&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;studentDetails&lt;/span&gt;  
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;getPerformanceRecordOfStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each iteration will spawn a &lt;em&gt;concurrent&lt;/em&gt; task. And these tasks will resolve in their own arbitrary order.&lt;/p&gt;

&lt;p&gt;We have to wait for the performance records &lt;em&gt;even after&lt;/em&gt; the iteration completes. This is the critical distinction between ordinary iteration and concurrent iteration.&lt;/p&gt;

&lt;p&gt;If &lt;code&gt;getPerformanceRecordOfStudent&lt;/code&gt; returns a Promise which resolves after a successful network request, &lt;code&gt;studentPerformanceRecordsPromises&lt;/code&gt; will be an array of Promises.&lt;/p&gt;

&lt;p&gt;We can use &lt;code&gt;Promise.all&lt;/code&gt; to wait on an array of Promises.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;studentPerformanceRecordsPromises&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
   &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;doSomethingWithPerformanceRecordsOfAllStudents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since we are contrasting synchronous and asynchronous iteration, it will be good to have an async counterpart of our &lt;code&gt;Array.map&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We will like to use it like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;  
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;studentDetails&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getPerformanceRecordOfStudent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;doSomethingWithPerformanceRecordsOfAllStudents&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is how a trivial definition of &lt;code&gt;Promise.map&lt;/code&gt; will look like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
 &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vals&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;cb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
   &lt;span class="nx"&gt;vals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;  
      &lt;span class="c1"&gt;// we are expecting \`cb\` to return a promise  &lt;/span&gt;
      &lt;span class="c1"&gt;// even if it does not we are converting it in to  &lt;/span&gt;
      &lt;span class="c1"&gt;// a promise using \`Promise.resolve\`  &lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;val&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  
   &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt;  
  &lt;span class="p"&gt;);&lt;/span&gt;  
 &lt;span class="p"&gt;};&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;This thought was &lt;em&gt;spawned&lt;/em&gt; while I was reading &lt;a href="https://github.com/getify/You-Dont-Know-JS"&gt;YDKJS&lt;/a&gt; by &lt;a href="https://twitter.com/getify"&gt;@getify&lt;/a&gt;. Particularly this part aptly titled &lt;a href="https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch3.md#concurrent-iterations"&gt;&lt;em&gt;Concurrent Iterations&lt;/em&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I was scratching my head for a little while. So thought of sharing my &lt;em&gt;resolved&lt;/em&gt; understanding. Maybe this will help somebody.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;I am a big fan of YDKJS. Highly recommend it!&lt;/p&gt;

&lt;p&gt;Resolve your relationship with JavaScript. &lt;em&gt;Sorry&lt;/em&gt;!&lt;/p&gt;

</description>
      <category>async</category>
      <category>javascript</category>
      <category>promise</category>
    </item>
  </channel>
</rss>
