<?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 Ansh Goyal on Medium]]></title>
        <description><![CDATA[Stories by Ansh Goyal on Medium]]></description>
        <link>https://medium.com/@anshgoyal749?source=rss-f147b4645b77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EW1KFUIovUq2hMdxRJYl4A.jpeg</url>
            <title>Stories by Ansh Goyal on Medium</title>
            <link>https://medium.com/@anshgoyal749?source=rss-f147b4645b77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:02:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anshgoyal749/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[Master Dynamic Programming With Patterns]]></title>
            <link>https://levelup.gitconnected.com/master-dynamic-programming-with-patterns-b25f1fb1297c?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/b25f1fb1297c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Wed, 24 Aug 2022 03:39:03 GMT</pubDate>
            <atom:updated>2022-08-30T11:58:07.243Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*RhsxkgA294xZC0y0.png" /></figure><p>Before starting the topic, let me introduce myself. I am a Mobile Developer currently studying at IIT BHU and spending my free time writing articles on medium. I started to prepare for interviews two years ago. At that time, I could not solve the two-sum problem. Easy problems seemed to me like hard ones, so most of the time, I had to look at editorials and discuss sections. Currently, I have solved ~800 problems and time to time, participate in contests. I usually solve three problems in a contest and sometimes four problems. Ok, let&#39;s come back to the topic.</p><p>Recently I have concentrated my attention on Dynamic Programming cause it&#39;s one of the hardest topics in an interview prep. After solving ~140 problems in DP, I have noticed that few patterns can be found in different problems. So I did some research on that and find the following topics. I will not give complete ways to solve problems, but these patterns may help solve DP.</p><h3>Patterns</h3><p><a href="https://leetcode.com/discuss/study-guide/458695/Dynamic-Programming-Patterns#Minimum-(Maximum)-Path-to-Reach-a-Target">Minimum (Maximum) Path to Reach a Target</a><br><a href="https://leetcode.com/discuss/study-guide/458695/Dynamic-Programming-Patterns#distinct-ways">Distinct Ways</a><br><a href="https://leetcode.com/discuss/study-guide/458695/Dynamic-Programming-Patterns#Merging-Intervals">Merging Intervals</a><br><a href="https://leetcode.com/discuss/study-guide/458695/Dynamic-Programming-Patterns#DP-on-Strings">DP on Strings</a><br><a href="https://leetcode.com/discuss/study-guide/458695/Dynamic-Programming-Patterns#Decision-Making">Decision Making</a></p><h3>Minimum (Maximum) Path to Reach a Target</h3><p>Problem list:</p><p><a href="https://leetcode.com/list/55ac4kuc">Favorite - LeetCode</a></p><p>Generate a problem statement for this pattern</p><h3>Statement</h3><blockquote><em>Given a target find minimum (maximum) cost / path / sum to reach the target.</em></blockquote><h3>Approach</h3><blockquote><em>Choose minimum (maximum) path among all possible paths before the current state, then add value for the current state.</em></blockquote><pre>routes[i] = min(routes[i-1], routes[i-2], ... , routes[i-k]) + cost[i]</pre><p>Generate optimal solutions for all values in the target and return the value for the target.</p><h3>Top-Down</h3><pre>for (int j = 0; j &lt; ways.size(); ++j) {<br>    result = min(result, topDown(target - ways[j]) + cost/ path / sum);<br>}<br>return memo[/*state parameters*/] = result;</pre><h3>Bottom-Up</h3><pre>for (int i = 1; i &lt;= target; ++i) {<br>   for (int j = 0; j &lt; ways.size(); ++j) {<br>       if (ways[j] &lt;= i) {<br>           dp[i] = min(dp[i], dp[i - ways[j]] + cost / path / sum) ;<br>       }<br>   }<br>}<br> <br>return dp[target]</pre><h3>Similar Problems</h3><p><a href="https://leetcode.com/problems/min-cost-climbing-stairs/">746. Min Cost Climbing Stairs</a> Easy</p><h3>Top-Down</h3><pre>int result = min(minCost(n-1, cost, memo), minCost(n-2, cost, memo)) + (n == cost.size() ? 0 : cost[n]);<br>return memo[n] = result;</pre><h3>Bottom-Up</h3><pre>for (int i = 2; i &lt;= n; ++i) {<br>   dp[i] = min(dp[i-1], dp[i-2]) + (i == n ? 0 : cost[i]);<br>}<br> <br>return dp[n]</pre><p><a href="https://leetcode.com/problems/minimum-path-sum/">64. Minimum Path Sum</a> Medium</p><h3>Top-Down</h3><pre>int result = min(pathSum(i+1, j, grid, memo), pathSum(i, j+1, grid, memo)) + grid[i][j];<br>    <br>return memo[i][j] = result;</pre><h3>Bottom-Up</h3><pre>for (int i = 1; i &lt; n; ++i) {<br>   for (int j = 1; j &lt; m; ++j) {<br>       grid[i][j] = min(grid[i-1][j], grid[i][j-1]) + grid[i][j];<br>   }<br>}<br> <br>return grid[n-1][m-1]</pre><p><a href="https://leetcode.com/problems/coin-change/">322. Coin Change</a> Medium</p><h3>Top-Down</h3><pre>for (int i = 0; i &lt; coins.size(); ++i) {<br>    if (coins[i] &lt;= target) { // check validity of a sub-problem<br>        result = min(ans, CoinChange(target - coins[i], coins) + 1);<br>    }<br>}<br>return memo[target] = result;</pre><h3>Bottom-Up</h3><pre>for (int j = 1; j &lt;= amount; ++j) {<br>   for (int i = 0; i &lt; coins.size(); ++i) {<br>       if (coins[i] &lt;= j) {<br>           dp[j] = min(dp[j], dp[j - coins[i]] + 1);<br>       }<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/minimum-falling-path-sum/">931. Minimum Falling Path Sum</a> Medium</p><p><a href="https://leetcode.com/problems/minimum-cost-for-tickets/">983. Minimum Cost For Tickets</a> Medium</p><p><a href="https://leetcode.com/problems/2-keys-keyboard/">650. 2 Keys Keyboard</a> Medium</p><p><a href="https://leetcode.com/problems/perfect-squares/">279. Perfect Squares</a> Medium</p><p><a href="https://leetcode.com/problems/last-stone-weight-ii/">1049. Last Stone Weight II</a> Medium</p><p><a href="https://leetcode.com/problems/triangle/">120. Triangle</a> Medium</p><p><a href="https://leetcode.com/problems/ones-and-zeroes/">474. Ones and Zeroes</a> Medium</p><p><a href="https://leetcode.com/problems/maximal-square/">221. Maximal Square</a> Medium</p><p><a href="https://leetcode.com/problems/coin-change/">322. Coin Change</a> Medium</p><p><a href="https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares/">1240. Tiling a Rectangle with the Fewest Squares</a> Hard</p><p><a href="https://leetcode.com/problems/dungeon-game/">174. Dungeon Game</a> Hard</p><p><a href="https://leetcode.com/problems/minimum-number-of-refueling-stops/">871. Minimum Number of Refueling Stops</a> Hard</p><h3>Distinct Ways</h3><p>Problem List:</p><p><a href="https://leetcode.com/list/55ajm50i">Favorite - LeetCode</a></p><p>Generate problem statement for this pattern</p><h3>Statement</h3><blockquote><em>Given a target find a number of distinct ways to reach the target.</em></blockquote><h3>Approach</h3><blockquote><em>Sum all possible ways to reach the current state.</em></blockquote><pre>routes[i] = routes[i-1] + routes[i-2], ... , + routes[i-k]</pre><p>Generate sum for all values in the target and return the value for the target.</p><h3>Top-Down</h3><pre>for (int j = 0; j &lt; ways.size(); ++j) {<br>    result += topDown(target - ways[j]);<br>}<br>return memo[/*state parameters*/] = result;</pre><h3>Bottom-Up</h3><pre>for (int i = 1; i &lt;= target; ++i) {<br>   for (int j = 0; j &lt; ways.size(); ++j) {<br>       if (ways[j] &lt;= i) {<br>           dp[i] += dp[i - ways[j]];<br>       }<br>   }<br>}<br> <br>return dp[target]</pre><h3>Similar Problems</h3><p><a href="https://leetcode.com/problems/climbing-stairs/">70. Climbing Stairs</a> Easy</p><h3>Top-Down</h3><pre>int result = climbStairs(n-1, memo) + climbStairs(n-2, memo); <br>    <br>return memo[n] = result;</pre><h3>Bottom-Up</h3><pre>for (int stair = 2; stair &lt;= n; ++stair) {<br>   for (int step = 1; step &lt;= 2; ++step) {<br>       dp[stair] += dp[stair-step];   <br>   }<br>}</pre><p><a href="https://leetcode.com/problems/unique-paths/">62. Unique Paths</a> Medium</p><h3>Top-Down</h3><pre>int result = UniquePaths(x-1, y) + UniquePaths(x, y-1);</pre><pre>return memo[x][y] = result;</pre><h3>Bottom-Up</h3><pre>for (int i = 1; i &lt; m; ++i) {<br>   for (int j = 1; j &lt; n; ++j) {<br>       dp[i][j] = dp[i][j-1] + dp[i-1][j];<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/number-of-dice-rolls-with-target-sum/">1155. Number of Dice Rolls With Target Sum</a> Medium</p><pre>for (int rep = 1; rep &lt;= d; ++rep) {<br>   vector&lt;int&gt; new_ways(target+1);<br>   for (int already = 0; already &lt;= target; ++already) {<br>       for (int pipe = 1; pipe &lt;= f; ++pipe) {<br>           if (already - pipe &gt;= 0) {<br>               new_ways[already] += ways[already - pipe];<br>               new_ways[already] %= mod;<br>           }<br>       }<br>   }<br>   ways = new_ways;<br>}</pre><p><strong>Note</strong></p><p>Some questions point out the number of repetitions, in that case, add one more loop to simulate every repetition.</p><p><a href="https://leetcode.com/problems/knight-probability-in-chessboard/">688. Knight Probability in Chessboard</a> Medium</p><p><a href="https://leetcode.com/problems/target-sum/">494. Target Sum</a> Medium</p><p><a href="https://leetcode.com/problems/combination-sum-iv/">377. Combination Sum IV</a> Medium</p><p><a href="https://leetcode.com/problems/knight-dialer/">935. Knight Dialer</a> Medium</p><p><a href="https://leetcode.com/problems/dice-roll-simulation/">1223. Dice Roll Simulation</a> Medium</p><p><a href="https://leetcode.com/problems/partition-equal-subset-sum/">416. Partition Equal Subset Sum</a> Medium</p><p><a href="https://leetcode.com/problems/soup-servings/">808. Soup Servings</a> Medium</p><p><a href="https://leetcode.com/problems/domino-and-tromino-tiling/">790. Domino and Tromino Tiling</a> Medium</p><p><a href="https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/">801. Minimum Swaps To Make Sequences Increasing</a></p><p><a href="https://leetcode.com/problems/number-of-longest-increasing-subsequence/">673. Number of Longest Increasing Subsequence</a> Medium</p><p><a href="https://leetcode.com/problems/unique-paths-ii/">63. Unique Paths II</a> Medium</p><p><a href="https://leetcode.com/problems/out-of-boundary-paths/">576. Out of Boundary Paths</a> Medium</p><p><a href="https://leetcode.com/problems/number-of-ways-to-stay-in-the-same-place-after-some-steps/">1269. Number of Ways to Stay in the Same Place After Some Steps</a> Hard</p><p><a href="https://leetcode.com/problems/count-vowels-permutation/">1220. Count Vowels Permutation</a> Hard</p><h3>Merging Intervals</h3><p>Problem List:</p><p><a href="https://leetcode.com/list/55aj8s16">Favorite - LeetCode</a></p><p>Generate problem statement for this pattern</p><h3>Statement</h3><blockquote><em>Given a set of numbers find an optimal solution for a problem considering the current number and the best you can get from the left and right sides.</em></blockquote><h3>Approach</h3><blockquote><em>Find all optimal solutions for every interval and return the best possible answer.</em></blockquote><pre>// from i to j<br>dp[i][j] = dp[i][k] + result[k] + dp[k+1][j]</pre><p>Get the best from the left and right sides and add a solution for the current position.</p><h3>Top-Down</h3><pre>for (int k = i; k &lt;= j; ++k) {<br>    result = max(result, topDown(nums, i, k-1) + result[k] + topDown(nums, k+1, j));<br>}<br>return memo[/*state parameters*/] = result;</pre><h3>Bottom-Up</h3><pre>for(int l = 1; l&lt;n; l++) {<br>   for(int i = 0; i&lt;n-l; i++) {<br>       int j = i+l;<br>       for(int k = i; k&lt;j; k++) {<br>           dp[i][j] = max(dp[i][j], dp[i][k] + result[k] + dp[k+1][j]);<br>       }<br>   }<br>}<br> <br>return dp[0][n-1];</pre><pre>for(int l = 1; l&lt;n; l++) {<br>   for(int i = 0; i&lt;n-l; i++) {<br>       int j = i+l;<br>       for(int k = i; k&lt;j; k++) {<br>           dp[i][j] = max(dp[i][j], dp[i][k] + result[k] + dp[k+1][j]);<br>       }<br>   }<br>}<br> <br>return dp[0][n-1]</pre><h3>Similar Problems</h3><p><a href="https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/">1130. Minimum Cost Tree From Leaf Values</a> Medium</p><pre>for (int l = 1; l &lt; n; ++l) {<br>   for (int i = 0; i &lt; n - l; ++i) {<br>       int j = i + l;<br>       dp[i][j] = INT_MAX;<br>       for (int k = i; k &lt; j; ++k) {<br>           dp[i][j] = min(dp[i][j], dp[i][k] + dp[k+1][j] + maxs[i][k] * maxs[k+1][j]);<br>       }<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/unique-binary-search-trees/">96. Unique Binary Search Trees</a> Medium</p><p><a href="https://leetcode.com/problems/minimum-score-triangulation-of-polygon/">1039. Minimum Score Triangulation of Polygon</a> Medium</p><p><a href="https://leetcode.com/problems/remove-boxes/">546. Remove Boxes</a> Medium</p><p><a href="https://leetcode.com/problems/minimum-cost-to-merge-stones/">1000. Minimum Cost to Merge Stones</a> Medium</p><p><a href="https://leetcode.com/problems/burst-balloons/">312. Burst Balloons</a> Hard</p><h3>Top-Down</h3><pre>for (int k = i; k &lt;= j; ++k) {<br>    result = max(result, topDown(nums, i, k-1, memo) + (i-1 &gt;= 0 ? nums[i-1] : 1) * nums[k] * (j+1 &lt; nums.size() ? nums[j+1] : 1) + topDown(nums, k+1, j, memo));<br>}<br>return memo[i][j] = result;</pre><h3>Bottom-Up</h3><pre>for(int l = 1; l &lt; n; l++) {<br>    for(int i = 0; i &lt; n-l; i++) {<br>        int j = i+l;<br>        for(int k = i; k &lt;= j; k++) {<br>            dp[i][j] = max(dp[i][j], (((k&gt;i &amp;&amp; k&gt;0) ? dp[i][k-1] : 0) + (i&gt;0 ? nums[i-1] : 1) * nums[k] * (j&lt;n-1 ? nums[j+1] : 1) + ((k&lt;j &amp;&amp; k&lt;n-1) ? dp[k+1][j] : 0)));<br>        }<br>    }<br>}<br>return dp[0][n-1];</pre><p><a href="https://leetcode.com/problems/guess-number-higher-or-lower-ii/">375. Guess Number Higher or Lower II</a> Medium</p><h3>DP on Strings</h3><p>Problem List:</p><p><a href="https://leetcode.com/list/55afh7m7">Favorite - LeetCode</a></p><p>General problem statement for this pattern can vary but most of the time you are given two strings where lengths of those strings are not big</p><h3>Statement</h3><blockquote><em>Given two strings </em><em>s1 and </em><em>s2, return </em><em>some result.</em></blockquote><h3>Approach</h3><blockquote><em>Most of the problems on this pattern requires a solution that can be accepted in O(n²) complexity.</em></blockquote><pre>// i - indexing string s1<br>// j - indexing string s2<br>for (int i = 1; i &lt;= n; ++i) {<br>   for (int j = 1; j &lt;= m; ++j) {<br>       if (s1[i-1] == s2[j-1]) {<br>           dp[i][j] = /*code*/;<br>       } else {<br>           dp[i][j] = /*code*/;<br>       }<br>   }<br>}</pre><blockquote><em>If you are given one string </em><em>s the approach may little vary</em></blockquote><pre>for (int l = 1; l &lt; n; ++l) {<br>   for (int i = 0; i &lt; n-l; ++i) {<br>       int j = i + l;<br>       if (s[i] == s[j]) {<br>           dp[i][j] = /*code*/;<br>       } else {<br>           dp[i][j] = /*code*/;<br>       }<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/longest-common-subsequence/">1143. Longest Common Subsequence</a> Medium</p><pre>for (int i = 1; i &lt;= n; ++i) {<br>   for (int j = 1; j &lt;= m; ++j) {<br>       if (text1[i-1] == text2[j-1]) {<br>           dp[i][j] = dp[i-1][j-1] + 1;<br>       } else {<br>           dp[i][j] = max(dp[i-1][j], dp[i][j-1]);<br>       }<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/palindromic-substrings/">647. Palindromic Substrings</a> Medium</p><pre>for (int l = 1; l &lt; n; ++l) {<br>   for (int i = 0; i &lt; n-l; ++i) {<br>       int j = i + l;<br>       if (s[i] == s[j] &amp;&amp; dp[i+1][j-1] == j-i-1) {<br>           dp[i][j] = dp[i+1][j-1] + 2;<br>       } else {<br>           dp[i][j] = 0;<br>       }<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/longest-palindromic-subsequence/">516. Longest Palindromic Subsequence</a> Medium</p><p><a href="https://leetcode.com/problems/shortest-common-supersequence/">1092. Shortest Common Supersequence</a> Medium</p><p><a href="https://leetcode.com/problems/edit-distance/">72. Edit Distance</a> Hard</p><p><a href="https://leetcode.com/problems/distinct-subsequences/">115. Distinct Subsequences</a> Hard</p><p><a href="https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/">712. Minimum ASCII Delete Sum for Two Strings</a> Medium</p><p><a href="https://leetcode.com/problems/longest-palindromic-substring/">5. Longest Palindromic Substring</a> Medium</p><h3>Decision Making</h3><p>Problem List:</p><p><a href="https://leetcode.com/list/55af7bu7">Favorite - LeetCode</a></p><p>The general problem statement for this pattern is forgiven situation decide whether to use or not to use the current state. So, the problem requires you to make a decision at a current state.</p><h3>Statement</h3><blockquote><em>Given a set of values find an answer with an option to choose or ignore the current value.</em></blockquote><h3>Approach</h3><blockquote><em>If you decide to choose the current value use the previous result where the value was ignored; vice-versa, if you decide to ignore the current value use previous result where value was used.</em></blockquote><pre>// i - indexing a set of values<br>// j - options to ignore j values<br>for (int i = 1; i &lt; n; ++i) {<br>   for (int j = 1; j &lt;= k; ++j) {<br>       dp[i][j] = max({dp[i][j], dp[i-1][j] + arr[i], dp[i-1][j-1]});<br>       dp[i][j-1] = max({dp[i][j-1], dp[i-1][j-1] + arr[i], arr[i]});<br>   }<br>}</pre><p><a href="https://leetcode.com/problems/house-robber/">198. House Robber</a> Easy</p><pre>for (int i = 1; i &lt; n; ++i) {<br>   dp[i][1] = max(dp[i-1][0] + nums[i], dp[i-1][1]);<br>   dp[i][0] = dp[i-1][1];<br>}</pre><p><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock/">121. Best Time to Buy and Sell Stock</a> Easy</p><p><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/">714. Best Time to Buy and Sell Stock with Transaction Fee</a> Medium</p><p><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/">309. Best Time to Buy and Sell Stock with Cooldown</a> Medium</p><p><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/">123. Best Time to Buy and Sell Stock III</a> Hard</p><p><a href="https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/">188. Best Time to Buy and Sell Stock IV</a> Hard</p><p>I hope these tips will be helpful 😊</p><h3>Level Up Coding</h3><p>Thanks for being a part of our community! Before you go:</p><ul><li>👏 Clap for the story and follow the author 👉</li><li>📰 View more content in the <a href="https://levelup.gitconnected.com/?utm_source=pub&amp;utm_medium=post">Level Up Coding publication</a></li><li>🔔 Follow us: <a href="https://twitter.com/gitconnected">Twitter</a> | <a href="https://www.linkedin.com/company/gitconnected">LinkedIn</a> | <a href="https://newsletter.levelup.dev/">Newsletter</a></li></ul><p>🚀👉 <a href="https://jobs.levelup.dev/talent/welcome?referral=true"><strong>Join the Level Up talent collective and find an amazing job</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b25f1fb1297c" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/master-dynamic-programming-with-patterns-b25f1fb1297c">Master Dynamic Programming With Patterns</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write a Bash script from Windows without having Linux installed]]></title>
            <link>https://faun.pub/how-to-write-a-bash-script-from-windows-without-having-linux-installed-61a9646a8594?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/61a9646a8594</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[bash]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 12:57:21 GMT</pubDate>
            <atom:updated>2022-08-22T12:57:21.134Z</atom:updated>
            <content:encoded><![CDATA[<h3>Use your browser to write Bash script without installing any Linux distro with OnWorks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*7CZbRnicDwkQttj1" /><figcaption>Photo by <a href="https://unsplash.com/@hidd3n?utm_source=medium&amp;utm_medium=referral">Kevin Horvat</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Yeah yeah, I know… Sometimes you are just messing around, watching some tutorials about Linux or scripting and you would like to follow along but… but… You are on Windows, and you do not want to set up a Virtual Machine or create a new partition to install Linux. If this is the case, this tutorial is for you.</p><p>Search for OnWorks or open the following link</p><p><a href="https://www.onworks.net/programs/ubuntu-emulator-online">ubuntu-emulator</a></p><p>in your favorite browser. Click on “Run In Ubuntu”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*DMKW_IuPwm_g2nSF.png" /><figcaption>OnWorks website</figcaption></figure><p>You will see the following page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ZEcmREFRS8Q4YwL3.png" /><figcaption>OnWorks website</figcaption></figure><p>Click the “Start” button and wait; it will take 20 seconds to boot up your machine.</p><p>When your machine is ready, click the “Enter” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Fx9-Qc62oNq-cwZv.png" /><figcaption>OnWorks website</figcaption></figure><p>You can start using your Linux distro (in this case, an Ubuntu machine).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SB_0n0RGj3N_EMmg.png" /><figcaption>Ubuntu OS running on OnWorks website</figcaption></figure><p>At this point, you can right-click on the Desktop and choose “Open terminal”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ZMfkj_OlGBbSeXEg.png" /><figcaption>Open terminal on Ubuntu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*BXPOlLQvNQrt3_CY.png" /><figcaption>Ubuntu terminal</figcaption></figure><p>You can test various commands and try to do different things on this emulator. We can try to write a simple script for example the classic “Hello World!”.</p><p>Create a hello.sh file with nano.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SIYZexPiThfyZrNn.png" /><figcaption>nano hello.sh</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ypmikgBqCg-3eQhH.png" /><figcaption>Hello World!</figcaption></figure><p>Close nano with Ctrl+X, and the terminal will show the question “Save modified buffer ?”. Press Y and then Enter to confirm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8GNOaUDhQSfoC6u9.png" /><figcaption>Question from terminal</figcaption></figure><p>You should choose the file name, just press Enter to keep the same name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1cMZrZaKPtZ71Cag.png" /><figcaption>Question from terminal</figcaption></figure><p>Use the command bash hello.sh and the terminal will print your echo command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*WxTsXKeqjVeR-Jgq.png" /><figcaption>bash script execution</figcaption></figure><p>Congratulations, you have just learned how to use Ubuntu without installing anything!</p><p>🎉🎉🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*TKIa9mnrF_xWypqd.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61a9646a8594" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/how-to-write-a-bash-script-from-windows-without-having-linux-installed-61a9646a8594">How to write a Bash script from Windows without having Linux installed</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Developer’s Guide to Flutter]]></title>
            <link>https://faun.pub/a-developers-guide-to-flutter-330f2eba0118?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/330f2eba0118</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Sat, 20 Aug 2022 10:46:13 GMT</pubDate>
            <atom:updated>2022-08-21T09:26:53.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*qoXa1LdGFbFxlzML.png" /></figure><p>Since its much-awaited launch, Flutter has caught a lot of attention, and we’re excited about it too! I’m hoping that a massive chunk of non-game apps will transition to flutter, and in anticipation, we are training our team on it as well.</p><p>Since there are new but few resources scattered over the internet to learn flutter — we’ve compiled our Flutter tutorial to get developers off their feet and start developing apps for Flutter.</p><p>In this Flutter guide for beginners, we will cover:</p><ul><li>Flutter: What, How, and Why?</li><li>Setting up Flutter</li><li>Dart Basics</li><li>Flutter Basics</li><li>Widgets</li><li>Layouts</li><li>Interactive Widgets</li><li>Designing an app: Forms, Gestures, and Images</li><li>Lists &amp; Navigation</li><li>Networking</li><li>JSON and Serialization</li><li>Dependency Management</li><li>State Management</li><li>Testing (Unit and Integration)</li></ul><h3>Flutter: What, How, and Why?</h3><p>What is Flutter, and how is it different? Just remember this — Flutter was built to work for any device with a screen and works with:</p><ul><li>iOS and Android</li><li>Web and Desktop (Mac, Windows, and Ubuntu) — Even support PWA</li><li>Auto</li><li>Raspberry Pi (POC stage)</li></ul><p>Check out this video from Google; it’s a great place to get a grasp — comparing Native Development, Hybrid App Development, React Native Development, and finally, <a href="https://www.solutelabs.com/flutter-app-development-services">Flutter App Development</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fl-YO9CmaSUM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dl-YO9CmaSUM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fl-YO9CmaSUM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5101991d505693aff25c8a7194aca85d/href">https://medium.com/media/5101991d505693aff25c8a7194aca85d/href</a></iframe><h3>Setting up Flutter</h3><p>Flutter is relatively straightforward to set up and depending on what OS you’re using; you can check out the steps in this official Flutter tutorial:</p><p><a href="https://flutter.dev/docs/get-started/install">Install</a></p><p>But in case you do run into something, check out here:</p><p><a href="https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#flutter-installation">Workarounds for common issues · flutter/flutter Wiki</a></p><p>The reason we ask that you set up Flutter before Dart is because when you install Flutter, you install Dart too, and while you can separately install dart, it would be an unnecessary step. Flutter will decide which dart version will be used, so installing different dart versions will also be ambiguous.</p><p>Once you’ve downloaded and unzipped Flutter, you should see something like this on running the flutter command at the console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*0iYkJva4MytyOdE6.png" /></figure><p>If you’re new to <a href="https://www.solutelabs.com/mobile-app-development">mobile development</a> in general, you will need to download <a href="https://developer.apple.com/xcode/">Xcode</a> and <a href="https://developer.android.com/studio/index.html">Android Studio</a> (and toolchain), as well. Once you’ve set up Flutter, scaffolding a new project is just one command.</p><h3>Dart Basics</h3><p>Flutter uses <a href="https://dart.dev/">Dart language</a> to build Apps. To understand why Flutter uses dart, check out my previous blog and down to the section — <strong>How Flutter was born</strong></p><p>Flutter and Chrome use the same rendering engine — SKIA. Instead of interacting with native APIs, it controls every pixel on the screen, which gives it the much necessary freedom from the legacy baggage as well as the performance it has.</p><p>Do give the <a href="https://flutter.dev/docs/resources/faq#why-did-flutter-choose-to-use-dart">official doc</a> a read, but I found this one to be good at explaining dart</p><p><a href="https://hackernoon.com/why-flutter-uses-dart-dd635a054ebf">Why Flutter Uses Dart</a></p><p>P.S. You can follow up with dart updates on their <a href="https://medium.com/dartlang">medium account</a></p><p>Now, you know why <a href="https://en.m.wikipedia.org/wiki/Google">Google</a> choose Dart — so let’s get your hands dirty!</p><h3>Learn Dart</h3><p>Check out the official docs of Dart language, <a href="https://dart.dev/guides/language/language-tour">a tour</a>, and their <a href="https://dart.dev/samples">language samples</a>.</p><p>Once you have an overview, head to <a href="http://jpryan.me/dartbyexample/">http://jpryan.me/dartbyexample/</a> and do all the examples religiously.</p><h3>Practice, Practice, Practice!</h3><p>Edit your code on <a href="https://dartpad.dartlang.org/">DartPad</a> for starters and get a better grip. I’m sure you’ll be up and running in no time!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*azOByQNpLCFgOszp.png" /></figure><p>After, you’re done with dartbyexample, head over to exercism, and complete their dart track. It’s trendy, so in case it’s full, you can do the practice track too.</p><p><a href="https://exercism.io/tracks/dart">Dart | Exercism</a></p><h3>Flutter Basics</h3><p>Now that you’re familiar with Dart, it’s finally time to move on to Flutter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/0*6OFxsrWxocnb6b37.gif" /></figure><p>Let’s start with the technical overview here:</p><p><a href="https://flutter.dev/docs/resources/technical-overview">Technical overview</a></p><p>And scaffold a new flutter app with:</p><pre>$ flutter create app_name</pre><p>And you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><p>Open the project on the Android Studio, download the emulator, and an Android version if not done already and run the project — and et voila!</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><p>Understand how you should structure your project directory and understand which files are meant for which purpose</p><p><a href="https://dev.to/jay_tillu/flutter-project-structure-1lhe">Flutter Project Structure</a></p><p>Now that you’ve set up flutter, it’s time to do what all developers do! Use other’s code 😆 — what I meant is to set up the package file: pubspec, written in YAML</p><p><a href="https://dart.dev/tools/pub/pubspec">The pubspec file</a></p><h3>Widgets</h3><blockquote>Remember — Everything’s a widget in Flutter</blockquote><p>If you’ve not read the technical overview as we asked you before, go back and read it :) You will get a fair idea of what widgets are. Widgets come in two flavors: <strong><em>stateless</em></strong> and <strong><em>stateful.</em></strong></p><p>Stateless Widgets are those whose state doesn’t change like a button or an image. As the name states, it doesn’t change its state when an action is performed on the screen.</p><p>Check out the short video series and its <a href="https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html">documentation</a> by Google to explore in-depth (I’m attaching the first video in the series).</p><p>When a widget needs to hold some state like a current page in <a href="https://api.flutter.dev/flutter/widgets/PageView-class.html">PageView</a>, the currently selected tab in a <a href="https://api.flutter.dev/flutter/widgets/PageView-class.html">BottomNavigationBar</a>, Stateful widgets are the right choice to make.</p><p>StatefulWidgets can hold the current state of a Widget. Instead of a widget build method, a Stateful widget has a <a href="https://api.flutter.dev/flutter/widgets/State-class.html">State</a> build method that calls each time we explicitly call <strong><em>setState</em></strong>.</p><p>And Similarly, check out the documentation (it has the video inside) for the stateful widgets here:</p><p><a href="https://api.flutter.dev/flutter/widgets/StatefulWidget-class.html">StatefulWidget class</a></p><p>Flutter 1.9 was released at <a href="https://developers.googleblog.com/2019/09/flutter-news-from-gdd-china-flutter1.9.html?m=1">GDD China</a> with a host of new features and a mark that the community is multiplying (and that you can’t ignore China now)</p><h3>Layouts in Flutter</h3><p>As we discussed earlier, everything is a widget in Flutter — including layout models.</p><p>Check out the documentation here:</p><p><a href="https://flutter.dev/docs/development/ui/layout">Layouts in Flutter</a></p><p>Widgets such as the rows, columns, and grid are layout widgets (which we don’t see on screen) that helps other visible widgets to arrange, constraints, and align.</p><blockquote><em>⏰ Time for Codelab: </em><a href="https://codelabs.developers.google.com/codelabs/first-flutter-app-pt1/#0">Write your First Flutter App : Part-1</a></blockquote><h3>And, Some more Widgets!</h3><p>Flutter comes with a suite of powerful basic Widgets such as <a href="https://api.flutter.dev/flutter/widgets/Text-class.html">Text</a>, <a href="https://api.flutter.dev/flutter/widgets/Column-class.html">Column</a>, <a href="https://api.flutter.dev/flutter/widgets/Row-class.html">Row</a>, <a href="https://api.flutter.dev/flutter/widgets/Stack-class.html">Stack</a>, and <a href="https://api.flutter.dev/flutter/widgets/Container-class.html">Container</a>. The basic widgets will help you create custom views as you want.</p><p>If your app follows <a href="https://material.io/design/guidelines-overview/">material design guidelines</a>, Flutter has much to cover by default. Flutter provides several widgets that support Material Design. It includes widgets such as <a href="https://api.flutter.dev/flutter/material/MaterialApp-class.html">MaterialApp</a>, <a href="https://api.flutter.dev/flutter/material/AppBar-class.html">AppBar</a>, <a href="https://api.flutter.dev/flutter/material/Scaffold-class.html">Scaffold</a>, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*pzG8b-T5CS91UFXg.png" /></figure><p>Flutter also includes the iOS-centric <a href="https://flutter.dev/docs/development/ui/widgets/cupertino">Cupertino component</a> package. It covers widgets such as <a href="https://api.flutter.dev/flutter/cupertino/CupertinoApp-class.html">CupertinoApp</a>, <a href="https://api.flutter.dev/flutter/cupertino/CupertinoNavigationBar-class.html">CupertinoNavigationBar</a>, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/0*kTtA589mmUtvUvLP.png" /></figure><h3>Interactive Widgets</h3><p>So far, we have seen Widgets that display information on-screen or arrange other widgets. For the real app, it is equally essential to make the app interactive and get user’s input in various forms like Gesture, taps, etc.</p><p>To achieve this, Flutter has numbers of StatefullWidgets such as <a href="https://api.flutter.dev/flutter/material/Checkbox-class.html">Checkbox</a>, <a href="https://api.flutter.dev/flutter/material/Radio-class.html">Radio</a>, <a href="https://api.flutter.dev/flutter/material/Slider-class.html">Slider</a>, <a href="https://api.flutter.dev/flutter/material/InkWell-class.html">InkWell</a>, <a href="https://api.flutter.dev/flutter/widgets/Form-class.html">Form</a>, and <a href="https://api.flutter.dev/flutter/material/TextField-class.html">TextField</a>, etc. These widgets are capable enough to maintain their state (e.g., Text we are entering in TextField, whether a CheckList is checked or not.)</p><p>Go and check out the below example to add Favorites/Non-Favorites functionality to your app.</p><p><a href="https://flutter.dev/docs/development/ui/interactive">Adding interactivity to your Flutter app</a></p><blockquote><em>⏰ </em>Time for Codelab<em>: </em><a href="https://codelabs.developers.google.com/codelabs/first-flutter-app-pt2/#0">Write your First Flutter App : Part-2</a></blockquote><blockquote>As you have reached here, you should be clear with <strong>What is Widgets?</strong> and <strong>Types of Widget</strong></blockquote><p>Now you must be curious about what are all widgets available in Flutter.</p><p>So here is a Widget Catalog; check all the Widgets that make Flutter development relaxed and Fun 😍</p><p><a href="https://flutter.dev/docs/development/ui/widgets">Widget catalog</a></p><h3>Flutter Cookbook</h3><p>And here we go; it’s time to learn Flutter for real apps. I mean apps with multiple screens, Images, Network dependency, and all.</p><p>So, Let’s begin.</p><h3>Designing an App</h3><p>Check the below app illustration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*l73btbJQRsXx0Exs.gif" /></figure><p>This Simple looking app has these features 👇</p><ol><li>Navigation Drawer<br><a href="https://flutter.dev/docs/cookbook/design/drawer">https://flutter.dev/docs/cookbook/design/drawer</a></li></ol><p>2. SnackBar<br><a href="https://flutter.dev/docs/cookbook/design/snackbars">https://flutter.dev/docs/cookbook/design/snackbars</a></p><p>3. Custom Fonts (A Text has its own Style 😉)<br><a href="https://flutter.dev/docs/cookbook/design/package-fonts">https://flutter.dev/docs/cookbook/design/package-fonts</a></p><p>4. A <a href="https://flutter.dev/docs/development/ui/widgets/text">Text</a>-based on Orientation (Bigger fonts in Landscape)<br><a href="https://flutter.dev/docs/cookbook/design/orientation">https://flutter.dev/docs/cookbook/design/orientation</a></p><p>5. And, Multiple Tabs<br><a href="https://flutter.dev/docs/cookbook/design/tabs">https://flutter.dev/docs/cookbook/design/tabs</a></p><blockquote><strong>Note here: OrientationBuilder</strong> is independent of the device’s orientation. Instead, It calculates the current Orientation by comparing the width and height available to the parent widget. To determine the device’s orientation you can refer <strong>MediaQuery.of(context).orientation</strong></blockquote><h3>Forms</h3><p>Flutter has a <strong>Form</strong> widget that helps to build a form that efficiently manages the essential requirement of a Form, e.g., State of a Form, Validation, etc. Check out the complete guild in the below documentation.</p><p><a href="https://flutter.dev/docs/cookbook#forms">Cookbook</a></p><h3>Gestures</h3><p>To get the user inputs and some-time to make the app super interactive, we maximize the use of Gestures. Flutter has pre-built widgets to cover this.</p><ol><li>Adding Material Ripple Effect<br><a href="https://flutter.dev/docs/cookbook/gestures/ripples">https://flutter.dev/docs/cookbook/gestures/ripples</a></li><li>Handle Taps<br><a href="https://flutter.dev/docs/cookbook/gestures/handling-taps">https://flutter.dev/docs/cookbook/gestures/handling-taps</a></li><li>Swipe to Dismiss<br><a href="https://flutter.dev/docs/cookbook/gestures/dismissible">https://flutter.dev/docs/cookbook/gestures/dismissible</a></li></ol><h3>Images</h3><p>To make apps beautiful and engaging, we use Images. Flutter provides an <strong>Image</strong> widget to display an image in the Flutter app from various sources.</p><ol><li>Display Images from Network</li></ol><p><a href="https://flutter.dev/docs/cookbook/images/network-image">Display images from the internet</a></p><ol><li>Display Image with Placeholder &amp; with Fade-in Animation</li></ol><p><a href="https://flutter.dev/docs/cookbook/images/fading-in-images">Fade in images with a placeholder</a></p><ol><li>Sometimes it’s handy to Load image from network and cache it in local storage to make it quickly available next time.</li></ol><p><a href="https://flutter.dev/docs/cookbook/images/cached-images">Work with cached images</a></p><h3>Showing more data using List</h3><p>To accommodate more data, we use List to show them. The list can be horizontally or linearly.</p><p>Flutter has a <a href="https://api.flutter.dev/flutter/widgets/GridView-class.html">GridView</a> and <a href="https://api.flutter.dev/flutter/widgets/ListView-class.html">ListView</a>. These are basic widgets with different contractors to identify how they can be used.</p><ol><li>Create a grid list</li></ol><p><a href="https://flutter.dev/docs/cookbook/lists/grid-lists">Create a grid list</a></p><ol><li>Create list horizontally</li></ol><p><a href="https://flutter.dev/docs/cookbook/lists/horizontal-list">Create a horizontal list</a></p><ol><li>The list can have different types of Items. E.g., a header &amp; items to it. Check here how you can cover such cases in ListView.</li></ol><p><a href="https://flutter.dev/docs/cookbook/lists/mixed-list">Create lists with different types of items</a></p><ol><li>Floating app bar and Nested scrolling using SliverList</li></ol><p><a href="https://flutter.dev/docs/cookbook/lists/floating-app-bar">Place a floating app bar above a list</a>.</p><h4>Don’t forget to check out <a href="https://medium.com/flutter/slivers-demystified-6ff68ab0296f">this awesome article</a> by Emily Fortuna to understand Slivers in depth.</h4><ol><li>Sometimes we have predefined arbitrary items to be placed in a List. e.g., Setting categories. In ListView, you can pass custom items (in the form of Widgets) to its children.</li></ol><p><a href="https://flutter.dev/docs/cookbook/lists/basic-list">Use lists</a></p><ol><li>Sometimes a List has more items than the viewport of a screen. In such cases, it makes no sense to build all the items at once. Flutter has <strong><em>ListView.Builder</em></strong> that uses the Lazy rendering approach to create list items efficiently.</li></ol><p><a href="https://flutter.dev/docs/cookbook/lists/long-lists">Work with long lists</a>.</p><p>If you have more items on a list and looking to paginate them. Here is a good article I found 👇</p><p><a href="https://blog.solutelabs.com/paginate-your-data-in-flutter-7744995febd1">How to paginate your data in Flutter</a></p><h3>Navigating between screens aka routes</h3><p>Most apps contain multiple screens to display data in a well-organized manner.</p><p>In Flutter, we can do navigation-related operations using <a href="https://api.flutter.dev/flutter/widgets/Navigator-class.html">Navigator</a>. <br>Check below diagram to understand how Flutter manages multiple routes, and later, we will discuss how to navigate up and forth between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/0*D1Nmak85LOOiXwgc.png" /></figure><ol><li>Navigate to a new screen and back</li></ol><p><a href="https://flutter.dev/docs/cookbook/navigation/navigation-basics">Navigate to a new screen and back</a></p><ol><li>Pass data to new screens and retrieve results.</li></ol><p><a href="https://flutter.dev/docs/cookbook/navigation/passing-data">Send data to a new screen</a></p><p><a href="https://flutter.dev/docs/cookbook/navigation/returning-data">Return data from a screen</a></p><blockquote>So far, what we have seen is suitable for small projects. But when the project grows, we want to manage all routes at a single place. Also, we might need to address below questions</blockquote><ul><li>How many routes we have?</li><li>How to initialize each route?</li><li>What data is required by each route? etc..</li></ul><ol><li>To manage all this efficiently, Flutter has named routes.</li></ol><p><a href="https://flutter.dev/docs/cookbook/navigation/named-routes">Navigate with named routes</a></p><ol><li>Pass arguments in named routes.</li></ol><p><a href="https://flutter.dev/docs/cookbook/navigation/navigate-with-arguments">Pass arguments to a named route</a></p><p>And, What about this animation while navigating to a new screen?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*sjNtKiAGm8QedNke.gif" /></figure><ol><li>Animate a widget across screens</li></ol><p><a href="https://flutter.dev/docs/cookbook/navigation/hero-animations">Animate a widget across screens</a></p><h3>Networking</h3><p>Most apps we come across nowadays, are generally connected with third party server and makes requests to the server to fetch or post data.</p><p>In Flutter, we can use Http as a third party pub to do such stuff.</p><p><a href="https://pub.dev/packages/http">http | Dart Package</a></p><ol><li>Fetch data from the network</li></ol><p><a href="https://flutter.dev/docs/cookbook/networking/fetch-data">Fetch data from the internet</a></p><ol><li>Make authenticated requests</li></ol><p><a href="https://flutter.dev/docs/cookbook/networking/authenticated-requests">Make authenticated requests</a></p><ol><li>Work with web sockets</li></ol><p><a href="https://flutter.dev/docs/cookbook/networking/web-sockets">Work with WebSockets</a></p><p><a href="https://flutter.dev/docs/cookbook/networking/web-sockets">Flutter has few more pubs available, which do such stuff more efficiently. Don’t forget to take a look at the below pubs</a>.</p><p><a href="https://pub.dev/packages/dio">dio | Dart Package</a></p><p><a href="https://pub.dev/packages/chopper">chopper | Dart Package</a></p><h3>Using JSON and Serialization</h3><p>In Flutter, we generally have two strategies for JSON serialization. Manual parsing and automated serialization using code generation.</p><blockquote>Runtime <a href="https://en.wikipedia.org/wiki/Reflection_(computer_programming)">reflection</a> is disabled in Flutter, resulting we cannot have libraries like <a href="https://github.com/google/gson">GSON</a>, <a href="https://github.com/FasterXML/jackson-core">Jackson</a> or <a href="https://github.com/square/moshi">Moshi</a></blockquote><p>Check out the full guide with both strategies here:</p><p><a href="https://flutter.dev/docs/development/data-and-backend/json">JSON and serialization</a></p><p>For manual parsing, don’t forget to check out this online tool to auto-generate boilerplate for the model class.</p><p><a href="https://app.quicktype.io/">Instantly parse JSON in any language | quicktype</a></p><h3>Data Persistence</h3><p>Sometimes we need to persist data in local memory to quickly available whenever we need them.</p><ol><li>If you have a relatively small amount of data to be stored in a key-value pair. Consider using <a href="https://pub.dev/packages/shared_preferences">shared-preferences</a>. Below is the detailed guide to achieving the same using Flutter.</li></ol><p><a href="https://flutter.dev/docs/cookbook/persistence/key-value">Store key-value data on disk</a></p><ol><li>You can also read and write files on disk.</li></ol><p><a href="https://flutter.dev/docs/cookbook/persistence/reading-writing-files">Read and write files</a></p><ol><li>If an app needs to persist a large amount of data and also it requires to query them. It is advised to use an <a href="https://www.sqlite.org/index.html">SQLite database</a></li></ol><p>Flutter app can use the SQLite database via <a href="https://pub.dev/packages/sqflite">sqflite</a> pub.</p><p><a href="https://flutter.dev/docs/cookbook/persistence/sqlite">Persist data with SQLite</a></p><p>For easy to use, reactive persistence, check out below pub. Moor is a wrapper around sqflite.</p><p><a href="https://pub.dev/packages/moor_flutter">moor_flutter | Flutter Package</a></p><h3>Dependency Management</h3><p>We use so many pubs in the app. It’s a great way to work collectively and share code across apps without having to develop everything from scratch.</p><p>You can find all the useful packages from here.</p><p><a href="https://pub.dev/">Dart packages</a></p><p>With multiple pubs, you might faces issues like conflicts in the version resolving. You can find all the best practices here to be followed while using pubs.</p><p><a href="https://flutter.dev/docs/development/packages-and-plugins/using-packages">Using packages</a></p><p>And, with all this, you now have completed Flutter cookbook. 👏</p><h3>An Art of State Management</h3><h3>Introduction</h3><p>In a typical app, it is a common use-case that a change made at Point-A reflects some changes at Point-B. That is called State management. It can also be understood by the below illustration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*aSir1z-8uQ9tdkOq.gif" /></figure><p>Flutter has multiple approaches that can efficiently manage the State of the app. Based on project size we can decide the appropriate techniques.</p><p>Here we will discuss a few of the possible techniques for State management.</p><ol><li><strong>setState way</strong></li></ol><p><a href="https://flutter.dev/docs/development/ui/interactive">Adding interactivity to your Flutter app</a></p><p><a href="https://medium.com/@agungsurya/basic-state-management-in-google-flutter-6ee73608f96d">Basic State Management in Google Flutter</a></p><p>2. Inherited Widget</p><p>Check out the below video to understand, <strong>What Inherited Widgets?</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZbm3hjPjQMk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZbm3hjPjQMk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZbm3hjPjQMk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/93acf2eb17f07f6a482f2f35a559c464/href">https://medium.com/media/93acf2eb17f07f6a482f2f35a559c464/href</a></iframe><p>Also, Check out the complete list of articles here.</p><p><a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt/options#inheritedwidget--inheritedmodel">List of state management approaches</a></p><h3>Remember “Theme.of(context);” and “Navigator.of(context);” you used earlier? That is using the same Inherited Widget concept to access data down in the widget tree.</h3><ol><li>The Provider Package</li></ol><p>The <a href="https://pub.dev/packages/provider">provider</a> is a mixture of DI (dependency injection) and State management built with widgets for widgets.</p><p>Official documentation of the provider is too good to understand it in depth.</p><p><a href="https://pub.dev/documentation/provider/latest/">provider — Dart API docs</a></p><ol><li>BLoC Pattern</li></ol><p><a href="https://bloclibrary.dev/#/">BLoC</a> is a Simple, Lightweight, and highly testable predictable state management library for Dart.</p><p>Here is an official guide to <a href="https://bloclibrary.dev/#/">Bloc</a></p><p>I also found this good video series explaining the BLoC pattern (with <a href="https://resocoder.com/2019/10/26/flutter-bloc-library-tutorial-1-0-0-stable-reactive-state-management/">Accompanying article series</a>)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FoxeYeMHVLII%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DoxeYeMHVLII&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FoxeYeMHVLII%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc23ddb7d61dc6e012eacf95cf8061c5/href">https://medium.com/media/fc23ddb7d61dc6e012eacf95cf8061c5/href</a></iframe><h3>Testing</h3><p>When the app grows, it becomes hard to test every feature, and then it comes regression too. In such cases, automation testing is the way to go. It helps ensure that the app performs as expected before we release it. <br>And so we don’t fall in such situations. 😆</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/0*PCV43vKWMeG4qapx.gif" /></figure><p>Automation testing falls under three categories</p><ul><li>A <a href="https://flutter.dev/docs/testing#unit-tests"><em>unit</em></a> test tests a single function, method, or class.</li><li>A *<a href="https://flutter.dev/docs/testing#widget-tests">widget test</a> (in other UI frameworks referred to as component test) tests a single widget.</li><li>An *<a href="https://flutter.dev/docs/testing#integration-tests">integration test</a> tests a complete app or a large part of an app.</li></ul><p>Check out the introduction to testing in Flutter here</p><p><a href="https://flutter.dev/docs/testing">Testing Flutter apps</a></p><h3>Unit Testing</h3><p>The goal of Unit testing is to test a particular Unit of code with Stub/mock dependencies. Verify the code works as expected in different scenarios. A unit test is very fast and doesn’t require an actual device to execute.</p><p><a href="https://flutter.dev/docs/cookbook/testing/unit/introduction">An introduction to unit testing</a></p><p>While doing Unit tests, any dependent classes should be injectable, so that we can inject a mock or fake implementation of dependancy and verify if everything working as expected. Flutter has a <a href="https://pub.dev/packages/mockito">mockito</a> framework that helps to create a mock or fake implementation.</p><p><a href="https://pub.dev/packages/mockito">mockito | Dart Package</a></p><h3>Widget Testing</h3><p>Widget Testing (in Flutter) is a UI testing technique. <br>The goal of widget testing is to test if particular Widget UI looks as expected, and it’s interactive. Widget testing doesn’t require a physical device.</p><p>We could also test the properties of Widget, like Color, Size, Font Family, etc..<br>We can also perform user events like tap, gestures, entering text, etc.</p><p><a href="https://flutter.dev/docs/cookbook/testing/widget/introduction">An introduction to widget testing</a></p><h3>Integration Testing</h3><p>Integration test work in a pair. The goal here is to test how multiple units work together. Integration testing happens on a real device or emulators.</p><p>We can fire a series of User interaction events and expect UI rendering or unit codes to be executed properly.</p><p><a href="https://flutter.dev/docs/cookbook/testing/integration/introduction">An introduction to integration testing</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKjE2IDphA_U&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKjE2IDphA_U&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FKjE2IDphA_U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d71c3b445967b157b49e5b8ddf9999e/href">https://medium.com/media/5d71c3b445967b157b49e5b8ddf9999e/href</a></iframe><h3>BDD: Behavior-driven development</h3><p>TDD or Unit Tests helps when a stakeholder has strong technical skills. BDD is all about writing a test case from the end user’s perspective. This is written in a natural English language.</p><p>Testcase can be written in the below format:<br><strong>Given</strong>: the initial context at the beginning of the scenario, in one or more clauses;<br><strong>when</strong>: the event that triggers the scenario;<br><strong>then</strong>: the expected outcome, in one or more clauses.</p><p>Internally, a behavior test cases can be a Unit test, widget test, or a combination of both.</p><p>BDD helps to understand software functionality from an end-user perspective and becomes a sort of functional documentation.</p><p>Flutter has a <a href="https://cucumber.io/docs/bdd/better-gherkin/">gherkin</a> that helps us writing Behaviour Test cases.</p><p><a href="https://pub.dev/packages/gherkin">gherkin | Dart Package</a></p><p>This guide covers all the basics that you would need to know to start with flutter and develop your apps! We hope this helps you on your journey to flutter.</p><p><a href="https://medium.com/subscribe/@anshgoyal749">Get an email whenever Anshgoyal publishes.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3Go2ZIQ_N0aRrPZC.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=330f2eba0118" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/a-developers-guide-to-flutter-330f2eba0118">A Developer’s Guide to Flutter</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ten mind-blowing AI websites you probably didn’t know existed.]]></title>
            <link>https://faun.pub/ten-mind-blowing-ai-websites-you-probably-didnt-know-existed-3eb2ac7a9110?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eb2ac7a9110</guid>
            <category><![CDATA[fun]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 15:34:05 GMT</pubDate>
            <atom:updated>2022-09-18T07:56:05.659Z</atom:updated>
            <content:encoded><![CDATA[<p>While AI is an important technological development, you can also have some fun with it. So, here are ten fun AI tools you should check out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CJdgJuMUD9wveLS4" /></figure><p>Job automation, algorithmic bias, and technological development are the first thoughts that spring to mind when we think of Artificial Intelligence. But at the same time, AI can be used in many fun and exciting ways.</p><p>Here, we discuss ten fun AI tools that you must try out. Besides being a great way to kill boredom, they demonstrate how advanced AI has already become.</p><h3>1. Magic Eraser</h3><p>Edit out parts of photos with Magic Eraser.</p><p>Have a great photo but with something annoying in the background?</p><p>Remove it easily:</p><p><a href="https://t.co/gcs0dUvk20">http://Magiceraser.io</a></p><ul><li>Upload the photo</li><li>• Select the part you don’t want</li><li>• Press ‘erase’ And boom. It’s gone.</li></ul><p>And boom. It’s gone.</p><p><a href="https://www.magiceraser.io/">Magic Eraser : Remove unwanted things in seconds</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JpScFLS7jd2KgGDlkUAw9w.png" /></figure><h3>2. Craiyon</h3><p>Create images from words with Craiyon.</p><p>Want to illustrate your idea?</p><p><a href="https://t.co/5MRc01mb85">http://Craiyon.com</a></p><p>Type in any words to describe what you want:</p><ul><li>Describe actions</li><li>Combine items</li><li>Create images in a particular style</li></ul><p>And it’ll produce an image to match</p><p>That sounds crazy…it is</p><p><a href="https://www.craiyon.com/">Craiyon, AI Image Generator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyETvb6xvvp8sZr1bc35KQ.png" /></figure><h3>3. Rytr</h3><p>Sort your creative block with Rytr.</p><p>Ever get stuck with writer’s block?</p><p>Rytr writes your piece for you.</p><p><a href="https://t.co/wTlPlNsACO">http://Rytr.me</a></p><ul><li>Choose a language</li><li>Choose a tone</li><li>Choose the type of content</li></ul><p>It’ll give you excellent copy you can edit and use as you like.</p><p><a href="https://rytr.me/">Free AI Writer, Content Generator &amp; Writing Assistant | Rytr</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fpQzhWAcPi9DCSQyudC0A.png" /></figure><h3><strong>4. Thing Translator</strong></h3><p>Identify objects from photos with Thing Translator.</p><p>On holiday and don’t know the word for an item?</p><p>Take a photo of it to find out.</p><p><a href="https://t.co/HuHc89IkfZ">http://thing-translator.appspot.com</a></p><ul><li>Take a picture of the item</li><li>Get the word in one of 10 languages</li></ul><p>No more fumbling through a dictionary.</p><p><a href="https://thing-translator.appspot.com/">Thing Translator</a></p><h3>5. AutoDraw</h3><p>Create better drawings with Autodraw.</p><p>Are you a terrible artist like me?</p><p><a href="https://t.co/fvSj8vf1wL">http://autodraw.com</a></p><ul><li>Start sketching</li><li>It guesses what you’re trying to draw</li><li>And offers better alternatives for you</li></ul><p>Suddenly my awful drawing of a dog is actually usable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZTc0J_fPw7xP5uKRt_xpA.png" /></figure><p><a href="https://www.autodraw.com/">AutoDraw</a></p><h3>6. Fontjoy</h3><p>Come up with good font combos with Fontjoy.</p><p>If you aren’t a designer, it’s hard to choose nice fonts.</p><p><a href="https://t.co/YqFgvAIKpa">http://fontjoy.com</a></p><p>chooses them for you</p><p>• Lock in a font you want</p><ul><li>Or start from scratch</li><li>Generate fonts that pair</li></ul><p>Now you KNOW your fonts work well together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bbMnxE2q_VhfZkh2H88Sg.png" /></figure><p><a href="https://fontjoy.com/">Generate font pairing using neural nets</a></p><h3>7. Talk to Books</h3><p>Use all the wisdom in books with Talk To Books.</p><p>Ask your question to the collective wisdom of &gt;100,000 books</p><p><a href="https://t.co/5a49fQ0pw0">https://books.google.com/talktobooks/</a></p><p>• Ask it a question</p><ul><li>It searches all its books</li><li>It gives you quotes that answer your question</li></ul><p>A curated book search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufAVLKnZk1pAta1_idd1GA.png" /></figure><p><a href="https://books.google.com/talktobooks/">Talk to Books</a></p><h3>8. This person does not exist</h3><p>Find a person that’s not a person.</p><p>Need to use an image of a person that’s copyright-free?</p><p><a href="https://t.co/NE9opuy90p">http://thispersondoesnotexist.com</a></p><ul><li>Go to the website</li><li>Press refresh</li><li>It generates a new face each time But this face is AI-generated.</li><li>It’s of a person who does not exist.</li></ul><p>Mind. Blown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypup8BdYVRbAPS81k4j8lg.png" /></figure><p><a href="https://thispersondoesnotexist.com/">This Person Does Not Exist</a></p><h3>9. Namelix</h3><p>Generate your business name with Namelix.</p><p>Often we spend way too long coming up with a name for a new project or business.</p><p><a href="https://t.co/UysYId954P">http://namelix.com</a></p><ul><li>Enter key words</li><li>Choose what type of name you want</li></ul><p>Namelix generates hundreds of ideas and logos for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KkhuN3Ow4LnBD_FB_wduYg.png" /></figure><p><a href="https://namelix.com/">Business Name Generator</a></p><h3>10. Lets Enhance</h3><p>Enhance your photos with Let’s Enhance</p><p>Have a grainy image or one that’s too small?</p><p><a href="https://t.co/1Q2w9YyTZu">http://letsenhance.io</a></p><ul><li>Upload your image</li><li>It increases the quality</li><li>It makes it larger</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZI46doPv9a5F27pNQ-xDEg.png" /></figure><p><a href="https://letsenhance.io/">LetsEnhance: Image quality AI - make photos HD/4k &amp; more online</a></p><h3>Conclusion</h3><p>10 AI websites you probably didn’t know existed:</p><p>• #1 Magic Eraser</p><ul><li>#2 Craiyon</li><li>#3 Rytr</li><li>#4 Thing Translator</li><li>#5 Autodraw</li><li>#6 Fontjoy</li><li>#7 Talk to Book</li><li>#8 This Person Does Not Exist</li><li>#9 Namelix</li><li>#10 Let’s Enhance</li></ul><p>Hope you find these websites helpful if you like this article please clap for article.</p><p>If you like this article, you can buy me a coffee.</p><p>It will encourage me to write more and more articles in future</p><ul><li><a href="https://www.buymeacoffee.com/anshgoyal7L?source=post_page-----3eb2ac7a9110--------------------------------">Ansh goyal</a></li><li><a href="https://medium.com/subscribe/@anshgoyal749">Get an email whenever Anshgoyal publishes.</a></li></ul><h3>Wanna Support Me :) BUY ME A COFFEE</h3><p>If you appreciate and like the content on my blog, Please support me by buying me a coffee. Click on the link below to support me:</p><p><a href="https://www.buymeacoffee.com/anshgoyal7L">Ansh goyal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MhlWvkTwts2NGIj_.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eb2ac7a9110" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/ten-mind-blowing-ai-websites-you-probably-didnt-know-existed-3eb2ac7a9110">Ten mind-blowing AI websites you probably didn’t know existed.</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Only Lists You Need For Your Interview Preparation]]></title>
            <link>https://faun.pub/the-only-lists-you-need-for-your-interview-preparation-780d972c030a?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/780d972c030a</guid>
            <category><![CDATA[preparation]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Tue, 09 Aug 2022 03:57:25 GMT</pubDate>
            <atom:updated>2022-08-15T06:00:57.948Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/507/0*a8chd7LrnJixWKbd.png" /></figure><p>Hi, I have been actively using leetcode for almost six months now and have solved 750+ problems and getting better day by day. I wanted to share some of my findings from leetcode discussion treasure.</p><p>I have collected various lists of questions by pattern and concepts. I hope these lists below help you in the preparation journey.</p><p>ConceptsLinks</p><p><strong>String</strong></p><p><a href="https://leetcode.com/list/ehkbkaxt">Favorite - LeetCode</a></p><p><strong>Binary Search</strong></p><p><a href="https://leetcode.com/list/e5vjd5xs">Favorite - LeetCode</a></p><p><strong>Two Pointers</strong></p><p><a href="https://leetcode.com/list/e9snhf4h">Favorite - LeetCode</a></p><p><strong>Two Pointers — Fast-Slow</strong></p><p><a href="https://leetcode.com/list/e9surc0r">Favorite - LeetCode</a></p><p><strong>Sliding Window</strong></p><p><a href="https://leetcode.com/list/e5na1hcg">Favorite - LeetCode</a></p><p><strong>Heap — Top K Pattern</strong></p><p><a href="https://leetcode.com/list/e9sr11es">Favorite - LeetCode</a></p><p><strong>Heap — Merge Pattern</strong></p><p><a href="https://leetcode.com/list/e9spcwu1">Favorite - LeetCode</a></p><p><strong>Heap — Two Heap Pattern</strong></p><p><a href="https://leetcode.com/list/e9smnbcm">Favorite - LeetCode</a></p><p><strong>Heap — Min Pattern</strong></p><p><a href="https://leetcode.com/list/e9sa9dgt">Favorite - LeetCode</a></p><p><strong>Tree</strong></p><p><a href="https://leetcode.com/list/e5xnbz4r">Favorite - LeetCode</a></p><p><strong>.Fenwick Tree</strong></p><p><a href="https://leetcode.com/list/5vezxjhm/">Favorite - LeetCode</a></p><p><strong>Graph</strong></p><p><a href="https://leetcode.com/list/exk9bfmj">Favorite - LeetCode</a></p><p><strong>Bridges &amp; Articulation Point</strong></p><p><a href="https://leetcode.com/list/exk9jcpt">Favorite - LeetCode</a></p><p><strong>DSU</strong></p><p><a href="https://leetcode.com/list/exseebe3">Favorite - LeetCode</a></p><p><strong>Recursion/Backtracking</strong></p><p><a href="https://leetcode.com/list/e9zey1gd">Favorite - LeetCode</a></p><p><strong>Dynamic ProgramingClassical DP</strong></p><p><a href="https://leetcode.com/list/e5du47b6">Favorite - LeetCode</a></p><p><strong>Knapsack DP</strong></p><p><a href="https://leetcode.com/list/e5du8m2r">Favorite - LeetCode</a></p><p><strong>Decision Making DP</strong></p><p><a href="https://leetcode.com/list/ehgh83qm">Favorite - LeetCode</a></p><p><strong>Distinct Ways DP</strong></p><p><a href="https://leetcode.com/list/ehgh7eyt">https://leetcode.com/list/ehgh7eyt</a></p><p><strong>Max Min DP</strong></p><p><a href="https://leetcode.com/list/ehghd2jv">Favorite - LeetCode</a></p><p><strong>Grid DP</strong></p><p><a href="https://leetcode.com/list/e5ducp4i">Favorite - LeetCode</a></p><p><strong>Math realted DP</strong></p><p><a href="https://leetcode.com/list/e5du6ce3">Favorite - LeetCode</a></p><p><strong>Dp on Strings</strong></p><p><a href="https://leetcode.com/list/ehghusgh">Favorite - LeetCode</a></p><p><strong>Graph/ Tree DP</strong></p><p><a href="https://leetcode.com/list/e5dult0g">Favorite - LeetCode</a></p><p><strong>Bit Manipulation Dp</strong></p><p><a href="https://leetcode.com/list/e5duqfrh">Favorite - LeetCode</a></p><p><strong>Interval DP</strong></p><p><a href="https://leetcode.com/list/e5dtxk8r">Favorite - LeetCode</a></p><p><strong>Merging Interval DP</strong></p><p><a href="https://leetcode.com/list/ehghlx1r">Favorite - LeetCode</a></p><p><strong>Multi Dimension DP</strong></p><p><a href="https://leetcode.com/list/e5dubese">Favorite - LeetCode</a></p><p><strong>Digit DP</strong></p><p><a href="https://leetcode.com/list/e5dufyqj">Favorite - LeetCode</a></p><p>I have also learned some algorithms, which made some questions very easy for me to solve, shared in the list below.</p><p>Other resources to learn algorithms</p><p><a href="https://cp-algorithms.com/">CP algos</a><br><a href="https://usaco.guide/">USACO</a></p><p><strong>Tip: Learn algorithms with the black box method</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*uODfrXmTvGRKv8mQ.png" /></figure><p>You can learn concepts of most algorithms and solve problems with them without actually knowing the internal working, but eventually learn the internal working. Refer below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*TkGHkiHWWVuNPLaH.png" /></figure><p><strong>By this method, you can cover a lot of breadth and depth concurrently</strong></p><p>I use this. Personally, this was inspired by colin Galen.</p><p>All The Best !!!</p><h3>About Me</h3><p><a href="https://medium.com/subscribe/@anshgoyal749">Get an email whenever Anshgoyal publishes.</a></p><p>LinkedIn<br><a href="https://www.linkedin.com/in/ansh-goyal-03936a191/">https://www.linkedin.com/in/ansh-goyal-03936a191/</a></p><p>Twitter<br><a href="https://twitter.com/fredgrott">https://twitter.com/a</a>nshgoyal749</p><p>Github</p><p><a href="https://github.com/anshgoyal1">anshgoyal1 - Overview</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yudRstILFtKq4oMW.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=780d972c030a" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/the-only-lists-you-need-for-your-interview-preparation-780d972c030a">The Only Lists You Need For Your Interview Preparation</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Roadmap to becoming a Flutter developer.]]></title>
            <link>https://faun.pub/roadmap-to-becoming-a-flutter-developer-46431853145b?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/46431853145b</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[roadmaps]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Sun, 07 Aug 2022 09:39:53 GMT</pubDate>
            <atom:updated>2022-08-07T09:39:53.612Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://dev.to/t/flutter">#flutter</a><a href="https://dev.to/t/discuss">#discuss</a><a href="https://dev.to/t/beginners">#beginners</a><a href="https://dev.to/t/tutorial">#tutorial</a></p><p>As we all know, Flutter is booming in the market, and everyone is talking about it. Most companies are recruiting Flutter engineers, therefore if you want to learn Flutter app development, then the blog is for you. In today’s blog, I’m going to give a road map to becoming a Flutter developer, so let’s get started.</p><p>If you are unfamiliar with Flutter, you can read about it in my article here: <a href="https://dev.to/this-is-learning/what-are-the-advantages-of-using-flutter-for-cross-platform-development-1dma">Article</a></p><h3>Dart</h3><p>Dart is a programming language developed by Google, and the Flutter SDK (Software Development Kit) builds apps using the Dart programming language. If you have prior experience with Dart programming languages, learning Flutter will be easier for you. Otherwise, you can cover the following concepts from Dart:</p><ul><li>Data types and variables</li><li>Operators</li><li>Control flow statement</li><li>Function</li><li>Classes</li><li>Lists</li><li>Map</li><li>Async</li></ul><p>The following resources link can help you learn dart programming,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*ALyOI-P2xHhuF1wr" /></figure><p><a href="https://dart.dev/tutorials">Tutorials</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEj_Pcr4uC2Q&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEj_Pcr4uC2Q&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FEj_Pcr4uC2Q%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8d072d125a1a827f780d370d79f61ff/href">https://medium.com/media/a8d072d125a1a827f780d370d79f61ff/href</a></iframe><h3>Flutter</h3><p>Flutter is an open-source mobile SDK (Software Development Kit) created by Google to build native applications for android, iOS, web, desktop, and embedded devices from a single codebase.</p><p>You can cover the following concepts from Flutter:</p><ul><li>Widgets</li><li>Layouts</li><li>Forms &amp; Gesture</li><li>Animation</li><li>Routing</li><li>State management</li><li>Database concepts</li><li>REST API</li></ul><p>The following resources link can help you learn dart programming:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*FoNpfdXuMuFMPR93.png" /></figure><p><a href="https://www.geeksforgeeks.org/flutter-tutorial/">Flutter Tutorial - GeeksforGeeks</a></p><p>A Computer Science portal for geeks. It contains well-written, well thought and well-explained computer science and programming articles, quizzes, and practice/competitive programming/company interview Questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/16/0*STlKTb-6iqO0vX5M.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*hHxH39C4S-6lpn2y.png" /></figure><p><a href="https://docs.flutter.dev/cookbook">Cookbook</a></p><p>The Flutter cookbook provides recipes for many commonly performed tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*UvHO8Vsh8WU2pf-B.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*J-tXOKkm-8VAoAKp" /></figure><p><a href="https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw">https://www.youtube.com/channel/UCwXdFgeE9KYzlDdR7TG9cMw</a></p><p>Projects</p><p>You can now do some small projects after learning dart and flutter. Here are some great projects to get you started.</p><ul><li><a href="https://github.com/londonappbrewery/Clima-Flutter-Completed">Weather app</a></li><li><a href="https://github.com/Ronak99/Skype-Clone">Skype clone</a></li><li><a href="https://github.com/JideGuru/FlutterEbookApp">Ebook app</a></li></ul><h3>Conclusion</h3><p>Throughout this blog post, I have discussed the roadmap that I followed to become a Flutter developer. If you are interested in becoming a Flutter developer, you can follow the same roadmap.</p><p>I hope you like this blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*VyZi8H8shSjdqyoq.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46431853145b" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/roadmap-to-becoming-a-flutter-developer-46431853145b">Roadmap to becoming a Flutter developer.</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google’s Recommended Flutter State Management]]></title>
            <link>https://faun.pub/googles-recommended-flutter-state-management-ed25712dfc66?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed25712dfc66</guid>
            <category><![CDATA[bloc]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 14:53:20 GMT</pubDate>
            <atom:updated>2022-08-22T06:50:03.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*2X2isdnVPaoS-pqy.jpeg" /></figure><p><strong>Everyone gets confused by this state management list:</strong></p><p>[list of states]</p><p><a href="https://docs.flutter.dev/development/data-and-backend/state-mgmt/options">List of state management approaches</a></p><p>And thinks that is the same as what Google recommends for state management; well, it’s not! And what makes it complicated is not the community choices but the fact that we are implementing a workaround for not having true Full-MVVM. Thus, it’s still wrapped up in what the MVC pattern does well and not well and how to fix it, and how to dependency inject things.</p><p>Let me make this easy for a designer to see.</p><h3>Background, What Is Implied By The Framework</h3><p>No matter what SDK framework, all front-end frameworks, whether native or not, start out as MVC. But, it’s a special form of MVC as the true form is MV-small-c as since the framework controls the screen renders it’s acting as a Super-Controller. So what things are we attempting to overcome by modifying the MVC app pattern?</p><p>MVC from Wikipedia:</p><p><a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Model-view-controller - Wikipedia</a></p><p>It was created during Xerox’s PARC days to write GUIs in small talk. And most people describe it as having the con of being directly coupled. That means you as the designer should read that as well its dependency of the Model is directly coupled to the view, implying that DATA-BINDING is also directly coupled.</p><p>Dependency-wise, what that means if we need that model for any other view that we have to directly couple it again to another view and write another controller, which gets into problems of those two model instances not being in sync with one another and showing different states to the user as they travel from one screen to another.</p><p>In short words, state management in Flutter is managing the decoupling of what the view needs, i.e., the data from the model and the business logic decoupling from the view.</p><p>So now, let me show you what the Flutter SDK framework itself actually implies that Google recommends as state management.</p><h3>View Data Binding</h3><p>In Flutter Doc’s state management example:</p><p><a href="https://docs.flutter.dev/development/data-and-backend/state-mgmt/simple">Simple app state management</a></p><p>It starts using the SDK ChangeNotifier class and then moves on to the provider. ChangeNotifier encapsulates state changes, which is a fancy way to state data binding, as the data then gets bound to the view in a decoupled fashion if you follow the example of using change notifier and provider together.</p><p>As one move towards stream and RxDart, it’s still data binding, but instead of a listener such as Change Notifier, we are using something else to do the data binding via RxDart’s use of functional programming to treat every change as a state event.</p><p>Notice that the advanced Data Binding part is outside the Flutter SDK. What is wrong with Change Notifier? When we remove items in very big models, that task is not O(N¹), meaning it takes a long time for big models to record the change, which designer-wise translates to non-responding UI. This is why the Flutter Community came up with RxDart.</p><p>But that is only data binding, and we still have the model dependency and business logic separation parts. Let’s tackle the model dependency part.</p><h3>Model Dependency In Views</h3><p>The whole reason we have to decouple the model dependency to the view is, so we can fully use it on multiple screens of the app. As otherwise, we would get two model instances that have different states. Now, I need to explain why Google does not use IoC.</p><p>Google, four years ago, did play with IoC model injection in the form of a package called inject:</p><p><a href="https://github.com/google/inject.dart">GitHub - google/inject.dart: Compile-time dependency injection for Dart and Flutter</a></p><p>It’s not maintained. So why the dead-end? Since it’s an IoC container, the dependencies are hidden from the developer as you do not see errors until you attempt to compile the application, which means it’s a high learning hurdle for beginning flutter app designers.</p><p>Now let’s dig into the SDK for just a moment. The Flutter SDK just like the Android SDK, has concepts of a Build Context, and yes Apple has it too, and they call their Build Context implementation context.</p><p>Google had the idea that if we integrated the model dependency with the widget lifecycle, we could get:</p><p>1. All the errors via devtools integration.</p><p>2. State management of the model dependency because it is integrated with the widget lifecycle.</p><p>But, they did not have time to devote to a full solution fully; so they just came up with the core of the Inherited Widget and Inherited model classes:</p><ul><li><a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html">InheritedWidget class - widgets library - Dart API</a></li><li><a href="https://api.flutter.dev/flutter/widgets/InheritedModel-class.html">InheritedModel class - widgets library - Dart API</a></li></ul><p>And the Flutter Community ran with this and created both Provider and Riverpod, with the provider part being a better-inherited widget and the provider consumer widget replacing the inherited model features and improving it.</p><p>And last is the business logic separated from the view part so that we eventually get a decoupled controller.</p><h3>Business Logic Decoupling</h3><p>Google first introduced BLoC in 2018 at Google IO:</p><p>In separating out the presentation (view) from business logic (controller) via some smart decoupling, we still are doing direct state management. And just like the model dependency solution of provider and riverpod BLoC re-uses the concept of putting the business-logic-controller in the widget lifecycle so that we correctly get our streams closed that BLoC uses.</p><p>And that use-case-command pattern from MVP got transformed into a BLoC event command pattern part of a BLoC controller.</p><p>So what is the desirable stack since Google does recommend BLoC for state management?</p><h3>The Flutter BLoC State Management Stack</h3><p>The beginning Flutter State Management Stack Is this:</p><p>1. Inherited Widget and Inherited Model</p><p><strong>2. Change Notifier</strong></p><p>And the intermediate step is:</p><p>1. Replace Inherited Widget and Inherited Model with either Provider or Riverpod</p><p><strong>2. Replace Change Notifier With Stream</strong></p><p><strong>3. Start Using BLoC as the Controller</strong></p><p>And then you move towards this:</p><p>1. Provider or Riverpod</p><p><strong>2. BLoC</strong></p><p><strong>3. RxDart way of using Streams</strong></p><h3>Provider And Riverpod BLoC Stacks</h3><p>Provider BLoC stack:</p><ol><li>BLoC</li></ol><p><a href="https://pub.dev/packages/bloc">bloc | Dart package</a></p><p>2. Flutter BLoC</p><p><a href="https://pub.dev/packages/flutter_bloc">https://pub.dev/packages/flutter_bloc</a></p><p>3. Bloc Test</p><p><a href="https://pub.dev/packages/bloc_test">bloc_test | Dart package</a></p><p>4. Bloc Concurrency</p><p><a href="https://pub.dev/packages/bloc_concurrency">bloc_concurrency | Dart package</a></p><p>5. Replay bloc</p><p><a href="https://pub.dev/packages/bloc_concurrency">bloc_concurrency | Dart package</a></p><p>6. Sealed Bloc</p><p><a href="https://pub.dev/packages/sealed_flutter_bloc">sealed_flutter_bloc | Flutter Package</a></p><p>Riverpod BLoC stack:</p><ol><li>River Bloc</li></ol><p><a href="https://pub.dev/packages/riverbloc">riverbloc | Dart Package</a></p><p>I am leaning towards always using the Provider and BLoC combination, as the riverpod BLoC implementation is not as robust feature-wise.</p><h3>Conclusion</h3><p>Despite that long state solution list that Google shows, they actually recommend the provider and BLoC combination for state management and that is somewhat fully reachable for every flutter app designer. And all it does is decouple the Model from the view and the controller from the view.</p><h3>About Me</h3><p>LinkedIn<br><a href="https://www.linkedin.com/in/ansh-goyal-03936a191/">https://www.linkedin.com/in/ansh-goyal-03936a191/</a></p><p>Twitter<br><a href="https://twitter.com/fredgrott">https://twitter.com/a</a>nshgoyal749</p><p>Github</p><ul><li><a href="https://github.com/anshgoyal1">anshgoyal1 - Overview</a></li><li><a href="https://www.buymeacoffee.com/anshgoyal7L">Ansh goyal</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1u9r8lH-USLPpDsm.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed25712dfc66" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/googles-recommended-flutter-state-management-ed25712dfc66">Google’s Recommended Flutter State Management</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Chrome Extensions To Boost Productivity By 269%]]></title>
            <link>https://faun.pub/10-chrome-extensions-to-boost-productivity-by-269-89bf78eeeae7?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/89bf78eeeae7</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Sun, 10 Jul 2022 14:23:56 GMT</pubDate>
            <atom:updated>2022-07-10T14:23:56.588Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*S8HSkC3zXTeVw_yH.png" /></figure><p>I asked, “what are the best browser extensions for browsers?”</p><p>I received 50+ replies. Here are the best 10 of them.</p><p>Browser extensions are a very powerful tool.</p><p>Extensions can not only enrich your web browsing experience but also provide insane value that will boost your overall productivity.</p><p>Here are 10 extensions every web developer should try:</p><ol><li><a href="https://www.wappalyzer.com/">Wappalyzer</a>:<br>Every time I see a website, I wonder what tech stack under the hood runs the site. Wappalyzer inspects the tech stack used in the website and lists all of them. It lists frontend libraries, frameworks, plugins, advertising networks, and everything that it is able to detect. It is a must-use for web developers.</li><li><a href="https://www.awesomescreenshot.com/">Awesome Screenshots:</a><br>As web developers, we have to constantly take screenshots for various purposes. <a href="https://www.awesomescreenshot.com/">Awesome Screenshots</a> make it easy for us to take screenshots of the browser. It has other features like <em>Full-page screenshots, screen recordings, custom area screenshots</em>, etc</li><li><a href="https://chrome.google.com/webstore/detail/site-palette/pekhihjiehdafocefoimckjpbkegknoh?hl=en-GB">Site Palette:</a><br>Finding a matching color theme for the webpage is quite a challenge. If you like the color theme of a certain website, you can copy that theme using this extension. The<a href="https://chrome.google.com/webstore/detail/site-palette/pekhihjiehdafocefoimckjpbkegknoh?hl=en-GB"> site palette</a> provides all the color palettes of the site.</li><li><a href="https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld?hl=en">User Javascript and CSS</a>:<br>This is a very useful extension for me personally. You can inject custom CSS and JS into any website you want. I have used this extension to hide <em>{display: none}</em> the Newsfeed of Facebook, trending hashtags into Twitter. Because it is annoying to me</li><li><a href="https://simplescraper.io/">SimpleScraper</a>:<br>This is an awesome extension. It allows you to extract data from any website intelligently and convert it into APIs or lets you download them in the desired format. I love this extension for many reasons 💞</li><li><a href="https://chrome.google.com/webstore/detail/octotree-github-code-tree/bkhaagjahfmjljalopjnoealnfndnagc">Octotree — Github Code Tree</a>:<br>Octotree allows you to browse code in GitHub faster. Whenever you are looking at a Github repo, you have to jump back and forth to understand the code. What octotree does is, that it lists all the files and folders on the left side of the browser, which makes it easier to browse the files of the project. It saves time ⌛</li><li><a href="https://chrome.google.com/webstore/detail/form-vault/lmhpmojffnpndeejifmkicggnilnlfem?hl=en">Form Vault</a>:<br>Remember the last, “Oh shit” moment, when everything you typed in online form got lost. Form Vault will save you from that, form vault allows you to save the form so that you don’t have to refill the form again because of some silly error. <a href="https://chrome.google.com/webstore/detail/form-vault/lmhpmojffnpndeejifmkicggnilnlfem?hl=en">Form Vault</a> is a time saver ⭐⭐⭐⭐⭐</li><li><a href="https://chrome.google.com/webstore/detail/web-developer-checklist/iahamcpedabephpcgkeikbclmaljebjp?hl=en">Web Developer Checklist</a>:<br>This extension will remind you of things and practices that you may miss when building a website. It will warn you about SEOs, Media Queries, Favicon, and Unfriendly Urls, <em>(small things that make a huge impact on website visitors)</em></li><li><a href="https://chrome.google.com/webstore/detail/jsonvue/chklaanhfefbnpoihckbnefhakgolnmc?hl=en">JsonVue</a>:<br>JsonVue will beautify JSON and make them readable and appealing to eyes 👀</li><li><a href="https://chrome.google.com/webstore/detail/temp-mail-disposable-temp/inojafojbhdpnehkhhfjalgjjobnhomj?hl=en">Temp Mail — Disposable Temporary Email</a>:<br>This is a very useful tool. It provides you temporary mail for a certain time which you can use if you don’t want your email to be in any newsletter</li></ol><p>These are the 10 most essential productivity tools. These tools I mentioned are very useful and are time savers.</p><p>I am</p><p>Ansh Goyal</p><p>. Thanks for reading my article</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*2fTMBZvOYNRwx4Dg.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89bf78eeeae7" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/10-chrome-extensions-to-boost-productivity-by-269-89bf78eeeae7">10 Chrome Extensions To Boost Productivity By 269%</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pusher Docs for creating real time Messaging with Flutter]]></title>
            <link>https://faun.pub/pusher-docs-for-creating-real-time-messaging-with-flutter-363df86c78d2?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/363df86c78d2</guid>
            <category><![CDATA[messaging]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Wed, 01 Jun 2022 00:32:02 GMT</pubDate>
            <atom:updated>2022-06-01T00:32:02.920Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the <a href="https://pusher.com/channels">Pusher Channels</a> Flutter client.</p><p>For tutorials and more in-depth information about Pusher Channels, visit our <a href="https://pusher.com/docs/channels">official docs</a>.</p><h3>Supported Flutter platforms</h3><ul><li>Android through <a href="https://github.com/pusher/pusher-websocket-java">pusher-websocket-java</a></li><li>iOS through <a href="https://github.com/pusher/pusher-websocket-swift">pusher-websocket-swift</a></li><li>Web through <a href="https://github.com/pusher/pusher-js">pusher-js</a></li></ul><h3>Deployment targets</h3><ul><li>iOS 13.0 and above</li><li>Android 6.0 and above</li><li>Web Chrome/Edge/Firefox/Safari.</li></ul><h3>Example Application</h3><p>By cloning this repository you can check the Flutter example application, a minimal application to connect to a channel and send events.</p><ul><li><a href="https://github.com/pusher/pusher-channels-flutter/tree/master/example">https://github.com/pusher/pusher-channels-flutter/tree/master/example</a></li></ul><h3>Table of Contents</h3><ul><li><a href="https://github.com/pusher/pusher-channels-flutter#pusher-channels-flutter-client">Pusher Channels Flutter Client</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#supported-flutter-platforms">Supported Flutter platforms</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#deployment-targets">Deployment targets</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#example-application">Example Application</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#table-of-contents">Table of Contents</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#installation">Installation</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#ios-specific-installation">iOS specific installation</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#android-specific-installation">Android specific installation</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#web-specific-installation">Web specific installation</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#initialization">Initialization</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#configuration">Configuration</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#activitytimeout-double">activityTimeout (double)</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#apikey-string">apiKey (String)</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#authparams-map">authParams (Map)</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#authendpoint-string">authEndpoint (String)</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#cluster-string">cluster (String)</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#usetls-bool">useTLS (bool)</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#event-callback-parameters">Event Callback parameters</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onevent">onEvent</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onsubscriptionsucceeded">onSubscriptionSucceeded</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onsubscriptionerror">onSubscriptionError</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#ondecryptionfailure">onDecryptionFailure</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onmemberadded">onMemberAdded</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onmemberremoved">onMemberRemoved</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onauthorizer">onAuthorizer</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onconnectionstatechange">onConnectionStateChange</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#onerror">onError</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#connection-handling">Connection handling</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#connecting">Connecting</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#disconnecting">Disconnecting</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#reconnection">Reconnection</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#subscribing">Subscribing</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#public-channels">Public channels</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#private-channels">Private channels</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#private-encrypted-channels">Private encrypted channels</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#limitations">Limitations</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#presence-channels">Presence channels</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#unsubscribing">Unsubscribing</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#binding-to-events">Binding to events</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#per-channel-events">Per-channel events</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#global-events">Global events</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#pusherevent">PusherEvent</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#parsing-event-data">Parsing event data</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#receiving-errors">Receiving errors</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#triggering-events">Triggering events</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#socket-information">Socket information</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#communication">Communication</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#credits">Credits</a></li><li><a href="https://github.com/pusher/pusher-channels-flutter#license">License</a></li></ul><h3>Installation</h3><p>To integrate the plugin in your Flutter App, you need to add the plugin to your pubspec.yaml:</p><pre>dependencies:<br>  pusher_channels_flutter: &#39;^1.0.1&#39;</pre><h3>iOS specific installation</h3><p>The Pusher Channels Flutter plugin adds the pusher-websocket-swift cocoapod to your project. You probably need to run a</p><pre>$ pod install</pre><p>in the ios directory.</p><h3>Android specific installation</h3><p>Gradle should automatically include the pusher-websocket-java dependency.</p><h3>Web specific installation</h3><p>For web this plugin uses pusher-js, you can load it from the Pusher CDN, or add it locally. You probably want to include it in the head of your index.html page:</p><pre>&lt;head&gt;<br>  &lt;script<br>    charset=&quot;utf-8&quot;<br>    src=&quot;https://js.pusher.com/7.0/pusher.min.js&quot;<br>  &gt;&lt;/script&gt;<br>  ...<br>&lt;/head&gt;</pre><h3>Initialization</h3><p>The PusherChannelFlutter class is a singleton, that can be instantiated with getInstance(). Then you need to initialize the client with a number of configuration options, here is a quick example with a number of callbacks options:</p><pre>PusherChannelsFlutter pusher = PusherChannelsFlutter.getInstance();<br>try {<br>  await pusher.init(<br>    apiKey: API_KEY,<br>    cluster: API_CLUSTER,<br>    onConnectionStateChange: onConnectionStateChange,<br>    onError: onError,<br>    onSubscriptionSucceeded: onSubscriptionSucceeded,<br>    onEvent: onEvent,<br>    onSubscriptionError: onSubscriptionError,<br>    onDecryptionFailure: onDecryptionFailure,<br>    onMemberAdded: onMemberAdded,<br>    onMemberRemoved: onMemberRemoved,<br>    // authEndpoint: &quot;&lt;Your Authendpoint&gt;&quot;,<br>    // onAuthorizer: onAuthorizer<br>  );<br>  await pusher.subscribe(channelName: &#39;presence-chatbox&#39;);<br>  await pusher.connect();<br>} catch (e) {<br>  print(&quot;ERROR: $e&quot;);<br>}</pre><p>After calling init(...) you can connect to the Pusher servers. You can subscribe to channels before calling connect()</p><h3>Configuration</h3><p>There are a number of configuration parameters which can be set for the Pusher client. The following table describes for which platform the parameter is available:</p><p>parameterAndroidiOSWebactivityTimeout</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*lyzHP7Voc0w-PWWO.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*a05wbKttm_VdGpmq.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*Wk6PABJDeVzgOZ7N.png" /></figure><p>apiKey</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*HgE6tvrRBbZRawwr.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*GZBQaCcLyYtuOB_Z.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*2f4PDWSf-7UJ-P76.png" /></figure><p>authParam</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*ePfK1Am_FxuWI2z0.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*xDI8bZ-c5I9YsE7M.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*KE8CPWMEl7erR2wm.png" /></figure><p>authEndpoint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*xGsr_W_3yT_I2a59.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*RqvMD7BKJNwLgcL2.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*L4pMygQ2GT-MNt2d.png" /></figure><p>authTransport</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*nSEb86gvnxykxs2C.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*HCUtNExEo5FNB5X3.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*ZrTgtkqWbdSqwLmV.png" /></figure><p>cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*qi2t4I-7z0wM4Zyq.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*cGLb_9aoRbfnyiIV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*IqTYaN-50_IcZCrn.png" /></figure><p>disabledTransports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*utXD1Mcf3alkAQeM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*irxQ_BPISL3xfwUH.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*5-SrG3enjqlF1rly.png" /></figure><p>enabledTransports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*Ds8Hh8vBpNyLG2e5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*o03JMDRhp2eT2cLP.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*Qa8dEdX8P2xuGnmi.png" /></figure><p>enableStats</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*xY-KuahhFEkBi15Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*UE-bG6VKCA1I8wv5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*CC3FRuWMNMhhE9P0.png" /></figure><p>ignoreNullOrigin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*7Qc73PIv_fbeBWap.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*h1vJ6eafWyifwtdx.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*hG1VAwzlho04grIG.png" /></figure><p>logToConsole</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*E1-6jttuEZBojPtM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*yTNlmh0wQ015JW5x.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*_4VMukvf4jwLh1y3.png" /></figure><p>maxReconnectGapInSeconds</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*fupVynAQkzHhq129.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*MyyqbkP2U3uCwVq5.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*KxQ58R3ygkjjXd-G.png" /></figure><p>maxReconnectionAttempts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*M0FJd48w4czDHpar.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*kOjmI5h1RKHOL0UW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*uqLWFqO-w3UyZxeF.png" /></figure><p>pongTimeout</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*ix6eCFu-KQ27_m8T.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*Mg809k8R87ItjyRC.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*8RxhTYW-z1rW4oRv.png" /></figure><p>proxy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*13k8xGE96kbxtYHS.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*JmEo5mhXBkHaX60K.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*pSeCOppOGNCZG2bA.png" /></figure><p>useTLS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*mN2DUEx_1sAtqY_z.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*Guh7R1vWF_Tk9WKd.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*WFpLBUYWPBKViMmM.png" /></figure><h4>activityTimeout (double)</h4><p>After this time (in seconds) without any messages received from the server, a ping message will be sent to check if the connection is still working; the default value is supplied by the server, low values will result in unnecessary traffic.</p><h4>apiKey (String)</h4><p>You can get your API_KEY and API_CLUSTER from the <a href="https://dashboard.pusher.com/">Pusher Channels dashboard</a>.</p><h4>authParams (Map)</h4><p>Allows passing additional data to authorizers. Supports query string params and headers (AJAX only). For example, following will pass foo=bar via the query string and baz: boo via headers:</p><pre>final pusher = PusherChannelsFlutter.getInstance()<br>await pusher.init(<br>  apiKey: API_KEY,<br>  cluster: API_CLUSTER,<br>  authParams: {<br>    params: { foo: &#39;bar&#39; },<br>    headers: { baz: &#39;boo&#39; }<br>  }<br>});</pre><p>Additional parameters to be sent when the channel authentication endpoint is called. When using <a href="https://pusher.com/docs/authenticating_users#ajax_authentication">ajax authentication</a> the parameters are passed as additional POST parameters. When using <a href="http://pusher.com/docs/authenticating_users#jsonp_authentication">jsonp authentication</a> the parameters are passed as GET parameters. This can be useful with web application frameworks that guard against <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF (Cross-site request forgery)</a>.</p><p>CSRF</p><p>If you require a CSRF header for incoming requests to the private channel authentication endpoint on your server, you should add a CSRF token to the auth hash under headers. This is applicable to frameworks which apply CSRF protection by default.</p><pre>final pusher = await pusher.init(<br>  apiKey: API_KEY,<br>  cluster: API_CLUSTER,<br>  authParams: {<br>    params: { foo: &#39;bar&#39; },<br>    headers: { &#39;X-CSRF-Token&#39;: &#39;SOME_CSRF_TOKEN&#39; }<br>  }<br>);</pre><h4>authEndpoint (String)</h4><p>The authEndpoint provides a URL that the Pusher client will call to authorize users for a presence channel. On how to implement an authorization service please check here:</p><p><a href="https://pusher.com/docs/channels/server_api/authenticating-users/">https://pusher.com/docs/channels/server_api/authenticating-users/</a></p><h4>cluster (String)</h4><p>Specifies the cluster that pusher-js should connect to. <a href="https://pusher.com/docs/clusters">If you’d like to see a full list of our clusters, click here</a>. If you do not specify a cluster, mt1 will be used by default.</p><h4>useTLS (bool)</h4><p>Whether or not you’d like to use TLS encrypted transport or not, default is true</p><h3>Event Callback parameters</h3><p>The following functions are callbacks that can be passed to the init() method. All are optional.</p><h4>onEvent</h4><pre>void onEvent(PusherEvent event) {<br>  print(&quot;onEvent: $event&quot;);<br>}</pre><p>Called when a event is received by the client. The global event handler will trigger on events from any channel.</p><h4>onSubscriptionSucceeded</h4><pre>void onSubscriptionSucceeded(String channelName, dynamic data) {<br>  print(&quot;onSubscriptionSucceeded: $channelName data: $data&quot;);<br>}</pre><p>use this if you want to be informed of when a channel has successfully been subscribed to, which is useful if you want to perform actions that are only relevant after a subscription has succeeded. For example querying the members for presence channel.</p><h4>onSubscriptionError</h4><pre>void onSubscriptionError(String message, dynamic e) {<br>  print(&quot;onSubscriptionError: $message Exception: $e&quot;);<br>}</pre><p>use this if you want to be informed of a failed subscription attempt, which you could use, for example, to then attempt another subscription or make a call to a service you use to track errors.</p><h4>onDecryptionFailure</h4><pre>void onDecryptionFailure(String event, String reason) {<br>  print(&quot;onDecryptionFailure: $event reason: $reason&quot;);<br>}</pre><p>only used with private encrypted channels — use this if you want to be notified if any messages fail to decrypt.</p><h4>onMemberAdded</h4><pre>void onMemberAdded(String channelName, PusherMember member) {<br>  print(&quot;onMemberAdded: $channelName member: $member&quot;);<br>}</pre><p>Called when a member is added to the presence channel.</p><h4>onMemberRemoved</h4><pre>void onMemberRemoved(String channelName, PusherMember member) {<br>  print(&quot;onMemberRemoved: $channelName member: $member&quot;);<br>}</pre><p>Called when a member is removed to the presence channel.</p><h4>onAuthorizer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/0*lYArHr-w6s7yTe2s.png" /></figure><blockquote><em>Currently on web release/profile mode this doesn’t work, we’re still investigating this.</em></blockquote><p>When passing the onAuthorizer() callback to the init() method, this callback is called to request auth information. For more information on how to generate the correct information, please look here: <a href="https://pusher.com/docs/channels/library_auth_reference/auth-signatures/">https://pusher.com/docs/channels/library_auth_reference/auth-signatures/</a></p><pre>dynamic onAuthorizer(String channelName, String socketId, dynamic options) async {<br>  return {<br>    &quot;auth&quot;: &quot;foo:bar&quot;,<br>    &quot;channel_data&quot;: &#39;{&quot;user_id&quot;: 1}&#39;,<br>    &quot;shared_secret&quot;: &quot;foobar&quot;<br>  };<br>}</pre><h4>onConnectionStateChange</h4><pre>void onConnectionStateChange(dynamic currentState, dynamic previousState) {<br>  print(&quot;Connection: $currentState&quot;);<br>}</pre><p>use this if you want to use connection state changes to perform different actions / UI updates The different states that the connection can be in are:</p><ul><li>CONNECTING - the connection is about to attempt to be made</li><li>CONNECTED - the connection has been successfully made</li><li>DISCONNECTING - the connection has been instructed to disconnect and it is just about to do so</li><li>DISCONNECTED - the connection has disconnected and no attempt will be made to reconnect automatically</li><li>RECONNECTING - an attempt is going to be made to try and re-establish the connection</li></ul><h4>onError</h4><pre>void onError(String message, int? code, dynamic e) {<br>  print(&quot;onError: $message code: $code exception: $e&quot;);<br>}</pre><p>use this if you want to be informed of errors received from Pusher Channels e.g. Application is over connection quota. You can find some of the possible errors listed <a href="https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol#error-codes">here</a>.</p><h3>Connection handling</h3><h3>Connecting</h3><p>To connect to the Pusher network, just call the connect() method.</p><pre>await pusher.connect();</pre><h3>Disconnecting</h3><p>To disconnect to the Pusher network, just call the disconnect() method.</p><pre>await pusher.disconnect();</pre><h3>Reconnection</h3><p>There are three main ways in which a disconnection can occur:</p><ul><li>The client explicitly calls disconnect and a close frame is sent over the websocket connection</li><li>The client experiences some form of network degradation which leads to a heartbeat (ping/pong) message being missed and thus the client disconnects</li><li>The Pusher server closes the websocket connection; typically this will only occur during a restart of the Pusher socket servers and an almost immediate reconnection should occur</li></ul><p>In the case of the first type of disconnection the library will (as you’d hope) not attempt a reconnection.</p><h3>Subscribing</h3><h3>Public channels</h3><p>The default method for subscribing to a channel involves invoking the subscribe method of your client object:</p><pre>final myChannel = await pusher.subscribe(channelName: &quot;my-channel&quot;);</pre><h3>Private channels</h3><p>Private channels are created in exactly the same way as public channels, except that they reside in the ‘private-’ namespace. This means prefixing the channel name:</p><pre>final myPrivateChannel = await pusher.subscribe(channelName: &quot;private-my-channel&quot;)</pre><p>Subscribing to private channels involves the client being authenticated. See the <a href="https://github.com/pusher/pusher-channels-flutter#configuration">Configuration</a> section for the authenticated channel example for more information.</p><h3>Private encrypted channels</h3><p>Similar to Private channels, you can also subscribe to a <a href="https://pusher.com/docs/channels/using_channels/encrypted-channels">private encrypted channel</a>. This library now fully supports end-to-end encryption. This means that only you and your connected clients will be able to read your messages. Pusher cannot decrypt them.</p><p>Like with private channels, you must provide an authentication endpoint. That endpoint must be using a <a href="https://pusher.com/docs/channels/using_channels/encrypted-channels#server">server client that supports end-to-end encryption</a>. There is a <a href="https://github.com/pusher/pusher-channels-auth-example#using-e2e-encryption">demonstration endpoint to look at using nodejs</a>.</p><p>The shared secret used to decrypt events is loaded from the same auth endpoint request that is used to authorize your subscription. There is also a mechanism for reloading the shared secret if your encryption master key changes. If an event is encountered that cannot be decrypted, a request is made to your auth endpoint to attempt to load the new shared secret. If that request fails or if the returned secret still cannot decrypt the event then that event will be skipped, the onDecryptionFailure callback function will be called, and the next received event will be processed.</p><h4>Limitations</h4><ul><li>Client events are not supported on encrypted channels</li></ul><pre>final privateEncryptedChannel = await pusher.subscribe(channelName: &quot;private-encrypted-my-channel&quot;)</pre><p>There is also an optional callback in the connection delegate when you can listen for any failed decryption events:</p><pre>optional func void onDecryptionFailure(String event, String reason)</pre><h3>Presence channels</h3><p>Presence channels are channels whose names are prefixed by presence-.</p><p>The resulting channel object has a member: members that contains the active members of the channel.</p><pre>final myPresenceChannel = await pusher.subscribe(channelName: &quot;presence-my-channel&quot;)</pre><p>You can also provide functions that will be called when members are either added to or removed from the channel. These are available as parameters to init() globally, or to subscribe() per channel.</p><pre>void onMemberAdded(String channelName, PusherMember member) {<br>  print(&quot;onMemberAdded: $channelName user: $member&quot;);<br>}</pre><pre>void onMemberRemoved(String channelName, PusherMember member) {<br>  print(&quot;onMemberRemoved: $channelName user: $member&quot;);<br>}</pre><p>Note: The members property of PusherChannel objects will only be set once subscription to the channel has succeeded.</p><p>The easiest way to find out when a channel has been successfully subscribed to is to bind to the callback named onSubscriptionSucceeded on the channel you&#39;re interested in. It would look something like this:</p><pre>final pusher = PusherChannelsFlutter.getInstance();<br>final channels = {};<br>await pusher.init(<br>  apiKey: API_KEY,<br>  cluster: API_CLUSTER,<br>  authEndPoint: &quot;https://your-server.com/pusher/auth&quot;<br>);<br>final myChannel = await pusher.subscribe(<br>  channelName:&#39;presence-my-channel&#39;,<br>  onSubscriptionSucceeded: (channelName, data) {<br>    print(&quot;Subscribed to $channelName&quot;);<br>    print(&quot;I can now access me: ${myChannel.me}&quot;)<br>    print(&quot;And here are the channel members: ${myChannel.members}&quot;)<br>  },<br>  onMemberAdded: (member) {<br>    print(&quot;Member added: $member&quot;);<br>  },<br>  onMemberRemoved: (member) {<br>    print(&quot;Member removed: $member&quot;);<br>  },<br>  onEvent: (event) {<br>    print(&quot;Event received: $event&quot;);<br>  },<br>);</pre><p>Note that both private and presence channels require the user to be authenticated in order to subscribe to the channel. This authentication can either happen inside the library, if you configured your Pusher object with your app’s secret, or an authentication request is made to an authentication endpoint that you provide, again when initializing your Pusher object.</p><p>We recommend that you use an authentication endpoint over including your app’s secret in your app in the vast majority of use cases. If you are completely certain that there’s no risk to you including your app’s secret in your app, for example if your app is just for internal use at your company, then it can make things easier than setting up an authentication endpoint.</p><h3>Unsubscribing</h3><p>To unsubscribe from a channel, call the unsubscribe() method:</p><pre>await pusher.unsubscribe(&quot;my-channel&quot;);</pre><h3>Binding to events</h3><p>Events can be bound to at 2 levels; globally and per channel. There is an example of this below.</p><h3>Per-channel events</h3><p>These are bound to a specific channel, and mean that you can reuse event names in different parts of your client application.</p><pre>final pusher = PusherChannelsFlutter.getInstance();<br>await pusher.init(<br>  apiKey: API_KEY,<br>  cluster: API_CLUSTER<br>);<br>final myChannel = await pusher.subscribe(<br>  channelName: &quot;my-channel&quot;,<br>  onEvent: (event) {<br>    print(&quot;Got channel event: $event&quot;);<br>  }<br>);<br>await pusher.connect();</pre><h3>Global events</h3><p>You can attach behavior to these events regardless of the channel the event is broadcast to.</p><pre>final pusher = PusherChannelsFlutter.getInstance();<br>await pusher.init(<br>  apiKey: API_KEY,<br>  cluster: API_CLUSTER,<br>  onEvent: (event) {<br>    print(&quot;Got event: $event&quot;);<br>  }<br>);<br>final myChannel = await pusher.subscribe(<br>  channelName: &quot;my-channel&quot;<br>);</pre><h3>PusherEvent</h3><p>The callbacks you bind receive a PusherEvent:</p><pre>class PusherEvent {<br>  String channelName; // Name of the channel.<br>  String eventName; // Name of the event.<br>  dynamic data; // Data, usually JSON string. See [parsing event data](#parsing-event-data).<br>  String? userId; // UserId of the sending event, only for client events on presence channels.<br>}</pre><h4>Parsing event data</h4><p>The data property of <a href="https://github.com/pusher/pusher-channels-flutter#pusherevent">PusherEvent</a> contains the string representation of the data that you passed when you triggered the event. If you passed an object then that object will have been serialized to JSON. You can parse that JSON as appropriate.</p><h3>Receiving errors</h3><p>Errors received from Pusher Channels can be accessed via the onError callback.</p><pre>void onError(String message, int? code, dynamic e) {<br>  print(&quot;onError: $message code: $code exception: $e&quot;);<br>}</pre><h3>Triggering events</h3><p>Once a <a href="https://pusher.com/docs/channels/using_channels/private-channels">private</a> or <a href="https://pusher.com/docs/channels/using_channels/presence-channels">presence</a> subscription has been authorized (see <a href="https://pusher.com/docs/channels/server_api/authenticating-users">authenticating users</a>) and the subscription has succeeded, it is possible to trigger events on those channels. You can do this per channel, or on the global PusherChannelsFlutter instance.</p><pre>await myChannel.trigger(eventName: &quot;client-my-event&quot;, data: [&quot;myName&quot;: &quot;Bob&quot;]);</pre><p>Or on the global pusher instance:</p><pre>await pusher.trigger(channelName: &quot;my-channel&quot;, eventName: &quot;client-my-event&quot;, data: [&quot;myName&quot;: &quot;Bob&quot;]);</pre><p>Events triggered by clients are called <a href="https://pusher.com/docs/channels/using_channels/events#triggering-client-events">client events</a>. Because they are being triggered from a client which may not be trusted there are a number of enforced rules when using them. Some of these rules include:</p><ul><li>Event names must have a client- prefix</li><li>Rate limits</li><li>You can only trigger an event when the subscription has succeeded</li></ul><p>For full details see the <a href="https://pusher.com/docs/channels/using_channels/events#triggering-client-events">client events documentation</a>.</p><h3>Get a channel by name</h3><p>To get the PusherChannel instance from the Pusher instance you can use the getChannel(&lt;channelName&gt;) method:</p><pre>final channel = pusher.getChannel(&quot;presence-channel&quot;);</pre><h3>Socket information</h3><p>To get information from the current socket call the getSocketId() method:</p><pre>final socketId = await pusher.getSocketId();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CpZxvZfN9isNM1vF.png" /></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</h4><h4>🚀Developers: Learn and grow by keeping up with what matters, <a href="https://faun.to/8zxxd">JOIN FAUN.</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=363df86c78d2" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/pusher-docs-for-creating-real-time-messaging-with-flutter-363df86c78d2">Pusher Docs for creating real time Messaging with Flutter</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a simple YouTube Video Downloader using Python]]></title>
            <link>https://faun.pub/creating-a-simple-youtube-video-downloader-using-python-28c6bd546dd3?source=rss-f147b4645b77------2</link>
            <guid isPermaLink="false">https://medium.com/p/28c6bd546dd3</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[download]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ansh Goyal]]></dc:creator>
            <pubDate>Fri, 20 May 2022 07:17:03 GMT</pubDate>
            <atom:updated>2022-05-25T15:59:00.709Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*A2c6ldfFeEXUULlF" /></figure><p>YouTube is an internationally known website for sharing videos. Unfortunately, when you use an online downloader to download a video or try to get it from a random website, you face the danger of your personal information being stolen.</p><h3>Introduction</h3><p>The task of downloading videos is incredibly straightforward, efficient, and safe while using the Python Tkinter module. Moreover, it gets the video directly from YouTube for you.</p><h3>Table of Contents</h3><ul><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#introduction">Introduction</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#table-of-contents">Table of Contents</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#requirements">Requirements</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#installations">Installations</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#installing-pytube-module">Installing PyTube module</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#install-tkinter">Install <strong>Tkinter</strong></a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#building-the-apigui">Building the API/GUI</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#1import-libraries-needed-in-the-project">1. Import Libraries needed in the project</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#2-create-the-api-window">2. Create the API window</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#3-create-the-link-entry">3. Create the link entry</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#4-create-the-download-button">4. Create the download button</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#creating-the-download-function">Creating the download function</a></li><li><a href="https://www.section.io/engineering-education/youtube-video-downloader-using-python/#conclusion">Conclusion</a></li></ul><h3>Requirements</h3><p>To develop a video downloader, you should have;</p><ul><li>An understanding of Python programming language.</li><li>Python package installed on your PC.</li><li>An editor of your choice.</li><li><strong>Tkinter</strong> — A Python module for creating GUIs.</li><li><strong>Pytube</strong> — Downloads the video from YouTube.</li></ul><h3>Installations</h3><p>Requirements need to be ready before you start your development process. A Python environment is a foremost requirement for this project. You can follow <a href="https://www.section.io/engineering-education/introduction-to-virtual-environments-and-dependency-managers/">these directives</a> to set up a Python environment on your PC. A crucial module needs to be installed, which is the beginning of the development process.</p><h4>Installing PyTube module</h4><p>To install Pytube using pip, open your command prompt CLI on your machine and type in the following command.</p><pre>pip install PyTube</pre><h4>Install Tkinter</h4><p>Like PyTube, the pip command is used to install any other Python module. For example, install Tkinter as shown below since it is required to develop the user interface.</p><pre>pip install Tkinter</pre><p>If you get errors while installing, please ensure that your Python package is installed correctly using the correct <a href="https://www.python.org/about/gettingstarted/">defaults</a>. Once it is successfully installed, you can start coding your API as instructed in the development section below.</p><h3>Building the API/GUI</h3><p>In this section, you will design the interface for the application. Since the article builds the downloading functionality, the interface will be minimalistic.</p><p>If you want to add more features to your API and make it more appealing, you can refer to this <a href="https://www.section.io/engineering-education/introduction-to-gui-in-python-using-tkinter/">article</a> to get more understanding of Tkinter GUI development. First, however, the following steps need to be followed.</p><h4>1. Import Libraries needed in the project</h4><p>After installing the modules, you need to import the libraries required in your application. Importing them allows them to act as a part of your project. Here is the right way to import them.</p><pre># import all Tkinter libraries from the module<br>from Tkinter import * <br># From the  installed Pytube module, import the youtube library<br>from Pytube import YouTube</pre><h4>2. Create the API window</h4><pre>root = Tk()<br>root.geometry(&#39;500 X 300&#39;) # Size of the window<br>root.resizable(0, 0) # makes the window adjustable with its features<br>root.title(&#39;youtube downloader&#39;)</pre><pre>root.mainloop()</pre><p>When you run the code so far, an empty window is displayed with the title in the code above. The rest of the code will fall in between the Tk() and the mainloop().</p><h4>3. Create the link entry</h4><p>Here you will create an entry where you can paste your link. The code is as follows;</p><pre>Label(root, text=&quot;Download Youtube videos for free&quot;, font=&#39;san-serif 14 bold&#39;).pack()<br>link = StringVar() # Specifying the variable type<br>Label(root, text=&quot;Paste your link here&quot;, font=&#39;san-serif 15 bold&#39;).place(x=150, y=55)<br>link_enter = Entry(root, width=70, textvariable=link).place(x=30, y=85)</pre><p>After running the code, the window will appear as shown in the photo below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*IpKPp7lwK9Ga2SEe.png" /></figure><h4>4. Create the download button</h4><p>The download button allows you to download the video by calling the download function in the next step. It only takes one line of code, as shown in the code block below.</p><pre>Button(root, text=&#39;Download&#39;, font=&#39;san-serif 16 bold&#39;, bg=&#39;red&#39;, padx=2,command=&quot;download&quot;).place(x=100, y=150)</pre><p>The command download is the attribute that initiates the download process when the button is pressed. It is called from the download function created below for getting the video from YouTube.</p><h3>Creating the download function</h3><p>Up to this point, you have made a GUI where you can paste your link from youtube, but the download button is not yet functional. So, to fetch the video using the URL, you will have to create a download function called the download button.</p><p>The code below is a python function titled, which reads the URL entered, connects to youtube, and downloads the video. The comments help you know the importance of every line of code and what it does.</p><pre>def download():<br>    url = YouTube(str(link.get())) #This captures the link(url) and locates it from YouTube.<br>    video = url.streams.first() # This captures the streams available for downloaded for the video i.e. 360p, 720p, 1080p. etc.<br>    video.download() # This is the method with the instruction to download the video.<br>    Label(root, text=&quot;Downloaded&quot;, font=&quot;arial 15&quot;).place(x=100, y=120) #Once the video is downloaded, this label `downloaded` is displayed to show dowload completion.</pre><p>Copy and paste a link from a YouTube video to test your API, and click the download button. The video is saved in your project folder when logged into a network. The completed GUI is now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*Ro3AVrLaqul20J-E.png" /></figure><h3>Conclusion</h3><p>To this point, we have successfully constructed a youtube video downloader application in Python. First, for rendering graphics, we have used the well-known Tkinter package. Next, we used the Pytube library to create a fully functional GUI to fetch videos from Youtube.</p><p>I hope you found this tutorial helpful.</p><figure><a href="https://faun.to/bP1m5"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BCiLLad3dvZLwBa-B5cAVQ.png" /></a></figure><p>Join FAUN: <a href="https://faun.to/i9Pt9"><strong>Website</strong></a><strong> </strong>💻<strong>|</strong><a href="https://faun.dev/podcast"><strong>Podcast</strong></a><strong> </strong>🎙️<strong>|</strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong>|</strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong>|</strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷|<a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>🗣️<strong>|</strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin Group</strong></a><strong> </strong>💬<strong>|</strong> <a href="https://faun.dev/chat"><strong>Slack</strong></a> 📱<strong>|</strong><a href="https://thechief.io/"><strong>Cloud Native</strong> <strong>News</strong></a><strong> </strong>📰<strong>|</strong><a href="https://linktr.ee/faun.dev/"><strong>More</strong></a><strong>.</strong></p><p><strong>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author 👇</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28c6bd546dd3" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/creating-a-simple-youtube-video-downloader-using-python-28c6bd546dd3">Creating a simple YouTube Video Downloader using Python</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>