<?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: Jonathan Cardoso</title>
    <description>The latest articles on DEV Community by Jonathan Cardoso (@jonathanccardoso).</description>
    <link>https://dev.to/jonathanccardoso</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%2F245537%2Ffcf7fdc4-9c65-4800-afdf-94d121add671.jpeg</url>
      <title>DEV Community: Jonathan Cardoso</title>
      <link>https://dev.to/jonathanccardoso</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jonathanccardoso"/>
    <language>en</language>
    <item>
      <title>Challenges working on my first app with React Native</title>
      <dc:creator>Jonathan Cardoso</dc:creator>
      <pubDate>Tue, 25 Jul 2023 17:14:28 +0000</pubDate>
      <link>https://dev.to/jonathanccardoso/challenges-working-on-my-first-app-with-react-native-j77</link>
      <guid>https://dev.to/jonathanccardoso/challenges-working-on-my-first-app-with-react-native-j77</guid>
      <description>&lt;h2&gt;
  
  
  Initial challenges
&lt;/h2&gt;

&lt;p&gt;Setting up the environment variables, such as Java, Kotlin, Android e Android SDK, along with the Android Studio program and configuring some emulators, can be an initially intense challenge. Going through all this initial setup may vary slightly on each operation system. In my case, I used Linux, and it took a considerable amount of time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YjMbyV3b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/8860/0%2AQN0Cpnp_oS3eMH-G" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YjMbyV3b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/8860/0%2AQN0Cpnp_oS3eMH-G" alt="Photo by [Simon Abrams](https://unsplash.com/@flysi3000?utm_source=medium&amp;amp;utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral)" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug resolutions
&lt;/h2&gt;

&lt;p&gt;Some technical challenges can be identified throughout the project, such as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; Removal of unused code and improper reuse of functions and hooks;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complexity:&lt;/strong&gt; Separation and restructuring of functions and responsibilities within the code;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Styling:&lt;/strong&gt; Improvement of layout responsiveness, such as font sizes and creation of new layouts. One suggestion is to use React Native’s &lt;a href="https://reactnative.dev/docs/dimensions"&gt;dimensions&lt;/a&gt;, which will greatly facilitate the process;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Libraries:&lt;/strong&gt; Update libraries, which is a common problem in Javascript projects, especially in older projects, where several incompatibilities may arise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exception handling:&lt;/strong&gt; Every app must have exception handling to avoid corruption in the app’s usage. One option is to use the &lt;strong&gt;&lt;a href="https://www.npmjs.com/package/react-native-exception-handler"&gt;react-native-exception-handler&lt;/a&gt;&lt;/strong&gt; library, which assists in handling fatal or no-fatal exceptions, allowing for a higher level of customization in the cataloging of errors that can be displayed or not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.typescriptlang.org/"&gt;TypeScript:&lt;/a&gt;&lt;/strong&gt; A project may present some challenges, but a new scenario full of possibilities appears on your table, such as optimizations, improvements, best practices, and new libraries, all to deliver the best app to the end user.&lt;/p&gt;

&lt;p&gt;In this article, I shared my main challenges, which I believe are common to all beginner developers in the mobile area. With that, I hope to have contributed some useful knowledge. If you have experienced similar situations or enjoyed the content I shared, please share and like the article!&lt;/p&gt;

&lt;p&gt;Adding this tool is crucial to assist in ensuring code quality and reducing common errors in data handling, increasing the potential for error detection during development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Facing Performance Issues: Memory
&lt;/h2&gt;

&lt;p&gt;This topic has truly been one of the most challenging. Understanding the reason why the app is closing unexpectedly, raises several questions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Could it be a code error, with some variable being null or undefined and causing a mapping (map) operation?”&lt;br&gt;
 “Is the app stuck because of rendering too much data on the same screen?&lt;br&gt;
 “Could it possibly be a memory leak?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Issues related to this often involve memory leaks. It is crucial to conduct a thorough study of memory management in React Native at this stage. I recommend reading this article: &lt;em&gt;“&lt;a href="https://blog.swmansion.com/hunting-js-memory-leaks-in-react-native-apps-bd73807d0fde"&gt;Hunting JS memory leaks in React Native apps&lt;/a&gt;”.&lt;/em&gt; Additionally, you can analyze your app using the &lt;a href="https://developer.android.com/studio/profile/android-profiler?hl=pt-br"&gt;Android Studio Profiler&lt;/a&gt; tool, which will help identify memory leak points during real-time app navigation.&lt;/p&gt;

