teleren/devto huggingface dataset:
Divs and Spans... O_o;
Published: 2022-09-10 01:16:46

At first, while learning about this I thought "This has a use, but I just don't know it yet!" Then, **BAM!!** I was shown exactly how useful this is! 

Div tags (`<div></div`) surround the elements you'd like to group together. The elements can be separate or in the same line, it doesn't really matter as long as they're surrounded by the div tags. An effect of the divs is that the elements within it are grouped into a "block level box", which would make the div, and all the elements it contains, act kind of like how the `<p>` tags containing text: The contents of the dive tags will get their own line. 

Span tags (`<span></span>`) are different in that the elements they contain don't get their own line. You could surround one word in a paragraph with the span tags, and the word wouldn't get its own line.

You can give both divs and spans IDs/classes. :D

Once again, as I suspected, when we learn CSS we'll see more about how this works, as it's mostly useful with CSS.

Onward!!
Classes and IDs? Feels like school again. Wait a minute...
Tags: html, beginners
Published: 2022-09-10 01:02:38

I'm listening to this lesson, and paused it after it finished the third sentence immediately - from what I know about javascript, this topic sounds awfully similar to objects/instances. So if you know some javascript, this may sound familiar. <hr> I was wrong!! Haha... heh...

Classes and IDs are used to identify an element in html. Classes can identify multiple, and IDs can identify just one. I know: "What is that useful for?" I thought the same thing. Apparently, you can use them in CSS to be able to select elements individually, or in groups, in order to apply some styles to them.

No examples on this yet, but we will go over it more when we learn about CSS. :) Exciiitiiiing!
ForwardMe - ForwardMe delivers happiness worldwide
Tags: shipping, shopping, solutions
Published: 2022-09-10 00:46:32

We’re obsessed with providing reliable, affordable international shipping solutions and package forwarding services.

ForwardMe services include product purchase, logistics, insurance, storage, re-packaging, package forwarding, freight, customs, tax, and advisory services, including market and use analysis, industry information, and promotional recommendations.

Thousands of global members have trusted ForwardMe to deliver simple, reliable shipping and shopping solutions.

[https://www.forwardme.com](https://www.forwardme.com)
(Pre-class) Project #1!
Tags: html, beginners, myfirstwebpage
Published: 2022-09-10 00:42:40

Well, it's finally here! I know enough (apparently) to build a webpage! 

I'm following a model, about a lizard programmer with likes and dislikes. Well, it's gonna be about my dog instead. Screenshots shared!

####<strong>The code!</strong>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fvu509p5obhzstbfhkf3.png)

####<strong>The page!</strong>
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jyidmhc1e1k7vi46fzwx.png)

...Et voila!

![Et voila...](https://media1.giphy.com/media/lN43HqgTKEczYIPMnK/giphy.gif?cid=790b7611fac25dde437470a3bae62704b84fce4a9a2c0074&rid=giphy.gif&ct=s)
Code Smell 162 - Too Many Parentheses
Tags: javascript, webdev, beginners, programming
Published: 2022-09-10 00:32:59

*Parentheses are free of charge. Aren't they?*

> TL;DR: Use as few parentheses as possible.

# Problems

- Readability

- Syntactic complexity

# Solutions

1. Remove all not necessary parentheses

# Context

We read code from left to right (at least in western culture). 

Parentheses often break this flow, adding cognitive complexity

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/03c6940b1fa140572f29bfe37cf784c1)

```javascript

schwarzschild = ((((2 * GRAVITATION_CONSTANT)) * mass) / ((LIGHT_SPEED ** 2)))

```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/5b468c4d60d25dec61e538d0c1ed1329)

```javascript

schwarzschild = (2 * GRAVITATION_CONSTANT * mass) / (LIGHT_SPEED ** 2)

```

# Detection

[X] Automatic 

This is a fully automated code smell.

It is based on syntax trees.

Many tools detect it.

# Exceptions

On some complex formulas, we can add extra parenthesis for terms readability.

# Tags

- Readability

- Bloaters

# Relations

