chore(i18n,curriculum): update translations (#43569)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7faa367417b2b2512bd6
|
||||
title: Add a Tooltip to a D3 Element
|
||||
title: Agrega un cuadro emergente a un elemento D3
|
||||
challengeType: 6
|
||||
forumTopicId: 301470
|
||||
dashedName: add-a-tooltip-to-a-d3-element
|
||||
@ -8,71 +8,71 @@ dashedName: add-a-tooltip-to-a-d3-element
|
||||
|
||||
# --description--
|
||||
|
||||
A tooltip shows more information about an item on a page when the user hovers over that item. There are several ways to add a tooltip to a visualization, this challenge uses the SVG `title` element.
|
||||
Un cuadro emergente muestra más información acerca de un elemento en la página cuando el usuario se coloca sobre ese elemento. Hay varias formas de agregar un cuadro emergente a una visualización, este desafío usa el elemento SVG`title`.
|
||||
|
||||
`title` pairs with the `text()` method to dynamically add data to the bars.
|
||||
`title` se empareja con el método `text()` para agregar datos dinámicamente a las barras.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Append a `title` element under each `rect` node. Then call the `text()` method with a callback function so the text displays the data value.
|
||||
Añade un elemento `title` debajo de cada nodo `rect`. Luego llama al método `text()` con una función de devolución de llamada para que el texto muestre el valor de los datos.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your code should have 9 `title` elements.
|
||||
Tu código debe tener 9 elementos `title`.
|
||||
|
||||
```js
|
||||
assert($('title').length == 9);
|
||||
```
|
||||
|
||||
The first `title` element should have tooltip text of `12`.
|
||||
El primer elemento `title` debe tener un cuadro emergente de texto de `12`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(0).text() == '12');
|
||||
```
|
||||
|
||||
The second `title` element should have tooltip text of `31`.
|
||||
El segundo elemento `title` debe tener un cuadro emergente de texto de `31`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(1).text() == '31');
|
||||
```
|
||||
|
||||
The third `title` element should have tooltip text of `22`.
|
||||
El tercer elemento `title` debe tener un cuadro emergente de texto de `22`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(2).text() == '22');
|
||||
```
|
||||
|
||||
The fourth `title` element should have tooltip text of `17`.
|
||||
El cuarto elemento `title` debe tener un cuadro emergente de texto de `17`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(3).text() == '17');
|
||||
```
|
||||
|
||||
The fifth `title` element should have tooltip text of `25`.
|
||||
El quinto elemento `title` debe tener uncuadro emergente de texto de `25`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(4).text() == '25');
|
||||
```
|
||||
|
||||
The sixth `title` element should have tooltip text of `18`.
|
||||
El sexto elemento `title` debe tener un cuadro emergente de texto de `18`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(5).text() == '18');
|
||||
```
|
||||
|
||||
The seventh `title` element should have tooltip text of `29`.
|
||||
El séptimo elemento `title` debe tener uncuadro emergente de texto de `29`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(6).text() == '29');
|
||||
```
|
||||
|
||||
The eighth `title` element should have tooltip text of `14`.
|
||||
El octavo elemento `title` debe tener un cuadro emergente de texto de `14`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(7).text() == '14');
|
||||
```
|
||||
|
||||
The ninth `title` element should have tooltip text of `9`.
|
||||
El noveno elemento `title` debe tener un cuadro emergente de texto de `9`.
|
||||
|
||||
```js
|
||||
assert($('title').eq(8).text() == '9');
|
||||
|
@ -37,7 +37,7 @@ Tente adicionar uma imagem ao seu site:
|
||||
|
||||
Dentro do elemento `main` existente, insira um elemento `img` antes dos elementos `p` existentes.
|
||||
|
||||
Agora defina o atributo `src` para que ele aponte para o URL `https://www.bit.ly/fcc-relaxing-cat`
|
||||
Agora defina o atributo `src` para que ele aponte para o URL `https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg`
|
||||
|
||||
Por fim, não se esqueça de dar ao elemento `img` um atributo `alt` com um texto adequado.
|
||||
|
||||
@ -52,7 +52,7 @@ assert($('img').length);
|
||||
A imagem deve ter um atributo `src` que aponte para o caminho da imagem do gatinho.
|
||||
|
||||
```js
|
||||
assert(/^https:\/\/(www\.)?bit\.ly\/fcc-relaxing-cat$/i.test($('img').attr('src')));
|
||||
assert(/^https:\/\/cdn\.freecodecamp\.org\/curriculum\/cat-photo-app\/relaxing-cat\.jpg$/i.test($('img').attr('src')));
|
||||
```
|
||||
|
||||
O atributo `alt` do elemento de imagem não deve estar vazio.
|
||||
@ -86,7 +86,7 @@ assert(
|
||||
```html
|
||||
<h2>CatPhotoApp</h2>
|
||||
<main>
|
||||
<a href="#"><img src="https://www.bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<a href="#"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
|
||||
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
|
||||
</main>
|
||||
|
@ -42,10 +42,10 @@ assert.deepEqual(addTogether(23, 30), 53);
|
||||
assert.deepEqual(addTogether(5)(7), 12);
|
||||
```
|
||||
|
||||
`addTogether("http://bit.ly/IqT6zt")` deve retornar `undefined`.
|
||||
`addTogether("https://www.youtube.com/watch?v=dQw4w9WgXcQ")` deve retornar `undefined`.
|
||||
|
||||
```js
|
||||
assert.isUndefined(addTogether('http://bit.ly/IqT6zt'));
|
||||
assert.isUndefined(addTogether('https://www.youtube.com/watch?v=dQw4w9WgXcQ'));
|
||||
```
|
||||
|
||||
`addTogether(2, "3")` deve retornar `undefined`.
|
||||
|
@ -8,7 +8,7 @@ dashedName: make-images-mobile-responsive
|
||||
|
||||
# --description--
|
||||
|
||||
Primeiro, adicione uma nova imagem abaixo da existente. Defina o seu atributo `src` para `https://bit.ly/fcc-running-cats`.
|
||||
Primeiro, adicione uma nova imagem abaixo da existente. Defina o seu atributo `src` como `https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg`.
|
||||
|
||||
Seria ótimo se essa imagem pudesse ser exatamente do tamanho da nossa tela do celular.
|
||||
|
||||
@ -34,10 +34,10 @@ A nova imagem não deve ter a classe `smaller-image`.
|
||||
assert(!$('img:eq(1)').hasClass('smaller-image'));
|
||||
```
|
||||
|
||||
A nova imagem deve ter um `src` de `https://bit.ly/fcc-running-cats`.
|
||||
A nova imagem deve ter um `src` de `https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg`.
|
||||
|
||||
```js
|
||||
assert($('img:eq(1)').attr('src') === 'https://bit.ly/fcc-running-cats');
|
||||
assert($('img:eq(1)').attr('src') === 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg');
|
||||
```
|
||||
|
||||
O novo elemento `img` deve ter uma tag de fechamento.
|
||||
@ -87,7 +87,7 @@ assert(
|
||||
|
||||
<p>Click here for <a href="#">cat photos</a>.</p>
|
||||
|
||||
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
|
||||
<p>Things cats love:</p>
|
||||
<ul>
|
||||
@ -148,8 +148,8 @@ assert(
|
||||
|
||||
<p>Click here for <a href="#">cat photos</a>.</p>
|
||||
|
||||
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
|
||||
<img src="https://bit.ly/fcc-running-cats" class="img-responsive">
|
||||
<a href="#"><img class="smaller-image thick-green-border" src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
|
||||
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg" class="img-responsive">
|
||||
|
||||
<p>Things cats love:</p>
|
||||
<ul>
|
||||
|
@ -35,40 +35,66 @@ Envie sua página quando você achar que ela está certa. Se você encontrar err
|
||||
|
||||
# --hints--
|
||||
|
||||
A rota /auth/github deve estar correta.
|
||||
A rota `/auth/github` deve estar correta.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
$.get(getUserInput('url') + '/_api/routes.js').then(
|
||||
(data) => {
|
||||
async (getUserInput) => {
|
||||
try {
|
||||
const res = await fetch(getUserInput('url') + '/_api/routes.js');
|
||||
if (res.ok) {
|
||||
const data = await res.text();
|
||||
assert.match(
|
||||
data.replace(/\s/g, ''),
|
||||
/('|")\/auth\/github\/?\1[^]*?get.*?passport.authenticate.*?github/gi,
|
||||
'Route auth/github should only call passport.authenticate with github'
|
||||
);
|
||||
},
|
||||
(xhr) => {
|
||||
throw new Error(xhr.statusText);
|
||||
data.replace(/\s/g, ''),
|
||||
/passport.authenticate.*?github/g,
|
||||
'Route auth/github should only call passport.authenticate with github'
|
||||
);
|
||||
} else {
|
||||
throw new Error(res.statusText);
|
||||
}
|
||||
);
|
||||
const res2 = await fetch(getUserInput('url') + '/_api/app-stack');
|
||||
if (res2.ok) {
|
||||
const data2 = JSON.parse(await res2.json());
|
||||
const dataLayer = data2.find(layer => layer?.route?.path === '/auth/github');
|
||||
assert.deepInclude(dataLayer?.route, { methods: {get: true}, path: "/auth/github"});
|
||||
assert.deepInclude(dataLayer?.route?.stack?.[0], {method: "get", name: "authenticate"});
|
||||
} else {
|
||||
throw new Error(res2.statusText);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
A rota /auth/github/callback deve estar correta.
|
||||
A rota `/auth/github/callback` deve estar correta.
|
||||
|
||||
```js
|
||||
(getUserInput) =>
|
||||
$.get(getUserInput('url') + '/_api/routes.js').then(
|
||||
(data) => {
|
||||
async (getUserInput) => {
|
||||
try {
|
||||
const res = await fetch(getUserInput('url') + '/_api/routes.js');
|
||||
if (res.ok) {
|
||||
const data = await res.text();
|
||||
assert.match(
|
||||
data.replace(/\s/g, ''),
|
||||
/('|")\/auth\/github\/callback\/?\1[^]*?get.*?passport.authenticate.*?github.*?failureRedirect:("|')\/\2/gi,
|
||||
/failureRedirect:("|')\/\1/g,
|
||||
'Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home'
|
||||
);
|
||||
},
|
||||
(xhr) => {
|
||||
throw new Error(xhr.statusText);
|
||||
} else {
|
||||
throw new Error(res.statusText);
|
||||
}
|
||||
);
|
||||
const res2 = await fetch(getUserInput('url') + '/_api/app-stack');
|
||||
if (res2.ok) {
|
||||
const data2 = JSON.parse(await res2.json());
|
||||
const dataLayer = data2.find(layer => layer?.route?.path === '/auth/github/callback');
|
||||
assert.deepInclude(dataLayer?.route, { methods: {get: true}, path: "/auth/github/callback"});
|
||||
assert.deepInclude(dataLayer?.route?.stack?.[0], {method: "get", name: "authenticate"});
|
||||
} else {
|
||||
throw new Error(res2.statusText);
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@ -10,7 +10,7 @@ dashedName: problem-119-digit-power-sum
|
||||
|
||||
O número 512 é interessante porque é igual à soma de seus algarismos elevado a alguma potência: $5 + 1 + 2 = 8$, e $8^3 = 512$. Outro exemplo de um número com essa propriedade é $614656 = 28^4$.
|
||||
|
||||
Vamos definir um número para ser o $n-ésimo$ termo desta sequência e reforçar que um número deve conter pelo menos dois dígitos para ter uma soma.
|
||||
Vamos definir $a_n$ como o $n-ésimo$ termo desta sequência e reforçar que um número deve conter pelo menos dois dígitos para ter uma soma.
|
||||
|
||||
Você já sabe que $a_2 = 512$ e $a_{10} = 614656$.
|
||||
|
||||
|
@ -15,9 +15,9 @@ Um número inteiro positivo é um [número de Kaprekar](https://en.wikipedia.org
|
||||
<li>A representação decimal de seu quadrado puder ser dividida uma vez em duas partes, que consistem em inteiros positivos que, somados, resultam no número original. </li>
|
||||
</ul>
|
||||
|
||||
Note que uma divisão resultando em uma parte que consiste puramente em 0s não é válida, já que 0 não é considerado um número positivo. Veja o exemplo abaixo:
|
||||
Note que uma divisão resultando em uma parte que consiste puramente em 0s não é válida, já que 0 não é considerado um número positivo.
|
||||
|
||||
Números de Kaprekar:
|
||||
Exemplo de números de Kaprekar:
|
||||
|
||||
<ul>
|
||||
<li><code>2223</code> é um número de Kaprekar, pois <code>2223 * 2223 = 4941729</code>, <code>4941729</code> pode ser dividido em <code>494</code> e <code>1729</code>, e <code>494 + 1729 = 2223</code></li>
|
||||
|
Reference in New Issue
Block a user