&lt;p&gt;However, the initial solution typically involves a meticulous code search. Refactoring components with a higher data flow and complexity to use best performance practices, such as:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hooks:&lt;/strong&gt; useMemo, useCallback e useEffect;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API:&lt;/strong&gt; lazy, memo e flatList, &lt;strong&gt;&lt;em&gt;&lt;a href="https://legacy.reactjs.org/docs/context.html"&gt;contextAPI&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The usage of these tools must be done responsibly, considering the objectives of each one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Other tips to solve potential errors include removing unnecessary component renderings with conditional limitations, like data pagination. Moreover, it is essential to avoid passing improper properties to these components.&lt;/p&gt;

&lt;p&gt;To render various items, the use of FlatList and pagination strategies in data searches is vital to prevent data retrieval from causing freezes. Remember that, in mobile devices, the data load limit should be lighter than what is typically used in web environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Versioning
&lt;/h3&gt;

&lt;p&gt;One of the common problems I faced was dealing with update checks, both on Android and IOS. This becomes a challenge when users don’t update the app frequently. One strategy is overcome this problem is to force the user to update the app through their respective app stores. For this purpose, you can use the &lt;a href="https://www.npmjs.com/package/react-native-version-check"&gt;react-native-version-check&lt;/a&gt; library, which will check the version of the installed app and compare it with the version available in the stores. This way, you can display an informative pop-up if an update is available.&lt;/p&gt;

&lt;h3&gt;
  
  
  Webview
&lt;/h3&gt;

&lt;p&gt;React Native has a useful library to incorporate a &lt;a href="https://www.npmjs.com/package/react-native-webview"&gt;WebView&lt;/a&gt; strategy, allowing you to display a web page within the app itself. However, this approach has its limitations, especially when dealing with web pages that have intense data flow.&lt;/p&gt;

&lt;p&gt;To overcome this issue, I suggest an excellent alternative: the &lt;a href="https://www.npmjs.com/package/react-native-inappbrowser-reborn"&gt;react-native-inappbrowser-reborn&lt;/a&gt; library. With it, you will experience smoother performance and have the ability to customize the display of the web page. Moreover, this library allows you to open the page in a default browser or share the link with any other app, providing greater flexibility and interaction with the web in your app, without the limitations of the standard WebView.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;A project may present some challenges, but a new scenario full of possibilities appears on your table, such as optimizations, improvements, best practices, and new libraries, all to deliver the best app to the end user.&lt;/p&gt;

&lt;p&gt;In this article, I shared my main challenges, which I believe are common to all beginner developers in the mobile area. With that, I hope to have contributed some useful knowledge. If you have experienced similar situations or enjoyed the content I shared, please &lt;strong&gt;share&lt;/strong&gt; and &lt;strong&gt;like&lt;/strong&gt; the article!&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>android</category>
      <category>ios</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to Develop a Portfolio using Gatsby</title>
      <dc:creator>Jonathan Cardoso</dc:creator>
      <pubDate>Mon, 13 Jul 2020 20:03:01 +0000</pubDate>
      <link>https://dev.to/jonathanccardoso/how-to-develop-a-portfolio-using-gatsby-2fjn</link>
      <guid>https://dev.to/jonathanccardoso/how-to-develop-a-portfolio-using-gatsby-2fjn</guid>
      <description>&lt;h3&gt;
  
  
  Making it more performance, using: Styled Components, Netlify, GraphQL, …
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Gatsby is a React-based static website generator. It offers advantages such as performance and SEO components!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2018
&lt;/h2&gt;

&lt;p&gt;In 2018, I wanted to apply some knowledge, and thus learn more about components, in addition to wanting to have my own website. So I elaborated using these technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://getbootstrap.com/"&gt;Bootstrap v4&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://fontawesome.com/"&gt;Font Awesome&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Javascript&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, over time there was a need to apply new development stacks, which made me think about refactoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  New website
&lt;/h2&gt;

