<?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>DEV Community: suryansh taragi</title>
    <description>The latest articles on DEV Community by suryansh taragi (@suryanshcode).</description>
    <link>https://dev.to/suryanshcode</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%2F918743%2F88c50a83-5ebd-4a96-82df-944eeec905d2.jpeg</url>
      <title>DEV Community: suryansh taragi</title>
      <link>https://dev.to/suryanshcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suryanshcode"/>
    <language>en</language>
    <item>
      <title>DATABASE INDEXING IN PoatgreSQL</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Tue, 12 Mar 2024 10:55:12 +0000</pubDate>
      <link>https://dev.to/suryanshcode/database-indexing-in-poatgresql-1l3p</link>
      <guid>https://dev.to/suryanshcode/database-indexing-in-poatgresql-1l3p</guid>
      <description>&lt;h2&gt;
  
  
  INDEXING
&lt;/h2&gt;

&lt;p&gt;In PostgreSQL, indexing is like making a cheat sheet for the database to find things faster. Imagine you have a big book (table) and you want to quickly find specific information (rows) without reading the whole book.&lt;/p&gt;

&lt;p&gt;So, an index is like a smart bookmark. It's a quick reference guide that helps PostgreSQL find what you're looking for without going through every page of the book. When you ask the database a question (query), it checks the index first to see if it can answer your question without reading the entire table.&lt;/p&gt;

&lt;p&gt;PostgreSQL offers different types of these bookmarks, like B-tree, hash, GiST, SP-GiST, and BRIN, each designed for specific types of questions or ways of organizing information.&lt;/p&gt;

&lt;p&gt;But, there's a catch. Creating these bookmarks takes up extra space, and it can make adding, changing, or deleting information a bit slower. So, you need to be thoughtful about when and where to use them. It's like deciding where to put your cheat sheet - it can be super helpful, but you don't want it to get in the way of actually using the book. So, choose wisely based on the questions you often ask the database and how your data is organized.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types Of Index
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. B-Tree
&lt;/h3&gt;

&lt;p&gt;In PostgreSQL, the B-tree index is like the go-to tool for efficiently handling data. It's so handy that it's the default choice - whenever you tell PostgreSQL to create an index without specifying the type, it automatically goes for the B-tree.&lt;/p&gt;

&lt;p&gt;Picture the B-tree index as a well-organized tree structure. At the top, there's the root node, kind of like the big boss. This boss points to other nodes, and each node has lots of key-value pairs. The keys are like labels for quick finding, and the values guide us straight to the actual data in the table.&lt;/p&gt;

&lt;p&gt;Making a B-tree index in PostgreSQL is simple. You just use the CREATE INDEX command. Here's how you do it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE INDEX index_name ON table_name;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  single column indexing
&lt;/h3&gt;

&lt;p&gt;To create a B-tree index on a specific column in a table rather than indexing the entire table, you can use the following syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE INDEX index_name ON table_name (column_name);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's an example using a table named "sales_info" and inserting sample data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;sales_info&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;sales_id&lt;/span&gt; &lt;span class="nb"&gt;integer&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="k"&gt;location&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="n"&gt;item_purchased&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;sales_info&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;sales_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;location&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;item_purchased&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; 
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'halie46@gmail.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'London'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Headphone'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'$50'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'romaine21@gmail.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Australia'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Webcam'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'$50'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'frederique19@gmail.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Canada'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'iPhone 14 pro'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'$1259'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'kenton_macejkovic80@hotmail.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'London'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Wireless Mouse'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'$20'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'alexis62@hotmail.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Switzerland'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Dell Charger'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'$15'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'concepcion_kiehn@hotmail.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Canada'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Longitech Keyboard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'$499'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create a B-tree index on the "sales_id" column:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE INDEX idx_sales_id ON sales_info (sales_id);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating an index on specific columns can significantly improve query performance, especially when dealing with large datasets.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hash Index
&lt;/h3&gt;

&lt;p&gt;Hash indexes are optimized for rapid key-value searches. They excel in scenarios where query conditions involve equality checks on indexed columns, offering swift data retrieval by directly mapping the hash function to the location of the desired data. Hash indexes are particularly effective for operations like = or IN, emphasizing efficiency in equality comparisons.&lt;/p&gt;

&lt;p&gt;Similar to other index types, hash indexes require regular maintenance during data modifications (inserts, updates, and deletes) to uphold data consistency. However, it's worth noting that maintaining hash indexes can be comparatively more resource-intensive than B-tree indexes. This is attributed to the additional overhead of resolving collisions and rehashing data.&lt;/p&gt;

&lt;p&gt;To establish a hash index in PostgreSQL, you can employ the CREATE INDEX statement with the USING HASH clause, as demonstrated below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;hash_name&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;HASH&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;column_name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command generates a hash index named "hash_name" on the specified column of the table.&lt;/p&gt;

