<?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: Ruchika Atwal</title>
    <description>The latest articles on DEV Community by Ruchika Atwal (@ruchikaatwal).</description>
    <link>https://dev.to/ruchikaatwal</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%2F664844%2F255f7f0d-2db4-401d-b123-918e2c0c2ea9.jpg</url>
      <title>DEV Community: Ruchika Atwal</title>
      <link>https://dev.to/ruchikaatwal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ruchikaatwal"/>
    <language>en</language>
    <item>
      <title>Web Crawling and Scraping: Traditional Approaches vs. LLM Agents</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Wed, 18 Dec 2024 17:19:01 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/web-crawling-and-scraping-traditional-approaches-vs-llm-agents-4ldk</link>
      <guid>https://dev.to/ruchikaatwal/web-crawling-and-scraping-traditional-approaches-vs-llm-agents-4ldk</guid>
      <description>&lt;p&gt;Web crawling and scraping are essential for gathering structured data from the internet. Traditional techniques have dominated the field for years, but the rise of Large Language Models (LLMs) like OpenAI’s GPT has introduced a new paradigm. Let’s explore the differences, advantages, and drawbacks of these approaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;&lt;strong&gt;Traditional Web Crawling &amp;amp; Scraping&lt;/strong&gt;&lt;/u&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How It Works:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Traditional approaches rely on:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code-driven frameworks like Scrapy, Beautiful Soup, and Selenium.&lt;/li&gt;
&lt;li&gt;Parsing HTML structures using CSS selectors, XPath, or regular expressions.&lt;/li&gt;
&lt;li&gt;Rule-based logic for task automation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Efficient for predictable websites: Handles structured websites with consistent layouts.&lt;/li&gt;
&lt;li&gt;Customizability: Code can be tailored to specific needs.
Cost-effective: Does not require extensive computational resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Drawbacks:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Brittle to changes: Fails when website layouts change.
High development time: Requires expertise to handle edge cases (e.g., CAPTCHAs, dynamic content).&lt;/li&gt;
&lt;li&gt;Scalability issues: Struggles with large-scale, unstructured, or diverse data sources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;&lt;strong&gt;LLM Agents for Web Crawling &amp;amp; Scraping&lt;/strong&gt;&lt;/u&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How It Works:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;LLM agents use natural language instructions and reasoning to interact with websites dynamically. They can infer patterns, adapt to changes, and execute tasks without hard-coded rules. Examples include tools like LangChain or Auto-GPT for multi-step workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic adaptability: LLMs adapt to layout changes without reprogramming.&lt;/li&gt;
&lt;li&gt;Reduced technical barrier: Non-experts can instruct agents with plain language.&lt;/li&gt;
&lt;li&gt;Multi-tasking: Simultaneously extract data, classify, summarize, and clean it.&lt;/li&gt;
&lt;li&gt;Intelligent decision-making: LLMs infer contextual relationships, such as prioritizing important links or understanding ambiguous data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Drawbacks:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;High computational cost: LLMs are resource-intensive.&lt;/li&gt;
&lt;li&gt;Limited precision: They may misinterpret website structures or generate hallucinated results.&lt;/li&gt;
&lt;li&gt;Dependence on training data: Performance varies depending on LLM training coverage.&lt;/li&gt;
&lt;li&gt;API costs: Running LLM-based scraping incurs additional API usage fees.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When to Use Traditional Approaches vs. LLM Agents&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tr&gt;
    &lt;th&gt;Scenario&lt;/th&gt;
    &lt;th&gt;Traditional&lt;/th&gt;
    &lt;th&gt;LLM Agents&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Static, well-structured sites&lt;/td&gt;
    &lt;td&gt;✔&lt;/td&gt;
    &lt;td&gt;✘&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Dynamic or unstructured sites&lt;/td&gt;
    &lt;td&gt;✘&lt;/td&gt;
    &lt;td&gt;✔&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Scalability required&lt;/td&gt;
    &lt;td&gt;✔&lt;/td&gt;
    &lt;td&gt;✔&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Complex workflows (e.g., NLP)&lt;/td&gt;
    &lt;td&gt;✘&lt;/td&gt;
    &lt;td&gt;✔&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;Cost-sensitive projects&lt;/td&gt;
    &lt;td&gt;✔&lt;/td&gt;
    &lt;td&gt;✘&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;&lt;strong&gt;Key Takeaway&lt;/strong&gt;&lt;/u&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use traditional methods for tasks requiring precision, cost-efficiency, and structure.&lt;/li&gt;