&lt;p&gt;With the rise of javascript frameworks, in 2020, I refactored using Gatsby. Along with some specific tools to increase performance, the main ones are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.gatsbyjs.org/"&gt;Gatsby&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://graphql.org/"&gt;GraphQL&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.styled-components.com/"&gt;Styled Components&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ueZ20kgP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2708/1%2AO92ylDjH7BUebikE9xk83g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ueZ20kgP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2708/1%2AO92ylDjH7BUebikE9xk83g.png" alt="Screenshot of the website"&gt;&lt;/a&gt;&lt;em&gt;Screenshot of the website&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Gatsby
&lt;/h2&gt;

&lt;p&gt;An SSG (Static Site Generator), based on React that uses GraphQL for content consumption.&lt;/p&gt;

&lt;p&gt;As already mentioned, one of its main advantages is to generate static files in the build, becoming a great ally to use SEO resources, having integrations through plugins with &lt;a href="https://www.gatsbyjs.org/docs/adding-analytics/"&gt;Analytics&lt;/a&gt; and &lt;a href="https://www.gatsbyjs.org/packages/gatsby-plugin-react-helmet/"&gt;Helmet&lt;/a&gt;. And it has multiple plugins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GI2HBM24--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AlTP8mYYrDTVQ0qkxa8aRGQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GI2HBM24--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AlTP8mYYrDTVQ0qkxa8aRGQ.png" alt="How Gatsby works on Docs Gatsby"&gt;&lt;/a&gt;&lt;em&gt;How Gatsby works on Docs Gatsby&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GraphQL
&lt;/h2&gt;

&lt;p&gt;Created with the aim of facilitating data manipulation, where you make queries describing what type of data you need and it returns exactly the respective values.&lt;/p&gt;

&lt;p&gt;Together with Gatsby, we inform what data a specific component will need. Then, the Gatsby receive this data when that component is rendered.&lt;/p&gt;

&lt;h2&gt;
  
  
  Styled Components
&lt;/h2&gt;

&lt;p&gt;CSS-in-JS solution, which takes advantage of current componentization methods to create components in a way that reduces style conflicts, for example:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Static object&lt;br&gt;
const Box = styled.div({&lt;br&gt;
  background: 'palevioletred',&lt;br&gt;
  height: '50px',&lt;br&gt;
  width: '50px'&lt;br&gt;
});

&lt;p&gt;// Adapting based on props&lt;br&gt;
const PropsBox = styled.div(props =&amp;gt; ({&lt;br&gt;
  background: props.background,&lt;br&gt;
  height: '50px',&lt;br&gt;
  width: '50px'&lt;br&gt;
}));&lt;/p&gt;

&lt;p&gt;render(&lt;br&gt;
  &amp;lt;div&amp;gt;&lt;br&gt;
    &amp;lt;Box /&amp;gt;&lt;br&gt;
    &amp;lt;PropsBox background="blue" /&amp;gt;&lt;br&gt;
  &amp;lt;/div&amp;gt;&lt;br&gt;
);&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Netlify&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;It’s a complete and automated platform for hosting projects “free for personal projects”, where it already has continuous deployment and several advanced features.&lt;/p&gt;

&lt;p&gt;In the continuous deployment process, each build performed can be accessed separately through a generated URL.&lt;/p&gt;

&lt;p&gt;If you want to know more about the source code, just access &lt;a href="https://github.com/jonathanccardoso/jonathanccardoso"&gt;github&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;I hope you enjoyed the content! If you have suggestions and/or criticisms comment below. Bye! 🖐🏽&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>javascript</category>
      <category>netlify</category>
      <category>seo</category>
    </item>
    <item>
      <title>Python3 Challenge: Unraveling Web Scraping</title>
      <dc:creator>Jonathan Cardoso</dc:creator>
      <pubDate>Wed, 17 Jun 2020 19:32:50 +0000</pubDate>
      <link>https://dev.to/jonathanccardoso/python3-challenge-unraveling-web-scraping-4fjg</link>
      <guid>https://dev.to/jonathanccardoso/python3-challenge-unraveling-web-scraping-4fjg</guid>
      <description>&lt;h3&gt;
  
  
  How to add dynamic data from different pages on a website efficiently!
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s a challenge that was requested in a real job interview, the purpose of this article is to show the technologies involved and learned during the challenge. Prior knowledge of the Django framework is required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Challenge
&lt;/h2&gt;