&lt;p&gt;It's crucial to note that while PostgreSQL supports hash indexes, they may not be the most suitable choice for range queries or sorting tasks. In such cases, B-tree indexes are typically preferred, being the default and widely used index type.&lt;/p&gt;

&lt;p&gt;Here's an example illustrating the creation of a hash index on the "sales_id" column in the "sales_info" table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;idx_sales_id&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;sales_info&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;HASH&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sales_id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CREATE INDEX idx_sales_id ON sales_info USING HASH(sales_id);&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;EXPLAIN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ANALYZE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="k"&gt;SELECT&lt;/span&gt; 
  &lt;span class="o"&gt;*&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; 
  &lt;span class="n"&gt;sales_info&lt;/span&gt; 
&lt;span class="k"&gt;WHERE&lt;/span&gt; 
  &lt;span class="n"&gt;sales_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  GiST and SP-GiST Indexes
&lt;/h3&gt;

&lt;p&gt;GiST (Generalized Search Tree) and SP-GiST (Space-Partitioned Generalized Search Tree) indexes are advanced index types in PostgreSQL that provide support for a wide range of data types and search operations.&lt;/p&gt;

&lt;p&gt;They are particularly useful for handling complex data structures and spatial data, GiST indexes are what you use if you want to speed up full-text searches.&lt;/p&gt;

&lt;h5&gt;
  
  
  Creating GiST and SP-GiST Indexes:
&lt;/h5&gt;

&lt;p&gt;To create a GiST or SP-GiST index in PostgreSQL, you can use the CREATE INDEX statement with the USING GIST or USING SPGIST clause, respectively.&lt;/p&gt;

&lt;p&gt;Here's an example of creating a GiST index on a geometry column:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;index_geometry&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;GIST&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;geometry_column&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here's an example of creating an SP-GiST index on a tsvector column:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;index_text_search&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;table_name&lt;/span&gt; &lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;SPGIST&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tsvector_column&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>sql</category>
      <category>softwareengineering</category>
      <category>python</category>
    </item>
    <item>
      <title>MERGE CONFLICTS in GITHUB</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Tue, 12 Mar 2024 10:51:00 +0000</pubDate>
      <link>https://dev.to/suryanshcode/merge-conflicts-in-github-1kde</link>
      <guid>https://dev.to/suryanshcode/merge-conflicts-in-github-1kde</guid>
      <description>&lt;h2&gt;
  
  
  MERGE CONFLICT
&lt;/h2&gt;

&lt;p&gt;Certainly! In version control systems like Git, a merge conflict occurs when two branches have changes in the same part of a file, and Git is unable to automatically merge those changes. This can happen when two developers make changes to the same line or section of code independently. When you try to merge these branches, Git will notify you of the conflict, and it's up to you to resolve it.&lt;/p&gt;

&lt;p&gt;Let's go through a simple example to illustrate a merge conflict and how to resolve it in a GitHub repository.&lt;/p&gt;

&lt;p&gt;Certainly! In version control systems like Git, a merge conflict occurs when two branches have changes in the same part of a file, and Git is unable to automatically merge those changes. This can happen when two developers make changes to the same line or section of code independently. When you try to merge these branches, Git will notify you of the conflict, and it's up to you to resolve it.&lt;/p&gt;

&lt;p&gt;Let's go through a simple example to illustrate a merge conflict and how to resolve it in a GitHub repository.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;p&gt;Suppose you have a GitHub repository with a file called example.txt, and two branches: master and feature-branch. The example.txt file initially looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, World!
This is an example file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, two developers make changes to the same line in example.txt, but in different branches.&lt;/p&gt;

&lt;p&gt;In the master branch, the file is changed to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, GitHub!
This is an example file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the feature-branch branch, the file is changed to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, World!
This is an updated example file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, someone tries to merge the feature-branch into master:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git checkout master
$ git merge feature-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, Git realizes there is a conflict. It might produce an error message, and if you open example.txt, you'll see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
Hello, GitHub!
=======
Hello, World!
This is an updated example file.
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lines between &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD and ======= are from the current branch (master), and the lines between ======= and &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feature-branch are from the branch being merged (feature-branch). Now, you need to manually resolve this conflict.&lt;/p&gt;

&lt;h4&gt;
  
  
  RESOLVE IN GITHUB
&lt;/h4&gt;

&lt;p&gt;to resolve the conflict, edit the file to decide what the final version should be. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, GitHub!
This is an updated example file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After resolving the conflict, you need to commit the changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git add example.txt
$ git commit -m "Merge branch 'feature-branch' into master"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the merge conflict is resolved, and you have successfully merged the changes from feature-branch into master.&lt;/p&gt;

&lt;p&gt;Remember, conflicts are a natural part of collaboration, and it's essential to communicate with your team to ensure that conflicts are resolved in a way that maintains the integrity of the codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  RESOLVE IN VSCODE
&lt;/h3&gt;

