<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vibhor Singh</title>
    <description>The latest articles on Forem by Vibhor Singh (@s_vibhor).</description>
    <link>https://forem.com/s_vibhor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F785563%2Ff0cdff6c-bd69-443c-9954-dedd24fd042c.png</url>
      <title>Forem: Vibhor Singh</title>
      <link>https://forem.com/s_vibhor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/s_vibhor"/>
    <language>en</language>
    <item>
      <title>Decentralized Application (dApp) Development Frameworks</title>
      <dc:creator>Vibhor Singh</dc:creator>
      <pubDate>Wed, 27 Mar 2024 15:52:38 +0000</pubDate>
      <link>https://forem.com/s_vibhor/decentralized-application-dapp-development-frameworks-2ccc</link>
      <guid>https://forem.com/s_vibhor/decentralized-application-dapp-development-frameworks-2ccc</guid>
      <description>&lt;p&gt;The rise of Web3 has fueled a surge in interest in Decentralized Applications (dApps).  These applications, built on blockchain technology, offer a new paradigm for user-controlled, transparent, and censorship-resistant interactions. But how do you actually build these innovative applications? Enter dApp development frameworks – the essential tools that empower developers to bring their dApp visions to life.&lt;/p&gt;

&lt;p&gt;This comprehensive guide unveils the world of dApp development frameworks, exploring their functionalities, advantages, and potential drawbacks. We'll delve into the top frameworks currently powering the dApp revolution, helping you choose the best fit for your next decentralized project. &lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding dApp Development Frameworks
&lt;/h3&gt;

&lt;p&gt;Developing a dApp from scratch can be a daunting task. Blockchain technology introduces new complexities compared to traditional web development. dApp development frameworks address this challenge by providing a pre-built infrastructure and a set of tools specifically tailored for blockchain interactions.&lt;/p&gt;

&lt;p&gt;These frameworks offer functionalities like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smart Contract Development Tools:&lt;/strong&gt; Streamlined environments for writing, testing, and deploying smart contracts – the self-executing code that governs dApp functionalities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blockchain Interaction Libraries:&lt;/strong&gt; Libraries that simplify communication with the underlying blockchain network, allowing developers to interact with blockchain data and functionalities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Front-End Development Integration:&lt;/strong&gt; Tools for integrating user interfaces and front-end logic with the blockchain back-end.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing and Debugging Utilities:&lt;/strong&gt;  Features enabling developers to test and debug their dApps efficiently within the framework.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By leveraging these functionalities, dApp development frameworks significantly improve developer productivity and reduce the time-to-market for dApps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of Using dApp Development Frameworks
&lt;/h3&gt;

&lt;p&gt;There are several compelling reasons to leverage dApp development frameworks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Development Time:&lt;/strong&gt; Frameworks provide pre-built components and functionalities, allowing developers to focus on core dApp logic rather than reinventing the wheel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Security:&lt;/strong&gt; Frameworks often incorporate best practices for developing secure smart contracts, mitigating common security vulnerabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster Prototyping:&lt;/strong&gt; Building a basic dApp prototype becomes quicker and easier with the framework's built-in functionalities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community and Support:&lt;/strong&gt; Popular frameworks benefit from large and active communities, offering invaluable resources, tutorials, and support for developers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Top dApp Development Frameworks to Consider
&lt;/h3&gt;

&lt;p&gt;Now that we understand the significance of dApp development frameworks, let's explore some of the leading players in the space:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Truffle:&lt;/strong&gt; A popular framework renowned for its developer-friendly features. Truffle offers comprehensive smart contract development, testing, and deployment tools along with a robust suite for front-end integration. Its compatibility with various blockchain networks makes it a versatile choice. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardhat:&lt;/strong&gt;  A rising star in the dApp development scene, Hardhat prioritizes speed and modularity. It provides a powerful testing environment and integrates seamlessly with other tools within the Ethereum development ecosystem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embark:&lt;/strong&gt;  A comprehensive framework targeted at both beginners and experienced developers. Embark offers a visual development environment alongside its smart contract functionalities, making it approachable for those new to blockchain development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brownie:&lt;/strong&gt;  A lightweight and minimalist framework, Brownie focuses on simplicity and ease of use. It emphasizes writing clean and well-tested smart contracts, making it ideal for developers who value control and flexibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DappHub:&lt;/strong&gt;  More than just a framework, DappHub is a comprehensive development environment focused on the Flow blockchain network. It offers a suite of tools for building, deploying, and managing dApps built on Flow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Choosing the Right Framework:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The ideal dApp development framework depends on your specific project requirements, team expertise, and the chosen blockchain network. Here are some factors to consider when making your choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blockchain Network Compatibility:&lt;/strong&gt; Ensure the framework supports the blockchain network your dApp is built upon (e.g., Ethereum, Flow, Solana).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer Experience:&lt;/strong&gt;  Consider your team's familiarity with different frameworks and choose one that aligns with their skillset and preferences. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project Requirements:&lt;/strong&gt;  Evaluate the functionalities offered by each framework and ensure they meet the specific needs of your dApp. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community and Support:&lt;/strong&gt;  A strong community around a framework provides valuable resources, tutorials, and assistance when needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beyond the Frameworks: Additional Considerations
&lt;/h3&gt;

