<?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 Sai Ankit on Medium]]></title>
        <description><![CDATA[Stories by Sai Ankit on Medium]]></description>
        <link>https://medium.com/@saiankit?source=rss-ede22013a73d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e-rbHg2MU2afLz6G8-qTkQ.png</url>
            <title>Stories by Sai Ankit on Medium</title>
            <link>https://medium.com/@saiankit?source=rss-ede22013a73d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:29:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saiankit/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[How to send custom WhatsApp messages to your contacts at once in bulk ?]]></title>
            <link>https://saiankit.medium.com/how-to-send-custom-whatsapp-messages-to-your-contacts-at-once-in-bulk-438ea7dc5d05?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/438ea7dc5d05</guid>
            <category><![CDATA[pywhatkit]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[whatsapp]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Wed, 31 Aug 2022 11:04:07 GMT</pubDate>
            <atom:updated>2022-08-31T11:04:07.683Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to send custom WhatsApp messages to your contacts at once in bulk ?</h3><p>I wanted to send custom wishes to everyone in my contacts with an image, just like the one mentioned below, and writing this message for around 400+ contacts on my phone is not humane. Then I thought to use some pre-existing python libraries to perform this task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*bqWtosM5FrAJMBWL16Rs0A.png" /></figure><p><strong>Step 1</strong> : Get all your contacts details as CSV</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNJ_hr7FSEvJcHNhPVKG2w.png" /></figure><p>You can export contacts from your google contacts and save them as CSV. Also, do remove all the unnecessary columns from the CSV and keep only the name and phone number column in the output CSV.</p><h4>Prerequisites for your system</h4><ol><li>Install python3</li><li>Install pandas and pywhatkit<br>pip3 install pandas<br>pip3 install pywhatkit</li></ol><p><strong>Step 2</strong> : Run this following script to clean the content ( i.e, phone number to make it acceptable for WhatsApp script )</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/70d7c5b937d4fc602d7aaa7abac3e268/href">https://medium.com/media/70d7c5b937d4fc602d7aaa7abac3e268/href</a></iframe><p>This cleans different formats of phone numbers in your contact list.</p><p>Step 3 : The actual script to send WhatsApp messages</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e81789dfc66d3777a8ce76677b70e78a/href">https://medium.com/media/e81789dfc66d3777a8ce76677b70e78a/href</a></iframe><pre>pw.sendwhats_image(&quot;+&quot; + str(j[&quot;phone_number&quot;]), &quot;image.jpg&quot;, &quot;Wishes &quot; + j[&quot;name&quot;])</pre><p>This is the actual command that sends the message to each contact. Note that this script only sends images in jpg format, not any other types. The first argument is the phone number. The second argument is the image location. The third argument is the caption for the image being sent. Ensure the script and image are inside the same folder or use the image’s relative location in the second argument position.</p><p>TADA Wait for one hour to send at least 250 messages</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xfdJ3-h-jZq_eOp_QhLk9A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=438ea7dc5d05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to setup custom search engines ( for Youtube, Amazon, etc )in chrome/brave]]></title>
            <link>https://saiankit.medium.com/how-to-setup-custom-search-engines-for-youtube-amazon-etc-in-chrome-brave-fdfd08dd9aa4?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdfd08dd9aa4</guid>
            <category><![CDATA[brave-browser]]></category>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[chrome]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 14:14:15 GMT</pubDate>
            <atom:updated>2022-07-19T14:14:15.963Z</atom:updated>
            <content:encoded><![CDATA[<p>You might visit some common sites all over the day multiple times for searching something on it, and to do it you visit the site main page initially and then enter your query in the search box. This might be tedious considering you waste a lot of time opening the main page, and navigating to the search bar. But no more wasting of time, I am here to help you setup shortcuts which help you directly enter your query in the new tab search bar, and you get your desired result. Isn’t it exciting ? Let’s get to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*KTXZI10PS22Pj4ZRheI-zA.gif" /><figcaption>Searching without hotkeys</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*6bdZTDtMIMoRRZkUHf_Ljg.gif" /><figcaption>Searching using Hotkey</figcaption></figure><p>PS: I am using a brave browser for explanation, but you can use any chromium based browser of choice, and it is pretty much the same in all browsers.</p><p>Step 1: Head over to the settings page of your browser.</p><p>Step 2: Find an option where you see options such as Search Engine or Manage Search Engines and Search.</p><p>Step 3: Find this option and hit on <strong>Add</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vIVhhohPfalbvReeogeJTw.png" /></figure><p>Step 4:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90dx3XTaJLaxVmxqMjyugQ.png" /></figure><p>Here are the 3 fields you need to enter for your custom search engine.</p><p>Search Engine : This denotes the name of the search engine ( Ex : Youtube )</p><p>Shortcut : This is the shortcut you hit in new tab page to enter into the search engine of the desired page</p><p>URL : This is the place you need to enter the url of search engine you are aiming for, and you have to grab the URL after you search some random keyword, replace the keyword with %s</p><p>Let’s do an example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inZwaxxKZIxIiMBTCiRlYQ.png" /><figcaption>This is the custom search engine for YouTube</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkYzIHTpgoN8Ocg-WvKoFQ.png" /><figcaption>This is the custom search engine for Amazon</figcaption></figure><p>Add as many search engines as you wish to and yay! you are ready to rock the search.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdfd08dd9aa4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to configure cursor traversal hotkeys into terminal app]]></title>
            <link>https://saiankit.medium.com/how-to-enable-cursor-traversal-hotkeys-into-terminal-app-bea06a1d2c75?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bea06a1d2c75</guid>
            <category><![CDATA[developer-productivity]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 11:14:26 GMT</pubDate>
            <atom:updated>2022-07-13T11:15:36.597Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a common practice among users to use ⌘ + →, ⌘ + ←, ⌥ + →, ⌥ +← for traversal across a line of text at varied intervals. If you are not aware, write a line of text, and use the commands mentioned above and see the cursor travelling and hopping either to the ends, or hopping word by word.</p><blockquote>⌘ + → : Hop to the end of the line</blockquote><blockquote>⌘ + ← : Hop to the start of the line</blockquote><blockquote>⌥ + → : Jump to the right one word at a time</blockquote><blockquote>⌥ +← : Jump to the left one word at a time</blockquote><p>I always wanted the same feature of gliding with my cursor in terminal app while editing commands inside it, and always failed to find a way. But now the issue is solved, and I am here to guide you how to enable cursor traversal hotkeys in your terminal app. I use iTerm2 as my daily driver, and am explaining the steps using the same.</p><p>Open Preferences of iTerm either by navigating through the menu like a noob or just by hitting ⌘ +,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oeIaG5o-6C-UACKkmoD96g.png" /></figure><p>Go to Profiles → Keys → Key Mappings and hit the + button at the bottom</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tA9JSbgWU0ghY8Gst3YLiA.png" /></figure><p>Click on the input button beside Keyboard Shortcut, and that is where you have to record your hotkey you want to configure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c_OcNr0GJNi1AmbWJGkwLw.png" /></figure><p>Choose Send Escape Sequence for all the 4 hotkeys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-d7YOT6b6foXRErFWSXFHA.png" /></figure><p>Enter the characters to send for each of the hotkey as mentioned below.</p><blockquote>⌘ + → : OF</blockquote><blockquote>⌘ + ← : OH</blockquote><blockquote>⌥ + → : f</blockquote><blockquote>⌥ +← : b</blockquote><p>Hope this helps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bea06a1d2c75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to follow a design system for all dimensions in Flutter ( not hard-coded ) ?]]></title>
            <link>https://saiankit.medium.com/how-to-follow-a-design-system-for-all-dimensions-in-flutter-not-hard-coded-578a9c7c441f?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/578a9c7c441f</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Wed, 25 May 2022 10:53:03 GMT</pubDate>
            <atom:updated>2022-05-25T10:53:03.155Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to follow a design system for all dimensions in Flutter ( not hard-coded ) ?</h3><p>In this article, I will give you a procedure to properly follow a design system provided by the design team for the Flutter application, which scales to any device size.</p><p>Why is this useful ?</p><p>When we get a high fidelity design from the design team, we start coding out our components in Flutter, which has different padding dimensions, text sizes etc as per the given device size. If we are using the same dimensions for different device types it might not look proper and deviates a lot from our core design that we are following. When are planning to change all those dimensions it might be a herculean task considering the scale of the project. To avoid this, we can use the below mentioned procedure and make things simple :)</p><p>The standard increments followed in a design, are in multiples of 8, so we will be using the same for the current discussion. If your design team is using any other values, please adhere to that and modify accordingly.</p><p>There are some files that need to be created inside the Flutter project. You can add them in a utilities folder.</p><ol><li>screen_config.dart</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c46c56686c48bbf05b65b2ef43812ac2/href">https://medium.com/media/c46c56686c48bbf05b65b2ef43812ac2/href</a></iframe><p>For the lines 21 and 22, there is a calculation that has to be done.<br>We have to basically create blockWidth and blockHeight as units of 8 according to the design we received from the design team. Once the blocks are created for us, we are going to multiply it and create the design system in the upcoming steps. To create the blocks we have to calculate the dividing factor for the known device ( design ) and apply it there.</p><p>Let’s assume the device dimensions are 360 x 800, then the for the _blockWidth to be 8, we have to divide the width ( 360 ) by 45. For the _blockHeight to be 8, we have to divide the height ( 800 ) by 100.</p><p>Hence the code can be modified as follows</p><pre>_blockWidth = _screenWidth / 45;<br>_blockHeight = _screenHeight / 100;</pre><p>We have to modify the main widget of our application, so that we get access to these block sizes across the app. We have to find out the first starting point of our application widget tree and modify it accordingly.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27d1e616f4f459a7b641176c85852cff/href">https://medium.com/media/27d1e616f4f459a7b641176c85852cff/href</a></iframe><p>After wrapping the Main widget of our application with Layout builder, we have access to the block lengths.</p><p>2. Create the design system.</p><p>We have to now start creating our design system based on the block sizes</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/269636bcd7a39019fe45338976209eef/href">https://medium.com/media/269636bcd7a39019fe45338976209eef/href</a></iframe><p>This is the first step, where we create the multipliers for different dimensions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/df225f096be3f2b26a788a0aa609d23e/href">https://medium.com/media/df225f096be3f2b26a788a0aa609d23e/href</a></iframe><p>We have now created text styles for different sizes, and now based on your design team inputs, modify the text styles and other dimensions and place them in a design_system folder which you can access and modify when the design team changes something.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2234a72f9d6c319a8576bb9dc1929512/href">https://medium.com/media/2234a72f9d6c319a8576bb9dc1929512/href</a></iframe><p>This is an example where we can use and modify our design system as per our needs.</p><p>You can also create the design system for your colors used in the application, and create a class for them as well.</p><p>Having a proper design system ready can boost our productivity, code cleanliness by a great extent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=578a9c7c441f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use DC++ on mac ( using NCDC ) ?]]></title>
            <link>https://saiankit.medium.com/how-to-use-dc-on-mac-using-ncdc-50bcc78aad01?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/50bcc78aad01</guid>
            <category><![CDATA[ncdc]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 09:51:27 GMT</pubDate>
            <atom:updated>2021-12-19T09:51:27.126Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use DC++ on mac ( using NCDC ) ?</h3><p>There are no good DC++ GUIs available for mac OS and the only good one available is a terminal version of DC known as NCDC.</p><h4>Installation</h4><p>The first and foremost important thing you must be having on your machine before moving any further is homebrew. To install Homebrew you can visit the <a href="http://brew.sh/">official website</a> or directly paste the given command in your terminal.</p><pre>/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</pre><p>Install ncdc using brew, by directly pasting the given command in your terminal</p><pre>brew install ncdc</pre><p>Change setting to use Option as Meta Key in Mac Terminal</p><ol><li>Open Terminal and Press Command + ,</li><li>Go to the “Profiles” tab and select the active profile in use</li><li>Choose the “Keyboards” tab</li><li>Check the box to enable “Use option as Meta key”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*Un8-KwKaU7RRjS3_H0ILkw.png" /><figcaption>Use Option as Meta Key</figcaption></figure><h4>Setup</h4><p>Open Terminal and type <strong>ncdc </strong>to launch ncdc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xO8inI27kU4udWfevUsjlA.png" /><figcaption>ncdc homepage</figcaption></figure><p>We can see that the working directory of ncdc is logged onto the screen as /Users/saiankit/.ncdc. We can navigate to the working directory and there is a folder called dl inside the working directory where all the downloads are saved.</p><h4>Instructions for initial setup</h4><ul><li>/set active_port 34194<br>Use this instruction as it is on the first launch</li><li>/set nick yourNick<br>This instruction is to set your nick as yourNick as the name suggests</li><li>/set description yourDescription<br>This instruction is to set your description for nick as yourDescription as the name suggests</li><li>/set active true</li></ul><h4>Usage</h4><ul><li>To start off launch an active hub at your place using the following command</li></ul><pre>/open NameOfHub 172.12.122.250</pre><p>172.12.122.250 is an example of hub at your place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-TwTF4vt1CjQtBk6QD6pTA.png" /><figcaption>Example of a hub opened</figcaption></figure><ul><li>You can use this command to search for your required file</li></ul><pre>/search Avengers</pre><p>Your query opens in a new tab and shows results for the same. Use arrow keys to navigate up and down between files and to download a file press <strong>D </strong>on keyboard to add the given file to queue</p><ul><li>You can use this command to get all the user List on given hub</li></ul><pre>/userlist</pre><p>This instruction opens all the userList in a new tab, and you can navigate using Up and down arrow keys, and if you want to view the share of the given nick, press B on keyboard, this opens the user shares in a separate tab</p><ul><li>If you require any additional help, just type in /help to know more.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50bcc78aad01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving from C to C++]]></title>
            <link>https://saiankit.medium.com/moving-from-c-to-c-b38b13d04682?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b38b13d04682</guid>
            <category><![CDATA[c]]></category>
            <category><![CDATA[cplusplus]]></category>
            <category><![CDATA[object-oriented]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 12:20:00 GMT</pubDate>
            <atom:updated>2021-08-03T12:20:00.075Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning C++ from scratch is a futile exercise when you can shift from C to C++ in an ingenious way.</p><p>Most of the students in India are taught C as their first programming language in colleges. However, shifting to C++ is a necessity in the current era. <strong>Competitive Programming</strong>, afield which is very popular in the current scenario and which is full of C++ and Java programmers ( maximum percentage ). Obviously, the available resources on the internet pertaining to this field would be mainly in C++ / Java. C++ has STL, which dominates C in terms of productivity during CC Competitions.</p><h3>What to do?</h3><p>Syntax of basic programming paradigms such as conditionals, loops do not change in C and C++. There are some vital fundamental differences that I will list out, and you can quickly learn them and imbibe within 5 min.</p><p><strong>Preprocessor Directives<br></strong>You can see in the below picture difference between the preprocessor directives in C ( left ) and C++ ( right )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foproXa9jXKtjqgxF2I_UA.png" /><figcaption>C(left) || C++(right)</figcaption></figure><p><strong>Standard Input<br></strong>Taking in C input is cumbersome because you have to strictly case the stuff inside the bracket based on the data type of the input variable. But in C++ is so damn simple. Any data type you declare can be easily <em>cinned.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9qFDsL3w-KS6_qkghR_KQ.png" /><figcaption>C(left) || C++(right)</figcaption></figure><p><strong>Standard Output<br></strong>Printing output in C is also boring because you have to strictly case the stuff inside the bracket based on the variable’s data type. But in C++ is simple. Any data type you declare can be easily <em>coutted.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFqoZy6cpwazQzHM7Kmr3A.png" /></figure><p>These 3 are the main key differences between C and C++. Transitioning from C to C++ does not only involve moving from <em>printf</em> to <em>cout</em>. There is much more, but the basic stuff is done, and you are good to go with some fundamental problems in C++ to make sure you are good with the requisite differences between C and C++.</p><p>Some Practice Problems to test your transition skills<br>1. <a href="https://codeforces.com/problemset/problem/4/A">Watermelon</a><br>2. <a href="https://codeforces.com/problemset/problem/231/A">Team</a></p><p>Now that you have understood the basic differences, it’s time to jump deep into more notable features of C++ 🤑</p><ol><li><a href="https://www.youtube.com/watch?v=R5BEcvTVZj0&amp;list=PLauivoElc3gh3RCiQA82MDI-gJfXQQVnn">STL Best Playlist</a></li></ol><p>Once you have understood these, you are good to go with many of the basic questions with C++</p><p>But some understanding of Object Oriented stuff in C++ would be helpful ( coz C++ is an object oriented language unlike C )</p><p><a href="https://www.youtube.com/watch?v=wN0x9eZLix4">Object Oriented Programming (OOP) in C++ Course</a></p><p>Clap the post if you did feel helpful.<br>Please do have a look into my YouTube channel: Code Studio Sai Ankit that discusses everything related to coding from Computer Science Concepts, Competitive Coding tutorials, Codeforces Editorials, Development Projects.<br>Please also do leave a like and Subscribe on the content you like 👍.</p><p><a href="https://www.youtube.com/c/CodeStudioSaiAnkit?sub_confirmation=1">Code Studio Sai Ankit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b38b13d04682" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why does Bitcoin consume a lot of Power ?]]></title>
            <link>https://saiankit.medium.com/why-does-bitcoin-consume-a-lot-of-power-4b008a549bd7?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b008a549bd7</guid>
            <category><![CDATA[sha-256]]></category>
            <category><![CDATA[bitcoin-mining]]></category>
            <category><![CDATA[hashing-algorithm]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Fri, 28 May 2021 05:25:37 GMT</pubDate>
            <atom:updated>2021-05-28T05:25:37.683Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why does Bitcoin consume a lot of Power ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*2DN0erptAOWXAeMe" /><figcaption>Elon Musk Tweet on Bitcoin Energy Demands</figcaption></figure><p>Blockchain basically has the following components : <br>1. Previous Block’s hash<br>2. Transactions content<br>3. Nonce</p><blockquote><strong>Previous Block’s Hash </strong>is as simple as it sounds. It is the hash (a unique value that acts like a fingerprint to identify a block ). This is required in the current block to form a link between the previous block and the current block.</blockquote><blockquote><strong>Transactions Content </strong>This is basically the list of transactions between peers.</blockquote><p>Both Transactions Content and Previous Block’s Hash are sent into a SHA-256 ( Secure Hashing Algorithm 256 bits ) to create a hash for the current block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LWoCa7jBDGQNeQRBAlfXSw.png" /></figure><p>This block has a Prev Hash and Transactions content ( Data ), and both are sent into an SHA-256 to generate the hash for the current block.</p><p>But the block isn’t sent to Blockchain yet. For a Block to be sent to Blockchain, the hash has to start with four leading zeroes.</p><blockquote>How to rehash the current hash for it to be accepted under Blockchain ?</blockquote><p>Here the comes the concept of <strong>Nonce</strong></p><blockquote><strong>Nonce </strong>is the special number / hash which when hashed with the current hash under SHA -256 generates the final hash with leading zeroes and goes to the blockchain.</blockquote><blockquote>Nonce <strong>&lt;H&gt;</strong> Hash = Final Hash</blockquote><p>&lt;H&gt; refers to the act of hashing with the help of SHA-256</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrmeHevsgc9BU6TIO7MCBg.png" /></figure><blockquote>How to find Nonce ?</blockquote><p>This is the actual work of Bitcoin miners. They do brute force computations to find the Nonce that generates the Final Hash with leading zeroes. When the Nonce is found and the Final hash is generated, the peers in the network accept the transaction. This process of finding Nonce requires a lot of computational power and hence requires a lot of electricity.</p><p>The miners are rewarded with some Bitcoins ( or part of them ) for their contribution towards finding the nonce.</p><p>Due to the increase in Bitcoin price, many miners started using very high-power computers that find nonce fast, which also consume vast amounts of electricity. If two miners find the nonce for the same block simultaneously, the miner with early contributions is given priority over the newbies. So miners are investing in mighty machines to do calculations and find nonce and these consume lot of electricity.</p><p>This is the main reason behind Bitcoin consuming a lot of electricity. Alt coins under development are trying to make the nonce finding algorithm less computer-intensive in anticipation of reducing carbon footprint.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b008a549bd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provider in Flutter for noobs]]></title>
            <link>https://saiankit.medium.com/provider-in-flutter-for-noobs-e9b2013945da?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9b2013945da</guid>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Sat, 01 May 2021 06:54:08 GMT</pubDate>
            <atom:updated>2021-05-01T06:54:08.589Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jIcGvta48iPqgqVRGKPS8w.png" /></figure><p>At some point of time after you start with a technology you will encounter state management. State is something that is the current scenario of data in the application and if the data is minimal and not very often changed and not very dependant on various other components in the application, basic state management would be sufficient. But when the data gets big, when the application needs to handle its state from various components a proper design pattern needs to be utilised and properly architected for the easy handling of data.</p><p>Provider is one such state management technique used in Flutter. When you are working with minimal data, setState serves our purpose but when you want to handle large data Provider comes into the play. Many people use it by learning some stuff from YouTube videos and then when the Provider also gets big, they face issues which have can be tackled if your basics are right.</p><p>So, I am presenting you a very basic overview of what Provider is, to make you understand the core working of the Provider Design Pattern.</p><h3><strong>Components of Provider</strong></h3><p>There are 3 important components of Provider<br>1. Change Notifier<br>2. Change Notifier Provider<br>3. Consumer</p><h3>Change Notifier</h3><p>It consists of all the state that needs to be managed by the application. There can be any number of Change Notifiers created which acts as a warehouse for storing data. We can architect our app such that each Change Notifier works with only one aspect of data that needs to be handled which makes the maintenance of the application way simpler. Change Notifier also consists of the methods ( functions ) that help us in modifying the state that is present in the given Change Notifier.</p><h3>Change Notifier Provider</h3><p>It provides the instance of Change Notifier to the widget. If we want any widget to access the state, we wrap that widget with Change Notifier Provider mentioning the Change Notifier that needs to be given access to for the widget and then after wrapping the widget, it gets the permission to access the treasure of Change Notifier.</p><h3>Consumer</h3><p>To actually use the data being managed by Provider inside a widget we use the help of consumer. This consumer widget has a builder function which on every change in the data present in change notifier rebuilds to show the new data on screen.</p><p>We can basically conclude that Change Notifier acts as a notifier which provides data as well as changes that occur to the data, and Consumer act as a listener to that notifier which is in constant connection, so that whenever an event is triggered and notified by Change Notifier, consumer listens and rebuilds itself to adapt to new data similar to how widget rebuilds on setState() call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGAyyVibKcaNWveXZTlosQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9b2013945da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dataflow modeling using Verilog on macOS]]></title>
            <link>https://saiankit.medium.com/dataflow-modeling-using-verilog-on-macos-489f85406393?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/489f85406393</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[verilog]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[modelling]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 10:02:19 GMT</pubDate>
            <atom:updated>2020-09-28T10:02:19.036Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1fJwmMAnYdxOd4MLq9G_YA.png" /></figure><p>There are three modeling styles in Verilog:<br>1. Gate level modeling ( Structural ): Use predefined or user-defined primitive gates<br>2. Dataflow modeling: Use assignment statements ( assign )<br>3. Behavioral modeling: Use procedural assignment statements ( always )</p><p>For Gate level modeling you can refer to my earlier article</p><p><a href="https://medium.com/@saiankit30/how-to-simulate-verilog-models-on-macos-5a6f821b2c4f">How to simulate Verilog models on macOS</a></p><h3>Dataflow Modelling</h3><p>The gate-level modeling becomes very complex for a VLSI circuit, hence dataflow modeling became a very important way of implementing the design. In dataflow modeling, most of the design is implemented using continuous assignments, which are used to drive a value onto a net. The continuous assignments are made using the keyword <strong>assign.</strong></p><p>There are very little changes when you want to do dataflow modeling in comparison to the gate-level modeling.</p><p>Let us say we are writing a Verilog simulation for the following circuit :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e5eyzT3g-quCL-DdgxeWkg.png" /><figcaption>This is the same circuit we coded for in gate-level modeling</figcaption></figure><h4>Main Program</h4><p>The main file would be saved as <strong>sample.v </strong>wherein we write the following code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07sxWT5XeQidOxvehBP1oA.png" /></figure><h4>Testbench Program</h4><p>We should also be writing a testbench program that allows us to test the main program with some values given as the inputs, a graph is generated using which we can analyze the output properly.</p><p>The test bench program is also in fact a Verilog code and hence the code extension <strong>.v </strong>stays intact to the code. Let us name the testbench code to be <strong>sample_tb.v</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mqOeeG55zxfN9KuuE4paOg.png" /></figure><h3>Compile and Run</h3><p>The compilation and running is the same as the gate level modelling<br>To compile and run the above code follow these steps :<br>(These commands have to be given in the terminal inside the directory where the main and testbench codes are present)</p><p>#1: Compile using this command where sample_tb denotes the file name of the testbench.</p><pre>iverilog -o sample_tb.vvp sample_tb.v</pre><p>#2: Run the compiled code using this following command</p><pre>vvp sample_tb.vvp</pre><h3>View the timing diagram</h3><p>There are two ways in which we can view the timing diagram<br>1. Using GTKWAVE<br>2. Using WaveTrace extension on <a href="https://marketplace.visualstudio.com/items?itemName=wavetrace.wavetrace">VS Code</a></p><p>You can use any of the above methods to view the timing diagram<br>To view the timing diagram using GTKWAVE you can refer the earlier article</p><p><a href="https://medium.com/@saiankit30/how-to-simulate-verilog-models-on-macos-5a6f821b2c4f">How to simulate Verilog models on macOS</a></p><h4>To view the waveform using WaveTrace</h4><p>You will be needing the WaveTrace extension to be enabled on your VS Code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jQ5SjFdZJ3OSF8VYK6TZlg.png" /><figcaption>WaveTrace Extension</figcaption></figure><p>After you compile the Verilog codes a <strong>.vcd </strong>file is created.</p><p>You can directly open that <strong>.vcd </strong>file from the file browser in VS Code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmZibUnrlUusco7G0nP8Dg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zb34W6Kpa21sJPn2L_094Q.png" /></figure><p>Click on the full-screen button for the waveform to fill the complete place</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CcEF_qcMuWp5fYhpU92yw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHHpJ-kXEhELgxmqrvNPxQ.png" /></figure><p>You can change the color of the wave using this option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Q6GlHFhaMXMf96y8x7b1A.png" /></figure><p>You can have a <strong>beautiful waveform representation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eDSBtVbB0lps3CeZXmFDTg.png" /></figure><p>This is how you simulate an electrical model using Verilog — data flow modeling on mac.</p><p>Clap the post if you did feel helpful.<br>Please do have a look into my YouTube channel: <strong>Code Studio Sai Ankit</strong> that discusses everything related to coding from Computer Science Concepts, Competitive Coding tutorials, Codeforces Editorials, Development Projects.<br>Please also do leave a like and Subscribe on the content you like 👍.</p><p><a href="https://www.youtube.com/c/CodeStudioSaiAnkit?sub_confirmation=1">Code Studio Sai Ankit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=489f85406393" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub CLI 1.0 is here!]]></title>
            <link>https://saiankit.medium.com/github-cli-1-0-is-here-f2acd988112?source=rss-ede22013a73d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2acd988112</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github-cli]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Sai Ankit]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 16:59:15 GMT</pubDate>
            <atom:updated>2020-09-18T16:59:15.967Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*lQIZiguw6IizSyWJZ8evrw.png" /></figure><p>Finally, GitHub CLI is here.</p><p>With GitHub CLI 1.0, you can:</p><ul><li>Run your entire GitHub workflow from the terminal, from issues through releases</li><li>Call the GitHub API to script nearly any action, and set a custom alias for any command</li><li>Connect to GitHub Enterprise Server in addition to GitHub.com</li></ul><h3><strong>Installation</strong></h3><p>On Mac OS GitHub CLI is available on brew</p><p>If you don’t have Homebrew already installed on your machine,<br>you can visit the <a href="http://brew.sh/">official website</a> or directly paste the given command in your terminal.</p><pre>/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;</pre><p>To install GitHub CLI via brew paste the given command in your terminal</p><pre>brew install gh</pre><p>Getting started with GitHub CLI</p><p>After you have installed gh, the next part would be to authenticate GitHub CLI which can be done by typing in this command into the terminal.</p><pre>gh auth login</pre><p>Choose the account you want to login to. ( Mine — Github.com )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*heELuO_QgnSGKocIZuQ4Tw.png" /></figure><p>Choose an authentication method. ( Mine — Login with a web browser )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o0O70wxTe-FzDAAyDY0ctw.png" /></figure><p>Copy the OTP that GitHub CLI provides you and then press enter to open up Github.com on a web browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xwZh82Ssnbjs1KwDWWIiaw.png" /></figure><p>Enter the OTP you copied into the input field</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-XnABcO_Q8Nd2lIxaKUmA.png" /></figure><p>Enable permissions and give access to connect Github.com and GitHub CLI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gp_FGuKuw9pPWvt9tIB8lw.png" /></figure><p>Type in your password and your Github.com and GitHub CLI are connected</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryfNjYidWLogHhedQyKLmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTJOjyejdufQeF8twbG9ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6x3zyF1BsOzI1QpEkBXMDQ.png" /></figure><p>After auth, you have to choose the default git protocol ( Mine — HTTPS )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VO7-s8gtn-1NTnGB34qkjQ.png" /></figure><p>Hurrah! GitHub CLI is ready and completely setup on your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bP2F_ruVmNGqNLbbEyjDpg.png" /></figure><h3><strong>Commands</strong></h3><p>The core commands of GitHub CLI are</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7y8geXD8dS9TjIdmKKdk1w.png" /></figure><p>To know more about each core command of GitHub CLI you can just type in</p><pre>gh core_command --help</pre><p>An example would be</p><pre>gh issue --help</pre><p>and you would be getting a complete list of possible commands for each core command and you can dive deeper into each sub-command with the help of</p><pre>--help</pre><p>tag attached at the end of the command.</p><p>You have a plethora of commands you can execute and do everything you have been doing using GitHub using the CLI version.</p><h3>A Simple Example</h3><p>We will look into a simple example of creating an issue inside a Git repository. <br>This can be done by clicking on the Issue button and adding the title, body on Github.com but since we are using GitHub CLI we will look into how to do the same using a command line “command”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aIWcWT1MziNkbQyOjHbaiQ.png" /></figure><pre>gh issue create --title &quot;Issue Title&quot; --body &quot;Issue body&quot;</pre><p>This creates an issue in your Git Repo with the appropriate title and body.<br>This also returns the Web URL of the issue created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8o3OGAk8s2cxe5Y72yhXug.png" /></figure><p>You can also get to know about other commands by using the help command.</p><p>Clap the post if you did feel helpful.<br>Please do have a look into my YouTube channel: <strong>Code Studio Sai Ankit</strong> that discusses everything related to coding from Computer Science Concepts, Competitive Coding tutorials, Codeforces Editorials, Development Projects.<br>Please also do leave a like and Subscribe to the content you like 👍.</p><p><a href="https://www.youtube.com/c/CodeStudioSaiAnkit?sub_confirmation=1">Code Studio Sai Ankit</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2acd988112" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>