{% post https://dev.to/mcsee/code-smell-02-constants-and-magic-numbers-obb %}

# Conclusion

We write code once and read it too many times.

Readability is king.  

# Disclaimer

Code Smells are just my [opinion](https://dev.to/mcsee/i-wrote-more-than-90-articles-on-2021-here-is-what-i-learned-1n3a).

# Credits

Photo by [Nick Fewings](https://unsplash.com/@jannerboy62) on [Unsplash](https://unsplash.com/s/photos/signs)
  
* * *

> If someone claims to have the perfect programming language, he is either a fool or a salesman or both.

_Bjarne Stroustrup_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Clustering com Dados do FIFA 20: Monte um Time Implacável
Tags: clustering, datascience, javascript, webdev
Published: 2022-09-09 23:56:07

Preparamos um artigo explicando como montar um [time implacável](https://canalnabeira.com/analise/clustering-com-dados-do-fifa-20-monte-um-time-implacavel/) no Fifa usando Data Science. 

O objetivo do presente projeto é utilizar clustering para agrupar jogadores com características semelhantes e perguntar aos dados como esses jogadores se comportam, para encontrar nomes ideais e montar um time poderoso no FIFA. No final, montaremos um time de acordo com as análises feitas. 

Confira!
First Post
Tags: beginners, opensource
Published: 2022-09-09 23:15:53

Hello Everyone, my name is Anshul Gandhi. I am currently in my third year of programming at Seneca. I really like to work on new challenges, since I am not that great at programming. It will help me to learn more in details about programming concepts.

I am really looking forward to work on some java application.
Forked Post link: https://github.com/anshul137/xManager-Spotify
Backup Github
Tags: pythongithubbackup, githubbackup
Published: 2022-09-09 23:13:57

Install: https://github.com/josegonzalez/python-github-backup

---

- Backup All Repositories in account
```bash
github-backup <username> -t <personal-access-token> -o <output-directory> --repositories --private
```

---

- Backup All Repositories in organization
```
github-backup <organization-name> -t <personal-access-token> -o <output-directory> --repositories --private --organization
# <organization-name> is case-sensitive
```

---

Check `README.md` of repositories for more information about the commands

Script donwloads all the branches of each repositores, to check them run `git branch -a` inside repositories
Android Firebase, Cluodfare, Google Cloud Hosting, AWS-AMAZON, GitHub, Gitlab, Integrated platforms across the internet
Tags: ubuntu
Published: 2022-09-09 21:35:57

Create an integrated platform open source, networks system manage credentials information on the internet, Domains Registrar, Domains Registration Processes, Domains WHOIS Records DNS Roots server Hostname Hosting Platform, integrated apps with free Websites Hosting
GCP Landing zone for FI
Tags: gcp, googlecloud, terraform, cicd
Published: 2022-09-09 21:24:46

HI Everyone,

  With the continuous efforts and lots of teamwork. We are able to achieve the end product. From past 9 months I was working on a project to create landing zone for Google Cloud Platform which should be Complient to fit for financial institution. 
 Today, I will not write much but requesting you all to Kindly visit below GitHub link and try it.

[GitHub Link](https://github.com/cldcvr/gcifi-lz)
Recursion
Tags: beginners, cpp, algorithms, codenewbie
Published: 2022-09-09 21:08:48


When reduced to a concise example, recursion can be quite a simple concept to grasp. 

The below recursive function: 
{% katex %}  f(x,\mathrm{count}) = 10 + x + f(x,\mathrm{count - 1}) {% endkatex %}

Takes a summand {% katex inline %} x {% endkatex %} float and a {% katex inline %} \mathrm{count} {% endkatex %} index which defines the number of recursions. The function decreases this index with every recursion, and terminates the function with a "0" when the {% katex inline %} \mathrm{count} {% endkatex %} value becomes 0. 
Defining this function in code:

```cpp
#include <bits/stdc++.h>
using namespace std;

double recurAdd(double x, int count)
{
    if (count == 0){return 0;} // termination
    return 10 + x + recurAdd(x, count - 1);
}

// Driver code
int main()
{
    cout << recurAdd(0.5, 3);
    return 0;
}
```
This small program will output 31.5 as a final value. We can represent the complete recursion in the following way:

{% katex %}  f_1 = 10 + 0.5 + ( 10 + 0.5 + ( 10 + 0.5  (0) ) ) {% endkatex %}


Where the recursion can be broken down in the following way, from its first to last input iteration: 
{% katex %} f_1 = 10 + 0.5 + f_2 \\\\ f_2 = 10 + 0.5 + f_3 \\\\ f_3 = 10 + 0.5 + f_4  \\\\ f_4 = 0 {% endkatex %}

After the last input function {% katex inline %}  f_4 {% endkatex %} has been terminated, the running of operations can be visualized to occur from the deepest {% katex inline %}  f_4 {% endkatex %} to the outermost {% katex inline %}  f_1 {% endkatex %} nest. I visualize this process with the following schematic:



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m1yuzhxl6lz2e2lfgnio.png)

Though not all recursion algorithms may follow this pattern, this visual has helped me simplify my understanding of recursion. I hope my visual helps you too. 

-Andrew
VARIÁVEIS, OPERAÇÕES E MÉDIA
Tags: codepen
Published: 2022-09-09 20:55:22

<p><a href="https://imersao.dev/aulas/aula01-variaveis-operacoes-media" target="_blank">https://imersao.dev/aulas/aula01-variaveis-operacoes-media</a></p>

{% codepen https://codepen.io/devhonorato/pen/mdLPwYy %}
Forecast Your Weather With Python Script
Tags: python, opensource, api, webdev
Published: 2022-09-09 20:22:47

**What we are going to build ?**
 → In order to check your place's weather. With the help of inbuilt libraries of python like requests, json and IPython. From "IPython" library , we  use modules like "Image" and "display". <br><br>

**Step 1** : Importing Dependencies

```python
import requests
import json
from IPython.display import Image, display
```<br>
**Step 2** : Enter your api-key
 → You can use https://api.openweathermap.org/ and get your API key. So that, you will get access of data.

```python
# api-key
appId="94*********************"
```<br>
**Step 3** : Enter your place name

```python
# place input
query=input("Enter Your Place to Check Weather : ")
```<br>
**Step 4** : Make queries for URL
 → Here you can write more specific queries for URL.

```python
# queries
unit="metric"
```<br>
**Step 5** : Create Dynamic URL
 → Design your URL. With query variables and make sure that you are using api key or id.

```python
# API url
url="https://api.openweathermap.org/data/2.5/weather?q="+f"{query}"+"&appid="+f"{appId}"+"&units="+f"{unit}"
```<br>
**Step 6** : Send GET request and store response of URL hit

```python
# get response from api-hit
response=requests.get(url,stream=True)
```<br>
**Step 7** : Store data from response

```python
# get data (in bytes form)
data=response.content
```<br>
**Step 8** : Convert "bytes" format to json

```python
# get json file from "bytes" type
jsn=json.loads(data.decode("utf-8"))
```<br>
**Step 9** : Store important data from converted json file

```python
# get temperature
temp=jsn["main"]["temp"]

# get weather icon
icon=jsn["weather"][0]["icon"]

# get weather description
weatherDesc=jsn['weather'][0]["description"]
```<br>
**Step 10** : Send GET request and store response of URL to fetch Image

```python
# get request with imageUrl to fetch png image
imageUrl="https://openweathermap.org/img/wn/"+f"{icon}"+"@2x.png"
response2=requests.get(imageUrl,stream=True)
```<br>
**Step 11** : Display Outputs

```python
# display png
display(Image(response2.content))

# display temperature
print(f"Temperature : {temp}°C (Degree Celcius)")

# display place name
print(f"Place : {query}")

# display weather description
print(f"Weather Description : {weatherDesc}")
```<br>

## Sample Output :<br>

![Forecast-Weather](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxlhts9farp8r484xcos.png)
<br>
**Github Link For Full Code** : [Click Here](https://github.com/CatalystsReachOut/python/blob/master/PythonScripts/ForecastYourWeather/main.py)
Caching - A catchy technique
Published: 2022-09-09 20:22:31

## CACHE
Cache is a high-speed data storage layer which stores a subset of data so that future requests for that data are served up faster.
Caching allows you to efficiently reuse previously retrieved or computed data.

## Where caching is applied?

- Database caching
- Content Delivery Network
- DNS Caching
- Session Management

## Caching Terminologies

- Lazy Caching
- Write Through
- Time to live
- Eviction
- Cache miss
- The thundering herd

## Caching in AWS

- Amazon elastic cache
- Amazon DynamoDB Accelerator(DAX)
- Amazon CloudFront
- AWS Greengrass
- Amazon Route 53
- Amazon File Cache



## Benefits of caching

- Improve Application Performance
- Reduce the Load on the Backend
- Predictable Performance
- Increase Read Throughput (IOPS)
- Reduce Database Cost
- Eliminate Database Hotspots


## PODCAST LINK
https://www.podbean.com/media/share/pb-djie9-12bb29a

##YouTube

{% embed https://youtu.be/BB9RqWH_Fmg/ %}


## Reference

https://aws.amazon.com/caching
The Staircase problem (a JavaScript solution)
Tags: javascript, beginners
Published: 2022-09-09 18:29:33

## What is the infamous staircase problem?
Imagine a staircase. Each step takes you further from the first one. Simple enough, right?

The base and height both equal `n`; # symbols and spaces represent each level of stairs. Your code should return a staircase of `n` size.

**Conditions**
- n is an integer that represents the `size` of the staircase ie: `n = 3`
- Print the staircase size with `spaces` and `#.`
- sample:

```
     #
    ##
   ###
```

## Start Simple

We know that as we travel down the staircase, we need to reduce the number of spaces by 1. We also needed to keep track of each row to reduce the number of spaces.

Let's start with something simple(and ugly)...

```
function staircase(n) {
   let row = "";

   for (let j = n; j > 0; j--) {
      for (let i = 1; i <= n; i++) {
         if (i < j) {
            row += " ";
            continue;
         }
            row += "#";
         } if (j === 1) {
            continue;
         }
      row += "\n";
      }
   console.log(row);
}
```

The break down:
1. I created a variable called `row` that will return the final result
2. The first(outer) loop tracks the number of rows `n`, that we need.
3. The second (inner) loop, tracks the number of spaces and # symbols needed for each row.
4. Lastly, we output the result with a `console.log`.

## The refactor
While the above code meets all the problem requirements, it's messy. So I did some research and found a much cleaner solution by [Ali Reubenstone](https://medium.com/@alireubenstone/two-ways-to-solve-the-hackerrank-staircase-problem-in-javascript-8036d2254567) that uses JavaScript's [repeat method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat).

```
function staircase(n) {
    for (let i = 1; i <= n; i++) {  
        console.log(" ".repeat(n-i) + "#".repeat(i))
    }    
}
```
Let's break it down:
1. The for loop iterates over each row.
2. During the interation process, we print the # symbols and spaces.
3. Finally, we repeat the blank spaces by the `n-i` number and # symbols by 'i' number of times so that each row (from top to bottom) reduces the number of spaces while increasing the number of # symbols, thus creating a `staircase` shape.
Badges de aprendizado da AWS - Adquira o seu de maneira gratuita
Tags: aws, cloud, braziliandevs, beginners
Published: 2022-09-09 18:23:26

Neste post vamos entender o que são os badges da AWS e como conseguir eles de maneira gratuita.

**O que é um Badge de aprendizado da AWS?**

Um badge digital (ou selo / credencial / emblema digital) fornece uma maneira verificável para indivíduos mostrarem seus conhecimento, habilidades ou realizações, seja por meio de um currículo, rede social ou assinatura de e-mail. Os ganhadores do badge podem exibir a imagem do selo com um link exclusivo no qual qualquer pessoa pode verificar a conquista desse indivíduo específico. Os Badges da AWS ainda oferecem os seguintes benefícios:

- Demonstram seu conhecimento e habilidades para tópicos específicos da Nuvem AWS, como Object Storage.


- Podem ser compartilhados em redes sociais para ajudar você a se destacar para recrutadores e possíveis gerentes de contratação.

- São gratuitos para ganhar e compartilhar.

**Quais tipos de badges da AWS estão disponíveis?**

Os Badges do AWS são alinhados aos planos de aprendizado selecionados do [AWS Skill Builder](https://explore.skillbuilder.aws/learn), como:

- [Storage Learning Plan - Object](https://explore.skillbuilder.aws/learn/public/learning_plan/view/51/storage-learning-plan-object-storage)

- [Storage Learning Plan - Block](https://explore.skillbuilder.aws/learn/public/learning_plan/view/93/storage-learning-plan-block-storage) 

- [Storage Learning Plan - File](https://explore.skillbuilder.aws/learn/public/learning_plan/view/95/storage-learning-plan-file-storage) 

- [Storage Learning Plan - Data Migration](https://explore.skillbuilder.aws/learn/public/learning_plan/view/94/storage-learning-plan-data-migration) 

- [Storage Learning Plan - Data Protection & Disaster Recovery](https://explore.skillbuilder.aws/learn/public/learning_plan/view/54/storage-learning-plan-data-protection-and-disaster-recovery)

![Badges AWS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmr79ibe4580lutawia1.png)

Se você conseguir os badges de <u>Object</u>, <u>Block </u>e <u>File</u>, ganhará automaticamente o badge de Storage Core. Se você ganhar todos os badges de <u>Storage</u>, você automaticamente ganhará o badge de Storage Technologist.

**Como ganhar um Badge de aprendizado da AWS**

A seguir estão as etapas para se obter um badge digital da AWS:

- Registre-se para uma conta gratuita do [AWS Skill Builder](https://skillbuilder.aws/).

- Inscreva-se em um dos planos de aprendizado listados acima. 

- Complete a avaliação associada ao plano de aprendizagem com pontuação igual ou superior a 80%.

- Crie uma conta [Credly](https://www.credly.com/users/sign_up) para reivindicar seu badge digital.

**Conclusão**

Neste post conseguimos entender o que são as badges digitais da AWS e como conseguir as mesmas.

Espero que tenham gostado e até a próxima!
Django Tutorial – Creating Dropdown Menus On Django Forms
Tags: programming, django, beginners, tutorial
Published: 2022-09-09 18:08:43

I have been teaching myself Python programming for the last couple of years and have recently started learning the Django framework for web development. I will be writing regular posts about some of the challenges I faced and their resolutions. This way, I can review these posts in the future if I need to and possibly benefit others who may experience these same challenges.
 
This is my first time posting here, so I apologize in advance if there’s anything I miss. For this post, the challenge I faced (and resolved) was creating dropdown menus on Django forms. Below are the steps I followed in doing this; please keep in mind that I created my form using ModelForm.

**Step 1:** Inside your Django model class, define the different values of your dropdown menu and assign a constant to each value
![Dropdown values](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7q1i3yrsoft284itmzi3.png)

**Step 2:** Still inside your model class, create a list of the values in your dropdown menu. Each item on the list will be a tuple containing two elements. The first element in the tuple is the constant that was created in Step 1 and the second element is the human-readable name. It is the second element (the human readable name) that will be displayed on the Django form for your user.
![Values list](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k80aasyzhcn0to5jj9lj.png)

**Step 3:** Add the dropdown field to your database model. Assign your list from step 2 as the value to the keyword argument “choices”. If you want to, you can also set a default value to display for your dropdown menu
![Django model](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8o5iew6pyqud5kmiy9h.png)

**Step 4:** In your model form (usually in forms.py), use the “Select” attribute for your dropdown widget 
![Widget](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uq1n63tngrm670r2q51w.png)

**Step 5:** Once you launch your  Django form, you should see your dropdown with your values
![Django form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ja1fwzzhz3h8ruac6y75.png)
Using "git diff" and "git apply" to share small changes.
Tags: git
Published: 2022-09-09 17:45:57

Sometimes in a Pull Request Review you want to tell someone about a little change to make. You make your change locally, maybe a few lines different, and note that it works locally. Your `git diff` output will show your change. How can you share this little snippit? Just copy the output of `git diff` and sent that to your team mate. Here is a small change I've made locally:

```diff
diff --git a/conf/local.rb b/conf/local.rb
index 57672691..28fd024c 100644
--- a/conf/local.rb
+++ b/conf/local.rb
@@ -1,6 +1,6 @@
-@whitePagesCacheTtl = "60s"
-
-@executionEnvironment = "local"
+@whitePagesCacheTtl = "120s"
+@considerEnv = "false"
+@executionEnvironment = "external"
 
 @lightstep_collector_host = "HO123"
 
```

Let's say I copied all that. On a mac, we have the cool `pbcopy` command to capture stdout and put it on the clipboard. So `git diff | pbcopy` will copy it for us. Now you can put it in a pull request comment or send it to someone on chat.

Ok so a team mate sent you that. You can read it as a human and see it changes a few lines. You could edit the file to make it match, but git can do it for you. Pipe the output to `git apply`. Again on mac we have the nice `pbpaste` command to send our clipboard to stdout. So one option is to copy the text from the pull request comment and pipe it to git apply.

```sh
$ pbpaste | git apply
```

Another option is to put the contents into a file and point git apply to that. Say you paste the diff into `new.patch`, you can apply the changes with:

```sh
$ git apply new.patch && rm new.patch
```

I delete the patch since we are done with it and don't want to commit it to git. 

This is something I do often. I used git for a long time without knowing about `apply` or that the output of `diff` can be used as input. It has helped me a few times.