&lt;p&gt;While dApp development frameworks streamline the process, building successful dApps requires attention to additional aspects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt;  Smart contract security audits are crucial to ensure your dApp isn't vulnerable to exploits. Reputable security firms offer audits to identify and address potential vulnerabilities in your code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Front-End Development:&lt;/strong&gt;  Building a user-friendly and intuitive front-end experience is essential for user adoption. Developers skilled in web development will be crucial for crafting a seamless user interface that would be used by all in Web3 world.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In conclusion, one can develop good dApps with effective usability required to many in the world.&lt;/p&gt;

</description>
      <category>dapp</category>
      <category>web3</category>
      <category>framework</category>
      <category>coding</category>
    </item>
    <item>
      <title>Web3 vs Web2: The Decentralized Revolution Reshaping the Internet</title>
      <dc:creator>Vibhor Singh</dc:creator>
      <pubDate>Wed, 27 Mar 2024 15:44:37 +0000</pubDate>
      <link>https://forem.com/s_vibhor/web3-vs-web2-the-decentralized-revolution-reshaping-the-internet-18ij</link>
      <guid>https://forem.com/s_vibhor/web3-vs-web2-the-decentralized-revolution-reshaping-the-internet-18ij</guid>
      <description>&lt;p&gt;The internet we know today is undergoing a massive transformation. Web2, the current iteration characterized by centralized platforms and user data dominance, is facing a potential challenger: Web3. But what exactly is Web3, and how does it differ from Web2? This blog delves into the core distinctions, exploring  the implications for users, businesses, and the future of the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Centralization vs. Decentralization: The Core Difference&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The fundamental difference between Web2 and Web3 lies in their structure. Web2 is centralized, meaning a small number of powerful companies like Google, Facebook, and Amazon control vast swathes of the online experience. These platforms collect, manage, and monetize user data, often with limited transparency or user control.&lt;/p&gt;

&lt;p&gt;Web3, on the other hand, proposes a decentralized model. Imagine a peer-to-peer network where users interact directly, without the need for intermediaries. Blockchain technology, a distributed ledger system, forms the backbone of this decentralized approach. Information is stored across a network of computers, making it tamper-proof and transparent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Web3 Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User Ownership:&lt;/strong&gt; Web3 empowers users with greater control over their data. Imagine owning your online identity and deciding who can access and use your information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transparency and Trust:&lt;/strong&gt; Blockchain technology fosters trust by making transactions and data ownership verifiable and publicly viewable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Censorship Resistance:&lt;/strong&gt; Decentralization makes it harder to censor information or block access to specific platforms. Free speech and open communication become cornerstones of Web3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissionless Innovation:&lt;/strong&gt; Anyone can participate in building and developing Web3 applications and protocols, fostering a more open and collaborative environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Web2 vs Web3: A Comparison Across Key Aspects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Ownership:&lt;/strong&gt; Web2: Companies own and monetize user data. Web3: Users own and control their data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy:&lt;/strong&gt; Web2: User privacy is often a concern due to data collection practices. Web3: Focuses on privacy-preserving technologies that give users more control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security:&lt;/strong&gt; Web2: Centralized servers are vulnerable to hacking and data breaches. Web3: Distributed ledger technology offers potentially greater security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monetization:&lt;/strong&gt; Web2: Platforms primarily capture value through advertising and data monetization. Web3: Users can capture a larger share of the value they create through cryptocurrencies and tokenized assets. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Impact of Web3: A Glimpse into the Future&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web3 holds the potential to transform various aspects of our online experience. Here are some potential areas of disruption:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Future of Finance:&lt;/strong&gt; Decentralized Finance (DeFi) removes the need for traditional financial institutions, enabling peer-to-peer lending and borrowing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Ownership Economy:&lt;/strong&gt; Non-Fungible Tokens (NFTs) represent digital ownership of unique assets, potentially revolutionizing how we interact with art, music, and collectibles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Rise of the Metaverse:&lt;/strong&gt; A network of interconnected virtual worlds powered by Web3 technologies could redefine how we work, socialize, and play online.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Challenges and Considerations for Web3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While Web3 offers exciting possibilities, it also faces challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt;  Blockchain technology currently struggles to handle large volumes of transactions, which could hinder widespread adoption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regulation:&lt;/strong&gt;  The nascent nature of Web3 necessitates clear regulations to ensure user protection and prevent illegal activities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility:&lt;/strong&gt;  User interfaces and applications need to become more user-friendly to attract a broader audience beyond tech enthusiasts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:  Web3 - A Paradigm Shift or Hype?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web3 represents a potential paradigm shift in how we interact with the internet. Whether it lives up to the hype remains to be seen. However, one thing is certain:  Web3 has sparked a critical conversation about user privacy, data ownership, and a more equitable internet landscape. &lt;/p&gt;