&lt;li&gt;Opt for LLM agents when dealing with dynamic, unstructured, or context-sensitive data.
The future lies in hybrid models, combining the predictability of traditional approaches with the adaptability of LLMs to create robust and scalable solutions.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>llmagents</category>
      <category>llm</category>
      <category>crawling</category>
    </item>
    <item>
      <title>Web Crawling, Web Scraping And Its challenges</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Thu, 11 May 2023 15:46:40 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/web-crawling-web-scraping-and-its-challenges-3k94</link>
      <guid>https://dev.to/ruchikaatwal/web-crawling-web-scraping-and-its-challenges-3k94</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Web crawling &amp;amp; Web scraping :
&lt;/h2&gt;

&lt;p&gt;Web crawling and web scraping are two related techniques used for extracting data from websites, but they have distinct differences in their methodology and purpose.&lt;/p&gt;

&lt;p&gt;Web crawling is the automated process of navigating through web pages using a software program called a crawler or spider. The crawler visits web pages and indexes their content, links, and metadata, which is then stored in a database for further analysis or retrieval. Web crawling is often used for web search engines, where the crawler collects data from a large number of web pages to build an index for search queries.&lt;/p&gt;

&lt;p&gt;On the other hand, web scraping is the process of extracting specific data from web pages using automated software tools. Web scraping tools can extract data from various sources, including text, images, and videos, and transform it into a structured format such as a CSV, JSON, or XML file. Web scraping is often used for data mining, market research, and content aggregation, where the goal is to gather and analyze data from multiple websites.&lt;/p&gt;