&lt;p&gt;Resolving a merge conflict involves combining changes from different branches in a way that makes sense. Here's an example of how you might resolve the conflict in a way that incorporates both changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, GitHub!
This is an updated example file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this resolution:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;"Hello, GitHub!" is taken from the master branch.&lt;/li&gt;
&lt;li&gt;"This is an updated example file." is taken from the feature-branch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This resolution includes the changes from both branches to create a coherent and updated version of the file. Once you've made this decision, you would save the file and then commit the changes:&lt;/p&gt;

&lt;p&gt;Visual Studio Code (VSCode) provides a user-friendly interface for resolving merge conflicts. Here's a step-by-step guide on how to resolve a merge conflict using VSCode:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open the File with Conflict:&lt;br&gt;
Open VSCode and navigate to the file with the conflict.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open Source Control (Git) View:&lt;br&gt;
Click on the Source Control icon in the activity bar on the side of the window. This will open the Source Control view.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;  Navigate to the Changes Tab:
In the Source Control view, switch to the "Changes" tab. You should see the file with a merge conflict listed.&lt;/li&gt;
&lt;li&gt;  Review and Choose Changes:
Click on the conflicted file to open it. You'll see the conflict markers (&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;, =======, and &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;) indicating the conflicting changes.&lt;/li&gt;
&lt;li&gt; Use the "Accept Incoming" or "Accept    Current" Buttons:
VSCode provides buttons in the gutter (to the left of the conflicting lines) to accept either the incoming (from the branch being merged) or current (from the branch you are merging into) changes. Click the buttons as needed.&lt;/li&gt;
&lt;li&gt; Manually Edit if Necessary:
If you want to customize the resolution further or if the automatic resolution is not satisfactory, you can manually edit the file.&lt;/li&gt;
&lt;li&gt;Mark as Resolved:
Once you're satisfied with the resolution, save the file.&lt;/li&gt;
&lt;li&gt;Commit the Changes:
Go back to the Source Control view, stage the resolved file by clicking the "+" button next to it, and then commit the changes with a meaningful commit message. &lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Palindrome check(cpp)</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Thu, 30 Nov 2023 14:12:00 +0000</pubDate>
      <link>https://dev.to/suryanshcode/palindrome-checkcpp-2ain</link>
      <guid>https://dev.to/suryanshcode/palindrome-checkcpp-2ain</guid>
      <description>&lt;h2&gt;
  
  
  Description of the Palindrome Checker Code:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Function isPalindrome(const string &amp;amp;word):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Takes a string word as input.&lt;br&gt;
Creates a new string (cleanWord) by removing spaces and converting characters to lowercase for case-insensitive comparison.&lt;br&gt;
Checks if the cleaned word is a palindrome.&lt;br&gt;
Returns true if it is a palindrome, and false otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Function:&lt;/strong&gt;&lt;br&gt;
Declares a string variable userWord to store user input.&lt;br&gt;
Prompts the user to enter a word.&lt;br&gt;
Calls the isPalindrome function to check if the entered word is a palindrome.&lt;br&gt;
Prints "YES, IT IS PALINDROME" or "NO, IT IS NOT A PALINDROME" based on the result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Palindrome Check:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Utilizes the isPalindrome function to determine whether the entered word is a palindrome.&lt;br&gt;
Palindrome checking is case-insensitive and ignores spaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input and Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Takes user input for a word using cin.&lt;br&gt;
Displays the result of the palindrome check using cout.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Palindrome Checking Logic:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Iterates through the cleaned word from both ends, comparing characters.&lt;br&gt;
Returns false if any pair of characters do not match.&lt;br&gt;
Returns true if all pairs match, confirming a palindrome.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code uses a simplified method for checking palindromes, suitable for single-word inputs.&lt;br&gt;
It provides a quick and straightforward way to determine if a word is a palindrome or not.&lt;br&gt;
This code serves as a basic palindrome checker, allowing users to input a word and check whether it reads the same backward as forward, considering case insensitivity and ignoring spaces.&lt;/p&gt;

&lt;p&gt;code link &lt;a href="https://github.com/suryansh-code/BHARATTECH/blob/main/Palindrome%20Check/pc.cpp"&gt;click here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SNAKE LADDER (cpp)</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Thu, 30 Nov 2023 14:04:57 +0000</pubDate>
      <link>https://dev.to/suryanshcode/snake-ladder-cpp-4mg6</link>
      <guid>https://dev.to/suryanshcode/snake-ladder-cpp-4mg6</guid>
      <description>&lt;h2&gt;
  
  
  Description of the Snake and Ladder Game Code:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Function rollDice():&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Generates a random number between 1 and 6, simulating a six-sided dice roll.&lt;br&gt;