&lt;p&gt;As technology evolves and challenges are addressed, Web3 has the potential to reshape the internet into a more democratic and user-centric space. The future of the web is likely to be a hybrid of Web2 and Web3, with each iteration playing a role in our online experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Looking to Learn More About Web3?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This blog has merely scratched the surface of the complex and dynamic world of Web3. Here are some resources for further exploration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@DappUniversity"&gt;https://www.youtube.com/@DappUniversity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/@freecodecamp"&gt;https://www.youtube.com/@freecodecamp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By staying informed and engaged, we can actively participate in shaping the future of the internet – a future that prioritizes user empowerment, security, and a more open and inclusive online environment. &lt;/p&gt;

</description>
      <category>web3</category>
      <category>cryptocurrency</category>
      <category>dapp</category>
      <category>web2</category>
    </item>
    <item>
      <title>Perimeters of squares in a rectangle</title>
      <dc:creator>Vibhor Singh</dc:creator>
      <pubDate>Thu, 08 Sep 2022 18:34:02 +0000</pubDate>
      <link>https://forem.com/s_vibhor/perimeters-of-squares-in-a-rectangle-1o5n</link>
      <guid>https://forem.com/s_vibhor/perimeters-of-squares-in-a-rectangle-1o5n</guid>
      <description>&lt;p&gt;In the following image (you should zoom in if the screenshot isn't clearer to you), you can see the problem description and what the input and output are supposed to be.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zjBPdZOf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lf4bh6lwphr13ai4hs8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zjBPdZOf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8lf4bh6lwphr13ai4hs8.jpg" alt="Problem description" width="880" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The input would be an integer and you have to calculate the sum of the perimeters of all the squares in a rectangle when there are n + 1 squares disposed in the same manner as shown in the following image - &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bOz6saEf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l38v0q1y3sl7m75tepe2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bOz6saEf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l38v0q1y3sl7m75tepe2.jpg" alt="Fibonacci Square Example screenshot" width="880" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above image has 6 squares which are fitted in a very unique manner. The sides of squares seem random at first glance but in reality, it is something that most noob coders also know - &lt;strong&gt;Fibonacci Sequence&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Notice the side of innermost circle is 1 and the progressing squares' sides are 1, 2, 3, 5, 8.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;1, 1, 2, 3, 5, 8&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In case you don't know, what Fibonacci sequence is - The Fibonacci sequence is the sequence in which each number is the sum of the two preceding ones. - &lt;a href="https://en.wikipedia.org/wiki/Fibonacci_number"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a function which generates sum of 'n+1' Fibonacci numbers where 'n' is the input&lt;/li&gt;
&lt;li&gt;Multiply it by 4 to calculate the perimeter of resulting sum&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Algorithm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following function calculates the sum of 'n+1' fibonacci numbers
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function fib(num) {
  let a=1;
  let b=1;
  let s=0;
  if(num===0) 
    return 1;
  while(num&amp;gt;1) {
    let c=a+b;
    s+=c;
    a=b;
    b=c;
    num-=1;
  }
  return s+2;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function takes a number 'num' as an input;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first two lines of 'fib()' function initializes and assign the first two Fibonacci numbers;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a=1;
let b=1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Line 3 mentions 's' variable which stores the sum of 'num+1' Fibonacci numbers;
&lt;code&gt;let s=0;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Line 4-5: When input is 0, we return 1 as for input '0', num+1 number would be 1;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if(num===0) 
    return 1;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Line 6-12: This block mentions a 'while()' loop as it would run until we add the required Fibonacci numbers which would Fibonacci sequence - 2 as the loop would run for num-2 times. Are you confused, don't be? I have noob coding writing skills :)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while(num&amp;gt;1) {
    let c=a+b;
    s+=c;
    a=b;
    b=c;
    num-=1;
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The loop would run num-2 times as we have already initialized and declared the first two numbers of Fibonacci sequence mentioned in line 1-2;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We would return s+2 in last line of 'fib()' function because we ignored the first two numbers of Fibonacci sequence and calulated the sum of only the remaining Fibonacci numbers in 'while' loop;&lt;br&gt;
&lt;code&gt;return s+2;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now in the end, print the perimeter of sum of 'n+1' squares by multiplying 4 to the output of 'fib()' function as the output on the console/prompt screen.&lt;br&gt;
&lt;code&gt;console.log( 4*fib(n));&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This problem uses the concept of fibonacci numbers generation and a little bit of basic maths (e.g. formula for perimeter of a square).&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>int32 to IPv4</title>
      <dc:creator>Vibhor Singh</dc:creator>
      <pubDate>Wed, 07 Sep 2022 17:39:55 +0000</pubDate>
      <link>https://forem.com/s_vibhor/int32-to-ipv4-46ia</link>
      <guid>https://forem.com/s_vibhor/int32-to-ipv4-46ia</guid>
      <description>&lt;p&gt;As you can see in the below screenshot, it has the problem description and what the input and output are supposed to be - &lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y_wjGsLR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vsjbfcyiqs8n5mzpvhd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y_wjGsLR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vsjbfcyiqs8n5mzpvhd.jpg" alt="Problem description and examples of input and output screenshot" width="880" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The input would be an integer e.g.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;2149583361 &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The output must be in IPv4 format e.g.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"128.32.10.1"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The programming language used here is Javascript but you can use any language of your choice.&lt;/p&gt;

&lt;p&gt;Approach - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convert the decimal integer to its binary representation&lt;/li&gt;
&lt;li&gt;Convert the binary form to its 32 bit form&lt;/li&gt;
&lt;li&gt;Divide the 32 bits into 8 bits each and store them in an array&lt;/li&gt;
&lt;li&gt;Convert all 8 binary bits to its decimal form&lt;/li&gt;
&lt;li&gt;Store them as a string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The steps would be -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take a variable and store the input in it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;let int32="2149583361";&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take another variable and convert the input from decimal to binary using Javascript's inbuilt toString() method and providing it the parameter 2 to convert the decimal integer to its binary string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;let s=int32.toString(2);&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Take an empty variable and store 0's in it of length =&amp;gt; 32-(length of string)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let zero_s="";
  let temp=32-s.length;
  for(let i=0;i&amp;lt;temp;i++) 
    zero_s+="0";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Take another variable and store the final 32 bits string by appending the zero bits string to the original input string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;let res_s=zero_s+s;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use a for loop to traverse through the 32 bit string and split them into 8 bits each part and store them in an array
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array=[];
  let z=0;
  for(let j=0;j&amp;lt;4;j++) {
    let r=res_s.substring(z, 8+z);
    array.push(r);
    z+=8;
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Take another array to store the converted decimal strings element using Javascript's inbuilt parseInt() method
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let array2=[];
  for(let k of array) {
    let qq=parseInt(k, 2);
    array2.push(qq);
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Print the output by converting the array into a string using dots(.) to seperate them with the help of join() function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;return array2.join(".");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This problem uses the concept of decimal to binary conversion and vice-versa. &lt;/p&gt;

&lt;p&gt;It also jogs your memory to array to string conversion and vice-verse.&lt;/p&gt;

</description>
      <category>codewars</category>
      <category>javascript</category>
      <category>problemsolving</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Flipping Bits Problem</title>
      <dc:creator>Vibhor Singh</dc:creator>
      <pubDate>Mon, 05 Sep 2022 17:45:05 +0000</pubDate>
      <link>https://forem.com/s_vibhor/flipping-bits-problem-524n</link>
      <guid>https://forem.com/s_vibhor/flipping-bits-problem-524n</guid>
      <description>&lt;p&gt;This problem asks the solver to print the flipped bits of 32bit unsigned integer.&lt;br&gt;&lt;br&gt;
In detail, you would be provided an integer -&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;9 (base 10)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You have to write a function such that it returns the 32 bit unsigned decimal integer result -&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;4294967286 (base 10)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;All code would be in Javascript but you can use any language to solve this problem.&lt;/p&gt;

&lt;p&gt;How one goes from 9 to 4294967286?&lt;br&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;first take the input and convert it a string using toString() function
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let s=n.toString(2);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;initialize a new variable and assign it to 32-(length of string)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let temp=32-s.length;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why temp is equal to 32-s.length - variable &lt;em&gt;s&lt;/em&gt; stores the number in binary format i.e. &lt;em&gt;n&lt;/em&gt;=9 in decimal and &lt;em&gt;s&lt;/em&gt; would store "1001" in binary {datatype of &lt;em&gt;s&lt;/em&gt; is string here}, you are asked in this case to generate a 32 bit integer so to add the remaining bits in s, we assign temp to the given formula.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;initialize a new variable and assign it to an empty string
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let temp_s="";
for(let i=0;i&amp;lt;temp;i++)
    temp_s+="0";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;temp_s&lt;/em&gt; appends 0 to an empty string of length temp.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;res_s&lt;/em&gt; would hold the string full of 0 and the converted string of the number in binary format
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let res_s=temp_s+s; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;res_s=00000000000000000000000000001001&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;flip_s&lt;/em&gt; would store the flipped string as 1 would convert to 0 and 0 to 1
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let flip_s="";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;we use &lt;em&gt;for of&lt;/em&gt; loop to traverse through string &lt;em&gt;res_s&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(let i of res_s) {
        if(i==="0")
            flip_s+="1";
        else if(i==="1")
            flip_s+="0";
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here every element in the string is checked for 0 and 1 and assigned to 1 and 0 respectively.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;flip_s=11111111111111111111111111110110&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;print the value of given expression on console/prompt screen
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log( parseInt(flip_s, 2));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, parseInt() method converts the &lt;em&gt;flip_s&lt;/em&gt; variable to decimal form and output results in &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;4294967286&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This problem is the part of HackerRank's 1 Month Interview Prep Kit.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>hackerrank</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Plus Minus problem</title>
      <dc:creator>Vibhor Singh</dc:creator>
      <pubDate>Sun, 04 Sep 2022 18:37:33 +0000</pubDate>
      <link>https://forem.com/s_vibhor/plus-minus-problem-3n6d</link>
      <guid>https://forem.com/s_vibhor/plus-minus-problem-3n6d</guid>
      <description>&lt;p&gt;&lt;strong&gt;Plus Minus problem&lt;/strong&gt; is a part of &lt;em&gt;1 month of interview prep&lt;/em&gt; on &lt;em&gt;HackerRank&lt;/em&gt;. &lt;br&gt;
&lt;a href="https://www.hackerrank.com/s_vibhor"&gt;I joined it today&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was the first of the lot hence it was seemingly easy but requires an important concept - &lt;strong&gt;floating point precision&lt;/strong&gt;.&lt;br&gt;
I used &lt;strong&gt;Javascript&lt;/strong&gt; to solve it but you can also use any language which you want to use. &lt;br&gt;
In Javascript, there is a function - &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed"&gt;&lt;strong&gt;toFixed()&lt;/strong&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The problem asks the solver to take the &lt;em&gt;input as an array of integers&lt;/em&gt; and &lt;em&gt;output the ratio of positives, negatives and zeroes&lt;/em&gt;; i.e. if an array [1,2,3,-4,-5,-6,0,0] is provided to you, you have to output the ratio of positives(array[i]) to length of array {in this case, it would be positives_ratio = 3/8 = 0.375} and same for negatives and zeroes.&lt;/p&gt;

&lt;p&gt;Approach&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;u&gt;Initialize few variables&lt;/u&gt;&lt;/em&gt; to count number of positives, negatives and zeroes {input is provided as an aray of integers};&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;let pos_count=0, neg_count=0, zero_count=0;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;u&gt;Use for loop&lt;/u&gt;&lt;/em&gt; {for of loop in Javascript} for traversal in the array and search for positive num, negative num and zeroes and increment their counts;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for(let i of array) {
    if(i&amp;lt;0) 
        neg_count += 1;
    else if(i&amp;gt;0) 
        pos_count += 1;
    else 
        zero_count += 1;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;u&gt;Print the count_ratios&lt;/u&gt;&lt;/em&gt; on the console(or prompt screens) by &lt;em&gt;&lt;u&gt;dividing each count by length of array and use the toFixed()&lt;/u&gt;&lt;/em&gt; method to set the precision to 6 decimal places;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;console.log((pos_count/array.length).toFixed(6));&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;u&gt;Do same for negative count and zero count.&lt;/u&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The problem is easy and suitable for beginners but requires the knowledge of &lt;strong&gt;floating point precision&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