&lt;p&gt;Web scraping and web crawling have some similarities, as both techniques involve automated software tools that interact with web pages. However, web scraping is more focused on data extraction, while web crawling is more focused on indexing and navigation. Additionally, web scraping can be more targeted and specific, while web crawling is more broad and general.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;There are many examples of how web crawling and web scraping can be used in various industries and applications. Here are a few examples :&lt;/u&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;E-commerce :&lt;/strong&gt; &lt;br&gt;
Web scraping can be used to extract product information from e-commerce websites such as Amazon or eBay. This data can be used for price monitoring, market analysis, or inventory management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Social media :&lt;/strong&gt; &lt;br&gt;
Web scraping can be used to collect user-generated content from social media platforms such as Twitter or Instagram. This data can be used for sentiment analysis, marketing research, or customer engagement.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Financial services :&lt;/strong&gt; &lt;br&gt;
Web scraping can be used to extract financial data from stock market websites or financial news portals. This data can be used for investment analysis, risk management, or financial modelling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;News media :&lt;/strong&gt; &lt;br&gt;
Web scraping can be used to collect news articles from various news websites such as BBC or CNN. This data can be used for media monitoring, trend analysis, or content curation.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Note : &lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
However, it is important to note that web scraping should be conducted ethically and legally, respecting the terms of service of the target websites and the privacy rights of the users.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;u&gt;Challenges in Web crawling :&lt;/u&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Web crawling can present several challenges that can affect the efficiency, accuracy, and legality of the crawling process. Here are some of the common challenges faced in web crawling:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Website blocking :&lt;/strong&gt;&lt;br&gt;
Some websites may use technologies such as CAPTCHAs, IP blocking, or user-agent detection to prevent automated access. This can make it difficult or impossible for the crawler to access the website.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data parsing :&lt;/strong&gt;&lt;br&gt;
Web pages can contain complex and unstructured data, which can make it difficult to extract relevant information. Moreover, some websites may use dynamic or AJAX-based content, which can require advanced techniques such as JavaScript rendering or browser emulation to extract data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data quality :&lt;/strong&gt;&lt;br&gt;
Web pages can contain duplicate, incomplete, or inaccurate data, which can affect the validity and reliability of the extracted data. Moreover, some websites may use anti-scraping measures such as honeypots or fake data to mislead the crawlers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Legal and ethical issues :&lt;/strong&gt;&lt;br&gt;
Web crawling can raise legal and ethical concerns such as copyright infringement, privacy violation, or web spamming. Crawlers should respect the terms of service of the target websites, obtain permission from the website owners, and apply ethical scraping practices such as rate limiting, respectful behaviour, and user-agent identification.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability and performance :&lt;/strong&gt;&lt;br&gt;
Web crawling can require significant computational resources, bandwidth, and storage capacity, especially when dealing with large or distributed websites. Moreover, web crawling can be time-sensitive, requiring real-time updates or continuous monitoring of the target websites.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;Solution for Web crawler blocking :&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;There are several solutions for website blocking that can help web crawlers to overcome access restrictions and avoid being detected as automated bots. Here are some of the common solutions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Proxy rotation :&lt;/strong&gt;&lt;br&gt;
Web crawlers can use a pool of rotating proxies to change their IP address and avoid being detected as coming from a single source. This can also help to distribute the crawling load across multiple IP addresses and reduce the risk of being blacklisted. Various proxy service providers are their find according to your use-case and cost.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User-agent customisation :&lt;/strong&gt;&lt;br&gt;
Web crawlers can customize their user-agent string to mimic the behaviour of a real user agent, such as a web browser. This can help to avoid being detected as a bot and enable access to websites that block bots.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Delay and throttling :&lt;/strong&gt;&lt;br&gt;
Web crawlers can introduce a delay or a throttling mechanism between requests to simulate the behaviour of a human user and avoid triggering anti-scraping measures such as rate limiting or traffic spikes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CAPTCHA solving :&lt;/strong&gt;&lt;br&gt;
Web crawlers can use CAPTCHA solving services to automatically solve CAPTCHAs and gain access to websites that use them. However, this solution may require additional computational resources and incur additional costs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Browser emulation :&lt;/strong&gt;&lt;br&gt;
Web crawlers can use headless browsers or browser emulators to simulate the behaviour of a real web browser and enable access to websites that use JavaScript or AJAX-based content. This can help to extract data that is not accessible through traditional web crawling techniques.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is important to note that some of these solutions may have legal and ethical implications and should be used with caution, respecting the terms of service of the target websites and the privacy rights of the users. Moreover, web crawlers should always monitor their performance and adjust their strategies according to the changing environment and the feedback from the target websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;Crawling large website some useful points :&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;If you are trying to crawl a large website, there are several techniques you can use to make the process more efficient. Here are some potential solutions to address the challenges of crawling large websites:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use parallel processing :&lt;/strong&gt;&lt;br&gt;
One way to speed up the crawling process is to use parallel processing. This involves splitting the crawling process across multiple threads or processes, each of which can crawl a separate section of the website simultaneously. This can significantly speed up the process and reduce the overall time required to crawl the entire site.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid duplicate requests :&lt;/strong&gt;&lt;br&gt;
When crawling a large website, it is easy to accidentally send duplicate requests to the same page. This can waste time and resources, and may also cause issues with the website's server. To avoid this, you can use caching techniques to store the results of previous requests and avoid sending duplicate requests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prioritize high-value pages :&lt;/strong&gt;&lt;br&gt;
Some pages on a website may be more important than others, either because they contain more valuable information or because they are more frequently visited by users. By prioritizing these high-value pages, you can ensure that they are crawled first, and that you do not waste time crawling less important pages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use a sitemap :&lt;/strong&gt;&lt;br&gt;
A sitemap is a file that contains a list of all the pages on a website. By using a sitemap, you can ensure that you crawl all the pages on the website in a systematic and efficient manner. This can also help you identify high-value pages and prioritize them for crawling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimize crawl settings :&lt;/strong&gt;&lt;br&gt;
Finally, it is important to optimize the crawl settings for the specific website you are crawling. This may include adjusting the crawl rate, setting crawl depth limits, and adjusting other settings to ensure that the crawling process is as efficient and effective as possible.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By using these techniques, you can make the process of crawling large websites more efficient and effective. However, it is important to remember that crawling large websites can still be a complex and challenging task, and may require a significant amount of time and resources to complete.&lt;/p&gt;