&lt;p&gt;A page Django is developed that presents the requested information automatically and is always up to date, and that page presents the updated numbers promptly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The estimated population of cities Natal/RN and Mossoró/RN.&lt;/li&gt;
&lt;li&gt;Sum of the populations of cities.&lt;/li&gt;
&lt;li&gt;Municipal human development index (MHDI) of the cities of Natal/RN and Mossoró/RN.&lt;/li&gt;
&lt;li&gt;The average for the Natal and Mossoró MHDIs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of this according to the data on the page&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ibge.gov.br/cidades-e-estados.html?view=municipio"&gt;https://www.ibge.gov.br/cidades-e-estados.html?view=municipio&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scrapping
&lt;/h2&gt;

&lt;p&gt;The language Python stands out a lot in data collection on the web. We will use the **Beautiful Soup **module, which creates a tree from HTML and XML documents analyzed on the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting project
&lt;/h2&gt;

&lt;p&gt;Since you have already created a Django project and have already activated your &lt;strong&gt;virtualenv&lt;/strong&gt; &lt;em&gt;(I advise you to use it)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Let’s use &lt;strong&gt;bs4&lt;/strong&gt; from &lt;strong&gt;Beautiful Soup&lt;/strong&gt;, we have to install the library in the project, through &lt;strong&gt;pip&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;(venv) ❯ pip install bs4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  HTML
&lt;/h2&gt;

&lt;p&gt;Given that you have already created a &lt;em&gt;templates&lt;/em&gt; folder in the app, your structure will correspond more or less this away:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cV_rgLO0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AaeHYmdRDi1RRJKwuTo007Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cV_rgLO0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2000/1%2AaeHYmdRDi1RRJKwuTo007Q.png" alt="Structure of Django files and folders"&gt;&lt;/a&gt;&lt;em&gt;Structure of Django files and folders&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now created an HTML page, in my case index.html, to show the content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.githubusercontent.com/jonathanccardoso/182a8d0d81774c130be1b9521114375d/raw/576321e412f29b60d0514f438539b1b7a3c90197/index.html"&gt;View Raw index.html on Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Scrapping
&lt;/h2&gt;

&lt;p&gt;Each website has it’s structure so inspect the area you want to capture and analyze, going thought each &lt;em&gt;li&lt;/em&gt; inside of the &lt;em&gt;ul&lt;/em&gt; in class &lt;em&gt;“resultados-padrao”&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a93P4qQH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2730/1%2AZDlfEGDSqK2t_nbdFq2FKw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a93P4qQH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2730/1%2AZDlfEGDSqK2t_nbdFq2FKw.png" alt="Source Code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;views&lt;/strong&gt;, we start by importing the tools to be used and the variables, placing cities and their respective fields:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.shortcuts import render
import re

import requests, json, locale
from bs4 import BeautifulSoup

def index(request):
  city = [
    {'state': 'rn', 'name': 'natal'},
    {'state': 'rn', 'name': 'mossoro'}
  ]
  fields = [
    'População', 'IDHM'
  ]
  city_values = []

context = {}

return render(request, 'ibge/index.html', context)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In the cityData function, pass the city variable as a parameter, scrolling by name and state, call the pages by the URL parameter through the cities, after capturing the page labels and values.&lt;/p&gt;

&lt;p&gt;If the selected fields are the same as the ones requested, save them in the arrays, after returning city_data.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def cityData(city):
  city_data = []
  for item in city:
    # convert and read in json
    item = json.dumps(item)
    item = json.loads(item)