Returns the rolled dice value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function playGame():&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implements the Snake and Ladder game logic.&lt;br&gt;
Initializes player positions (player1 and player2) to 0 and currentPlayer to 1 (for player 1).&lt;br&gt;
Loops until one of the players reaches or exceeds position 100.&lt;br&gt;
Asks players to press Enter to roll the dice and updates their positions accordingly.&lt;br&gt;
Checks for snakes and ladders at specific positions, adjusting the player's position accordingly.&lt;br&gt;
Switches to the next player after each turn.&lt;br&gt;
Displays the current positions of both players after each turn.&lt;br&gt;
Determines the winner based on who reaches or exceeds position 100 first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Function:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Seeds the random number generator with the current time.&lt;br&gt;
Calls playGame() to start and execute the Snake and Ladder game.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Randomness:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Utilizes the rand() function and srand(time(0)) to introduce randomness to dice rolls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Game Features:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Incorporates snakes and ladders with specific positions affecting player movement.&lt;br&gt;
Provides messages indicating snake bites or ladder discoveries during the game.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Displays information such as the rolled dice value, player positions, and game progress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Winner Determination:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Declares the winner based on the player who reaches or exceeds position 100 first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code offers a simplified representation of the Snake and Ladder game without a graphical interface.&lt;br&gt;
It serves as a text-based illustration of player movement, snake bites, and ladder discoveries.&lt;br&gt;
This code provides a basic implementation of the classic Snake and Ladder game, showcasing player movements and the influence of snakes and ladders on the gameplay.&lt;/p&gt;

&lt;p&gt;code link-&lt;a href="https://github.com/suryansh-code/BHARATTECH/blob/main/SNAKE%20LADDER%20/code.cpp"&gt;click here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>cpp</category>
    </item>
    <item>
      <title>CGPA CALCULATOR</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Thu, 30 Nov 2023 13:56:24 +0000</pubDate>
      <link>https://dev.to/suryanshcode/cgpa-calculator-271p</link>
      <guid>https://dev.to/suryanshcode/cgpa-calculator-271p</guid>
      <description>&lt;h2&gt;
  
  
  Description of the Code:
&lt;/h2&gt;

&lt;p&gt;The provided C++ code converts a Cumulative Grade Point Average (CGPA) to its equivalent percentage. Here's a breakdown of the code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function cgpaToPercentage:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Takes a double parameter cgpa representing the Cumulative Grade Point Average.&lt;br&gt;
Assumes a simple conversion formula (e.g., CGPA * 10) to calculate the equivalent percentage.&lt;br&gt;
Returns the calculated percentage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Main Function:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Declares a double variable cgpa to store the user-input CGPA.&lt;/p&gt;

&lt;p&gt;Prompts the user to enter their CGPA.&lt;/p&gt;

&lt;p&gt;Checks if the entered CGPA is within the valid range (0 to 10).&lt;/p&gt;

&lt;p&gt;If valid, calls the cgpaToPercentage function to convert CGPA to percentage.&lt;br&gt;
Prints the equivalent percentage.&lt;br&gt;
Uses cout for output and cin for input.&lt;br&gt;
If the entered CGPA is not within the valid range, prints an error message indicating an invalid CGPA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input Validation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ensures the entered CGPA is between 0 and 10.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Displays either the equivalent percentage or an error message based on the validity of the entered CGPA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assumption:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code assumes a linear conversion from CGPA to percentage (CGPA * 10).&lt;br&gt;
It provides a straightforward illustration of converting CGPA to a more commonly used percentage scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code does not include advanced error handling or additional validation beyond the specified CGPA range.&lt;br&gt;
This code offers a simple utility for students or users to quickly convert their CGPA to a percentage, assuming a direct linear relationship between the two grading systems.&lt;/p&gt;

&lt;p&gt;github link-&lt;a href="https://github.com/suryansh-code/BHARATTECH/blob/main/CGPA%20converter/cgpa.cpp"&gt;click here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>cpp</category>
    </item>
    <item>
      <title>BANK MANAGEMET SYSTEM</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Thu, 30 Nov 2023 13:49:18 +0000</pubDate>
      <link>https://dev.to/suryanshcode/bank-managemet-system-51g5</link>
      <guid>https://dev.to/suryanshcode/bank-managemet-system-51g5</guid>
      <description>&lt;p&gt;&lt;strong&gt;Class Definition (Bank):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Private members include total for customer count and id for search/update.&lt;br&gt;
person array stores customer data (name, ID, address, contact, cash).&lt;br&gt;
Public methods handle various banking operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Public Methods:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;choice(): Displays a menu for user selection.&lt;br&gt;
perData(): Creates a new customer account.&lt;br&gt;
show(): Displays all customer details.&lt;br&gt;
update(): Allows updating customer information.&lt;br&gt;
search(): Searches and displays customer details.&lt;br&gt;
transactions(): Handles deposit/withdrawal transactions.&lt;br&gt;
del(): Removes a specific customer or clears the entire database&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;main() Function:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creates a Bank instance and initiates banking operations using the choice() method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Banking Operations:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create New Account:&lt;br&gt;
Takes user input for new customer details.&lt;br&gt;
View Customers List:&lt;br&gt;
Displays details of all customer accounts.&lt;br&gt;
Update Information:&lt;br&gt;
Allows the user to update existing customer data.&lt;br&gt;
Check Details:&lt;br&gt;
Searches for a customer by ID and displays their details.&lt;br&gt;
Transactions:&lt;br&gt;
Handles deposit and withdrawal transactions for existing customers.&lt;br&gt;
Remove Existing Account:&lt;br&gt;
Allows removal of a specific customer record or clears the entire database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User Interface:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple text-based menu for user interaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage of conio.h and windows.h:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Utilizes conio.h for console I/O functions (getch()) and windows.h for screen clearing and delays (Sleep()).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Looping Structure:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The program runs in an infinite loop until the user chooses to exit.&lt;/p&gt;