</description>
      <category>webscraping</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Mongo Database dump &amp; restore command - For ubuntu</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Wed, 15 Feb 2023 13:35:20 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/mongo-database-dump-restore-command-for-ubuntu-1oma</link>
      <guid>https://dev.to/ruchikaatwal/mongo-database-dump-restore-command-for-ubuntu-1oma</guid>
      <description>&lt;h3&gt;
  
  
  Introduction for NoSQL database MongoDB :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. MongoDB is a popular NoSQL document-oriented database that was first released in 2009.
2. MongoDB is an open-source database that is designed to be flexible and scalable, making it a popular choice for many modern web applications.
3. Unlike traditional relational databases, MongoDB stores data in flexible JSON-like documents, which allows for easy and fast querying of data.
4. MongoDB is known for its fast performance and scalability, making it an ideal choice for handling large amounts of data.

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Importance of why we need to backup data in MongoDB :
&lt;/h3&gt;

&lt;h5&gt;
  
  
  &lt;strong&gt;Problem :&lt;/strong&gt;
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Data loss can be a serious problem for organisations that rely on MongoDB for their applications.
- Without proper backups, organisations may be at risk of losing critical data in the event of a hardware failure, software bug, or other issue.
- The process of backing up data can be time-consuming and complex, especially for organisations with large amounts of data.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  &lt;strong&gt;Highlights :&lt;/strong&gt;
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Losing important data can be a major setback for any organisation, leading to lost revenue, decreased productivity, and damaged reputation.
- Without proper backups, organisations are putting their critical data at risk, which can lead to costly downtime and lost business opportunities.
- The process of backing up data can be a challenge for organisations, especially those that lack the resources or expertise to do it effectively.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  &lt;strong&gt;Solve :&lt;/strong&gt;
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Schedule regular backups: Establish a regular backup schedule that meets your organisation's needs and make sure it is followed consistently.
- Use a reliable backup solution: Choose a backup solution that is reliable, secure, and easy to use. Consider options like MongoDB Cloud Backup or third-party backup tools.
- Test your backups: Regularly test your backups to make sure they are working as expected and can be used to restore data in the event of a failure.
- Consider a managed backup service: If you lack the expertise or resources to manage backups in-house, consider using a managed backup service that can handle backups for you.
- By implementing these solutions, organizations can protect their critical data and avoid the risk of data loss. With a reliable backup strategy in place, organizations can focus on their core business objectives and rest assured that their data is safe and secure.


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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mongo dump command
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongodump --host your_db_ip --port your_db_port --username db_username --password db_password -d database_name -c collection_name --out /folder_path --authenticationDatabase admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mongo restore command
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongorestore -d database_name -c collection_name
/folder_path/database_folder_name/collection_file_name.bson --host your_db_ip --port your_db_port --username db_username --password db_password --authenticationDatabase admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mongo dump command with zip
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongodump --host your_db_ip --port your_db_port --authenticationDatabase admin --username db_username --password db_password -d database_name -c collection_name --gzip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mongo restore command with zip
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongorestore --gzip --db database_name --collection collection_name ./collection_name.bson.gz --host your_db_ip --port your_db_port --authenticationDatabase admin --username db_username --password db_password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Working with multiple python and pip version on one machine with virtual enviornment.</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Tue, 26 Jul 2022 12:45:00 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/working-with-multiple-python-and-pip-version-on-one-machine-with-virtual-enviornment-3bao</link>
      <guid>https://dev.to/ruchikaatwal/working-with-multiple-python-and-pip-version-on-one-machine-with-virtual-enviornment-3bao</guid>
      <description>&lt;p&gt;Based on python requirment you can first instal python version you want. Just time of virtual environment creation mention python version. Below have provided example with python3.7. if you want to use create python3.8 or any other version, replace python3.7 with your python version.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create python virtual environment without pip
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;python3.7 &lt;span class="nt"&gt;-m&lt;/span&gt; venv myenv_python37 &lt;span class="nt"&gt;--without-pip&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Activate python virtual environment you created above
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;source &lt;/span&gt;myenv_python37/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now, install pip inside virtual environment
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl https://bootstrap.pypa.io/get-pip.py | python
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;If you get error while installing pip:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ModuleNotFoundError: No module named &lt;span class="s1"&gt;'distutils.cmd'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;install below distutils package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt-get install python3.7-distutils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install all requirement for python 3.7 inside virtual enviornment
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;After your work is done, close virtual environment&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;This helps maintaining multiple python and pip version on one system and using python and its supported package based on your requirement.&lt;/li&gt;
&lt;li&gt;All packages from requirements.txt would be accesible inside virtual environment only, not global on your system for python3.7&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Session Vs Cookies, Stateless Vs Stateful Protocol, HTTP Session Tracking</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Sun, 17 Jul 2022 10:15:40 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/session-vs-cookies-stateless-vs-stateful-protocol-http-session-tracking-3gih</link>
      <guid>https://dev.to/ruchikaatwal/session-vs-cookies-stateless-vs-stateful-protocol-http-session-tracking-3gih</guid>
      <description>&lt;h3&gt;
  
  
  &lt;u&gt;&lt;strong&gt;Session Vs Cookies&lt;/strong&gt; :&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;Cookies and Sessions are used to store information. Cookies are only stored on the client-side machine, while sessions get stored on the client as well as a server.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;u&gt;Session&lt;/u&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A session creates a file in a temporary directory on the server where registered session variables and their values are stored. This data will be available to all pages on the site during that visit.&lt;/li&gt;
