chore(i18n,learn): processed translations (#44965)

This commit is contained in:
camperbot
2022-01-31 22:43:48 +05:30
committed by GitHub
parent b2caef3d18
commit d58e5e5bdd
11 changed files with 261 additions and 54 deletions

View File

@ -1,6 +1,6 @@
--- ---
id: 587d8249367417b2b2512c42 id: 587d8249367417b2b2512c42
title: Issue Tracker title: Seguidor de incidentes
challengeType: 4 challengeType: 4
forumTopicId: 301569 forumTopicId: 301569
dashedName: issue-tracker dashedName: issue-tracker
@ -8,42 +8,42 @@ dashedName: issue-tracker
# --description-- # --description--
Build a full stack JavaScript app that is functionally similar to this: <https://issue-tracker.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods: Construye una aplicación full stack de JavaScript que sea funcionalmente similar a esta: <https://issue-tracker.freecodecamp.rocks/>. Trabajar en este proyecto implicará escribir tu código utilizando uno de los siguientes métodos:
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) and complete your project locally. - Clona [este repositorio de GitHub](https://github.com/freeCodeCamp/boilerplate-project-issuetracker/) y completa tu proyecto localmente.
- Use [this Replit starter project](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker) to complete your project. - Usa [este proyecto inicial de Replit](https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker) para completar tu proyecto.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo. - Usa un constructor de sitios de tu elección para completar el proyecto. Asegúrate de incorporar todos los archivos de nuestro repositorio GitHub.
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field. Cuando hayas terminado, asegúrate de que una demostración de trabajo de tu proyecto esté alojado en algún lugar público. Luego, envía la URL en el campo `Solution Link`. Opcionalmente, también envía un enlace al código fuente de tu proyecto en el campo `GitHub Link`.
# --instructions-- # --instructions--
- Complete the necessary routes in `/routes/api.js` - Completa las rutas necesarias en `/routes/api.js`
- Create all of the functional tests in `tests/2_functional-tests.js` - Crea todas las siguientes pruebas funcionales en `tests/2_functional-tests.js`
- Copy the `sample.env` file to `.env` and set the variables appropriately - Copia el archivo `sample.env` a `.env` y establece las variables apropiadamente
- To run the tests uncomment `NODE_ENV=test` in your `.env` file - Para ejecutar las pruebas, descomenta `NODE_ENV=test` en tu archivo `.env`
- To run the tests in the console, use the command `npm run test`. To open the Replit console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell" - Para ejecutar las pruebas en la consola, usa el comando `npm run test`. Para abrir la consola de Replit presiona Ctrl+Shift+P (Cmd si estas en Mac) y escribe "open shell"
Write the following tests in `tests/2_functional-tests.js`: Escribe las siguientes pruebas en `tests/2_functional-tests.js`:
- Create an issue with every field: POST request to `/api/issues/{project}` - Crear un problema con cada campo: solicitud POST a `/api/issues/{project}`
- Create an issue with only required fields: POST request to `/api/issues/{project}` - Crear un problema con sólo los campos requeridos: solicitud POST a `/api/issues/{project}`
- Create an issue with missing required fields: POST request to `/api/issues/{project}` - Crear un problema con los campos requeridos faltantes: solicitud POST a `/api/issues/{project}`
- View issues on a project: GET request to `/api/issues/{project}` - Ver problemas en un proyecto: Solicitud GET a `/api/issues/{project}`
- View issues on a project with one filter: GET request to `/api/issues/{project}` - Ver problemas en un proyecto con un filtro: Solicitud GET a `/api/issues/{project}`
- View issues on a project with multiple filters: GET request to `/api/issues/{project}` - Ver problemas en un proyecto con múltiples filtros: Solicitud GET a `/api/issues/{project}`
- Update one field on an issue: PUT request to `/api/issues/{project}` - Actualizar un campo en un problema: Solicitud PUT a `/api/issues/{project}`
- Update multiple fields on an issue: PUT request to `/api/issues/{project}` - Actualizar varios campos en un problema: Solicitud PUT a `/api/issues/{project}`
- Update an issue with missing `_id`: PUT request to `/api/issues/{project}` - Actualizar un problema con `_id`faltante: solicitud PUT a `/api/issues/{project}`
- Update an issue with no fields to update: PUT request to `/api/issues/{project}` - Actualizar un problema sin campos para actualizar: solicitud PUT a `/api/issues/{project}`
- Update an issue with an invalid `_id`: PUT request to `/api/issues/{project}` - Actualizar un problema con un `_id` inválido: Solicitud PUT a `/api/issues/{project}`
- Delete an issue: DELETE request to `/api/issues/{project}` - Eliminar un problema: solicitud DELETE a `/api/issues/{project}`
- Delete an issue with an invalid `_id`: DELETE request to `/api/issues/{project}` - Eliminar un problema con un `_id` inválido: solicitud DELETE a `/api/issues/{project}`
- Delete an issue with missing `_id`: DELETE request to `/api/issues/{project}` - Eliminar un problema con `_id` faltante: solicitud DELETE a `/api/issues/{project}`
# --hints-- # --hints--
You can provide your own project, not the example URL. Debes proveer tu propio proyecto, no la URL de ejemplo.
```js ```js
(getUserInput) => { (getUserInput) => {
@ -51,7 +51,7 @@ You can provide your own project, not the example URL.
}; };
``` ```
You can send a `POST` request to `/api/issues/{projectname}` with form data containing the required fields `issue_title`, `issue_text`, `created_by`, and optionally `assigned_to` and `status_text`. Puedes enviar una solicitud `POST` a `/api/issues/{projectname}` con datos de formulario que contienen los campos obligatorios `issue_title`, `issue_text`, `created_by`, y opcionalmente `assigned_to` y `status_text`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -73,7 +73,7 @@ async (getUserInput) => {
}; };
``` ```
The `POST` request to `/api/issues/{projectname}` will return the created object, and must include all of the submitted fields. Excluded optional fields will be returned as empty strings. Additionally, include `created_on` (date/time), `updated_on` (date/time), `open` (boolean, `true` for open - default value, `false` for closed), and `_id`. La solicitud `POST` a `/api/issues/{projectname}` devolverá el objeto creado y debe incluir todos los campos enviados. Los campos opcionales excluidos serán devueltos como cadenas vacías. Además, incluye `created_on` (fecha/hora), `updated_on` (fecha/hora), `open` (booleano, `true` para abrir - valor predeterminado, `false` para cerrar), y `_id`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -107,7 +107,7 @@ async (getUserInput) => {
}; };
``` ```
If you send a `POST` request to `/api/issues/{projectname}` without the required fields, returned will be the error `{ error: 'required field(s) missing' }` Si envías una solicitud `POST` a `/api/issues/{projectname}` sin los campos requeridos, será devuelto el error `{ error: 'required field(s) missing' }`
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -125,7 +125,7 @@ async (getUserInput) => {
}; };
``` ```
You can send a `GET` request to `/api/issues/{projectname}` for an array of all issues for that specific `projectname`, with all the fields present for each issue. Puedes enviar una solicitud `GET` a `/api/issues/{projectname}` para un arreglo de todos los incidentes para ese `projectname`, con todos los campos presentes para cada incidente.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -172,7 +172,7 @@ async (getUserInput) => {
}; };
``` ```
You can send a `GET` request to `/api/issues/{projectname}` and filter the request by also passing along any field and value as a URL query (ie. `/api/issues/{project}?open=false`). You can pass one or more field/value pairs at once. Puedes enviar una solicitud `GET` a `/api/issues/{projectname}` y filtrar la solicitud también, pasando por cualquier campo y valor como una consulta de URL (por ejemplo, `/api/issues/{project}?open=false`). Puedes pasar uno o más pares de campo/valor a la vez.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -213,7 +213,7 @@ async (getUserInput) => {
}; };
``` ```
You can send a `PUT` request to `/api/issues/{projectname}` with an `_id` and one or more fields to update. On success, the `updated_on` field should be updated, and returned should be `{ result: 'successfully updated', '_id': _id }`. Puedes enviar una solicitud `PUT` a `/api/issues/{projectname}` con un `_id` y uno o más campos para actualizar. En caso de éxito, el campo `updated_on` debe actualizarse, y debe ser devuelto `{ result: 'successfully updated', '_id': _id }`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -248,7 +248,7 @@ async (getUserInput) => {
}; };
``` ```
When the `PUT` request sent to `/api/issues/{projectname}` does not include an `_id`, the return value is `{ error: 'missing _id' }`. Cuando la solicitud `PUT` enviada a `/api/issues/{projectname}` no incluya un `_id`, el valor devuelto es `{ error: 'missing _id' }`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -264,7 +264,7 @@ async (getUserInput) => {
}; };
``` ```
When the `PUT` request sent to `/api/issues/{projectname}` does not include update fields, the return value is `{ error: 'no update field(s) sent', '_id': _id }`. On any other error, the return value is `{ error: 'could not update', '_id': _id }`. Cuando la solicitud `PUT` enviada a `/api/issues/{projectname}` no incluya los campos para actualizar, el valor devuelto es `{ error: 'no update field(s) sent', '_id': _id }`. En cualquier otro error, el valor devuelto es `{ error: 'could not update', '_id': _id }`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -294,7 +294,7 @@ async (getUserInput) => {
}; };
``` ```
You can send a `DELETE` request to `/api/issues/{projectname}` with an `_id` to delete an issue. If no `_id` is sent, the return value is `{ error: 'missing _id' }`. On success, the return value is `{ result: 'successfully deleted', '_id': _id }`. On failure, the return value is `{ error: 'could not delete', '_id': _id }`. Puede enviar una solicitud `DELETE` a `/api/issues/{projectname}` con un `_id` para eliminar un problema. Si ningún `_id` es enviado, el valor devuelto es `{ error: 'missing _id' }`. En caso de éxito, el valor devuelto es `{ result: 'successfully deleted', '_id': _id }`. En caso de fallo, el valor devuelto es `{ error: 'could not delete', '_id': _id }`.
```js ```js
async (getUserInput) => { async (getUserInput) => {
@ -336,7 +336,7 @@ async (getUserInput) => {
}; };
``` ```
All 14 functional tests are complete and passing. Las 14 pruebas funcionales están completas y pasan.
```js ```js
async (getUserInput) => { async (getUserInput) => {

View File

@ -8,13 +8,70 @@ dashedName: medical-data-visualizer
# --description-- # --description--
In questo progetto visualizzerai e farai calcoli relativi ai dati di esami medici usando matplotlib, seaborn, e pandas. Lavorerari a [questo progetto con il nostro codice iniziale su Replit](https://replit.com/github/freeCodeCamp/boilerplate-medical-data-visualizer).
Puoi accedere [alla descrizione completa del progetto e al codice iniziale su Replit](https://replit.com/github/freeCodeCamp/boilerplate-medical-data-visualizer). Stiamo ancora sviluppando la parte didattica interattiva del curriculum di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto quello che devi sapere per completare questo progetto:
Dopo essere andato a quel collegamento, fai un fork del progetto. Una volta completato il progetto in base alle istruzioni riportate in 'README.md', invia il link del progetto qui sotto. - [Video corso Python for Everybody](https://www.freecodecamp.org/news/python-for-everybody/) (14 ore)
- [Video corso Learn Python](https://www.freecodecamp.org/news/learn-python-video-course/) (10 ore)
Stiamo ancora sviluppando la parte didattica interattiva del curriculum di analisi dei dati con Python. Per ora, dovrai utilizzare altre risorse per imparare a superare questa sfida. # --instructions--
In questo progetto visualizzerai e farai calcoli relativi ai dati di esami medici usando matplotlib, seaborn, e pandas. I valori dellinsieme di dati sono stati raccolti durante una serie di esami medici.
## Descrizione dei dati
Le righe nel set di dati rappresentano i pazienti e le colonne rappresentano informazioni come le misurazioni del corpo, i risultati di vari esami del sangue e lo stile di vita. Userai il set di dati per esplorare il rapporto tra malattie cardiache, misurazioni del corpo, marcatori del sangue e stile di vita.
Nome del file: medical_examination.csv
| Caratteristica | Tipo Di Variabile | Variabile | Tipo Di Valore |
|:----------------------------------------------:|:-----------------:|:-----------:|:------------------------------------------------------------------------:|
| Età | Dato oggettivo | age | int (giorni) |
| Altezza | Dato oggettivo | height | int (cm) |
| Peso | Dato oggettivo | weight | float (kg) |
| Genere | Dato oggettivo | gender | codice di categoria |
| Pressione sistolica | Dato da esami | ap_hi | int |
| Pressione sanguigna diastolica | Dato da esami | ap_lo | int |
| Colesterolo | Dato da esami | cholesterol | 1: normale, 2: al di sopra del normale, 3: molto al di sopra del normale |
| Glucosio | Dato da esami | gluc | 1: normale, 2: al di sopra del normale, 3: molto al di sopra del normale |
| Fumatore | Dato soggettivo | smoke | binario |
| Assunzione di alcol | Dato soggettivo | alco | binario |
| Attività fisica | Dato soggettivo | active | binario |
| Presenza o assenza di malattie cardiovascolari | Variabile target | cardio | binario |
## Compiti
Crea un grafico simile a `examples/Figure_1.png`, dove vengono mostrati i conteggi di buoni e cattivi risultati per le variabili `cholesterol`, `gluc`, `alco`, `active` e `smoke` per pazienti con cardio=1 e cardio=0 in differenti pannelli.
Utilizza i dati per completare le seguenti attività in `medical_data_visualizer.py`:
- Aggiungi una colonna `overweight` (sovrappeso) ai dati. Per determinare se una persona è sovrappeso, calcola prima il suo BMI dividendo il peso in chilogrammi per il quadrato della sua altezza in metri. Se questo valore è > 25 allora la persona è sovrappeso. Usa il valore 0 per NON sovrappeso e 1 per sovrappeso.
- Normalizza i dati ponendo 0 sempre bene e 1 sempre male. Se il valore di `cholesterol` o `gluc` è 1, metti il valore 0. Se il valore è superiore a 1, metti il valore 1.
- Converti i dati in formato esteso e crea un grafico che mostri il valore del conteggio delle caratteristiche categoriche usando il `catplot()` di seaborn. Il set di dati dovrebbe essere suddiviso in base a 'Cardio' in modo che ci sia un grafico per ogni valore di `cardio`. Il grafico dovrebbe apparire come `examples/Figure_1.png`.
- Pulisci i dati. Filtra i seguenti segmenti di pazienti che rappresentano dati errati:
- la pressione diastolica è superiore a quella sistolica (tieni i dati corretti con `(df['ap_lo'] <= df['ap_hi'])`)
- l'altezza è inferiore al 2.5° percentile (tieni i dati corretti con `(df['height'] >= df['height'].quantile(0.025))`)
- l'altezza è superiore al 97.5° percentile
- il peso è inferiore al 2.5° percentile
- il peso è superiore al 97.5° percentile
- Crea una matrice di correlazione usando l'insieme di dati. Traccia la matrice di correlazione usando la `heatmap()` di seaborn. Maschera il triangolo superiore. Il grafico dovrebbe apparire come in `examples/Figure_2.png`.
Ogni volta che una variabile è impostata su `None`, assicurati di impostarla al codice corretto.
I test unitari sono scritti per te in `test_module.py`.
## Sviluppo
Nello sviluppo, puoi usare `main.py` per testare le tue funzioni. Usa il bottone "run" e `main.py` sarà eseguito.
## Test
Abbiamo importato i test da `test_module.py` in `main.py` per tua convenienza. I test saranno eseguiti automaticamente quando usi il bottone "run".
## Invio
Copia l'URL del tuo progetto e consegnalo nell'input qua sotto.
# --hints-- # --hints--

View File

@ -25,7 +25,7 @@ Utilizza i dati per completare le seguenti attività:
- Pulisci i dati filtrando i giorni in cui le viste della pagina erano nel 2,5% superiore o nel 2,5% inferiore del set di dati. - Pulisci i dati filtrando i giorni in cui le viste della pagina erano nel 2,5% superiore o nel 2,5% inferiore del set di dati.
- Crea una funzione `draw_line_plot` che utilizza Matplotlib per disegnare un grafico a linee simile a "examples/Figure_1.png". Il titolo dovrebbe essere "Daily freeCodeCamp Forum Page Views 5/2016-12/2019". L'etichetta sull'asse x dovrebbe essere "Date" e l'etichetta sull'asse y dovrebbe essere "Page Views". - Crea una funzione `draw_line_plot` che utilizza Matplotlib per disegnare un grafico a linee simile a "examples/Figure_1.png". Il titolo dovrebbe essere "Daily freeCodeCamp Forum Page Views 5/2016-12/2019". L'etichetta sull'asse x dovrebbe essere "Date" e l'etichetta sull'asse y dovrebbe essere "Page Views".
- Crea una funzione `draw_bar_plot` che disegna un grafico a barre simile a "examples/Figure_2.png". Dovrebbe mostrare le visualizzazioni medie giornaliere delle pagine per ogni mese raggruppato per anno. La legenda dovrebbe mostrare le etichette mensili e avere un titolo di "Months". Sul grafico, l'etichetta sull'asse x dovrebbe essere "Years" e l'etichetta sull'asse y dovrebbe essere "Average Page Views". - Crea una funzione `draw_bar_plot` che disegna un grafico a barre simile a "examples/Figure_2.png". Dovrebbe mostrare le visualizzazioni medie giornaliere delle pagine per ogni mese raggruppato per anno. La legenda dovrebbe mostrare le etichette mensili e avere un titolo di "Months". Sul grafico, l'etichetta sull'asse x dovrebbe essere "Years" e l'etichetta sull'asse y dovrebbe essere "Average Page Views".
- Crea una funzione `draw_box_plot` che utilizza Searborn per disegnare due grafici adiacenti simili a "examples/Figure_3.png". Questi grafici a riquadro devono mostrare come i valori sono distribuiti entro un determinato anno o mese e come si confronta nel tempo. Il titolo del primo grafico dovrebbe essere "Year-wise Box Plot (Trend)" e il titolo del secondo grafico dovrebbe essere "Month-wise Box Plot (Seasonality)". Assicurati che le etichette mensili in basso inizino da "Jan" e che gli assi x e y siano etichettati correttamente. Il boilerplate include comandi per preparare i dati. - Crea una funzione `draw_box_plot` che utilizzi Seaborn per disegnare due grafici adiacenti simili a "examples/Figure_3.png". Questi grafici a riquadro devono mostrare come i valori sono distribuiti entro un determinato anno o mese e come si confronta nel tempo. Il titolo del primo grafico dovrebbe essere "Year-wise Box Plot (Trend)" e il titolo del secondo grafico dovrebbe essere "Month-wise Box Plot (Seasonality)". Assicurati che le etichette mensili in basso inizino da "Jan" e che gli assi x e y siano etichettati correttamente. Il boilerplate include comandi per preparare i dati.
Per ogni grafico, assicurati di utilizzare una copia del frame di dati. I test unitari sono scritti per te in `test_module.py`. Per ogni grafico, assicurati di utilizzare una copia del frame di dati. I test unitari sono scritti per te in `test_module.py`.

View File

@ -0,0 +1,150 @@
---
id: 61abc7ebf3029b56226de5b6
title: Implementare Binary Search
challengeType: 1
forumTopicId: 487618
dashedName: implement-binary-search
---
# --description--
Binary Search è un algoritmo con efficienza **O(log(n))** che permette di cercare un elemento dentro a un array ordinato. Funziona usando i seguenti step:
1. Trova il `value` centrale di un array ordinato. Se `value == target` allora restituiscilo (trovato!).
1. Se invece `value < target`, cerca nella metà destra dell'array nella prossima comparazione.
1. Se invece `value > target`, cerca nella metà sinistra dell'array nella prossima comparazione.
Come puoi vedere, stai dimessando successivamente un array, cosa che da l'efficienza log(n). Per questa sfida vogliamo vedere il tuo lavoro - come sei arrivato al valore target... la strada che hai preso!
# --instructions--
Scrivi una funzione `binarySearch` che implementa un algoritmo di ricerca binaria su un array, restituendo il percorso che hai preso (ogni valore centrale di comparazione) per trovare il target nell'array.
La funzione riceve un array di numeri interi ordinati, e un valore target come input. Restituisce un array contentente in ordine i valori centrali che hai trovato ad ogni dimezzamento dell'array originale fino a che non hai trovato il valore target. Il valore target dovrebbe essere l'ultimo elemento dell'array restituito. Se il valore non è stato trovato, restituisci `Value Not Found`.
Per esempio, `binarySearch([1,2,3,4,5,6,7], 5)` dovrebbe restituisce `[4,6,5]`.
Per questa sfida, quando dimezzi, DEVI usare `Math.floor()` quando fai la divisione: `Math.floor(x/2)`. Questo darà un percorso consistente e testabile.
**Nota:** Il seguente array sarà usato nei test:
```js
const testArray = [
0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 49, 70
];
```
# --hints--
`binarySearch` dovrebbe essere una funzione.
```js
assert(typeof binarySearch == 'function');
```
`binarySearch(testArray, 0)` dovrebbe restituire `[13, 5, 2, 0]`.
```js
assert.deepEqual(binarySearch(_testArray, 0), [13, 5, 2, 0]);
```
`binarySearch(testArray, 1)` dovrebbe restituire `[13, 5, 2, 0, 1]`.
```js
assert.deepEqual(binarySearch(_testArray, 1), [13, 5, 2, 0, 1]);
```
`binarySearch(testArray, 2)` dovrebbe restituire `[13, 5, 2]`.
```js
assert.deepEqual(binarySearch(_testArray, 2), [13, 5, 2]);
```
`binarySearch(testArray, 6)` dovrebbe restituire la stringa `Value Not Found`.
```js
assert.strictEqual(binarySearch(_testArray, 6), 'Value Not Found');
```
`binarySearch(testArray, 11)` dovrebbe restituire `[13, 5, 10, 11]`.
```js
assert.deepEqual(binarySearch(_testArray, 11), [13, 5, 10, 11])
```
`binarySearch(testArray, 13)` dovrebbe restituire `[13]`.
```js
assert.deepEqual(binarySearch(_testArray, 13), [13]);
```
# --seed--
## --after-user-code--
```js
const _testArray = [
0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 49, 70
];
```
## --seed-contents--
```js
function binarySearch(searchList, value) {
let arrayPath = [];
return arrayPath;
}
```
# --solutions--
```js
let binarySearch = (searchList, value) => {
let arrayPath = [];
// set initial L - M - R
let left = 0;
let right = searchList.length - 1;
let middle = Math.floor(right / 2);
// if first comparison finds value
if (searchList[middle] == value) {
arrayPath.push(searchList[middle]);
return arrayPath;
}
while (searchList[middle] !== value) {
// add to output array
arrayPath.push(searchList[middle]);
// not found
if (right < left) {
return 'Value Not Found';
}
// value is in left or right portion of array
// update L - M - R
if (searchList[middle] > value) {
right = middle - 1;
middle = left + Math.floor((right - left) / 2);
} else {
left = middle + 1;
middle = left + Math.floor((right - left) / 2);
}
// if found update output array and exit
if (searchList[middle] == value) {
arrayPath.push(searchList[middle]);
break;
}
}
return arrayPath;
};
```

View File

@ -8,7 +8,7 @@ dashedName: render-conditionally-from-props
# --description-- # --description--
So far, you've seen how to use `if/else`, `&&`, and the ternary operator (`condition ? expressionIfTrue : expressionIfFalse`) to make conditional decisions about what to render and when. However, there's one important topic left to discuss that lets you combine any or all of these concepts with another powerful React feature: props. Using props to conditionally render code is very common with React developers — that is, they use the value of a given prop to automatically make decisions about what to render. ここまで、いつ、何をレンダーするのかを条件で決める方法として、`if/else``&&`、および三項演算子 (`condition ? expressionIfTrue : expressionIfFalse`) を見てきました。 しかし、まだ説明していない重要なトピックが一つあります。それは、これらの概念はそのいずれかまたはすべてを、React の別の強力な機能である props と組み合わせることができる、ということです。 props を使用してコードを条件付きでレンダーすることは、React の開発者にとってはごく一般的な作業です。つまり、与えられた prop の値を利用することで、何を表示するかを自動的に決めることができます。
このチャレンジでは、props に基づいてレンダー処理を決定する子コンポーネントを設定します。 また、三項演算子も使用しますが、前のチャレンジで説明した他のいくつかの概念が、このチャレンジでも同じように役立つかもしれません。 このチャレンジでは、props に基づいてレンダー処理を決定する子コンポーネントを設定します。 また、三項演算子も使用しますが、前のチャレンジで説明した他のいくつかの概念が、このチャレンジでも同じように役立つかもしれません。

View File

@ -25,7 +25,7 @@ Python カリキュラムの対話式教育コンテンツを引き続き開発
- データをクリーニングするため、ページビュー数がデータセットの上位 2.5% または下位 2.5% となった日を除外します。 - データをクリーニングするため、ページビュー数がデータセットの上位 2.5% または下位 2.5% となった日を除外します。
- `draw_line_plot` 関数を作成します。この関数は、Matplotlib を使用して "examples/Figure_1.png" に示すような折れ線グラフを描きます。 タイトルは "Daily freeCodeCamp Forum Page Views 5/2016-12/2019" とします。 x 軸のラベルを "Date"、y 軸のラベルを "Page Views" とします。 - `draw_line_plot` 関数を作成します。この関数は、Matplotlib を使用して "examples/Figure_1.png" に示すような折れ線グラフを描きます。 タイトルは "Daily freeCodeCamp Forum Page Views 5/2016-12/2019" とします。 x 軸のラベルを "Date"、y 軸のラベルを "Page Views" とします。
- `draw_bar_plot` 関数を作成します。この関数は "examples/Figure_2.png" に示すような棒グラフを描きます。 月ごとの 1 日の平均ページビュー数を表示し、年ごとにグループ化する必要があります。 凡例には月のラベルを表示し、タイトルを "Months" とします。 グラフの x 軸のラベルを "Years"、y 軸のラベルを "Average Page Views" とします。 - `draw_bar_plot` 関数を作成します。この関数は "examples/Figure_2.png" に示すような棒グラフを描きます。 月ごとの 1 日の平均ページビュー数を表示し、年ごとにグループ化する必要があります。 凡例には月のラベルを表示し、タイトルを "Months" とします。 グラフの x 軸のラベルを "Years"、y 軸のラベルを "Average Page Views" とします。
- Create a `draw_box_plot` function that uses Seaborn to draw two adjacent box plots similar to "examples/Figure_3.png". これらのボックスプロットでは、特定の年または月の中で値がどのように分布しているかを示し、経時的に比較できるようにする必要があります。 最初のグラフのタイトルを "Year-wise Box Plot (Trend)"、2 つ目のグラフのタイトルを "Month-wise Box Plot (Seasonality)" とします。 一番下の月ラベルの始まりを "Jan" とし、x および x 軸のラベルを正しく設定する必要があります。 ボイラープレートには、データを準備するコマンドが含まれています。 - `draw_box_plot` 関数を作成します。この関数は、Seaborn を使用して "examples/Figure_3.png" に示すような 2 つの隣接するボックスプロットを描きます。 これらのボックスプロットでは、特定の年または月の中で値がどのように分布しているかを示し、経時的に比較できるようにする必要があります。 最初のグラフのタイトルを "Year-wise Box Plot (Trend)"、2 つ目のグラフのタイトルを "Month-wise Box Plot (Seasonality)" とします。 一番下の月ラベルの始まりを "Jan" とし、x および x 軸のラベルを正しく設定する必要があります。 ボイラープレートには、データを準備するコマンドが含まれています。
グラフごとに、必ずデータフレームのコピーを使用してください。 `test_module.py` の下に単体テストが記述してあります。 グラフごとに、必ずデータフレームのコピーを使用してください。 `test_module.py` の下に単体テストが記述してあります。

View File

@ -27,8 +27,8 @@ dashedName: circles-of-given-radius-through-two-points
<ul> <ul>
<li>2点が直径上にある場合は、1 点を返します。 ただし、半径もゼロの場合は、<code>"Radius Zero"</code> を返します。</li> <li>2点が直径上にある場合は、1 点を返します。 ただし、半径もゼロの場合は、<code>"Radius Zero"</code> を返します。</li>
<li>If points are coincident, return <code>"Coincident point. Infinite solutions"</code>.</li> <li>2点が完全に一致する場合は、<code>"Coincident point. Infinite solutions"</code> を返します。</li>
<li>If points are farther apart than the diameter, return <code>"No intersection. Points further apart than circle diameter"</code>.</li> <li>2点が直径よりも離れている場合は、<code>"No intersection. Points further apart than circle diameter"</code> を返します。</li>
</ul> </ul>
**入力例** **入力例**
@ -61,13 +61,13 @@ assert.deepEqual(getCircles(...testCases[0]), answers[0]);
assert.deepEqual(getCircles(...testCases[1]), answers[1]); assert.deepEqual(getCircles(...testCases[1]), answers[1]);
``` ```
`getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0)` should return `Coincident point. Infinite solutions` `getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0)` `Coincident point. Infinite solutions` を返します。
```js ```js
assert.deepEqual(getCircles(...testCases[2]), answers[2]); assert.deepEqual(getCircles(...testCases[2]), answers[2]);
``` ```
`getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5)` should return `No intersection. Points further apart than circle diameter` `getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5)` `No intersection. Points further apart than circle diameter` を返します。
```js ```js
assert.deepEqual(getCircles(...testCases[3]), answers[3]); assert.deepEqual(getCircles(...testCases[3]), answers[3]);

View File

@ -36,7 +36,7 @@ assert(
); );
``` ```
`discordianDate(new Date(2012, 1, 29))` should return `"Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!"`. `discordianDate(new Date(2012, 1, 29))` `"Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!"` を返します。
```js ```js
assert( assert(
@ -54,7 +54,7 @@ assert(
); );
``` ```
`discordianDate(new Date(2010, 0, 5))` should return `"Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!"`. `discordianDate(new Date(2010, 0, 5))` `"Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!"` を返します。
```js ```js
assert( assert(
@ -63,7 +63,7 @@ assert(
); );
``` ```
`discordianDate(new Date(2011, 4, 3))` should return `"Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!"`. `discordianDate(new Date(2011, 4, 3))` `"Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!"` を返します。
```js ```js
assert( assert(

View File

@ -168,7 +168,7 @@ assert.deepEqual(markov(rules[1], tests[1]), outputs[1]);
assert.deepEqual(markov(rules[2], tests[2]), outputs[2]); assert.deepEqual(markov(rules[2], tests[2]), outputs[2]);
``` ```
`markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_")` should return "11111111111111111111". `markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_")` は「11111111111111111111」を返します。
```js ```js
assert.deepEqual(markov(rules[3], tests[3]), outputs[3]); assert.deepEqual(markov(rules[3], tests[3]), outputs[3]);

View File

@ -22,7 +22,7 @@ dashedName: factorial
<li><code>4! = 4 * 3 * 2 * 1 = 24</code></li> <li><code>4! = 4 * 3 * 2 * 1 = 24</code></li>
</ul> </ul>
**Note:** `0! = 1` **:** `0! = 1` です。
# --hints-- # --hints--

View File

@ -25,7 +25,7 @@ Use os dados para completar as seguintes tarefas:
- Limpe os dados filtrando os dias em que as visualizações de página estavam nos 2,5% maiores ou nos 2,5% menores do dataset. - Limpe os dados filtrando os dias em que as visualizações de página estavam nos 2,5% maiores ou nos 2,5% menores do dataset.
- Crie uma função `draw_line_plot` que use o Matplotlib para desenhar um gráfico de linhas semelhante a "examples/Figure_1.png". O título deve ser "Daily freeCodeCamp Forum Page Views 5/2016-12/2019". O rótulo no eixo x deve ser "Date" e o rótulo no eixo y deve ser "Page Views". - Crie uma função `draw_line_plot` que use o Matplotlib para desenhar um gráfico de linhas semelhante a "examples/Figure_1.png". O título deve ser "Daily freeCodeCamp Forum Page Views 5/2016-12/2019". O rótulo no eixo x deve ser "Date" e o rótulo no eixo y deve ser "Page Views".
- Crie uma função `draw_bar_plot` para desenhar um gráfico de barras semelhante a "examples/Figure_2.png". Ele deve mostrar as médias de visualizações de página diárias para cada mês agrupadas por ano. A legenda deve mostrar os rótulos dos meses e ter o título "Months". No gráfico, o rótulo no eixo x deve ser "Years" e o rótulo no eixo y deve ser "Average Page Views". - Crie uma função `draw_bar_plot` para desenhar um gráfico de barras semelhante a "examples/Figure_2.png". Ele deve mostrar as médias de visualizações de página diárias para cada mês agrupadas por ano. A legenda deve mostrar os rótulos dos meses e ter o título "Months". No gráfico, o rótulo no eixo x deve ser "Years" e o rótulo no eixo y deve ser "Average Page Views".
- Crie uma função `draw_box_plot` que use o Seaborn para desenhar dois diagramas de caixa semelhantes a "examples/Figure_3.png". Esses diagramas de caixa devem mostrar como os valores são distribuídos dentro de um determinado ano ou mês e como são comparados ao longo do tempo. O título do primeiro diagrama deve ser "Year-wise Box Plot (Trend)" (Diagrama de caixas do ano (Tendência)) e o título do segundo gráfico deve ser "Month-wise Box Plot (Seasonality)" (Diagrama de caixas do mês (Sazonalidade)). Certifique-se de que as etiquetas do mês na parte inferior comecem em "Jan" e que o eixos x e y estejam rotulados corretamente. O boilerplate inclui comandos para preparar os dados. - Crie uma função `draw_box_plot` que use o Seaborn para desenhar um diagrama de 2 caixas adjacentes similar a "examples/Figure_3.png". Esses diagramas de caixa devem mostrar como os valores são distribuídos dentro de um determinado ano ou mês e como são comparados ao longo do tempo. O título do primeiro diagrama deve ser "Year-wise Box Plot (Trend)" (Diagrama de caixas do ano (Tendência)) e o título do segundo gráfico deve ser "Month-wise Box Plot (Seasonality)" (Diagrama de caixas do mês (Sazonalidade)). Certifique-se de que as etiquetas do mês na parte inferior comecem em "Jan" e que o eixos x e y estejam rotulados corretamente. O boilerplate inclui comandos para preparar os dados.
Para cada gráfico, certifique-se de usar uma cópia do data frame. Os testes unitários foram escritos para você no `test_module.py`. Para cada gráfico, certifique-se de usar uma cópia do data frame. Os testes unitários foram escritos para você no `test_module.py`.