&lt;p&gt;Basic validation ensures proper handling of user inputs.&lt;br&gt;
Structure and Organization:&lt;/p&gt;

&lt;p&gt;Code is modular with methods, enhancing readability and organization.&lt;br&gt;
Considerations for Improvement:&lt;/p&gt;

&lt;p&gt;Suggestions include avoiding deprecated headers and enhancing error handling for a more robust system.&lt;/p&gt;

&lt;p&gt;code link -&lt;a href="https://github.com/suryansh-code/BHARATTECH/blob/main/BANK%20MANAGEMENT%20SYSTEM/code.cpp"&gt;click here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>coding</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>SIMPLE GAME USING PYGAME</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Thu, 07 Sep 2023 11:41:06 +0000</pubDate>
      <link>https://dev.to/suryanshcode/simple-game-using-pygame-1m1n</link>
      <guid>https://dev.to/suryanshcode/simple-game-using-pygame-1m1n</guid>
      <description>&lt;p&gt;&lt;strong&gt;Exploring the Universe through Code: My School Time Projects&lt;/strong&gt;&lt;br&gt;
During my school years, I had the opportunity to dive into the world of game development using Python and Pygame, and the experience was nothing short of exhilarating. I'd like to share two of my most cherished projects: "Drop Space" and "Space War Multiplayer Game," both of which allowed me to combine my passion for coding and my fascination with outer space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Drop Space: A Galactic Adventure&lt;/strong&gt;&lt;br&gt;
Drop Space was the first project that truly ignited my interest in game development. In this single-player game, players controlled a spaceship navigating through an asteroid-filled galaxy. The goal was simple yet challenging: survive as long as possible by avoiding collisions with fast-moving space debris.&lt;/p&gt;

&lt;p&gt;The game was brought to life using Python's Pygame library, which provided the tools to handle graphics, audio, and user input. It was amazing to see how code could create a visual and interactive experience that players could enjoy.&lt;/p&gt;

&lt;p&gt;One of the most rewarding aspects of developing Drop Space was the opportunity to learn about game physics and collision detection. I was able to experiment with different algorithms to ensure that the spaceship's movements felt realistic and responsive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4uuau2b5zxc3tegk41o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4uuau2b5zxc3tegk41o.PNG" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Space War Multiplayer Game: An Intergalactic Showdown&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Building on my experience with Drop Space, I decided to take on a more ambitious project: a multiplayer space battle game. In this game, two players could compete head-to-head, piloting their own spaceships and engaging in thrilling dogfights amidst a starry backdrop.&lt;/p&gt;

&lt;p&gt;These school projects taught me that coding is not just about solving problems; it's also about creating experiences. They reinforced my belief that with determination, curiosity, and the right tools, anyone can turn their imaginative ideas into interactive realities.&lt;/p&gt;

&lt;p&gt;As I look back on my school time projects, I am grateful for the skills and insights I gained through them. They were not just games; they were journeys into the boundless universe of programming and game development.&lt;/p&gt;

&lt;p&gt;Now, armed with the knowledge and passion I've acquired, I'm excited to explore new galaxies and create even more captivating experiences in the world of game development.&lt;/p&gt;

&lt;p&gt;here is the github link for those project . Try it and add some more features to it, and let me know in the comments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drop Space&lt;/strong&gt; :-&lt;a href="https://github.com/suryansh-code/python_PROJECTS/blob/master/box%20down.py" rel="noopener noreferrer"&gt;https://github.com/suryansh-code/python_PROJECTS/blob/master/box%20down.py&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Space War&lt;/strong&gt; :-&lt;a href="https://github.com/suryansh-code/python_PROJECTS/blob/master/multiplayer%20space%20game" rel="noopener noreferrer"&gt;https://github.com/suryansh-code/python_PROJECTS/blob/master/multiplayer%20space%20game&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>pygame</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>BOGO SORT</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Sun, 03 Sep 2023 05:31:43 +0000</pubDate>
      <link>https://dev.to/suryanshcode/bogo-sort-2o4a</link>
      <guid>https://dev.to/suryanshcode/bogo-sort-2o4a</guid>
      <description>&lt;p&gt;BOGO sort also known as stupid sort , slow sort ,monkey sort , shotgun sort and monkey sort . the name stupid is given to this sort because of its working , &lt;/p&gt;