&lt;li&gt;A session ends when the user closes the browser or after leaving the site, the server will terminate the session after a predetermined period of time, commonly 30 minutes duration.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;Cookies&lt;/u&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Cookies contains a piece of information are not safe, though it is kept on client-side server. &lt;/li&gt;
&lt;li&gt;Cookies are text files stored on the client computer and they are kept of use tracking purpose. Server script sends a set of cookies to the browser. For example name, age, or identification number etc. The browser stores this information on a local machine for future use. When next time browser sends any request to web server then it sends those cookies information to the server and server uses that information to identify the user.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;&lt;strong&gt;Stateless Vs Stateful Protocol&lt;/strong&gt; :&lt;/u&gt;
&lt;/h3&gt;

&lt;p&gt;Network Protocols for web browser and servers are categorized into two types: &lt;strong&gt;Stateless Protocol&lt;/strong&gt;, and &lt;strong&gt;Stateful protocol&lt;/strong&gt;. These two protocols are differentiated on the basis of the requirement of server or server-side software to save status or session information.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;u&gt;&lt;strong&gt;Stateless Protocol&lt;/strong&gt; :&lt;/u&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;In Stateless protocol, Client send request to the server and server response back according to current state. &lt;/li&gt;
&lt;li&gt;It does not require the server to retain session information or a status about each communicating partner for multiple request. &lt;/li&gt;
&lt;li&gt;Means, whenever the request is sent to  server , server does not store the information about client/user request. Each time the same user sent the request, for server it will be new user though it is same user. As no information or id is being store with server for validation or identification.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Example of Stateless Protocol&lt;/strong&gt; :&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;HTTP (Hypertext Transfer Protocol)&lt;/li&gt;
&lt;li&gt;UDP (User Datagram Protocol)&lt;/li&gt;
&lt;li&gt;DNS (Domain Name System)&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Features of Stateless Protocols&lt;/strong&gt; :&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Stateless Protocol simplify the design of Server.&lt;/li&gt;
&lt;li&gt;The stateless protocol requires less resources because system do not need to keep track of the multiple link communications and the session details.&lt;/li&gt;
&lt;li&gt;In Stateless Protocol each information packet travel on it’s own without reference to any other packet.&lt;/li&gt;
&lt;li&gt;Each communication in Stateless Protocol is discrete and unrelated to those that precedes or follow.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;u&gt;&lt;strong&gt;Statefull Protocol&lt;/strong&gt; :&lt;/u&gt;
&lt;/h4&gt;