name = item['name']
    state = item['state']
    url_request = requests.get("https://www.ibge.gov.br/cidades-e-estados/"+ state +"/"+ name +".html")
    div_select = BeautifulSoup(url_request.content, 'html.parser')

    ul = div_select.find(class_='resultados-padrao')
    city_label = ul.findAll("p", {"class": "ind-label"})
    city_value = ul.findAll("p", {"class": "ind-value"})

    data = []
    for label, value in zip(city_label, city_value):
      text_label = label.text
      text_value = value.text
      if text_label.split()[0] == fields[0] or text_label.split()[0] == fields[1]:
        data.append([text_label, text_value])
        city_values.append(text_value.split()[0])

     data.append([name, state])
     city_data.append(data)
  return city_data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In conclusion, the expected result from &lt;strong&gt;views&lt;/strong&gt; is this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.githubusercontent.com/jonathanccardoso/a8d063e451887e904f837dd259222915/raw/3b8c8d0ad1f9dd59a8de5257bd7330d4ecaca715/views.py"&gt;View Raw views.py on Github&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;After that, we’re done. Use this command to run the web application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;(venv) ❯ python manage.py runserver
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--77qswQkK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2730/1%2AqbAuyc31yxXAzYZtviH1YQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--77qswQkK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2730/1%2AqbAuyc31yxXAzYZtviH1YQ.png" alt="Page rendering IBGE data."&gt;&lt;/a&gt;&lt;em&gt;Page rendering IBGE data.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we used Python, Django, and Beautiful Soup to collect data. You now have great possibilities for development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jonathanccardoso/challenges-interviews"&gt;Project repository on Github&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;I hope you enjoyed the content! If you have suggestions and/or criticisms comment below. Bye! 🖐🏽&lt;/p&gt;

</description>
      <category>django</category>
      <category>scraping</category>
      <category>challenge</category>
      <category>python</category>
    </item>
    <item>
      <title>Become a Productive Programmer with VSCode</title>
      <dc:creator>Jonathan Cardoso</dc:creator>
      <pubDate>Mon, 18 May 2020 15:46:37 +0000</pubDate>
      <link>https://dev.to/jonathanccardoso/become-a-productive-programmer-with-vscode-3hid</link>
      <guid>https://dev.to/jonathanccardoso/become-a-productive-programmer-with-vscode-3hid</guid>
      <description>&lt;h3&gt;
  
  
  Do you know all the tools?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;If you spent hours and hours programming in your IDE and felt that you were performing more mechanical than logical actions or were not having as much productivity? This article is for you!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Themes
&lt;/h2&gt;

&lt;p&gt;A fact that must be taken into account. In vscode, there are several themes that can help you not to overload your vision (the case of a dark theme) and improve the reading of source codes.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Researching themes&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;On the sidebar tab, of a block-like icon (Ctrl/⌘ + Shift + x), of vscode, is the extension part, where you can write in the search bar &lt;strong&gt;“category: themes”&lt;/strong&gt;, being filtered by downloads and stars. One of the community favorites that I can measure, is &lt;a href="https://marketplace.visualstudio.com/items?itemName=gerane.Theme-Dracula"&gt;Dracula&lt;/a&gt;, &lt;a href="https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme"&gt;Material Theme&lt;/a&gt; &lt;strong&gt;e &lt;a href="https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark"&gt;Atom One Dark Theme&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once selected and installed, the platform will restart and load the selected theme.&lt;/p&gt;

&lt;h2&gt;
  
  
  Extensions
&lt;/h2&gt;

&lt;p&gt;And it doesn’t matter what language (markup or programming) you use in vscode, there is some extension to that language, &lt;em&gt;snippets&lt;/em&gt;, &lt;em&gt;emmets&lt;/em&gt; and &lt;em&gt;linting&lt;/em&gt;, which I will explain shortly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--muz6b6gJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2800/0%2A28m5oxh_6BWSUke_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--muz6b6gJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/2800/0%2A28m5oxh_6BWSUke_.png" alt="vscode extensions screen on vscode"&gt;&lt;/a&gt;&lt;em&gt;vscode extensions screen on vscode&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And don’t stop there, there are also for formatters, stylists, test managers, packages, etc. Here are some extensions that I use a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Python&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Bracket Pair Colorizer&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Material Icon Theme&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;SASS&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Prettier Code formatter&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;ESLint&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Color Highlight&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Vscode Styled Components&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Shortcuts
&lt;/h2&gt;