&lt;p&gt;BOGO sort, short for "Bogosort," is a highly inefficient and humorously named sorting algorithm that serves more as a joke or a parody of sorting algorithms than a practical sorting method. In fact, it is often referred to as "stupid sort" precisely because of its absurdly inefficient nature.&lt;/p&gt;

&lt;p&gt;Here's how Bogo sort works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with an unsorted list of elements that need to be 
sorted.&lt;/li&gt;
&lt;li&gt;Randomly shuffle the elements in the list.&lt;/li&gt;
&lt;li&gt;Check if the list is sorted. If it is, stop; otherwise, go 
back to step 2&lt;/li&gt;
&lt;li&gt;Repeat steps 2 and 3 until the list becomes sorted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;" my college pc crashes .when I run this algo on that pc for &lt;br&gt;
   around 1000 of data"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;bits/stdc++.h&amp;gt;

using namespace std;

bool isSorted(int Arr[], int N)

{

    for(int i=1; i&amp;lt;N; i++)

    {

        if(Arr[i] &amp;lt; Arr[i-1])

            return false;

    }

    return true;

}



void randomly_shuffle(int Arr[], int N)

{

    for(int i = 0; i &amp;lt; N; i++)

    {

        swap(Arr[i], Arr[rand() % N]);

    }

}




int main()