&lt;p&gt;In Stateful Protocol If client send a request to the server then it expects some kind of response, if it does not get any response then it resend the request. FTP (File Transfer Protocol), Telnet are the example of Stateful Protocol.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Features of Stateless Protocols&lt;/strong&gt; :&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Stateful Protocols provide better performance to the client by keeping track of the connection information.&lt;/li&gt;
&lt;li&gt;Stateful Application require Backing storage.&lt;/li&gt;
&lt;li&gt;Stateful request are always dependent on the server-side state.&lt;/li&gt;
&lt;li&gt;TCP session follow stateful protocol because both systems maintain information about the session itself during its life.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;u&gt;&lt;strong&gt;HTTP Session Tracking explanation how it works :&lt;/strong&gt;&lt;/u&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Whenever the client/user makes request to server.&lt;/li&gt;
&lt;li&gt;The request is being made through/via HTTP.&lt;/li&gt;
&lt;li&gt;HTTP stands for Hyper Text Transfer Protocol&lt;/li&gt;
&lt;li&gt;HTTP is a stateless protocol.&lt;/li&gt;
&lt;li&gt;Stateless protocol means the server does not track user, so no information is stored with server regarding client/user request.&lt;/li&gt;
&lt;li&gt;So the problem here is that&lt;/li&gt;
&lt;li&gt;Whenever the client/user makes multiple request, Same client/user is new for server.&lt;/li&gt;
&lt;li&gt;So to overcome , session and cookie came in-hand&lt;/li&gt;
&lt;li&gt;As http is stateless, to maintain state, server decided whenever client/user sent the request a ID will be sent along with request, and server though return same ID with response to keep track.&lt;/li&gt;
&lt;li&gt;After session is created ,  after sending request and response recieved, server sends key with response to browser known as cookie.&lt;/li&gt;
&lt;li&gt;So whenever the client/user sent request again browser takes cookie along with request to server.&lt;/li&gt;
&lt;li&gt;So know the server check cookie id(key),  and check for which session (client/user) does this cookie id (key) belongs to&lt;/li&gt;
&lt;li&gt;So server identifies user with cookie.&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Note : Points to remember  :
&lt;/h6&gt;

&lt;ul&gt;
&lt;li&gt;Session is used to identify a user/client.&lt;/li&gt;
&lt;li&gt;Session is stored at server side.&lt;/li&gt;
&lt;li&gt;Cookie is stored in browser on client side.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>session</category>
      <category>cookies</category>
      <category>webcookies</category>
      <category>httpsession</category>
    </item>
    <item>
      <title>Ubuntu commands</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Tue, 28 Jun 2022 15:03:42 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/ubuntu-commands-4e9n</link>
      <guid>https://dev.to/ruchikaatwal/ubuntu-commands-4e9n</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Command 'df' Short of "desk free". used to check available disk on system. Displays the information of file system device names, disk blocks, total disk space used, available disk space, percentage of usage and mount points on a file system
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;df&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;With df add -h to display Disk Space in Human Readable Format like in MB and GB.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Show only your home file system information.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; /home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change directory/Folder.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /folder_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Show just the names of files and directories existing in your present directory.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Show list of all the files and directories existing along with the details like permissions, ownership, size etc.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ll
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Beginner's - creating virtual environment on ubuntu for python</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Mon, 27 Jun 2022 09:56:41 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/beginners-create-virtual-environment-on-ubuntu-for-python-5ap2</link>
      <guid>https://dev.to/ruchikaatwal/beginners-create-virtual-environment-on-ubuntu-for-python-5ap2</guid>
      <description>&lt;h2&gt;
  
  
  Installing virtual environment
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Update your system
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install Virtual Environment package with below command :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;virtualenv &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a python virtual environment directory for different.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/python-environments &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/python-environments
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;Explanation :&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mkdir&lt;/strong&gt; -&amp;gt; is used a create folder/directory in ubuntu from &lt;br&gt;
         terminal&lt;br&gt;
&lt;strong&gt;cd&lt;/strong&gt;    -&amp;gt; is used to change path for folder/directory path&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&amp;amp;&amp;amp;&lt;/strong&gt;    -&amp;gt; is used to join and run 2 commands in terminal &lt;br&gt;
           together at once&lt;/p&gt;

