<?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[Tech@Carnot - Medium]]></title>
        <description><![CDATA[Carnot is AI enabled Agri IOT platform that helps farmers make up to 30% more money - Medium]]></description>
        <link>https://medium.com/tech-carnot?source=rss----72bc570073ef---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Tech@Carnot - Medium</title>
            <link>https://medium.com/tech-carnot?source=rss----72bc570073ef---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:00:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/tech-carnot" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Startups — Law of the Jungle!!]]></title>
            <link>https://medium.com/tech-carnot/the-soul-of-a-startup-is-its-people-bb9cb69a3a5a?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/bb9cb69a3a5a</guid>
            <category><![CDATA[writer]]></category>
            <category><![CDATA[team-building]]></category>
            <category><![CDATA[carnot]]></category>
            <category><![CDATA[account]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Vihang Salgat]]></dc:creator>
            <pubDate>Mon, 18 Apr 2022 09:59:53 GMT</pubDate>
            <atom:updated>2022-04-19T04:21:23.096Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>An army of multitasking wolves, strengthen the pack towards Jungle war<br>Carnot Chronicle-II</strong></blockquote><p>“NOW this is the law of the jungle, as old and as true as the sky,<br>And the wolf that shall keep it may prosper, but the wolf that shall break it must die.<br>As the creeper that girdles the tree trunk, the law runneth forward and back;<br>For the strength of the pack is the wolf, and the strength of the wolf is the pack.”</p><p>Excerpt from a poetry written by Rudyard Kipling.</p><p>Are these lines hitting you similar to the law of startup!! Especially the last line which says the strength of a startup is its people and the strength of people is its startup. And for being a part of a startup you need to be a multitasker. In the same scenario the story of Carnot started, where people are blessed with a multitasking mindset.</p><p><strong>The Story of Multitasking Mindset</strong></p><p>The story of Carnot’s accounts department is very familiar with these concepts. In the early stage of a startup, the company doesn’t have any department for accounts. These are all managed by Rohan Vadgaonkar, Co-founder and CEO. He also outsourced the accounting work to a third party. But the workings done are not enough for the company. As time is changing, the company started to grow and there is a need for an accounts department, for that the first person hired was Samshudin Shaikh. When he joined Carnot, there was no office, it was just a room where everybody works. At that time, there were few employees but the workload was at the peak of the mountain.</p><p><strong>The Initial Challenge</strong></p><p>The first biggest challenge for him was, “Where to start from” because there are many things to settle down. And a process is required for doing every task, which is necessary for every company.</p><p>Samshudin says people in Carnot are from the IT sector, initially they didn’t have any knowledge about finance and accounting. There are many problems running in the organization like invoices are missing, a bit confusing in filing the returns, etc. Whenever Carnot is surrounded by problems, there is one mantra they follow–” Always try to gather your focus on solutions rather than sticking with the problem”. The same is again followed by the Carnot, they focused on getting a way out to solve the accounting issues. They started creating processes for billing, invoices, payment, reimbursement, etc. Being short in time Samshudin also worked in admin, HR, and inventory and also worked in the logistic sector. After a time, Ruchi Suresh Gori, joined Carnot and helped the company to establish a better process and maintain accounts of the company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KYkbwJ3TRTMpIKWdrOVb8w.jpeg" /><figcaption>@Carnot’s Mumbai office</figcaption></figure><p><strong>The power of 100 people– One Man army!!</strong></p><p>Ruchi Suresh Gori, Associate Director of Finance &amp; HR says that, when she joined the finance department of Carnot about 3 years ago, things were quite scattered. There was no work process for expenses, purchases, salary, invoices, etc. And the accounting was done with Quick books. At the very initial stage, she worked on vendor onboarding and then also established the HRMS portal. At that time invoices for the company were in big chaos, the actual problem arose when the auditor asked for it. Every process is set with the help of Pushkar Limaye and Rohan Vadgaonkar, Co-founders of the company. Sometimes I had to be very strict and straightforward, I knew I was getting Hitler’s image, but it was necessary. She also said that employees supported the implementation of the process, no one creates any disturbances during implementation.</p><p>Mahindra’s B-Series Invest Round in 2020 proved to be an exposure for me. Management showed confidence in me and entrusted the entire responsibility to me, while this job was completely new for me, I did. Also, I got many registrations done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*0DG2Oanz9ERtCUxDp86rFA.jpeg" /><figcaption><a href="https://medium.com/u/8c842617c37d">Carnot Tech Team</a></figcaption></figure><p>Ruchi says that we have now set the process in such a way that when we worked from home during the lockdown, Rohan and he would have talked only 2–3 times only. Moreover, she prepared the audit report and the best thing was there was no red flag from the auditor. Now, she has a good companionship with the Mahindra department and whenever any problem arises she is comfortable discussing it with different departments of Mahindra.</p><blockquote>One should not hold back from doing any work. When the urge to do something is in your mind, then you get to learn everything and the company also supports you, otherwise, the job of 9 to 6 makes you a robot.</blockquote><ul><li><strong>Shamsuddin Shaikh</strong>, Accounts manager</li></ul><blockquote>I always believe in learning new things and taking on challenges. Moreover, there is more to the satisfaction of working and learning than anything combined.</blockquote><ul><li><strong>Ruchi Suresh Gori</strong>, Associate Director of Finance &amp; HR</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb9cb69a3a5a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/the-soul-of-a-startup-is-its-people-bb9cb69a3a5a">Startups — Law of the Jungle!!</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[21 Days Habit — A Journey from ‘100 to Zero!’]]></title>
            <link>https://medium.com/tech-carnot/21-days-habit-a-journey-from-100-to-zero-2b49e47e601d?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/2b49e47e601d</guid>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[team-building]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[chronicle]]></category>
            <dc:creator><![CDATA[Vihang Salgat]]></dc:creator>
            <pubDate>Fri, 01 Apr 2022 10:02:23 GMT</pubDate>
            <atom:updated>2022-04-01T10:02:23.757Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>21 Days Habit — A Journey from ‘100 to Zero!’</strong></h3><blockquote>Carnot Chronicle</blockquote><p>“Startup”, the term fascinates us!! It feels like freedom, fame, a room full of money, and whatnot. But the word “startup” starts with the letter “S,” which also means struggle, lots of struggle.</p><p>Isn’t it?</p><p>But deep down, we know that once our startup becomes a brand, everything will pay off. Every startup has limited manpower and resources. Funding is a big factor in the success or failure of any startup. In the early stages of a startup, decisions are made in terms of funding also. In such a situation, some people form teams of 100 people, while others make small teams and work with a capacity of 100 people, choosing to go with limited manpower. When you enter any startup company that has a few members only, it creates a trust issue from both sides of the coin. Everything that happens in this world is blessed with some problems, and there are many theories written by physiologists and startup experts to balance the life of a startup.</p><p><strong>Researchers said,</strong> <em>“When the cycle of the first “S,” i.e., struggle, touches the finish line, then the cycle of the “S,” i.e., success, starts, and the finish line of success develops a startup into a big brand.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*gVxfrugdPmOMlJa2_9gqZw.jpeg" /><figcaption>@Carnot Mumbai office</figcaption></figure><p><strong>This is where the story of Carnot begins</strong></p><p>Carnot, an Agri-tech startup by IIT Bombay alumni, is on a mission to improve the incomes of farmers through technology. It began with just three people and has grown to be worth millions of dollars.</p><p>Puskar Limaye (CTO, CO-FOUNDER) says, at the beginning, when he had to make a team of those talented minds for his company, he used to believe in two types of people: one who is honest and the other is a hard-working person. He had a poetry stick on the wall, which he used to read before going to interview creative minds. He says he is more confident in people who have some fall-off points because they have the power to learn things more quickly. He also believes in working with a team, hand in hand.</p><p>When Carnot was in his initial stage, Bhanu Rao, Director of Sales and Operations, joined in, and at that time, he was handling the sales of Carnot. Bhanu says that what inspires him to be with the startup is the futuristic approach of Pushkar Limaye, CTO and CO-FOUNDER, he believes he has a bright future here. But we are all familiar with the fact that in startups, there are only a few people and they have to manage everything. So, he shuffled a bit in different departments, and when he came to the operations, he was directly in contact with farmers. When he used to talk to farmers or customers directly, he would get to know the actual problem faced by them. And usually, he discusses it with the team.</p><p>It was a time in the success journey of Carnot when there was less manpower and resources. There was a time when they were getting many quarries related to the SIMHA kit(rental kit for tractors), and the ratio of problems has gone above 10%. In the year 2020, the customer happiness index was only 3.5%, and there were only 50 downloads per month. These are alarming situations for any startup; they create unnecessary bubbles in the minds of people working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9WEsHtejyyVwFhOzaVFh9Q.jpeg" /><figcaption>@Work in progress</figcaption></figure><p><strong>Let’s get to the good part first</strong></p><p>In Oct 2021, the customer happiness index was 4.3. And there are 1000 downloads per month. Carnot has reached the pinnacle of his career in just one year! But the point is, how do they do it? What were their plans? How do they manage it with limited resources?</p><p>According to Pushkar, when there were few people in the initial phase with less manpower and the rate of problems was increasing, they decided to focus on their solution rather than the problems. From there, this 21-day habit culture came to the fore and we moved from 100 problems to 0 problems.</p><p>The simple answer to these questions is that the Carnot team met and came up with the brilliant idea of working on the most famous problem-solving theory known as “21-days-habit.”</p><p>Creating a habit may seem like brushing teeth on a daily basis, but it is much more than that. In this 21-day habit plan, they all decided to schedule a call every night for 21 days. The theme is to write down all the problems in one excel sheet to go through the core of the problems and find the right way to deal with the situation. In this 21-day habit plan, Pushkar and Bhanu have two more people in their discussion team.</p><p>Kunal Pachupate, who was the first employee of the product SIMHA, is right now operating the sales in Maharashtra. He is working in the field and is directly in contact with the buyers.</p><p>Anurag Kumar (head of customer support) said he was not familiar with the tractors, and even though he was from the IT department, he didn’t have any experience in the field. But when he saw Pushkar himself put up and doing everything by his own hands, that gave him the best example of how an actual startup works.</p><p>On the very first day, Pushkar Limaye scheduled a call at night around 10 p.m. with Anurag, Kunal, and Bhanu to get the actual scenario of the customers. The people are very familiar with what customers feel about Simha Kit and why the customer happiness index is low.</p><p>So, after writing the problems on an excel sheet, they used it to discuss them for almost an hour. Their main motive is not just to discuss the problem but to find a way to deal with it. They did it for a straight 21 days to make it a habit. The habit has exceeded 21 days and continues.</p><p>It leads to a lot of insights, decisions, and DNA for solving problems rather than cribbing about them. Besides this, the rate of happiness has shown massive growth and now reaches 4.5. And now this 21 days habit turned in the daily routine.</p><p>Just a slight change in the planning and execution can change the whole life cycle of a startup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KithbdhVXQDQUuqowLigwQ.jpeg" /><figcaption>@Team work</figcaption></figure><blockquote><em>If you start something, just complete it. Don’t stick in between. If you are the one who is responsible for starting something, then you are the one who should be responsible for completing it.</em></blockquote><ul><li><strong><em>Bhanu Rao, Head of Sales and Operations</em></strong></li></ul><blockquote><em>When you see your mentor working on the field with you, then you start giving your 200% to the company. In return, the company will give you more than 200%.</em></blockquote><ul><li><strong><em>Kunal Pachupate, Maharashtra operations and Support</em></strong></li></ul><blockquote><em>Mind is never a problem is, mindset is. We, at Carnot believe that first principle thinking and solution mindset can move mountains. Literally.</em></blockquote><ul><li><strong><em>Pushkar Limaye, CTO and Co-founder</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b49e47e601d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/21-days-habit-a-journey-from-100-to-zero-2b49e47e601d">21 Days Habit — A Journey from ‘100 to Zero!’</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Defining Culture @ Carnot]]></title>
            <link>https://medium.com/tech-carnot/defining-culture-carnot-f6955d85cb13?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/f6955d85cb13</guid>
            <category><![CDATA[engineering-culture]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[team]]></category>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Pushkar Limaye]]></dc:creator>
            <pubDate>Fri, 30 Apr 2021 13:58:47 GMT</pubDate>
            <atom:updated>2021-04-30T13:58:47.752Z</atom:updated>
            <content:encoded><![CDATA[<p>Journey from a fancy buzzword 🌟 to a behavioral guide 🪔</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ef8UxSXkrFcXYtxEQORNyQ.png" /><figcaption>Carnot Technologies — Creating Tech for Farmers, one byte at a time</figcaption></figure><p>Culture is perhaps the most commonly used but least understood buzzword when it comes to startups. Wait 🤯, is this post about another founder bragging about what is a good culture and giving fundae about how culture is important for the company? No, this is not. Perhaps, we@carnot haven’t figured it out completely, and we keep shaping up our why,what and how. This blog just an honest way to put across Carnot’s identity to the world, to give a little prospective about the way we run the show. 🏃</p><p>Around 1 year back, I was interviewing one of the Android Engineers and she asked — “So how is the culture at Carnot?”. Honestly — my answer was — hey ,look we are very passionate engineers who thoroughly enjoy each other’s company and solve problems together. It is not all 🌈 and 🌞 scene, but we are one happy family. But she continued probing more, mostly because of her bad experience in her previous workplace. That interview ended in 30 mins or so, but my mind was wandering to solve another problem — “Hey, what exactly is our culture?” 🤔. So, I decided to have series of fun brainstorming sessions with my team-members to come up with a simple doc describing how is culture@carnot, and long story short —drum rolls… presenting Carnot’s culture to the world. :) 🥂</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2FxuomhQauHU04zZ&amp;display_name=SlideShare&amp;url=https%3A%2F%2Fwww.slideshare.net%2Fsecret%2FxuomhQauHU04zZ&amp;image=https%3A%2F%2Fpublic.slidesharecdn.com%2Fv2%2Fimages%2Fprivate_thumbnail.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=slideshare" width="342" height="291" frameborder="0" scrolling="no"><a href="https://medium.com/media/f19308ec138e607ecf87ab119555d18a/href">https://medium.com/media/f19308ec138e607ecf87ab119555d18a/href</a></iframe><p>This document is perhaps the result of not the destination, but the journey Carnot has been through — Read about it <a href="https://medium.com/tech-carnot/innovation-follows-passion-story-of-tech-carnot-c72f11faf9aa">here</a> 👈</p><p>Is this the best culture document out there? — Definitely not, we need to improve on it every single day. We embrace and live it every single day! 💪</p><p>How has this document helped us? I think it has given us a sense of identity and helped us hire, and in most cases not hire awesome people, who were best in professional skills, but not so in the culture fit. This document also forms basis for on-boarding of every new member, and we 💚 to align the synergies on day 1 with this doc !</p><p>Most importantly, we keep changing it as we “understand” it even further. And hopefully this will keep acting as a inspirational torch to keep us guided and motivated for the path ahead as we are scaling. 🚀</p><p><em>We’re eager to hear your thoughts. If you have any suggestions or queries, or even better — if you are game to join us — drop me a line at pushkar@carnot.co.in.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6955d85cb13" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/defining-culture-carnot-f6955d85cb13">Defining Culture @ Carnot</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating first Serverless AWS Lambda API in Node.js]]></title>
            <link>https://medium.com/tech-carnot/creating-first-serverless-aws-lambda-api-in-node-js-c5e91b5ad8f6?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/c5e91b5ad8f6</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[mridul shukla]]></dc:creator>
            <pubDate>Fri, 29 Jan 2021 10:07:40 GMT</pubDate>
            <atom:updated>2021-01-29T13:19:51.753Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS Lambda functions are event-driven and serverless — triggered to process a piece of code and return a result. In this article, we are going to walk through the creation of one Node.js API.🤓</p><h3>So…Why use Serverless?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*EK4bkOz9hkwy52zn" /></figure><p><strong>Lower-Cost:</strong>💸</p><p>In a serverless architecture, you will pay only for what you use. There is no waste of capacity. No resources or money are wasted either.</p><p>(⚠️: If by mistake you share your API in a public group, R.I.P to your AWS bill)</p><p><strong>No need to manage the Server:</strong>🥺</p><p>Forget the headache of backend infrastructure management. No server downtimes, no prearrangement or maintaining of servers ever again.</p><p><strong>Unlimited Scalability:</strong>✨</p><p>You can scale the functions according to users.</p><h3>Prerequisites</h3><ul><li>AWS account with access to IAM and Lambda.</li><li>Node.js 8 or later.</li><li>NPM</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY0JG7GD9OvGBQKE39RRmQ.jpeg" /></figure><h3><strong>Setting Up Serverless framework</strong></h3><pre>npm install -g serverless</pre><p>running the above command will install serverless in you&#39;re local.<br>The next step is setting up you&#39;re serverless project🙃</p><pre>## Create a new Serverless service/project run command ##<br>$ serverless</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ky1BUvgydyFHF6mbzKbFUg.png" /></figure><p>after that do “<em>yes</em>” for the new project and select <em>AWS Node.js </em>as the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUIonIUewVQzUjnHVheqUA.png" /></figure><p>Give your project an appropriate name. Do “yes” to the rest of the steps to create your folder.</p><pre>&gt;&gt; cd {your app name}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*nnZKgyo7Jgg3oxLsoa0Msg.png" /></figure><p>after that and you will see a</p><h4>handler.js</h4><p>The handle.js file is for your writing your business logic.</p><h4>Serverless.yml</h4><p>Your application is deployed using the Serverless framework based on the serverless.yml configuration file.</p><p>The below link is a list of all available properties in serverless.yml when the provider is set to aws</p><pre><a href="https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/">https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/</a></pre><p>now we need three dependency</p><pre>&quot;express&quot;: &quot;^4.17.1&quot;,  // for node.js routing and api</pre><pre>&quot;pg&quot;: &quot;^8.5.1&quot;,        // for postgress-db querry for node.js</pre><pre>&quot;serverless-http&quot;: &quot;^2.6.0&quot;          </pre><pre>// This module allows you to &#39;wrap&#39; your API for serverless use.</pre><blockquote>Rename your <strong><em>handler.js </em></strong>file to<strong> <em>app.js</em></strong><em> .</em></blockquote><blockquote><em>….</em>Your <strong>app<em>.j</em></strong><em>s </em>will look like</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*WLepmZPGoPqKEXt4b2RSyQ.png" /></figure><p>Import’s + DB query + wrapping “app” in the serverless handler.🤯</p><pre>.then(()=&gt;client.end()); //at this point we are closing the db conn.</pre><p>the serverless.yml file would not be changed majorly. except for the function part, we will add the HTTP events (Simply put, events are the things that trigger your functions to run.</p><p>If you are using AWS as your provider, all events in the service are anything in AWS that can trigger an AWS Lambda function, like an S3 bucket upload, an SNS topic, and HTTP endpoints created via <a href="https://serverless.com/amazon-api-gateway/">API Gateway</a>. )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*K5jz4YJV7oWlFjszBGUtmQ.png" /></figure><p>now the final time to deploy the app….🧐<br>run command</p><pre>serverless deploy (or sls deploy)</pre><p>though sls deploy re-deploys the entire stack through cloud formation and can be noticeably slooowww🐌.</p><p>On the flip side, sls deploy function -f myFuncName only zips up the code (&amp; any dependencies) and updates the Lambda function only. This is much much faster than waiting for an entire stack update</p><pre># Redeploy entire stack through cloud formation<br>sls deploy<br><br>4# Redeploy only the code + dependencies to update the AWS lambda function<br>sls deploy function -f myFuncName</pre><h3>Offline Emulation</h3><p>Now you might be asking, what about offline emulation? It’s absolutely a way to speed up dev cycles without having to re-deploy anything.</p><pre>npm install serverless-offline </pre><p>Then add the plugins key in serverless.yml</p><pre>plugins:<br>   - serverless-offline</pre><p>Now you should have the serverless offline commands for testing on localhost the function before deploying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5e91b5ad8f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/creating-first-serverless-aws-lambda-api-in-node-js-c5e91b5ad8f6">Creating first Serverless AWS Lambda API in Node.js</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fleet management got better with the Simha kit!]]></title>
            <link>https://medium.com/tech-carnot/fleet-management-got-better-with-the-simha-kit-7db281955824?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/7db281955824</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[fleet-management]]></category>
            <category><![CDATA[farming]]></category>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[innovation]]></category>
            <dc:creator><![CDATA[Hiten Rajgor]]></dc:creator>
            <pubDate>Thu, 31 Dec 2020 01:33:15 GMT</pubDate>
            <atom:updated>2020-12-31T01:33:13.223Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i4sWMrt1R5oFd9EkGkrdhA.jpeg" /></figure><p>Covid had put a hold on everything! But the Innovation at <a href="https://www.carnot.co.in/">Carnot Technologies </a>is an exception. We started working remotely but our efficiency was not sacrificed nor our hunger for innovation. This post covers the design journey of one such innovation realized during the lockdown.</p><p>Simha Kit, our flagship product, is loved and accepted by the farmers but we stumbled across a challenge. What about the many medium/large sized sugar factories, mills, and agri-business centers that own a fleet of 20–50 tractors?</p><p>The challenge was — how can we bring a behavior change with something as simple as fleet management, but to an audience which has never gone beyond excel sheets? Besides the obvious problems of UX and tech in viewing information of 50 tractors in 2G enabled low-end mobile phones, we needed something that showcases complicated information in a seemingly simple way.</p><p>We had two options either to optimize the phone app for the 50-tractors use cases or to release a desktop version. In the team discussion, we realize that launching a desktop version would make more sense as the fleet manager spends most of their time on a desktop and the web version can be accessed from anywhere on any OS.</p><p>A meeting was set up between Software Engineers, Developers, Designers &amp; Stakeholders to discuss the features and vision of the product and the outcome was to release the MVP version of the Simha-kit Android App equivalent for the desktop.</p><p>We started exploring ideas for the layout considering the use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ovPBrykmerbuvk8FnZzR7w.jpeg" /><figcaption>Low fidelity paper wireframe Layouts from the exploration phase</figcaption></figure><p>We listed out a bunch of features based on our competitor research but as this was the first release we wanted to ship our product with the essential features and built on it based on our user feedback.</p><p>The question was, which are actually essential features? Which would be good to have? Which to push for the future release?</p><p>We constantly perform user research to improve our products and this proved to be handy when deciding on the essential features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IoMZz8CLYqgeYXGQacXcQQ.gif" /><figcaption>High fidelity wireframe to UI Transition</figcaption></figure><p>On doing initial user research and checking the analytics of mobile app, it was obvious that the first thing fleet users do is search by their vehicle name/driver name/number plate/model name, in a hope of landing on the information of that specific vehicle.</p><p>Given that we are talking about tractors, the decision to keep the map with the option of satellite view as the placeholder/landing was quite natural and a user can simply navigate the map to select and view tractors.</p><p>We usually scan a screen from Left to Right. Hence, we kept the list of tractors at the left so the first thing the users see is the list of tractors. A user can easily scan the list as they are pictorial with the Company &amp; Model name and if a user decides to do a quick sort/filter they can easily do it using the filter on the top right of the list.</p><p>Scrolling to see more content is the natural behavior used by tech giants like <a href="https://www.linkedin.com/">Linkedin</a>, <a href="https://www.facebook.com/">Facebook</a>, <a href="https://www.instagram.com/">Instagram</a>, and that’s what you are doing right now on Medium as well 😉 We decided to leverage this behavior, So a user simply has to scroll to see more tractors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*PwAKT07HjFr3rpjRURqQ9w.gif" /><figcaption>A prototype of Simha Fleet Management</figcaption></figure><p>When a user clicks on a Tractor, the information slides-in in a card style that feels organic and guides the user’s eye. When the user clicks on a particular tractor, the other tractors’ information is minimized, though the tractor image can be seen so the user can browse, and click the tractor images to switch between the tractors.</p><p>Simha Fleet Management is built using modern web technology — <a href="https://reactjs.org/">React </a>hence you will experience a smooth User interface with no lag in data.</p><p>We have launched Simha Fleet Management and waiting for more insights from our users. Want to give it a try? Drop us a mail — <a href="/service/mailto:report@carnot.co.in">report@carnot.co.in</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7db281955824" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/fleet-management-got-better-with-the-simha-kit-7db281955824">Fleet management got better with the Simha kit!</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smoothening noisy GNSS data]]></title>
            <link>https://medium.com/tech-carnot/smoothening-noisy-gnss-data-b7661170625e?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/b7661170625e</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Swaraj Patil]]></dc:creator>
            <pubDate>Tue, 24 Nov 2020 13:30:55 GMT</pubDate>
            <atom:updated>2026-05-18T14:55:12.500Z</atom:updated>
            <content:encoded><![CDATA[<p>Most of us are fairly regular in ordering our favorite food through Zomato or Swiggy. You must have checked the tracking feature present on such apps while waiting for your food to get delivered. The route between the food outlet (source) and your home (destination) visible on the app is smooth and clear, and it feels great to watch the rider travel along those paths.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tguksQ8jPMSI9azYnZ-z2A.png" /></figure><p>A similar feature is present on our Simha app, wherein a customer can track the entire activity (traveled path) for the day. Sometimes due to the presence of noisy points captured by the device, the travel path isn’t smooth, which affects the user experience. Have a look at the example below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ngh080Evn4eqAHk1.png" /></figure><p>To address this, we first endeavored to identify the root cause of the issue and find possible solutions. After carefully observing the patterns in the data, it was clear that some environmental conditions are affecting the data captured during trips. It was quite difficult to know when such conditions might occur; the noise was completely random in nature. Therefore, we shifted focus to ways of mitigating the noise in the path. The data collected from the device is time-series data, and a better way of dealing with such data is filtering.</p><p>Several filters were experimented with to find out the best one that suits our data, and finally, we found it. The Savitzky-Golay filter came to our rescue. Let’s understand this filter. The Wikipedia description for <a href="https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter"><strong><em>Savitzky–Golay filter</em></strong></a><em> is a digital filter that can be applied to a set of digital data points to smooth the data and increase the precision of the data without distorting the signal tendency. </em>Before diving into it, let’s look at the example below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RM49u4PcRrh1sA2U.png" /></figure><p>The signal above is the sine wave which got distorted due to the presence of some noise. The SG filter, in simple terms, considers the window of points (<em>w</em>) and fits these points on a polynomial of degree (<em>n) </em>to generate smooth data. The parameter (<em>w</em>) and the polynomial degree (<em>n</em>) are the hyperparameters and can be tuned as per the data to get the desired output.</p><p>Let’s have a look at the python-based implementation of the above example.</p><pre># Import Necessary Packages<br>import numpy as np<br>import plotly.graph_objects as go<br>from scipy.signal import savgol_filter<br># Define Noisy Sinusoidal signal<br>time = np.arange(0, 10, 0.1);<br>f = np.sin(time)*10<br>f1 = [np.random.randn(1)[0]+i for i in f]<br># Plot the noisy sinusoidal signal<br>fig = go.Figure()<br>fig.add_trace(go.Scatter(x=time, y=f1,<br>                    mode=&#39;lines&#39;,<br>                    name=&#39;Distorted Sinusoidal Signal&#39;,<br>                  <br>                        ))<br>fig.update_layout(title=&quot;Distorted Sinusoidal Signal&quot;)<br>fig.update_xaxes(title_text=&#39;Time&#39;)<br>fig.update_yaxes(title_text=&#39;Amplitude&#39;)<br>fig.show()<br># Apply the Savitzky- Golay Filter on the noisy data<br>f2 = savgol_filter(f1, window_length = 17, polyorder = 2)# Compare the smoothen output with the original input<br>fig = go.Figure()<br>fig.add_trace(go.Scatter(x=time, y=f1,<br>                    mode=&#39;lines&#39;,<br>                    name=&#39;Distorted Sinusoidal Signal&#39;,<br>                        ))<br>fig.add_trace(go.Scatter(x=time, y=f2,<br>                    mode=&#39;lines&#39;,<br>                    name=&#39;Smoothed signal&#39;))<br>fig.update_xaxes(title_text=&#39;Time&#39;)<br>fig.update_yaxes(title_text=&#39;Amplitude&#39;)<br>fig.update_layout(title=&quot;Signal&quot;)<br>fig.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YGhkfssXooc8k2xY.png" /></figure><p>After applying this filter to the data with a proper set of parameters, the noise from the signal gets completely removed. The plot in red now closely resembles the sine function. We were able to get rid of the noise that was present in the signal. This approach can be extended for the traveled path data to make it smooth.</p><p>Let’s see how the travel paths were present before and after the use of this filter. First, we identify the optimal value of window size and degree of the polynomial based on our data. And then use these values in a filter to smoothen our data. This process, obviously, involved several iterations. The results obtained after the usage of filters were quite promising and acceptable. Have a look !!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qMqgb-EEeZO3d-5d.png" /><figcaption>Figure 1 Distorted commute</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4n7dcph5_tOmV0Oe.png" /><figcaption>Figure 2 After filtering</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5FFNJ0Hmvi4lc9Mr.png" /><figcaption>Figure 3 Patch plots of the commutes</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8aZ0JRhQzh5o_vob.png" /><figcaption>Figure 4 Patch plots after filtering</figcaption></figure><p>After applying this filter, the noise from the traveled path gets satisfactorily removed. We also checked whether this filter affects the smooth travel path, which is free from noise. And as expected, it didn’t. Clearly, with the usage of this filter, we can definitely observe a boost in the user experience of Simha customers!!!!</p><h3>References -:</h3><p><a href="https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter">https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter</a></p><p><a href="https://aip.scitation.org/doi/pdf/10.1063/1.4822961">https://aip.scitation.org/doi/pdf/10.1063/1.4822961</a></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong><em>If this was useful, consider giving it a clap, it really helps. I write about ML, AI, and technology. Follow me here on Medium so you don’t miss the next one.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7661170625e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/smoothening-noisy-gnss-data-b7661170625e">Smoothening noisy GNSS data</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Triggering one AWS lambda from another using the serverless framework]]></title>
            <link>https://medium.com/tech-carnot/triggering-one-aws-lambda-from-another-using-the-serverless-framework-816006b27b8f?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/816006b27b8f</guid>
            <category><![CDATA[invocation]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Yash Sanghvi]]></dc:creator>
            <pubDate>Mon, 05 Oct 2020 13:31:38 GMT</pubDate>
            <atom:updated>2020-10-05T13:31:38.530Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*05rP7suhxY5NkcC2AJZR5A.png" /></figure><p>A couple of days ago, I encountered a rather not-so-unique problem. I had deployed a lambda to perform some computations on the data sent by all the IoT devices we had deployed in the field. Now, as the number of devices grew, the execution time of the lambda grew. Eventually, it breached the sacred 15-minute window. I urgently needed a scalable solution.</p><p>One of my colleagues suggested breaking down the list of devices into smaller fixed-size sets. The sets can then be fed sequentially to the lambda. With fixed-size sets, the execution time of the lambda will be fixed, only the number of times it is invoked will increase as the number of devices increases. This sounded like a sound plan. There was only one obstacle. How was I to determine the number of sets daily and feed them to the lambda?</p><p>That’s when I started reading about triggering one lambda through another. If I could do that, I can have a parent lambda determining the number of sets and feeding them to the required number of child lambdas. Turns out that it is very straight-forward using the serverless framework. Let me walk you through the steps.</p><h4>Step 1: Provide lambda invocation permission in the provider in serverless.yml</h4><pre>provider:<br>  name: aws<br>  runtime: python3.6<br>  stage: prod<br>  region: us-east-2<br>  profile: yash-sanghvi<br>  timeout: 900<br>  memorySize: 1024<br>  iamRoleStatements:<br>    - Effect: &quot;Allow&quot;<br>      Action:<br>        - &quot;lambda:InvokeFunction&quot;<br>      Resource: &quot;*&quot;</pre><pre>functions:<br>  lambda_parent:<br>    handler: invoking_lambda_demo.lambda_parent<br>    events:<br>      - schedule: cron(25 16 * * ? *)<br>  lambda_child:<br>    handler: invoking_lambda_demo.lambda_child</pre><p>Here, the * for Resource indicates that all resources are allowed. You could mention specific resources if you wish to restrict invocation.</p><p>Note that we haven’t specified an event for the child lambda because it will be invoked by the parent lambda.</p><h4>Step 2: Define the boto3 client in the parent lambda and invoke the child lambda(s)</h4><pre>from boto3 import client as boto3_client<br>lambda_client = boto3_client(&#39;lambda&#39;, region_name=&quot;us-east-2&quot;,)</pre><pre>def lambda_parent(event=&#39;&#39;, context=&#39;&#39;):<br>  device_sets = get_device_sets()<br>  for set in device_sets:<br>    lambda_client.invoke(<br>            FunctionName=&quot;lambda_child&quot;,<br>            InvocationType=&#39;Event&#39;,<br>            Payload=json.dumps(set.to_json())<br>        )</pre><p>The lambda_client.invoke() takes in at least 3 arguments.</p><p>The first one, FunctionName, is the name of the function as it appears on the AWS Lambda console. You could also enter the function ARN or the partial ARN. See the <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke">documentation</a>.</p><p>InvocationType can have three possible values: ‘RequestResponse’, ‘Event’, and ‘DryRun’. ‘RequestResponse’ is the default option and this should be used when you wish the child lambda to send a response to the parent lambda. In this case, the execution time of the parent lambda will be greater than the execution time of the child lambda, as it waits for the response. ‘Event’ means that the parent lambda doesn’t require the response from the child lambda, and can terminate after invoking the child lambda(s). ‘DryRun’ is, as the name suggests, used primarily for testing purposes. It is used to check if the required permission to invoke the lambda is present, and to validate parameter values.</p><p>The Payload is the JSON file that will be an input to the child lambda(s), in the event argument.</p><p>There are a couple of more arguments that are not required for our context. You can read more about them <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke">here</a>.</p><h4>Step 3: Parse the Payload in child lambda(s) and perform the required computations</h4><pre>def lambda_child(event=&#39;&#39;, context=&#39;&#39;):<br>  device_set = pd.read_json(event)<br>  perform_computations(device_set)</pre><p>That’s it. We’re done. Quite simple, right? That’s how easy serverless makes it.</p><h4>References</h4><ol><li>Boto3 lambda client documentation: <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke">https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke</a></li><li>Serverless Framework: Lambdas Invoking Lambdas: <a href="https://lorenstewart.me/2017/10/02/serverless-framework-lambdas-invoking-lambdas/">https://lorenstewart.me/2017/10/02/serverless-framework-lambdas-invoking-lambdas/</a></li></ol><p>We are trying to fix some <a href="https://medium.com/tech-carnot/c72f11faf9aa?source=friends_link&amp;sk=00c153681f6709fc8197fdfcc87a264e">broken benches </a>in the Indian agriculture ecosystem through technology, to improve farmers’ income. If you share the same passion <a href="https://angel.co/company/carnot-technologies/jobs/">join us in the pursuit,</a> or simply drop us a line on report@carnot.co.in</p><p>Follow <a href="https://medium.com/tech-carnot">Tech@Carnot</a> for more such blogs on topics like Data Science and Visualization, Cloud Engineering, Firmware Development, and many more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=816006b27b8f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/triggering-one-aws-lambda-from-another-using-the-serverless-framework-816006b27b8f">Triggering one AWS lambda from another using the serverless framework</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two-way data-binding in Android: 101]]></title>
            <link>https://medium.com/tech-carnot/two-way-data-binding-in-android-101-e3b580c85460?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/e3b580c85460</guid>
            <category><![CDATA[data-binding]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[two-way-data-binding]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[Alok Bharti]]></dc:creator>
            <pubDate>Fri, 11 Sep 2020 05:16:40 GMT</pubDate>
            <atom:updated>2020-09-11T05:16:40.309Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQudJcoc6o4GVZMDG6pxvQ.png" /></figure><p>If you’re an android developer, there is a high chance that you’ve heard of <a href="https://developer.android.com/topic/libraries/data-binding">Data Binding</a>.</p><p>Pre-requisite: It’ll be good if you’re already familiar with normal or one-way data-binding.</p><p>So, what is two-way data binding?</p><p>In one-way data binding, you set a value on an attribute and set a listener that reacts to a change in that attribute. But two-way data binding allows you to directly react to the changes without using listeners.</p><p>Let me give you an example. I recently had to add a feature in one of my company’s projects where we ask users to fill some details regarding soil like pH value and there is an expected range for it like 6–9. So if the user types 3, an icon labeled as “LOW” should be displayed at the end of the EditText. And this should be dynamic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*AVo-ulr8raDLSEumhogHsw.gif" /><figcaption>Here UI changes immediately as users type</figcaption></figure><p>Basically, the first thing that I thought was to use a TextWatcher such that whenever a user writes something it’ll let me know. But there are 3 methods in it and generally, we use only one of them for our purpose. And what if, you’ve to add multiple EditText with similar requirements?</p><p>So by using two-way data binding, you can easily achieve this by writing very few lines of code. Let’s see how.</p><p>In this example, we’ll enable a button if the EditText is not empty.</p><p>Define a variable in your ViewModel that will listen to your user’s input</p><pre>class MyViewModel: ViewModel(){</pre><pre>   //variable that will listen to user&#39;s input<br>   var _userInput = MutableLiveData&lt;String&gt;()</pre><pre>   //expose the variable to the owner(activity/fragment)<br>   val getUserInput: LiveData&lt;String&gt; = _userInput</pre><pre>}</pre><p>Now, add a variable for your ViewModel in your XML. One thing that is important here is, in one-way data-binding, we use @{expression} but here we’ve to use @={expression}. It receives the data changes to the property and listens to user updates at the same time.</p><pre>&lt;layout&gt;</pre><pre>    &lt;data&gt;<br>        &lt;variable<br>            name=&quot;viewmodel&quot;<br>            type=&quot;com.example.MyViewModel&quot;</pre><pre>&lt;/data&gt;<br>    &lt;EditText<br>        android:id=&quot;@+id/edit_text&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;match_parent&quot;<br>        android:hint=&quot;@string/hint&quot;<br>        android:text=&quot;@={viewModel._userInput}&quot; /&gt;<br>    <br>    &lt;Button<br>        android:id=&quot;@+id/edit_text&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:text=&quot;@string/button_text&quot;<br>        android:clickable=&quot;@{viewModel._userInput.toString().length()&gt;0}&quot; /&gt;</pre><pre>&lt;/layout&gt;</pre><p>And that’s it. No need to attach any TextWatcher here to observe the user’s input.</p><pre>class ExampleActivity: AppCompatActivity(){</pre><pre>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)</pre><pre>        val binding = DataBindingUtil.setContentView(this,  R.layout.<em>activity_example</em>)<br>    <br>        val viewModel =  ViewModelProvider(this).get(MyViewModel::class.<em>java</em>)<br><br>        binding.<em>lifecycleOwner </em>= this<br>        binding.<em>viewModel </em>= viewModel<br>    }<br>}</pre><p>Well, this is just an introduction of how you can use two-way data binding in your projects but there are a lot of things that you can do with this. To learn more, check out the official android documentation on <a href="https://developer.android.com/topic/libraries/data-binding/two-way">two-way data binding</a>.</p><p>Also, there is one more thing that I want to discuss. If you read about the clean architecture, it says that our UI should be as dumb as possible such that we don’t need to do any testing on it. But if we’re using data binding that means that we’re not following clean architecture strictly. But still, our ViewModel doesn’t know anything about the view and we can test our business logic independently. In my point of view, if you’re not writing any logic that should be in ViewModel than it’s okay to write simple if-else in your views. But if you’ve any different perspective on this, please let me know your thoughts.</p><p>Hope you learned something in this article. Let’s connect on <a href="https://www.linkedin.com/in/alok-bharti/">LinkedIn</a> or <a href="https://twitter.com/_Alok_Bharti">Twitter</a>.</p><p>Happy coding! Peace out✌</p><p>We are trying to fix some <a href="https://medium.com/tech-carnot/c72f11faf9aa?source=friends_link&amp;sk=00c153681f6709fc8197fdfcc87a264e">broken benches </a>in the Indian agriculture ecosystem through technology, to improve farmers’ income. If you share the same passion <a href="https://angel.co/company/carnot-technologies/jobs/">join us in the pursuit,</a> or simply drop us a line on report@carnot.co.in</p><p>Follow <a href="https://medium.com/tech-carnot">Tech@Carnot</a> for more such blogs on topics like Data Science and Visualization, Cloud Engineering, Firmware Development, and many more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3b580c85460" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/two-way-data-binding-in-android-101-e3b580c85460">Two-way data-binding in Android: 101</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Multiprocessing in AWS Lambda with Python]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/tech-carnot/understanding-multiprocessing-in-aws-lambda-with-python-6f50c11d57e4?source=rss----72bc570073ef---4"><img src="https://cdn-images-1.medium.com/max/1934/1*K99ghCyzTzWAag48Dcqgaw.png" width="1934"></a></p><p class="medium-feed-snippet">Adding some transparency to the black box</p><p class="medium-feed-link"><a href="https://medium.com/tech-carnot/understanding-multiprocessing-in-aws-lambda-with-python-6f50c11d57e4?source=rss----72bc570073ef---4">Continue reading on Tech@Carnot »</a></p></div>]]></description>
            <link>https://medium.com/tech-carnot/understanding-multiprocessing-in-aws-lambda-with-python-6f50c11d57e4?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/6f50c11d57e4</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[multiprocessing]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Yash Sanghvi]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 13:31:01 GMT</pubDate>
            <atom:updated>2021-04-05T17:56:24.471Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Making Recyclerview Efficient using List Adapter and DiffUtil]]></title>
            <link>https://medium.com/tech-carnot/making-recyclerview-efficient-using-list-adapter-with-diffutil-4a06d4583ea4?source=rss----72bc570073ef---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a06d4583ea4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[diffutil]]></category>
            <category><![CDATA[listadapter]]></category>
            <category><![CDATA[recyclerview]]></category>
            <dc:creator><![CDATA[Manoj Mohanty]]></dc:creator>
            <pubDate>Mon, 31 Aug 2020 03:25:26 GMT</pubDate>
            <atom:updated>2020-08-31T03:25:26.171Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will help you understand what is List Adapter, how to implement recyclerview with list adapter and its benefits over default recyclerview adapter and when to use List Adapter.</p><figure><img alt="User scrolling through list of task" src="https://cdn-images-1.medium.com/max/1024/0*cTlvIZgqc3mE11Uz" /></figure><p>If you are an Android app developer probability is you would have implemented recyclerview. A Recyclerview is used to display a list of data. It can be things like a list of issues, a to-do list, a movie list, etc. Most of the time we end up using <em>notifyDataSetChanged()</em> to inform data updates but google suggests</p><blockquote>If you are writing an adapter it will always be more efficient to use the more specific change events if you can. Rely on notifyDataSetChanged() as a last resort</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*yIkqxBRsIU6O40DF.jpg" /></figure><p>So lets get started and see how we can implement Recyclerview with List Adapter.</p><p>No additional dependency is required we just need to add recyclerview</p><pre>implementation &quot;androidx.recyclerview:recyclerview:1.1.0&quot;</pre><p>Lets assume we have a data class with following details</p><p><strong>Setting Up Data Class</strong></p><pre>data class Post(val id:Int, val title:String, val body:String)</pre><p><strong>Implementing Adapter Class</strong></p><p>Here we extend ListAdapter&lt;T, YourAdapter.ViewHolder&gt; and implement constructor with a class extending DiffUtil.ItemCallback&lt;T&gt; as a parameter which does the data update calculation for us, which is a bit different when compared with the existing RecyclerView Adapter</p><p>Below is an example how to do it in Kotlin. Here we extend ListAdapter and pass TaskDiffCallBack which extends DiffUtilItemCallback&lt;Post&gt;</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6954771258ef902a35be65c91b42b2d6/href">https://medium.com/media/6954771258ef902a35be65c91b42b2d6/href</a></iframe><blockquote>DiffUtil is a utility class that calculates the difference between two lists and outputs a list of update operations that converts the first list into the second one.</blockquote><p><strong>Let’s Understand Few Important Things</strong></p><ul><li><strong>areItemsTheSame(T oldItem, T newItem): </strong>Called to check whether two objects represent the same item. If your items have unique ids, this method should check their id equality. Here we check as our is Post is unique we have a check on id, it could have been any unique constraint for your model.</li><li><strong>areContentsTheSame(T oldItem, T newItem):<em> </em></strong>Checks whether two items have the same data. This method is called only if areItemsTheSame(T, T) returns true for these items, i.e. if any of the id is available in both new and old list it would compare actual properties to verify if they have changed and with Kotlin all we need to do is <em>oldItem == newItem</em></li></ul><p><strong>Accessing Data in onBindViewHolder</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/883652cf98e0a36204a14d26478cfbf1/href">https://medium.com/media/883652cf98e0a36204a14d26478cfbf1/href</a></iframe><p><strong>Initializing And Calling Our Adapter Class</strong></p><p>Here we initialized our Adapter and set our recyclerview adapter to Adapter instance, and call our updatePostAdapter with the required parameter. At last, we just need to call the adapter.submitList(postList). So next time we have if we have new data we would just call the same function with updated and Our DiffUtil Implementation would take care of calculating the changes in new List and communicate it to our PostAdapter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5548b3987f78def25bf1d1094043ce5a/href">https://medium.com/media/5548b3987f78def25bf1d1094043ce5a/href</a></iframe><p><strong>Let’s Understand Few Important Things</strong></p><ul><li><strong>No need Of notifyDataSetChanged: </strong>submitList takes care of replacing the existing list of data with new and notify the same to the adapter.</li><li>Internally it calls DiffUtil.calculateDiff which does the handling for us</li><li>All this calculation happens off the main thread</li><li>For the first run, nothing happens its just displays the list directly without any check.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*bqFhW3zhirL58ifg.jpg" /><figcaption>Confused When to use what?</figcaption></figure><p><strong>Conclusion</strong></p><ul><li>If we have a static list that doesn’t change once loaded then it is better to use normal Adapter.</li><li>If Data source is dynamic and something which changes with real-time syncing I would use ListAdapter.</li><li>The actual runtime of the algorithm/calculation of diff in the new list and old list - significantly depends on the number of changes in the list and the cost of your comparison methods (<a href="https://developer.android.com/reference/androidx/recyclerview/widget/DiffUtil">Runtime Info from Android Docs using Diff Util</a>)</li><li>If the data in list mostly changes with user interaction I would still use normal Adapter and use adapter methods like <a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter?authuser=1#notifyItemChanged(int)">notifyItemChanged(int)</a> <a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter?authuser=1#notifyItemInserted(int)">notifyItemInserted(int)</a> <a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter?authuser=1#notifyItemRemoved(int)">notifyItemRemoved(int),</a> etc as this is the most efficient way to update your view.</li><li>Google suggests notifyDataSetChanged should be the last option to update data</li></ul><p>Please let me know your thoughts about it in comments and if think this was helpful then do share and give a clap.</p><p>We are trying to fix some <a href="https://medium.com/tech-carnot/c72f11faf9aa?source=friends_link&amp;sk=00c153681f6709fc8197fdfcc87a264e">broken benches </a>in the Indian agriculture ecosystem through technology, to improve farmers’ income. If you share the same passion <a href="https://angel.co/company/carnot-technologies/jobs/">join us in the pursuit,</a> or simply drop us a line on report@carnot.co.in</p><p>Follow <a href="https://medium.com/tech-carnot">Tech@Carnot</a> for more such blogs on topics like Data Science and Visualization, Cloud Engineering, Firmware Development, and many more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a06d4583ea4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-carnot/making-recyclerview-efficient-using-list-adapter-with-diffutil-4a06d4583ea4">Making Recyclerview Efficient using List Adapter and DiffUtil</a> was originally published in <a href="https://medium.com/tech-carnot">Tech@Carnot</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>