{

    int N = 4;

    int Arr[N] = {2, 13, 7, 1};



    // isSorted() function return true if array

    // is sorted else it returns false

    while(!isSorted(Arr, N))

    {

        // randomly_shuffle() function generates a

        // random permutation of array

        randomly_shuffle(Arr, N);

    }

    for(int i = 0; i &amp;lt; N; i++)

        cout &amp;lt;&amp;lt; Arr[i] &amp;lt;&amp;lt; " ";



    return 0;

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;TIME COMPLEXITY&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Worst-case time complexity: O(infinite)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Average-case time complexity: O(n! * n)&lt;/em&gt; :- There are n! permutations, only one of which is sorted. So, we would expect to get the correct answer after about O(n!) iterations. And each shuffle/check operation is itself O(n)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Best-case time complexity: O(n)&lt;/em&gt;&lt;br&gt;
When the given array is already sorted, the program terminates just after checking if the array is sorted once, which takes O(n) time to execute.&lt;/p&gt;

</description>
      <category>coding</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>VIRTUAL ASSISTANT USING PYTHON (GUI-BASED)</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Mon, 12 Sep 2022 18:35:14 +0000</pubDate>
      <link>https://dev.to/suryanshcode/virtual-assistant-using-python-gui-based-3h64</link>
      <guid>https://dev.to/suryanshcode/virtual-assistant-using-python-gui-based-3h64</guid>
      <description>&lt;p&gt;&lt;strong&gt;VIRTUAL ASSISTANT USING PYTHON&lt;/strong&gt;&lt;br&gt;
THIS IS MY SECOND YEAR (B-TECH CSE) MINI PROJECT  . THIS  PROJECT JUST WORK AS THE AMAZON ALEXA AND GOOGLE ASSISTANT . BUT THE FEATURES ARE LIMITED​ . NO USE OF ANY AI JUST WORKS WITH (IF-ELSE) CONDITION , CAN PERFORM SOME TASKS LIKE (OPENING ANY WEBSITE OR APPLICATION , PLAYING MUSIC , SENDING EMAILS &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IDEA&lt;/strong&gt;&lt;br&gt;
The best thing about this project is that this is GUI based . tkinter is a very famous library for making GUI based projects . at starting I only thought to make this project terminal based means all the output are shown in terminal. than I remember about my childhood project (A GUI TEXT GAME) so I merge both projects which in result turns out to be pretty impressive .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;INTERFACE OF THIS PROJECT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eXj18Iev--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7norsjhnvrhdjjcaqjxw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eXj18Iev--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7norsjhnvrhdjjcaqjxw.jpeg" alt="Image description" width="880" height="784"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOME LIBRARIES WHICH ARE USED:-&lt;/strong&gt;&lt;br&gt;
1.&lt;a href="https://www.geeksforgeeks.org/python-random-module/"&gt;random&lt;/a&gt;&lt;br&gt;
2.&lt;a href="https://www.geeksforgeeks.org/python-gui-tkinter/"&gt;tkinter&lt;/a&gt;&lt;br&gt;
3.&lt;a href="https://pypi.org/project/PyAudio/"&gt;Pyaudio&lt;/a&gt;&lt;br&gt;
4.&lt;a href="https://www.geeksforgeeks.org/python-text-to-speech-by-using-pyttsx3/#:~:text=pyttsx3%20is%20a%20text%2Dto,a%20reference%20to%20a%20pyttsx3."&gt;pyttssx3&lt;/a&gt;&lt;br&gt;
5.&lt;a href="https://www.geeksforgeeks.org/python-datetime-module/"&gt;datetime&lt;/a&gt;&lt;br&gt;
6.&lt;a href="https://www.geeksforgeeks.org/python-launch-a-web-browser-using-webbrowser-module/"&gt;webbrowser&lt;/a&gt;&lt;br&gt;
7.&lt;a href="https://www.geeksforgeeks.org/speech-recognition-in-python-using-google-speech-api/"&gt;speech recognizer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOW IT WORKS&lt;/strong&gt;&lt;br&gt;
1.Making a function which use our system microphone and take our voice as input.&lt;br&gt;
2.Then convert the voice format to text format. &lt;br&gt;
3.Perform various functions according to that input.&lt;br&gt;
4.Than again convert the text output in voice format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;THIS PPT AND GIT-REPO SUMMARIZED MY PROJECT IN DETAILED&lt;/strong&gt;&lt;br&gt;
1.&lt;a href="https://geuac-my.sharepoint.com/:p:/g/personal/suryanshtaragi_cse_20011617_gehu_ac_in/ES99bYzyPj5IuulwGUtdjY8BdOHR1jjG7weHOCq3jWZHuQ?e=bD88oN"&gt;POWERPOINT PRESENTATION&lt;/a&gt;&lt;br&gt;
2.&lt;a href="https://github.com/suryansh-code/MY_ALEXA"&gt;GIT REPO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank You&lt;/em&gt;                                                          &lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>github</category>
    </item>
    <item>
      <title>CHECK THE SEQUENCE (STRICTLY DECREASING THAN INCREASING || STRICTLY DECREASING || STRICTLY INCREASING)</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Mon, 12 Sep 2022 18:33:55 +0000</pubDate>
      <link>https://dev.to/suryanshcode/check-the-sequence-strictly-decreasing-than-increasing-strictly-decreasing-strictly-increasing-1e1d</link>
      <guid>https://dev.to/suryanshcode/check-the-sequence-strictly-decreasing-than-increasing-strictly-decreasing-strictly-increasing-1e1d</guid>
      <description>&lt;p&gt;&lt;strong&gt;Check Number sequence&lt;/strong&gt;&lt;br&gt;
You are given S, a sequence of n integers i.e. S = s1, s2, ..., sn. Compute if it is possible to split S into two parts : s1, s2, ..., si and si+1, si+2, ….., sn (0 &amp;lt;= i &amp;lt;= n) in such a way that the first part is strictly decreasing while the second is strictly increasing one.&lt;br&gt;
Note : We say that x is strictly larger than y when x &amp;gt; y.&lt;br&gt;
So, a strictly increasing sequence can be 1 4 8. However, 1 4 4 is NOT a strictly increasing sequence.&lt;/p&gt;

&lt;p&gt;That is, in the sequence if numbers are decreasing, they can start increasing at one point. And once the sequence of numbers starts increasing, they cannot decrease at any point further.&lt;br&gt;
Sequence made up of only increasing numbers or only decreasing numbers is a valid sequence. So, in both the cases, print true.&lt;/p&gt;

&lt;p&gt;You just need to print true/false. No need to split the sequence.&lt;br&gt;
Input format :&lt;br&gt;
Line 1 : Integer 'n'&lt;br&gt;
Line 2 and Onwards : 'n' integers on 'n' lines(single integer on each line)&lt;br&gt;
Output Format :&lt;br&gt;
"true" or "false" (without quotes)&lt;br&gt;
Constraints :&lt;br&gt;
1 &amp;lt;= n &amp;lt;= 10^7&lt;br&gt;
Sample Input 1 :&lt;br&gt;
5&lt;br&gt;
9&lt;br&gt;
8&lt;br&gt;
4&lt;br&gt;
5&lt;br&gt;
6&lt;br&gt;
Sample Output 1 :&lt;br&gt;
true&lt;br&gt;
Sample Input 2 :&lt;br&gt;
3&lt;br&gt;
1&lt;br&gt;
2&lt;br&gt;
3&lt;br&gt;
Sample Output 2 :&lt;br&gt;
true&lt;br&gt;
Sample Input 3 :&lt;br&gt;
3&lt;br&gt;
8&lt;br&gt;
7&lt;br&gt;
7&lt;br&gt;
Sample Output 3 :&lt;br&gt;
false&lt;br&gt;
Explanation for Sample Format 3 :&lt;br&gt;
8 7 7 is not strictly decreasing, so output is false.&lt;br&gt;
Sample Input 4 :&lt;br&gt;
6&lt;br&gt;
8&lt;br&gt;
7&lt;br&gt;
6&lt;br&gt;
5&lt;br&gt;
8&lt;br&gt;
2&lt;br&gt;
Sample Output 4 :&lt;br&gt;
false&lt;br&gt;
Explanation for Sample Input 4 :&lt;br&gt;
The series is :&lt;br&gt;
8 7 6 5 8 2&lt;br&gt;
It is strictly decreasing first (8 7 6 5). Then it's strictly increasing (5 8). But then it starts strictly decreasing again (8 2). Therefore, the output for this test case is 'false'&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
using namespace std;

int main() {

    int n;
    cin&amp;gt;&amp;gt;n;
    bool a;
    int count=0;

    int num[n];

    for(int i=0;i&amp;lt;n;i++)
    {
        cin&amp;gt;&amp;gt;num[i];
    }


    for(int i=0;i&amp;lt;n;i++)
    {
        if(num[i]&amp;gt;num[i+1])
        {
            a=true;
            count++;
        }

        else
        {
            a=false;
            break;
        }
    }

    for(int i=count;i&amp;lt;n;i++)
    {
        if(num[i]&amp;lt;num[i+1])
        {
            a=true;
            count++;
        }

        else
        {
            a=false;
            break;
        }
    }



    for(int i=count;i&amp;lt;n;i++)
    {
        if(num[i]&amp;lt;num[i+1])
        {
            a=true;
            count++;
        }

        else
        {
            a=false;
            break;
        }
    }

    for(int i=count;i&amp;lt;n;i++)
    {
        if(num[i]&amp;gt;num[i+1])
        {
            a=true;
            count++;
        }

        else
        {
            a=false;
            break;
        }
    }

    if(a==1)
    {
        cout&amp;lt;&amp;lt;"true";
    }
    else
    {
        cout&amp;lt;&amp;lt;"false";
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;suggest me a better approach to solve this problem&lt;br&gt;
&lt;a href="https://github.com/suryansh-code/DATA-STRUCTURE-ALGORITHM---CODING-NINJAS/blob/main/check_sequence.cppurl"&gt;git&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>github</category>
      <category>programming</category>
    </item>
    <item>
      <title>HOW TO SOLVE (N-rows ) DIAMOND PATTERN USING C++.</title>
      <dc:creator>suryansh taragi</dc:creator>
      <pubDate>Fri, 09 Sep 2022 15:57:20 +0000</pubDate>
      <link>https://dev.to/suryanshcode/n-rows-diamond-pattern-4567</link>
      <guid>https://dev.to/suryanshcode/n-rows-diamond-pattern-4567</guid>
      <description>&lt;p&gt;&lt;strong&gt;(N-ROWS) DIAMOND OF STARS PATTERN&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;loops are the most important part of any programming. to master the the concept of loops I practiced various type of pattern (Star,Alphabet,Numeric) .&lt;/p&gt;

&lt;p&gt;This question is a last question of assignment in coding-ninjas platform . &lt;/p&gt;

&lt;p&gt;**Print the following pattern for the given number of rows.&lt;br&gt;
Note: N is always odd.&lt;/p&gt;

&lt;p&gt;Pattern for N = 5&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PrfiVf8s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5wm2tjso49dremklnde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PrfiVf8s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5wm2tjso49dremklnde.png" alt="Image description" width="86" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The dots represent spaces.&lt;br&gt;
**&lt;/p&gt;

&lt;p&gt;I divided the pattern in 4 parts the upper left,The upper right,&lt;br&gt;
The bottom left and the bottom right . which makes it very easy to solve the given problem.so there are total 6 loops&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the loop which count the rows of upper triangle (n+1/2) .&lt;/li&gt;
&lt;li&gt;the loop which count the rows of bottom triangle (n/2).&lt;/li&gt;
&lt;li&gt;the loop to print spaces for upper triangle (nested loop of upper loop).&lt;/li&gt;
&lt;li&gt;the loop to print spaces for bottom triangle (nested loop of bottom loop).&lt;/li&gt;
&lt;li&gt;the loop to print the * for upper triangle (nested loop of upper loop).&lt;/li&gt;
&lt;li&gt;the loop to print the * for bottom triangle (nested loop of bottom loop).
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
using namespace std;
int main()
{
    int i, j, rowNum, space;
    cin&amp;gt;&amp;gt;rowNum;
    for(i=1; i&amp;lt;=(rowNum+1)/2; i++)
    {
        for(j=1; j&amp;lt;=(rowNum+1)/2-i; j++)
            cout&amp;lt;&amp;lt;" ";
        for(j=1; j&amp;lt;=(2*i-1); j++)
            cout&amp;lt;&amp;lt;"*";
        cout&amp;lt;&amp;lt;endl;
    }
    for(i=(rowNum/2); i&amp;gt;=1; i--)
    {
        for(j=1; j&amp;lt;=(rowNum/2)-i+1; j++)
            cout&amp;lt;&amp;lt;" ";
        for(j=1; j&amp;lt;=2*i-1; j++)
            cout&amp;lt;&amp;lt;"*";
        cout&amp;lt;&amp;lt;endl;
    }
    cout&amp;lt;&amp;lt;endl;
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/suryansh-code/DATA-STRUCTURE-ALGORITHM---CODING-NINJAS/blob/master/diamond_pattern.cpp"&gt;git-link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>codingninjas</category>
      <category>algorithms</category>
    </item>
  </channel>
</rss>
