mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
chore(i18n,learn): processed translations (#53714)
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
This commit is contained in:
co-authored by
Naomi Carrigan
parent
31f5e9be21
commit
bf7ae1ed67
+1
-9
@@ -11,17 +11,9 @@ dashedName: exercise-tracker
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://exercise-tracker.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://exercise-tracker.freecodecamp.rocks</a>. Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-exercisetracker" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-exercisetracker/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- Start by importing the project on Replit.
|
||||
- Next, you will see a `.replit` window.
|
||||
- Select `Use run command` and click the `Done` button.
|
||||
|
||||
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.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Your responses should have the following structures.
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: file-metadata-microservice
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://file-metadata-microservice.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://file-metadata-microservice.freecodecamp.rocks</a>. Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-filemetadata/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-filemetadata" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-filemetadata/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- Start by importing the project on Replit.
|
||||
- Next, you will see a `.replit` window.
|
||||
- Select `Use run command` and click the `Done` button.
|
||||
|
||||
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.
|
||||
|
||||
# --instructions--
|
||||
|
||||
**HINT:** You can use the `multer` npm package to handle file uploading.
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: request-header-parser-microservice
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://request-header-parser-microservice.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://request-header-parser-microservice.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-headerparser/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-headerparser" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-headerparser/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- Start by importing the project on Replit.
|
||||
- Next, you will see a `.replit` window.
|
||||
- Select `Use run command` and click the `Done` button.
|
||||
|
||||
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.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should provide your own project, not the example URL.
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: timestamp-microservice
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://timestamp-microservice.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://timestamp-microservice.freecodecamp.rocks</a>. سوف يقوم يلزمك العمل على هذا المشروع بكتابة كود باستخدام إحدى الطرق التالية:
|
||||
|
||||
- أستنسخ <a href="https://github.com/freeCodeCamp/boilerplate-project-timestamp/" target="_blank" rel="noopener noreferrer nofollow">هذا مستودع من GitHub</a> واكمل مشروعك محلياً.
|
||||
- استخدم <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-timestamp" target="_blank" rel="noopener noreferrer nofollow">مشروعنا المبدئي في Replit</a> لإكمال مشروعك.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-timestamp/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ لموقع لإكمال المشروع. تأكد من دمج جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا كنت تستخدم Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
When you are done, make sure a working demo of your project is hosted somewhere public. ثم أرسل عنوان (URL) إليه في خانة "رابط الحل". وإن أردت تستطيع أيضًا إرسال رابط لكود المصدر لمشروعك في الخانة "رابط Github".
|
||||
|
||||
**ملاحظة:** ليس الغرض من هذا المشروع تحويل المناطق الزمنية، لذلك افترض إن جميع التواريخ الصحيحة المرسلة ستحلل بواسطة `new Date()` كتواريخ GMT.
|
||||
|
||||
# --hints--
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: url-shortener-microservice
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://url-shortener-microservice.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://url-shortener-microservice.freecodecamp.rocks</a>. Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-urlshortener/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-urlshortener" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-urlshortener/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- Start by importing the project on Replit.
|
||||
- Next, you will see a `.replit` window.
|
||||
- Select `Use run command` and click the `Done` button.
|
||||
|
||||
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.
|
||||
|
||||
# --instructions--
|
||||
|
||||
**HINT:** Do not forget to use a body parsing middleware to handle the POST requests. Also, you can use the function `dns.lookup(host, cb)` from the `dns` core module to verify a submitted URL.
|
||||
|
||||
+2
-10
@@ -11,20 +11,12 @@ dashedName: meet-the-node-console
|
||||
Working on these challenges will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-express/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-express" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-express/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete these challenges.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- Start by importing the project on Replit.
|
||||
- Next, you will see a `.replit` window.
|
||||
- Select `Use run command` and click the `Done` button.
|
||||
|
||||
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.
|
||||
|
||||
During the development process, it is important to be able to check what’s going on in your code.
|
||||
|
||||
Node is just a JavaScript environment. Like client side JavaScript, you can use the console to display useful debug information. On your local machine, you would see console output in a terminal. On Replit, a terminal is open in the right pane by default.
|
||||
Node is just a JavaScript environment. Like client side JavaScript, you can use the console to display useful debug information. On your local machine, you would see console output in a terminal. On Gitpod, a terminal is open at the bottom of the editor by default.
|
||||
|
||||
We recommend to keep the terminal open while working at these challenges. By reading the output in the terminal, you can see any errors that may occur.
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ function(req, res) {
|
||||
|
||||
# --instructions--
|
||||
|
||||
استخدم طريقة `app.get()` لتمديد المقطع "Hello Express" إلى طلبات GET المطابقة للمسار `/` (منفذ المصدر). أنظر إلى السجلات لتتأكد من أن الكود يعمل، ثم شاهد النتائج في علامة تبويب preview إذا كنت تستخدم Replit.
|
||||
استخدم طريقة `app.get()` لتمديد المقطع "Hello Express" إلى طلبات GET المطابقة للمسار `/` (منفذ المصدر). Be sure that your code works by looking at the logs, then see the results in the preview if you are using Gitpod.
|
||||
|
||||
**ملاحظة:** يجب إضافة كل الكود لهذه الدروس بين سطور الكود التي بدأنا بها.
|
||||
|
||||
|
||||
-2
@@ -20,8 +20,6 @@ Create a `.env` file in the root of your project directory, and store the variab
|
||||
|
||||
Then, in the `/json` GET route handler you created in the last challenge access `process.env.MESSAGE_STYLE` and transform the response object's `message` to uppercase if the variable equals `uppercase`. The response object should either be `{"message": "Hello json"}` or `{"message": "HELLO JSON"}`, depending on the `MESSAGE_STYLE` value. Note that you must read the value of `process.env.MESSAGE_STYLE` **inside** the route handler, not outside of it, due to the way our tests run.
|
||||
|
||||
**Note:** If you are using Replit, you cannot create a `.env` file. Instead, use the built-in <dfn>SECRETS</dfn> tab to add the variable.
|
||||
|
||||
If you are working locally, you will need the `dotenv` package. It loads environment variables from your `.env` file into `process.env`. The `dotenv` package has already been installed, and is in your project's `package.json` file. At the top of your `myApp.js` file, add `require('dotenv').config()` to load the environment variables.
|
||||
|
||||
# --hints--
|
||||
|
||||
+3
-9
@@ -11,17 +11,9 @@ dashedName: how-to-use-package-json-the-core-of-any-node-js-project-or-npm-packa
|
||||
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- انسخ <a href="https://github.com/freeCodeCamp/boilerplate-npm/" target="_blank" rel="noopener noreferrer nofollow"> هذا المستودع من GitHub</a> واكمل مشروعك محلياً.
|
||||
- استخدم <a href="https://replit.com/github/freeCodeCamp/boilerplate-npm" target="_blank" rel="noopener noreferrer nofollow">مشروعنا المبدئي على Replit</a> لإكمال هذه التحديات.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-npm/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete these challenges.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو لمشروعك في مكان عام. ثم أرسل عنوانه (URL) في خانة "رابط الحل".
|
||||
|
||||
إن ملف `package.json` مركز أي مشروع Node.js أو حزمة npm. It stores information about your project, similar to how the `head` section of an HTML document describes the content of a webpage. ويتكون من كائن JSON واحد حيث يتم تخزين المعلومات في أزواج key-value. There are only two required fields; `name` and `version`, but it’s good practice to provide additional information about your project that could be useful to future users or maintainers.
|
||||
|
||||
If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. هذا هو الملف الذي سوف تحسنه في التحديات القادمة.
|
||||
@@ -38,6 +30,8 @@ Add your name as the `author` of the project in the `package.json` file.
|
||||
|
||||
**ملاحظة:** تذكر أنك تكتب JSON، لذلك يجب أن تستخدم جميع أسماء الخانات علامات اقتباس مزدوجة (") وأن تكون مفصولة بفاصلة (,).
|
||||
|
||||
If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below.
|
||||
|
||||
# --hints--
|
||||
|
||||
`package.json` should have a valid "author" key
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ dashedName: create-a-model
|
||||
|
||||
First of all, we need a Schema. Each schema maps to a MongoDB collection. It defines the shape of the documents within that collection. Schemas are building blocks for Models. They can be nested to create complex models, but in this case, we'll keep things simple. A model allows you to create instances of your objects, called documents.
|
||||
|
||||
Replit is a real server, and in real servers, the interactions with the database happen in handler functions. These functions are executed when some event happens (e.g. someone hits an endpoint on your API). We’ll follow the same approach in these exercises. The `done()` function is a callback that tells us that we can proceed after completing an asynchronous operation such as inserting, searching, updating, or deleting. It's following the Node convention, and should be called as `done(null, data)` on success, or `done(err)` on error.
|
||||
Gitpod is a real server, and in real servers, the interactions with the database happen in handler functions. These functions are executed when some event happens (e.g. someone hits an endpoint on your API). We’ll follow the same approach in these exercises. The `done()` function is a callback that tells us that we can proceed after completing an asynchronous operation such as inserting, searching, updating, or deleting. It's following the Node convention, and should be called as `done(null, data)` on success, or `done(err)` on error.
|
||||
|
||||
Warning - When interacting with remote services, errors may occur!
|
||||
|
||||
|
||||
+1
-11
@@ -11,17 +11,9 @@ dashedName: install-and-set-up-mongoose
|
||||
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-mongomongoose/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-mongomongoose" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mongomongoose/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete these challenges.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
|
||||
|
||||
In this challenge, you will set up a MongoDB Atlas database and import the required packages to connect to it.
|
||||
|
||||
Follow <a href='https://www.freecodecamp.org/news/get-started-with-mongodb-atlas/' target="_blank" rel="noopener noreferrer nofollow">this tutorial</a> to set up a hosted database on MongoDB Atlas.
|
||||
@@ -30,8 +22,6 @@ Follow <a href='https://www.freecodecamp.org/news/get-started-with-mongodb-atlas
|
||||
|
||||
`mongoose@^5.11.15` has been added to your project’s `package.json` file. First, require mongoose as `mongoose` in `myApp.js`. Next, create a `.env` file and add a `MONGO_URI` variable to it. Its value should be your MongoDB Atlas database URI. Be sure to surround the URI with single or double quotes, and remember that you can't use spaces around the `=` in environment variables. For example, `MONGO_URI='VALUE'`.
|
||||
|
||||
**Note:** If you are using Replit, you cannot create a `.env` file. Instead, use the built-in <dfn>SECRETS</dfn> tab to add the variable. <em>Do not</em> surround the values with quotes when using the <em>SECRETS</em> tab.
|
||||
|
||||
When you are done, connect to the database by calling the `connect` method within your `myApp.js` file by using the following syntax:
|
||||
|
||||
```js
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ The basic path this kind of authentication will follow in your app is:
|
||||
|
||||
Strategies with OAuth require you to have at least a *Client ID* and a *Client Secret* which is a way for the service to verify who the authentication request is coming from and if it is valid. These are obtained from the site you are trying to implement authentication with, such as GitHub, and are unique to your app--**THEY ARE NOT TO BE SHARED** and should never be uploaded to a public repository or written directly in your code. A common practice is to put them in your `.env` file and reference them like so: `process.env.GITHUB_CLIENT_ID`. For this challenge you are going to use the GitHub strategy.
|
||||
|
||||
Follow <a href="https://www.freecodecamp.org/news/how-to-set-up-a-github-oauth-application/" target="_blank" rel="noopener noreferrer nofollow">these instructions</a> to obtain your *Client ID and Secret* from GitHub. Set the homepage URL to your Replit homepage (**not the project code's URL**), and set the callback URL to the same homepage URL with `/auth/github/callback` appended to the end. Save the client ID and your client secret in your project's `.env` file as `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`.
|
||||
Follow <a href="https://www.freecodecamp.org/news/how-to-set-up-a-github-oauth-application/" target="_blank" rel="noopener noreferrer nofollow">these instructions</a> to obtain your *Client ID and Secret* from GitHub. Set the homepage URL to your homepage (**not the project code's URL**), and set the callback URL to the same homepage URL with `/auth/github/callback` appended to the end. Save the client ID and your client secret in your project's `.env` file as `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`.
|
||||
|
||||
In your `routes.js` file, add `showSocialAuth: true` to the homepage route, after `showRegistration: true`. Now, create 2 routes accepting GET requests: `/auth/github` and `/auth/github/callback`. The first should only call passport to authenticate `'github'`. The second should call passport to authenticate `'github'` with a failure redirect to `/`, and then if that is successful redirect to `/profile` (similar to your last project).
|
||||
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: set-up-a-template-engine
|
||||
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-advancednode/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-advancednode" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-advancednode/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete these challenges.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
|
||||
|
||||
A template engine enables you to use static template files (such as those written in *Pug*) in your app. At runtime, the template engine replaces variables in a template file with actual values which can be supplied by your server. Then it transforms the template into a static HTML file that is sent to the client. This approach makes it easier to design an HTML page and allows for displaying variables on the page without needing to make an API call from the client.
|
||||
|
||||
`pug@~3.0.0` has already been installed, and is listed as a dependency in your `package.json` file.
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: assert-deep-equality-with--deepequal-and--notdeepequal
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a> or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a> or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`deepEqual()` asserts that two objects are deep equal.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: compare-the-properties-of-two-elements
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: learn-how-javascript-assertions-work
|
||||
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete these challenges.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Within `tests/1_unit-tests.js` under the test labeled `#1` in the `Basic Assertions` suite, change each `assert` to either `assert.isNull` or `assert.isNotNull` to make the test pass (should evaluate to `true`). Do not alter the arguments passed to the asserts.
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iii---put-me
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
When you test a `PUT` request, you'll often send data along with it. The data you include with your `PUT` request is called the body of the request.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-an-api-response-using-chai-http-iv---put-met
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
This exercise is similar to the previous one.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http-ii
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: run-functional-tests-on-api-endpoints-using-chai-http
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
Mocha allows you to test asynchronous operations like calls to API endpoints with a plugin called `chai-http`.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser-ii
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: run-functional-tests-using-a-headless-browser
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
On the page there's an input form. It sends data to the `PUT /travellers` endpoint as an AJAX request.
|
||||
|
||||
|
||||
+3
-3
@@ -7,13 +7,13 @@ dashedName: simulate-actions-using-a-headless-browser
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
In the next challenges, you'll simulate human interaction with a page by using a headless browser.
|
||||
|
||||
Headless browsers are web browsers without a GUI. They are able to render and interpret HTML, CSS, and JavaScript the same way a regular browser would, making them particularly useful for testing web pages.
|
||||
|
||||
For the following challenges you'll use Zombie.js, which is a lightweight headless browser that doesn't rely on additional binaries to be installed. This feature makes it usable in limited environments like Replit. But there are many other, more powerful headless browser options.
|
||||
For the following challenges you'll use Zombie.js, which is a lightweight headless browser that doesn't rely on additional binaries to be installed. But there are many other, more powerful headless browser options.
|
||||
|
||||
Mocha allows you to run some code before any of the actual tests run. This can be useful to do things like add entries to a database which will be used in the rest of the tests.
|
||||
|
||||
@@ -28,7 +28,7 @@ There are several other hook types that can execute code before each test, after
|
||||
Within `tests/2_functional-tests.js`, immediately after the `Browser` declaration, add your project URL to the `site` property of the variable:
|
||||
|
||||
```js
|
||||
Browser.site = 'https://boilerplate-mochachai.your-username.repl.co'; // Your URL here
|
||||
Browser.site = 'http://localhost:3000'; // Your URL here
|
||||
```
|
||||
|
||||
Then at the root level of the `'Functional Tests with Zombie.js'` suite, instantiate a new instance of the `Browser` object with the following code:
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-for-truthiness
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`isTrue()` will test for the boolean value `true` and `isNotTrue()` will pass when given anything but the boolean value of `true`.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-a-string-contains-a-substring
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`include()` and `notInclude()` work for strings too! `include()` asserts that the actual string contains the expected substring.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-a-value-falls-within-a-specific-range
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
```javascript
|
||||
.approximately(actual, expected, delta, [message])
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-a-string
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`isString` or `isNotString` asserts that the actual value is a string.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-an-array
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-a-value-is-of-a-specific-data-structure-type
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`#typeOf` asserts that value's type is the given string, as determined by `Object.prototype.toString`.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-a-variable-or-function-is-defined
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-an-array-contains-an-item
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-an-object-has-a-property
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`property` asserts that the actual object has a given property.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-an-object-is-an-instance-of-a-constructor
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`#instanceOf` asserts that an object is an instance of a constructor.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: test-if-one-value-is-below-or-at-least-as-large-as-another
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: use-assert-isok-and-assert-isnotok
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`isOk()` will test for a truthy value, and `isNotOk()` will test for a falsy value.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: use-regular-expressions-to-test-a-string
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`match()` asserts that the actual value matches the second argument regular expression.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: use-the-double-equals-to-assert-equality
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`equal()` compares objects using `==`.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: use-the-triple-equals-to-assert-strict-equality
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-mochachai" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-mochachai/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`strictEqual()` compares objects using `===`.
|
||||
|
||||
|
||||
+3
-11
@@ -11,25 +11,17 @@ dashedName: american-british-translator
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://american-british-translator.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://american-british-translator.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-american-british-english-translator" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
|
||||
|
||||
# --instructions--
|
||||
|
||||
- All logic can go into `/components/translator.js`
|
||||
- Complete the `/api/translate` route in `/routes/api.js`
|
||||
- Create all of the unit/functional tests in `tests/1_unit-tests.js` and `tests/2_functional-tests.js`
|
||||
- See the JavaScript files in `/components` for the different spelling and terms your application should translate
|
||||
- To run the tests on Replit, set `NODE_ENV` to `test` without quotes in the `.env` file
|
||||
- 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"
|
||||
- To run the tests automatically, set `NODE_ENV` to `test` without quotes in the `.env` file
|
||||
- To run the tests in the console, use the command `npm run test`.
|
||||
|
||||
Write the following tests in `tests/1_unit-tests.js`:
|
||||
|
||||
|
||||
+3
-11
@@ -11,24 +11,16 @@ dashedName: issue-tracker
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://issue-tracker.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://issue-tracker.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-issuetracker/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-issuetracker" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-issuetracker/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
|
||||
|
||||
# --instructions--
|
||||
|
||||
- Complete the necessary routes in `/routes/api.js`
|
||||
- Create all of the functional tests in `tests/2_functional-tests.js`
|
||||
- Copy the `sample.env` file to `.env` and set the variables appropriately
|
||||
- To run the tests uncomment `NODE_ENV=test` in your `.env` file
|
||||
- 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"
|
||||
- To run the tests automatically, add `NODE_ENV=test` in your `.env` file
|
||||
- To run the tests in the console, use the command `npm run test`
|
||||
|
||||
Write the following tests in `tests/2_functional-tests.js`:
|
||||
|
||||
|
||||
+3
-11
@@ -11,17 +11,9 @@ dashedName: metric-imperial-converter
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://metric-imperial-converter.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://metric-imperial-converter.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-metricimpconverter" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-metricimpconverter/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
|
||||
|
||||
**Note:** This project's tests do not work when using `glitch.com`.
|
||||
|
||||
# --instructions--
|
||||
@@ -29,8 +21,8 @@ Build a full stack JavaScript app that is functionally similar to this: <a href=
|
||||
- Complete the necessary conversion logic in `/controllers/convertHandler.js`
|
||||
- Complete the necessary routes in `/routes/api.js`
|
||||
- Copy the `sample.env` file to `.env` and set the variables appropriately
|
||||
- To run the tests uncomment `NODE_ENV=test` in your `.env` file
|
||||
- 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"
|
||||
- To run the tests automatically, add `NODE_ENV=test` in your `.env` file
|
||||
- To run the tests in the console, use the command `npm run test`.
|
||||
|
||||
Write the following tests in `tests/1_unit-tests.js`:
|
||||
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: personal-library
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://personal-library.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://personal-library.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-library" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-library" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-library" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
|
||||
|
||||
# --instructions--
|
||||
|
||||
1. Add your MongoDB connection string to `.env` without quotes as `DB` Example: `DB=mongodb://admin:pass@1234.mlab.com:1234/fccpersonallib`
|
||||
|
||||
+2
-10
@@ -11,17 +11,9 @@ dashedName: sudoku-solver
|
||||
Build a full stack JavaScript app that is functionally similar to this: <a href="https://sudoku-solver.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://sudoku-solver.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freecodecamp/boilerplate-project-sudoku-solver" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-sudoku-solver" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freecodecamp/boilerplate-project-sudoku-solver" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
|
||||
|
||||
# --instructions--
|
||||
|
||||
- All puzzle logic can go into `/controllers/sudoku-solver.js`
|
||||
@@ -31,7 +23,7 @@ Build a full stack JavaScript app that is functionally similar to this: <a href=
|
||||
- All routing logic can go into `/routes/api.js`
|
||||
- See the `puzzle-strings.js` file in `/controllers` for some sample puzzles your application should solve
|
||||
- To run the challenge tests on this page, set `NODE_ENV` to `test` without quotes in the `.env` file
|
||||
- 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"
|
||||
- To run the tests in the console, use the command `npm run test`.
|
||||
|
||||
Write the following tests in `tests/1_unit-tests.js`:
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ You should have `for guess in range(1,10):` within the `else` block.
|
||||
const tCode = code.replace(/\r/g, '');
|
||||
const {function_body} = __helpers.python.getDef(tCode, "solver");
|
||||
const {block_body} = __helpers.python.getBlock(function_body, "else");
|
||||
assert.match(block_body, /for\s+\w+\s+in\s+range\(\s*1,\s*10\s*\)/);
|
||||
assert.match(block_body, /for\s+\w+\s+in\s+range\(\s*1\s*,\s*10\s*\)/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ You should have `row, col = next_empty` within the innermost `if` statement.
|
||||
const tCode = code.replace(/\r/g, '');
|
||||
const {function_body} = __helpers.python.getDef(tCode, "solver");
|
||||
const {block_body} = __helpers.python.getBlock(function_body, "if self.is_valid(next_empty, guess)");
|
||||
assert.match(block_body, /row,\s*col\s*=\s*next_empty/);
|
||||
assert.match(block_body, /row\s*,\s*col\s*=\s*next_empty/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ You should have `total = sum_of_odd_digits + sum_of_even_digits` within the `ver
|
||||
|
||||
const function_body_indentation = function_body.match(/^\s*/)[0];
|
||||
|
||||
const total_re = new RegExp(`^${function_body_indentation}total\\s*=\\s*sum_of_odd_digits\\s*\\+\\s*sum_of_even_digits`, "m");
|
||||
const total_re = new RegExp(`^${function_body_indentation}total\\s*=\\s*(sum_of_odd_digits\\s*\\+\\s*sum_of_even_digits|sum_of_even_digits\\s*\\+\\s*sum_of_odd_digits)`, "m");
|
||||
|
||||
assert.match(function_body, total_re);
|
||||
}
|
||||
|
||||
+2
-2
@@ -13,9 +13,9 @@ A dictionary is another built-in data type in Python. A dictionary is a collecti
|
||||
{'amount': 50.0, 'category': 'Food'}
|
||||
```
|
||||
|
||||
In the example above, `amount` and `category` are keys, and `50.0` and `'Food'` are their the corresponding values.
|
||||
In the example above, `'amount'` and `'category'` are keys, and `50.0` and `'Food'` are their corresponding values.
|
||||
|
||||
Create a dictionary with a key `amount` and value of the `amount` parameter and pass your new dictionary to the `.append()` call.
|
||||
Create a dictionary with a key `'amount'` and value of the `amount` parameter and pass your new dictionary to the `.append()` call.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ In this project, you are going to learn about list comprehensions in Python by b
|
||||
|
||||
List comprehensions in Python are a concise way to construct a list without using loops or the `.append()` method. Apart from being briefer, list comprehensions often run faster.
|
||||
|
||||
Start defining a new function named `convert_to_snake_case()` that accepts a string named `pascal_or_camel_cased_string` as input.
|
||||
Start defining a new function named `convert_to_snake_case()` that accepts a string named `pascal_or_camel_cased_string` as input. For now, add a `pass` statement inside the function.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
+3
-2
@@ -19,9 +19,10 @@ You should replace `pass` with an empty list named `snake_cased_char_list` withi
|
||||
({
|
||||
test: () => {
|
||||
const transformedCode = code.replace(/\r/g, "");
|
||||
const convert_to_snake_case = __helpers.python.getDef("\n" + transformedCode, "convert_to_snake_case");
|
||||
const commentless_code = __helpers.python.removeComments(transformedCode)
|
||||
const convert_to_snake_case = __helpers.python.getDef("\n" + commentless_code, "convert_to_snake_case");
|
||||
const { function_body } = convert_to_snake_case;
|
||||
|
||||
assert.notMatch(function_body, /\bpass\b/);
|
||||
assert.match(function_body, / +snake_cased_char_list\s*=\s*\[\s*\]\s*/);
|
||||
}
|
||||
})
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ dashedName: step-3
|
||||
|
||||
Now that you have an empty list in place, you can start iterating through the input string and start converting each character to snake case.
|
||||
|
||||
Use a `for` loop to iterate through the `pascal_or_camel_cased_string`. Make sure to name the target variable `char` which is short for character.
|
||||
Use a `for` loop to iterate through the `pascal_or_camel_cased_string`. Make sure to name the target variable `char` which is short for character. For now, add a `pass` statement in the loop body.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -22,7 +22,7 @@ You should write a new `for` loop with the target variable named `char`. Don't f
|
||||
const convert_to_snake_case = __helpers.python.getDef("\n" + transformedCode, "convert_to_snake_case");
|
||||
const { function_body } = convert_to_snake_case;
|
||||
|
||||
assert.match(function_body, / +for\s+char\s+in\s+pascal_or_camel_cased_string\s*:/);
|
||||
assert.match(function_body, / +for\s+char\s+in\s+pascal_or_camel_cased_string\s*:\s*pass[\s]*$/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
+18
-6
@@ -13,16 +13,28 @@ Inside the loop body, use an `if` statement in conjunction with the `.isupper()`
|
||||
|
||||
# --hints--
|
||||
|
||||
You should write a new `if` statement with `char.isupper()` as the condition. Don't forget the colon at the end.
|
||||
You should write a new if statement with char.isupper() as the condition. Remember to add the colon at the end and use the pass keyword to fill the if statement body.
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => {
|
||||
const transformedCode = code.replace(/\r/g, "");
|
||||
const convert_to_snake_case = __helpers.python.getDef("\n" + transformedCode, "convert_to_snake_case");
|
||||
const { function_body } = convert_to_snake_case;
|
||||
test: () => {
|
||||
const commentless_code = __helpers.python.removeComments(code)
|
||||
const transformedCode = commentless_code.replace(/\r/g, "");
|
||||
const {function_body} = __helpers.python.getDef("\n" + commentless_code, "convert_to_snake_case");
|
||||
assert.match(function_body, /\s+if\s+char\.isupper\s*\(\s*\)\s*:\s+pass/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
You should replace the `pass` statement in the loop body with the `if` statement.
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => {
|
||||
const commentless_code = __helpers.python.removeComments(code)
|
||||
const {block_body} = __helpers.python.getBlock(commentless_code, /for\s+char\s+in\s+pascal_or_camel_cased_string\s*/);
|
||||
assert.notMatch(block_body, /^\s+pass/);
|
||||
|
||||
assert.match(function_body, / +if\s+char\.isupper\s*\(\s*\)\s*:/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
+12
@@ -33,6 +33,18 @@ You should assign the modified character to a variable named `converted_characte
|
||||
})
|
||||
```
|
||||
|
||||
You should not have `pass` in your `if` statement.
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => {
|
||||
const commentless_code = __helpers.python.removeComments(code);
|
||||
const {block_body} = __helpers.python.getBlock(commentless_code, /if\s+char\.isupper\s*\(\s*\)\s*/);
|
||||
assert.notMatch(block_body, /pass/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
+15
@@ -25,6 +25,21 @@ You should call `convert_to_snake_case()` inside the `main()` function and pass
|
||||
})
|
||||
```
|
||||
|
||||
You should not have `pass` in your `main` function.
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => {
|
||||
const commentless_code = __helpers.python.removeComments(code);
|
||||
const transformedCode = commentless_code.replace(/\r/g, "");
|
||||
const main = __helpers.python.getDef("\n" + transformedCode, "main");
|
||||
const { function_body } = main;
|
||||
|
||||
assert.notMatch(function_body, /pass/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
+3
-1
@@ -7,7 +7,9 @@ dashedName: step-13
|
||||
|
||||
# --description--
|
||||
|
||||
Before running the `main()` function, you need to make sure that the file is running as a script. Add an `if` statement on the same level as the two existing functions and check whether `__name__ == '__main__'` evaluates to `True` or not.
|
||||
Before running the `main()` function, you need to make sure that the file is running as a script. Add an `if` statement on the same level as the two existing functions and check whether `__name__ == '__main__'`.
|
||||
|
||||
Remember to use `pass` to fill the `if` statement body.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
+14
-1
@@ -7,7 +7,7 @@ dashedName: step-14
|
||||
|
||||
# --description--
|
||||
|
||||
Replace pass with a call to the `main()` function inside the body of the `if` statement. You should see the given camel or pascal cased string converted to snake case upon execution.
|
||||
Replace `pass` with a call to the `main()` function inside the body of the `if` statement. You should see the given camel or pascal cased string converted to snake case upon execution.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -22,6 +22,19 @@ You should add a call to `main()` inside the `if` statement.
|
||||
})
|
||||
```
|
||||
|
||||
You should not have `pass` in your `if` statement.
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => {
|
||||
const commentless_code = __helpers.python.removeComments(code);
|
||||
const {block_body} = __helpers.python.getBlock(commentless_code, /if\s+__name__\s+==\s+'__main__'\s*/);
|
||||
|
||||
assert.notMatch(block_body, /pass/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ You should move the code nested inside the first `if` statement (except the firs
|
||||
|
||||
```js
|
||||
({ test: () => {
|
||||
assert.match(code, /def\s+make_allowed_move\(\s*rod1, rod2\s*\):\s+forward\s+=\s+False\s+if\s+not\s+rods\s*\[\s*target\s*\]\s*:\s+forward\s*=\s*True\s+elif\s+rods\s*\[\s*source\s*\]\s+and\s+rods\s*\[\s*source\s*\]\s*\[\s*-1\s*\]\s*<\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*:\s+forward\s*=\s*True\s+if\s+forward\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*source\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*source\s*\}\sto\s\{\s*target\s*\}'\s*\)\s+rods\s*\[\s*target\s*\]\s*\.append\(\s*rods\s*\[\s*source\s*\]\s*\.pop\(\s*\)\s*\)\s+else\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*target\s*\}\sto\s\{\s*source\s*\}'\s*\)\s+rods\s*\[\s*source\s*\]\s*\.append\(\s*rods\s*\[\s*target\s*\]\s*\.pop\(\s*\)\s*\)\s+#\s*display\sour\sprogress\s+print\(\s*rods\s*\)/);
|
||||
assert.match(code, /def\s+make_allowed_move\(\s*rod1\s*,\s*rod2\s*\):\s+forward\s*=\s*False\s+if\s+not\s+rods\s*\[\s*target\s*\]\s*:\s+forward\s*=\s*True\s+elif\s+rods\s*\[\s*source\s*\]\s+and\s+rods\s*\[\s*source\s*\]\s*\[\s*-1\s*\]\s*<\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*:\s+forward\s*=\s*True\s+if\s+forward\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*source\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*source\s*\}\sto\s\{\s*target\s*\}'\s*\)\s+rods\s*\[\s*target\s*\]\s*\.append\(\s*rods\s*\[\s*source\s*\]\s*\.pop\(\s*\)\s*\)\s+else\s*:\s+print\(\s*f'Moving\sdisk\s\{\s*rods\s*\[\s*target\s*\]\s*\[\s*-\s*1\s*\]\s*\}\sfrom\s\{\s*target\s*\}\sto\s\{\s*source\s*\}'\s*\)\s+rods\s*\[\s*source\s*\]\s*\.append\(\s*rods\s*\[\s*target\s*\]\s*\.pop\(\s*\)\s*\)\s+#\s*display\sour\sprogress\s+print\(\s*rods\s*\)/);
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Before your recursive call, add a comment saying `move n - 1 disks from source t
|
||||
You should add a comment with the provided text before your recursive call.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /if\s+n\s*>\s*0\s*:\s+#\s*move\sn\s-\s1\sdisks\sfrom\ssource\sto\sauxiliary,\sso\sthey\sare\sout\sof\sthe\sway\s+(?=move\(\s*n\s*-\s*1\s*,\s*source\s*,\s*auxiliary\s*,\s*target\s*\))/) })
|
||||
({ test: () => assert.match(code, /if\s+n\s*>\s*0\s*:\s+#\s*move\sn\s-\s1\sdisks\sfrom\ssource\sto\sauxiliary\s*,\s*so\sthey\sare\sout\sof\sthe\sway\s+(?=move\(\s*n\s*-\s*1\s*,\s*source\s*,\s*auxiliary\s*,\s*target\s*\))/) })
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ You should delete the last three lines in your code.
|
||||
({ test: () => {
|
||||
assert.isFalse(/pattern\s*=\s*r("|')\\W\1/.test(code));
|
||||
assert.isFalse(/quote\s*=\s*("|')_\1/.test(code));
|
||||
assert.isFalse(/print\(\s*re\.findall\(\s*pattern, quote\s*\)\s*\)/.test(code));
|
||||
assert.isFalse(/print\(\s*re\.findall\(\s*pattern\s*,\s*quote\s*\)\s*\)/.test(code));
|
||||
}})
|
||||
```
|
||||
|
||||
|
||||
+2
-2
@@ -14,13 +14,13 @@ Turn the expression inside your `for` loop into an `if` statement. Use the expre
|
||||
You should turn `constraint <= len(re.findall(pattern, password))` into the `if` condition.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s* <=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:/m) })
|
||||
({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s*<=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:/m) })
|
||||
```
|
||||
|
||||
You should increment `count` by one inside your new `if` statement.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s* <=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:\s*^\1\2\2(count\s*\+=\s*1|count\s*=\s*count\s*\+\s*1)/m) })
|
||||
({ test: () => assert.match(code, /^(\s*)for.+:\s*^\1(\s{4})if\s+constraint\s*<=\s*len\s*\(\s*re\.findall\s*\(\s*pattern\s*,\s*password\s*\)\s*\)\s*:\s*^\1\2\2(count\s*\+=\s*1|count\s*=\s*count\s*\+\s*1)/m) })
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -16,13 +16,13 @@ Delete `pass` and recursively call the `_insert` method on the left child of the
|
||||
You should call the `self._insert` method passing `node.left` and `key` as the arguments.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\._insert\(\s*node\.left,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /self\._insert\(\s*node\.left\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
You should assign the result of your `self._insert()` call to the `left` attribute of the current node.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /node\.left\s*=\s*self\._insert\(\s*node\.left,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /node\.left\s*=\s*self\._insert\(\s*node\.left\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -14,13 +14,13 @@ Inside your `elif` clause, replace `pass` with a call to the `_insert` method on
|
||||
You should call the `self._insert()` method passing `node.right` and `key` as the arguments.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\._insert\(\s*node\.right,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /self\._insert\(\s*node\.right\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
You should assign the result of your `self._insert()` call to the right attribute (`node.right`) of the current node.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /node\.right\s*=\s*self\._insert\(\s*node\.right,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /node\.right\s*=\s*self\._insert\(\s*node\.right\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ You should call the `_search` method within the `search` method.
|
||||
You should call the `_search` method passing `self.root` and `key` as the arguments.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\._search\(\s*self\.root,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /self\._search\(\s*self\.root\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Now, make the `search` method return the result of the `_search()` call.
|
||||
You should prepend the `return` statement to your `_search()` call.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /return\s+self\._search\(\s*self\.root,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /return\s+self\._search\(\s*self\.root\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ assert.match(after_split, /if\s+key\s+<\s+node\.key/);
|
||||
You should return `self._search(node.left, key)` from your new `if` block.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /return\s+self\._search\(\s*node\.left,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /return\s+self\._search\(\s*node\.left\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -25,14 +25,14 @@ assert.match(after_split, /self\._search/);
|
||||
You should pass two arguments to the call of the `_search` method: `node.right` and `key`.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\._search\(\s*node\.right,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /self\._search\(\s*node\.right\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
You should return the result of the `_search` method call.
|
||||
|
||||
```js
|
||||
({
|
||||
test: () => assert.match(code, /return\s+self\._search\(\s*node\.right,\s*key\s*\)/)
|
||||
test: () => assert.match(code, /return\s+self\._search\(\s*node\.right\s*,\s*key\s*\)/)
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ Within the `BinarySearchTree` class, define a `delete` method. It takes two para
|
||||
You should define a `delete` method with two parameters: `self` and `key`. Remember to use `pass`.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /def\s+delete\(\s*self,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /def\s+delete\(\s*self\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Inside the `delete` method, delete `pass` and call the private helper method `_d
|
||||
Your `delete` method should call the `_delete` method with two arguments: `self.root` and `key`.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\._delete\(\s*self\.root,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /self\._delete\(\s*self\.root\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ To handle this case, assign the result of the `_delete` call to `self.root`.
|
||||
You should assign the result of the `_delete()` call to `self.root`.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\.root\s*=\s*self\._delete\(\s*self\.root,\s*key\s*\)/) });
|
||||
({ test: () => assert.match(code, /self\.root\s*=\s*self\._delete\(\s*self\.root\s*,\s*key\s*\)/) });
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Inside the `BinarySearchTree` class, define a new helper method called `_delete`
|
||||
You should define the `_delete` method inside the `BinarySearchTree` class with the parameters `self`, `node` and `key`. Remember to use the `pass` keyword.
|
||||
|
||||
```js
|
||||
assert.match(code, /def\s+_delete\(\s*self,\s*node,\s*key\s*\)/);
|
||||
assert.match(code, /def\s+_delete\(\s*self\s*,\s*node\s*,\s*key\s*\)/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -14,13 +14,13 @@ Within the `if` block, replace `pass` with a call to the `_delete` method, passi
|
||||
You should call the `_delete` method with `node.left` and the `key` as the arguments.
|
||||
|
||||
```js
|
||||
assert.match(code, /self\._delete\(\s*node\.left,\s*key\s*\)/);
|
||||
assert.match(code, /self\._delete\(\s*node\.left\s*,\s*key\s*\)/);
|
||||
```
|
||||
|
||||
You should assign the result of the `_delete()` call to the left child (`node.left`) of the current node.
|
||||
|
||||
```js
|
||||
assert.match(code, /node\.left\s*=\s*self\._delete\(\s*node\.left,\s*key\s*\)/);
|
||||
assert.match(code, /node\.left\s*=\s*self\._delete\(\s*node\.left\s*,\s*key\s*\)/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -23,13 +23,13 @@ assert.match(after_split, /elif\s+key\s+>\s+node\.key/);
|
||||
You should call the `_delete` method with `node.right` and `key` as the arguments.
|
||||
|
||||
```js
|
||||
assert.match(code, /self\._delete\(\s*node\.right,\s*key\s*\)/);
|
||||
assert.match(code, /self\._delete\(\s*node\.right\s*,\s*key\s*\)/);
|
||||
```
|
||||
|
||||
You should assign the result of the `_delete()` call to `node.right`.
|
||||
|
||||
```js
|
||||
assert.match(code, /node\.right\s*=\s*self\._delete\(\s*node\.right,\s*key\s*\)/);
|
||||
assert.match(code, /node\.right\s*=\s*self\._delete\(\s*node\.right\s*,\s*key\s*\)/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ assert.match(code, /self\._delete\(\s*node\.right\s*,\s*node\.key\s*/);
|
||||
You should assign the return value of the `_delete()` call to the right child of the current node.
|
||||
|
||||
```js
|
||||
assert.match(code, /node\.right\s*=\s*self\._delete\(\s*node\.right\,\s*node\.key/);
|
||||
assert.match(code, /node\.right\s*=\s*self\._delete\(\s*node\.right\s*,\s*node\.key/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
@@ -78,6 +78,6 @@ class BinarySearchTree:
|
||||
elif node.right is None:
|
||||
return node.left
|
||||
--fcc-editable-region--
|
||||
node.key = self._min_value(node.right)
|
||||
node.key = self._min_value(node.right)
|
||||
--fcc-editable-region--
|
||||
```
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ This will start the traversal from the root of the binary search tree (`self.roo
|
||||
You should call `_inorder_traversal` and pass `self.root` and `result` as the arguments.
|
||||
|
||||
```js
|
||||
({ test: () => assert.match(code, /self\._inorder_traversal\(\s*self\.root,\s*result\s*\)/) })
|
||||
({ test: () => assert.match(code, /self\._inorder_traversal\(\s*self\.root\s*,\s*result\s*\)/) })
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Define the `_inorder_traversal` method and give it three parameters: `self`, `no
|
||||
You should define a method `_inorder_traversal` that takes three parameters: `self`, `node`, and `result`. Remember to use `pass`.
|
||||
|
||||
```js
|
||||
assert.match(code, /def\s+_inorder_traversal\(\s*self,\s*node,\s*result\s*\)/);
|
||||
assert.match(code, /def\s+_inorder_traversal\(\s*self\s*,\s*node\s*,\s*result\s*\)/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ This recursive call explores the entire right subtree in an in-order manner.
|
||||
You should call `_inorder_traversal` passing `node.right` and `result` as the arguments.
|
||||
|
||||
```js
|
||||
assert.match(code, /self\._inorder_traversal\(\s*node\.right,\s*result\s*\)/);
|
||||
assert.match(code, /self\._inorder_traversal\(\s*node\.right\s*,\s*result\s*\)/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
+4
-11
@@ -8,12 +8,7 @@ dashedName: demographic-data-analyzer
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-demographic-data-analyzer" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-demographic-data-analyzer/" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
We are still developing the interactive instructional part of the Python curriculum. For now, here are some videos on the freeCodeCamp.org YouTube channel that will teach you everything you need to know to complete this project:
|
||||
|
||||
@@ -47,17 +42,15 @@ You must use Pandas to answer the following questions:
|
||||
- What country has the highest percentage of people that earn >50K and what is that percentage?
|
||||
- Identify the most popular occupation for those who earn >50K in India.
|
||||
|
||||
Use the starter code in the file `demographic_data_analyzer`. Update the code so all variables set to "None" are set to the appropriate calculation or code. Round all decimals to the nearest tenth.
|
||||
|
||||
Unit tests are written for you under `test_module.py`.
|
||||
Use the starter code in the file `demographic_data_analyzer.py`. Update the code so all variables set to `None` are set to the appropriate calculation or code. Round all decimals to the nearest tenth.
|
||||
|
||||
## التطوير
|
||||
|
||||
For development, you can use `main.py` to test your functions. Click the "run" button and `main.py` will run.
|
||||
Write your code in `demographic_data_analyzer.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
We imported the tests from `test_module.py` to `main.py` for your convenience. The tests will run automatically whenever you hit the "run" button.
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
+3
-10
@@ -8,12 +8,7 @@ dashedName: mean-variance-standard-deviation-calculator
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-mean-variance-standard-deviation-calculator" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-mean-variance-standard-deviation-calculator/" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
وما زلنا نطور الجزء التعليمي التفاعلي من منهج Python. الآن، إليك بعض مقاطع الفيديو على قناة اليوتيوب الخاصة بي freeCodeCamp.org التي ستعلمك كلّما تحتاج إليه لإكمال هذا المشروع:
|
||||
|
||||
@@ -55,15 +50,13 @@ For example, `calculate([0,1,2,3,4,5,6,7,8])` should return:
|
||||
}
|
||||
```
|
||||
|
||||
The unit tests for this project are in `test_module.py`.
|
||||
|
||||
## التطوير
|
||||
|
||||
For development, you can use `main.py` to test your `calculate()` function. انقر فوق زر "run" (التشغيل) و `main.py` سيتم تشغيله.
|
||||
Write your code in `mean_var_std.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
We imported the tests from `test_module.py` to `main.py` for your convenience. سيتم تشغيل الاختبارات تلقائياً عندما تضغط على زر "run".
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
+3
-10
@@ -8,12 +8,7 @@ dashedName: medical-data-visualizer
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-medical-data-visualizer" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-medical-data-visualizer/" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
وما زلنا نطور الجزء التعليمي التفاعلي من منهج Python. الآن، إليك بعض مقاطع الفيديو على قناة اليوتيوب الخاصة بي freeCodeCamp.org التي ستعلمك كلّما تحتاج إليه لإكمال هذا المشروع:
|
||||
|
||||
@@ -65,15 +60,13 @@ Use the data to complete the following tasks in `medical_data_visualizer.py`:
|
||||
|
||||
Any time a variable is set to `None`, make sure to set it to the correct code.
|
||||
|
||||
Unit tests are written for you under `test_module.py`.
|
||||
|
||||
## التطوير
|
||||
|
||||
For development, you can use `main.py` to test your functions. انقر فوق زر "run" (تشغيل) و `main.py` سيتم تشغيله.
|
||||
Write your code in `medical_data_visualizer.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
قمنا باستيراد الاختبارات من `test_module.py` إلى `main.py` من أجل تسهيل العملية لك. سيتم تشغيل الاختبارات تلقائياً عندما تضغط على زر "run"(تشغيل).
|
||||
The unit tests for this project are in `test_module.py`. قمنا باستيراد الاختبارات من `test_module.py` إلى `main.py` من أجل تسهيل العملية لك.
|
||||
|
||||
## التسليم
|
||||
|
||||
|
||||
+4
-9
@@ -8,12 +8,7 @@ dashedName: page-view-time-series-visualizer
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-page-view-time-series-visualizer" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-page-view-time-series-visualizer" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
وما زلنا نطور الجزء التعليمي التفاعلي من منهج Python. الآن، إليك بعض مقاطع الفيديو على قناة اليوتيوب الخاصة بي freeCodeCamp.org التي ستعلمك كلّما تحتاج إليه لإكمال هذا المشروع:
|
||||
|
||||
@@ -33,17 +28,17 @@ Use the data to complete the following tasks:
|
||||
- Create a `draw_bar_plot` function that draws a bar chart similar to "examples/Figure_2.png". It should show average daily page views for each month grouped by year. The legend should show month labels and have a title of `Months`. On the chart, the label on the x axis should be `Years` and the label on the y axis should be `Average Page Views`.
|
||||
- Create a `draw_box_plot` function that uses Seaborn to draw two adjacent box plots similar to "examples/Figure_3.png". These box plots should show how the values are distributed within a given year or month and how it compares over time. The title of the first chart should be `Year-wise Box Plot (Trend)` and the title of the second chart should be `Month-wise Box Plot (Seasonality)`. Make sure the month labels on bottom start at `Jan` and the x and y axis are labeled correctly. The boilerplate includes commands to prepare the data.
|
||||
|
||||
For each chart, make sure to use a copy of the data frame. Unit tests are written for you under `test_module.py`.
|
||||
For each chart, make sure to use a copy of the data frame.
|
||||
|
||||
The boilerplate also includes commands to save and return the image.
|
||||
|
||||
## التطوير
|
||||
|
||||
For development, you can use `main.py` to test your functions. Click the "run" button and `main.py` will run.
|
||||
Write your code in `time_series_visualizer.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
We imported the tests from `test_module.py` to `main.py` for your convenience. The tests will run automatically whenever you hit the "run" button.
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
+3
-10
@@ -8,12 +8,7 @@ dashedName: sea-level-predictor
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-sea-level-predictor" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-sea-level-predictor/" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
وما زلنا نطور الجزء التعليمي التفاعلي من منهج Python. الآن، إليك بعض مقاطع الفيديو على قناة اليوتيوب الخاصة بي freeCodeCamp.org التي ستعلمك كلّما تحتاج إليه لإكمال هذا المشروع:
|
||||
|
||||
@@ -33,17 +28,15 @@ Use the data to complete the following tasks:
|
||||
- Plot a new line of best fit just using the data from year 2000 through the most recent year in the dataset. Make the line also go through the year 2050 to predict the sea level rise in 2050 if the rate of rise continues as it has since the year 2000.
|
||||
- The x label should be `Year`, the y label should be `Sea Level (inches)`, and the title should be `Rise in Sea Level`.
|
||||
|
||||
Unit tests are written for you under `test_module.py`.
|
||||
|
||||
The boilerplate also includes commands to save and return the image.
|
||||
|
||||
## التطوير
|
||||
|
||||
For development, you can use `main.py` to test your functions. Click the "run" button and `main.py` will run.
|
||||
Write your code in `sea_level_predictor.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
We imported the tests from `test_module.py` to `main.py` for your convenience. The tests will run automatically whenever you hit the "run" button.
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
+1
-9
@@ -13,17 +13,9 @@ Build a full stack JavaScript app that is functionally similar to this: <a href=
|
||||
Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-messageboard/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-messageboard" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-messageboard/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
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.
|
||||
|
||||
# --instructions--
|
||||
|
||||
1. Set `NODE_ENV` to test without quotes when ready to write tests and DB to your databases connection string (in `.env`)
|
||||
|
||||
+3
-8
@@ -9,12 +9,7 @@ dashedName: port-scanner
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-port-scanner" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-port-scanner" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
وما زلنا نطور الجزء التعليمي التفاعلي من منهج Python. الآن، إليك بعض مقاطع الفيديو على قناة اليوتيوب الخاصة بي freeCodeCamp.org التي ستعلمك كلّما تحتاج إليه لإكمال هذا المشروع:
|
||||
|
||||
@@ -75,11 +70,11 @@ If the IP address passed into the `get_open_ports` function is invalid, the func
|
||||
|
||||
## التطوير
|
||||
|
||||
Write your code in `port_scanner.py`. For development, you can use `main.py` to test your code. Click the "run" button and `main.py` will run.
|
||||
Write your code in `port_scanner.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
اختبارات الوحدة او ما يدعي الـ unit tests لهذا المشروع في `test_module.py`. قمنا باستيراد الاختبارات من `test_module.py` إلى `main.py` من أجل تسهيل العملية لك. سيتم تشغيل الاختبارات تلقائياً عندما تضغط على زر "تشغيل".
|
||||
اختبارات الوحدة او ما يدعي الـ unit tests لهذا المشروع في `test_module.py`. قمنا باستيراد الاختبارات من `test_module.py` إلى `main.py` من أجل تسهيل العملية لك.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: secure-real-time-multiplayer-game
|
||||
Develop a 2D real time multiplayer game using the HTML Canvas API and Socket.io that is functionally similar to this: <a href="https://secure-real-time-multiplayer-game.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://secure-real-time-multiplayer-game.freecodecamp.rocks/</a>. العمل على هذا المشروع سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link. وإن أردت تستطيع أيضًا إرسال رابط إلى الكود المصدري للمشروع الخاص بك في خانة GitHub Link.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Create a secure multiplayer game in which each player can move their avatar, there is at least one collectible item, and the rank of the players is calculated based on their score.
|
||||
|
||||
+3
-8
@@ -9,12 +9,7 @@ dashedName: sha-1-password-cracker
|
||||
|
||||
# --description--
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-SHA-1-password-cracker" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-SHA-1-password-cracker" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
وما زلنا نطور الجزء التعليمي التفاعلي من منهج Python. الآن، إليك بعض مقاطع الفيديو على قناة اليوتيوب الخاصة بي freeCodeCamp.org التي ستعلمك كلّما تحتاج إليه لإكمال هذا المشروع:
|
||||
|
||||
@@ -52,11 +47,11 @@ The `hashlib` library has been imported for you. You should consider using it in
|
||||
|
||||
## التطوير
|
||||
|
||||
Write your code in `password_cracker.py`. For development, you can use `main.py` to test your code. Click the "run" button and `main.py` will run.
|
||||
Write your code in `password_cracker.py`. For development, you can use `main.py` to test your code.
|
||||
|
||||
## الاختبار
|
||||
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience. The tests will run automatically whenever you hit the "run" button.
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
+1
-9
@@ -15,17 +15,9 @@ Since all reliable stock price APIs require an API key, we've built a workaround
|
||||
Working on this project will involve you writing your code using one of the following methods:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-project-stockchecker/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete your project locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-project-stockchecker" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete your project.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-project-stockchecker/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete your project.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
If you use Replit, follow these steps to set up the project:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
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.
|
||||
|
||||
# --instructions--
|
||||
|
||||
1. SET `NODE_ENV` to `test` without quotes and set `DB` to your MongoDB connection string
|
||||
|
||||
+2
-2
@@ -8,13 +8,13 @@ dashedName: ask-browsers-to-access-your-site-via-https-only-with-helmet-hsts
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
HTTP Strict Transport Security (HSTS) is a web security policy which helps to protect websites against protocol downgrade attacks and cookie hijacking. If your website can be accessed via HTTPS you can ask user’s browsers to avoid using insecure HTTP. By setting the header Strict-Transport-Security, you tell the browsers to use HTTPS for the future requests in a specified amount of time. This will work for the requests coming after the initial request.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Configure `helmet.hsts()` to use HTTPS for the next 90 days. Pass the config object `{maxAge: timeInSeconds, force: true}`. You can create a variable `ninetyDaysInSeconds = 90*24*60*60;` to use for the `timeInSeconds`. Replit already has hsts enabled. To override its settings you need to set the field "force" to true in the config object. We will intercept and restore the Replit header, after inspecting it for testing.
|
||||
Configure `helmet.hsts()` to use HTTPS for the next 90 days. Pass the config object `{maxAge: timeInSeconds, force: true}`. You can create a variable `ninetyDaysInSeconds = 90*24*60*60;` to use for the `timeInSeconds`. Gitpod already has hsts enabled. To override its settings you need to set the field "force" to true in the config object. We will intercept and restore the Gitpod header, after inspecting it for testing.
|
||||
|
||||
Note: Configuring HTTPS on a custom website requires the acquisition of a domain, and an SSL/TLS Certificate.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: avoid-inferring-the-response-mime-type-with-helmet-nosniff
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>. Browsers can use content or MIME sniffing to override the `Content-Type` header of a response to guess and process the data using an implicit content type. While this can be convenient in some scenarios, it can also lead to some dangerous attacks. This middleware sets the `X-Content-Type-Options` header to `nosniff`, instructing the browser to not bypass the provided `Content-Type`.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>. Browsers can use content or MIME sniffing to override the `Content-Type` header of a response to guess and process the data using an implicit content type. While this can be convenient in some scenarios, it can also lead to some dangerous attacks. This middleware sets the `X-Content-Type-Options` header to `nosniff`, instructing the browser to not bypass the provided `Content-Type`.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: configure-helmet-using-the-parent-helmet-middleware
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
`app.use(helmet())` will automatically include all the middleware introduced above, except `noCache()`, and `contentSecurityPolicy()`, but these can be enabled if necessary. You can also disable or configure any other middleware individually, using a configuration object.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: disable-client-side-caching-with-helmet-nocache
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
If you are releasing an update for your website, and you want the users to always download the newer version, you can (try to) disable caching on client’s browser. It can be useful in development too. Caching has performance benefits, which you will lose, so only use this option when there is a real need.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: disable-dns-prefetching-with-helmet-dnsprefetchcontrol
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
To improve performance, most browsers prefetch DNS records for the links in a page. In that way the destination ip is already known when the user clicks on a link. This may lead to over-use of the DNS service (if you own a big website, visited by millions people…), privacy issues (one eavesdropper could infer that you are on a certain page), or page statistics alteration (some links may appear visited even if they are not). If you have high security needs you can disable DNS prefetching, at the cost of a performance penalty.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: hash-and-compare-passwords-asynchronously
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-bcrypt" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
As hashing is designed to be computationally intensive, it is recommended to do so asynchronously on your server as to avoid blocking incoming connections while you hash. All you have to do to hash a password asynchronous is call
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: hash-and-compare-passwords-synchronously
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-bcrypt" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
Hashing synchronously is just as easy to do but can cause lag if using it server side with a high cost or with hashing done very often. Hashing with this method is as easy as calling
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: hide-potentially-dangerous-information-using-helmet-hidepoweredby
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. `X-Powered-By: Express` is sent in every request coming from Express by default. Use the `helmet.hidePoweredBy()` middleware to remove the X-Powered-By header.
|
||||
|
||||
|
||||
+1
-9
@@ -11,17 +11,9 @@ dashedName: install-and-require-helmet
|
||||
العمل على هذه التحديات سوف ينطوي على كتابة كودك باستخدام إحدى الطرق التالية:
|
||||
|
||||
- Clone <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">this GitHub repo</a> and complete these challenges locally.
|
||||
- Use <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">our Replit starter project</a> to complete these challenges.
|
||||
- Use <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">our Gitpod starter project</a> to complete these challenges.
|
||||
- استخدم أي منشئ موقع لإكمال المشروع. تحقق انك أضفت جميع الملفات من مستودعنا في GitHub في مشروعك.
|
||||
|
||||
إذا استخدمت Replit، اتبع هذه الخطوات لإعداد المشروع:
|
||||
|
||||
- ابدأ باستيراد (import) المشروع إلى Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
|
||||
عند الانتهاء، تأكد من استضافة ديمو (demo) أو عرض عملي لمشروعك في مكان عام. ثم أرسل عنوان URL للمشروع في خانة Solution Link.
|
||||
|
||||
Helmet helps you secure your Express apps by setting various HTTP headers.
|
||||
|
||||
# --instructions--
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: mitigate-the-risk-of-clickjacking-with-helmet-frameguard
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
Your page could be put in a `<frame>` or `<iframe>` without your consent. This can result in clickjacking attacks, among other things. Clickjacking is a technique of tricking a user into interacting with a page different from what the user thinks it is. This can be obtained by executing your page in a malicious context, by means of iframing. In that context, a hacker can put a hidden layer over your page. Hidden buttons can be used to run bad scripts. This middleware sets the X-Frame-Options header. It restricts who can put your site in a frame. It has three modes: DENY, SAMEORIGIN, and ALLOW-FROM.
|
||||
|
||||
|
||||
+2
-2
@@ -9,11 +9,11 @@ dashedName: mitigate-the-risk-of-cross-site-scripting-xss-attacks-with-helmet-xs
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
Cross-site scripting (XSS) is a frequent type of attack where malicious scripts are injected into vulnerable pages, with the purpose of stealing sensitive data like session cookies, or passwords.
|
||||
|
||||
The basic rule to lower the risk of an XSS attack is simple: “Never trust user’s input”. As a developer you should always sanitize all the input coming from the outside. This includes data coming from forms, GET query urls, and even from POST bodies. Sanitizing means that you should find and encode the characters that may be dangerous e.g. <, >.
|
||||
The basic rule to lower the risk of an XSS attack is simple: "Never trust user's input". As a developer you should always sanitize all the input coming from the outside. This includes data coming from forms, GET query urls, and even from POST bodies. Sanitizing means that you should find and encode the characters that may be dangerous e.g. <, >.
|
||||
|
||||
Modern browsers can help mitigating the risk by adopting better software strategies. Often these are configurable via http headers.
|
||||
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ dashedName: prevent-ie-from-opening-untrusted-html-with-helmet-ienoopen
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
Some web applications will serve untrusted HTML for download. Some versions of Internet Explorer by default open those HTML files in the context of your site. This means that an untrusted HTML page could start doing bad things in the context of your pages. This middleware sets the X-Download-Options header to noopen. This will prevent IE users from executing downloads in the trusted site’s context.
|
||||
Some web applications will serve untrusted HTML for download. Some versions of Internet Explorer by default open those HTML files in the context of your site. This means that an untrusted HTML page could start doing bad things in the context of your pages. This middleware sets the X-Download-Options header to noopen. This will prevent IE users from executing downloads in the trusted site's context.
|
||||
|
||||
# --instructions--
|
||||
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ dashedName: set-a-content-security-policy-with-helmet-contentsecuritypolicy
|
||||
|
||||
# --description--
|
||||
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
As a reminder, this project is being built upon the following starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or cloned from <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
This challenge highlights one promising new defense that can significantly reduce the risk and impact of many type of attacks in modern browsers. By setting and configuring a Content Security Policy you can prevent the injection of anything unintended into your page. This will protect your app from XSS vulnerabilities, undesired tracking, malicious frames, and much more. CSP works by defining an allowed list of content sources which are trusted. You can configure them for each kind of resource a web page may need (scripts, stylesheets, fonts, frames, media, and so on…). There are multiple directives available, so a website owner can have a granular control. See HTML 5 Rocks, KeyCDN for more details. Unfortunately CSP is unsupported by older browsers.
|
||||
This challenge highlights one promising new defense that can significantly reduce the risk and impact of many type of attacks in modern browsers. By setting and configuring a Content Security Policy you can prevent the injection of anything unintended into your page. This will protect your app from XSS vulnerabilities, undesired tracking, malicious frames, and much more. CSP works by defining an allowed list of content sources which are trusted. You can configure them for each kind of resource a web page may need (scripts, stylesheets, fonts, frames, media, and so on...). There are multiple directives available, so a website owner can have a granular control. See HTML 5 Rocks, KeyCDN for more details. Unfortunately CSP is unsupported by older browsers.
|
||||
|
||||
By default, directives are wide open, so it’s important to set the defaultSrc directive as a fallback. Helmet supports both defaultSrc and default-src naming styles. The fallback applies for most of the unspecified directives.
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ dashedName: understand-bcrypt-hashes
|
||||
|
||||
# --description--
|
||||
|
||||
For the following challenges, you will be working with a new starter project that is different from the previous one. You can find the new starter project on <a href="https://replit.com/github/freeCodeCamp/boilerplate-bcrypt" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, or clone it from <a href="https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
For the following challenges, you will be working with a new starter project that is different from the previous one. You can find the new starter project on <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">Gitpod</a>, or clone it from <a href="https://github.com/freeCodeCamp/boilerplate-bcrypt/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
|
||||
|
||||
BCrypt hashes are very secure. A hash is basically a fingerprint of the original data- always unique. This is accomplished by feeding the original data into an algorithm and returning a fixed length result. To further complicate this process and make it more secure, you can also *salt* your hash. Salting your hash involves adding random data to the original data before the hashing process which makes it even harder to crack the hash.
|
||||
|
||||
|
||||
+2
-8
@@ -10,11 +10,7 @@ dashedName: rock-paper-scissors
|
||||
|
||||
For this challenge, you will create a program to play Rock, Paper, Scissors. A program that picks at random will usually win 50% of the time. To pass this challenge your program must play matches against four different bots, winning at least 60% of the games in each match.
|
||||
|
||||
You will be <a href="https://replit.com/github/freeCodeCamp/boilerplate-rock-paper-scissors" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Replit starter code</a>.
|
||||
|
||||
- ابدأ باستيراد (import) المشروع على Replit.
|
||||
- بعد ذلك، سترى نافذة `.replit`.
|
||||
- اختار `Use run command` وانقر على زر `Done`.
|
||||
You will be <a href="https://gitpod.io/?autostart=true#https://github.com/freeCodeCamp/boilerplate-rock-paper-scissors/" target="_blank" rel="noopener noreferrer nofollow">working on this project with our Gitpod starter code</a>.
|
||||
|
||||
We are still developing the interactive instructional part of the machine learning curriculum. For now, you will have to use other resources to learn how to pass this challenge.
|
||||
|
||||
@@ -50,11 +46,9 @@ For example, here is how you would call the function if you want `player` and `q
|
||||
play(player, quincy, 1000, verbose=True)
|
||||
```
|
||||
|
||||
Click the "run" button and `main.py` will run.
|
||||
|
||||
## الاختبار
|
||||
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience. If you uncomment the last line in `main.py`, the tests will run automatically whenever you hit the "run" button.
|
||||
The unit tests for this project are in `test_module.py`. We imported the tests from `test_module.py` to `main.py` for your convenience. If you uncomment the last line in `main.py`, the tests will run automatically whenever you run `python main.py` in the console.
|
||||
|
||||
## التقديم
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user