&lt;p&gt;You can run make directory and change directory command in separate line too :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/python-environments
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/python-environments
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now create python virtual environment :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;virtualenv &lt;span class="nt"&gt;--python&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;python3.8 env_python38
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running create virtual enviornment commant output in terminal would be like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;created virtual environment CPython3.8.10.final.0-64 &lt;span class="k"&gt;in &lt;/span&gt;80ms
  creator CPython3Posix&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;dest&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/ruchika/python-environments/env_python38, &lt;span class="nv"&gt;clear&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;False, &lt;span class="nv"&gt;global&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;False&lt;span class="o"&gt;)&lt;/span&gt;
  seeder FromAppData&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;download&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;False, &lt;span class="nv"&gt;pip&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;latest, &lt;span class="nv"&gt;setuptools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;latest, &lt;span class="nv"&gt;wheel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;latest, &lt;span class="nv"&gt;pkg_resources&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;latest, &lt;span class="nv"&gt;via&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;copy, &lt;span class="nv"&gt;app_data_dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/ruchika/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1&lt;span class="o"&gt;)&lt;/span&gt;
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;type ls command to check list of file, folder in current directory :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can your created virtual environment directory :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;env_python38
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check your environment is installed with the python version is proper :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls &lt;/span&gt;env_python38/lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Activate and deactivate virtual environment
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Activate your virtual environment
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;source &lt;/span&gt;env_python38/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After activating you see your virtual env name in rounf bracket :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;env_python38&lt;span class="o"&gt;)&lt;/span&gt; yoursystemname:~/python-environments&lt;span class="err"&gt;$&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Deactiavte (close) your virtual environment:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;deactivate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ubuntu</category>
      <category>virtualenvironment</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Remove extra space from text with regex - Python</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Fri, 24 Jun 2022 09:22:59 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/remove-extra-space-from-text-with-regex-python-42hj</link>
      <guid>https://dev.to/ruchikaatwal/remove-extra-space-from-text-with-regex-python-42hj</guid>
      <description>&lt;p&gt;Easy way to remove extra spaces from text, paragraph with regex in python&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Import regular expression packages
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Remove extra spaces from text.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;  Hi python   is a case   sensitive language.    &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; +&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text : &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation for above piece of code :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;re.sub() - is a function in used to replace sub-string with another sub-string.&lt;/li&gt;
&lt;li&gt;first argument in sub function is regular expression to find sub-string expression that will replace, 
i.e: ' +'      (space with +) capture number of spaces.&lt;/li&gt;
&lt;li&gt;second argument is what will replace in place of first argument, 
i.e: ' '       (one single space to replace with number of spaces)&lt;/li&gt;
&lt;li&gt;third argument is your piece of text variable that you want to clean.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>regex</category>
      <category>text</category>
      <category>cleaning</category>
    </item>
    <item>
      <title>Git - Beginner's Guide</title>
      <dc:creator>Ruchika Atwal</dc:creator>
      <pubDate>Wed, 22 Jun 2022 16:23:52 +0000</pubDate>
      <link>https://dev.to/ruchikaatwal/git-beginners-guide-2fkj</link>
      <guid>https://dev.to/ruchikaatwal/git-beginners-guide-2fkj</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Git is version control system used to handle small to very large projects efficiently. &lt;/p&gt;

&lt;p&gt;Git helps in tracking changes in the source code, enabling multiple developers to work together on non-linear development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing git on ubuntu
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Update packages
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install git
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;sudo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Confirm that you have installed Git correctly by running the following command :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Push your first project folder to git server
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;How to initialiaze git in local system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After this command it will create empty git directory under current directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;init&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;git&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Staging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After initiate git, now check what files are there for stating area.  File have have added or not.  If file not added to staging it will show filename as red color.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add to staging
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;#### to add single file or folder&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;#### to add all file and folder&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding you can check status by git status,  file is added to staging or no.&lt;/p&gt;

&lt;p&gt;And then now we need to commit changes.&lt;/p&gt;

&lt;p&gt;Note:.  Add will only add in the queue,  it will not be added to versioning,  after commit it will be added to version control.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commit
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;commit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-m&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"this helps to track changes readble easy,  so write what changes you made"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