&lt;p&gt;Shortcuts are good practice for productivity, the more the better.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Search by settings: &lt;strong&gt;Ctrl/⌘ + Shift + p&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Search or files: &lt;strong&gt;Ctrl/⌘ + Shift + p&lt;/strong&gt;, (erasing the arrow)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Search line in the file: &lt;strong&gt;Ctrl/⌘ + Shift + p&lt;/strong&gt;, (erasing the arrow and placing &lt;strong&gt;:&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open terminal: &lt;strong&gt;Ctrl/⌘ + Shift + `&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Up or down line: &lt;strong&gt;Alt + PageUp /PageDown&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replicate text: &lt;strong&gt;Ctrl/⌘ + h&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select identical texts: &lt;strong&gt;Ctrl/⌘ + d&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Search the file for methods: &lt;strong&gt;Ctrl/⌘ + Shift + p&lt;/strong&gt;, (erasing the arrow and placing &lt;strong&gt;@&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you used another platform and are migrating to this tool, type in the search bar “&lt;strong&gt;keymaps + ide&lt;/strong&gt;” and install an extension that will provide all those shortcuts. The vscode documentation provides tips and all &lt;a href="https://code.visualstudio.com/docs/getstarted/tips-and-tricks"&gt;keyboard-shortcuts&lt;/a&gt; &lt;em&gt;on the platform&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fonts
&lt;/h2&gt;

&lt;p&gt;For a better visualization and understanding of codes, I recommend using fonts, where after installed on your machine, just use the shortcut &lt;strong&gt;(Ctrl/⌘ + Shift + p)&lt;/strong&gt; to go to the user’s preferences, then click on &lt;em&gt;Text Editor&lt;/em&gt; and on &lt;em&gt;Font&lt;/em&gt; type your respective source and enable ligatures. The following is a source I advise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/tonsky/FiraCodehttps://github.com/tonsky/FiraCode"&gt;Firacode&lt;/a&gt;&lt;/strong&gt; (&lt;em&gt;Font&lt;/em&gt; e &lt;em&gt;Font Ligatures&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Emmet
&lt;/h2&gt;

&lt;p&gt;This tool came to speed up the time with repetitive content like &lt;em&gt;divs&lt;/em&gt; and &lt;em&gt;components&lt;/em&gt;. Enable this option in both &lt;strong&gt;html&lt;/strong&gt; and &lt;strong&gt;jsx&lt;/strong&gt;, copying the code snippet below in your &lt;em&gt;settings.json&lt;/em&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"emmet.triggerExpansionOnTab": true,

"emmet.syntaxProfiles": {"javascript":"jsx"},

"emmet.includeLanguages": {"javascript":"javascriptreact"},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ul&amp;gt;li.class#id+li.class

// result

&amp;lt;ul&amp;gt;

  &amp;lt;li class="class" id="id"&amp;gt;&amp;lt;/li&amp;gt;

  &amp;lt;li class="class"&amp;gt;&amp;lt;/li&amp;gt;

&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Snippets
&lt;/h2&gt;

&lt;p&gt;Snippets are blocks of code that can be reused in a simple way as an acronym. With the help of extensions we can use snippets of each language such as &lt;a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2"&gt;angular&lt;/a&gt;, &lt;a href="https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets"&gt;javascript&lt;/a&gt;, &lt;em&gt;among others&lt;/em&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Examples, in JS
&lt;/h3&gt;
&lt;h3&gt;
  
  
  rcc
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// result

import React, { Component } from 'react'

export default class FileName extends *Component* {
  render() {
    return &amp;lt;div&amp;gt;$2&amp;lt;/div&amp;gt;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  clg
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// result 

console.log(object)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  rcredux
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// result

import React, { Component } from 'react'
import { connect } from 'react-redux'

export class FileName extends Component {
  render() {
    return &amp;lt;div&amp;gt;$4&amp;lt;/div&amp;gt;
  }
}

const mapStateToProps = state =&amp;gt; ({})

const mapDispatchToProps = {}

export default connect(mapStateToProps, mapDispatchToProps)(FileName)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For this and other information follow the &lt;a href="https://marketplace.visualstudio.com/vscode"&gt;visual studio marketplace&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed the content! If you have suggestions and/or criticisms comment below. Bye! 🖐🏽&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>extensionsvscode</category>
      <category>react</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
