jiebi/CodeConvo huggingface dataset:
```yml tests: - text: Your regex <code>myRegex</code> should return <code>true</code> for the string <code>Franklin D. Roosevelt</code> <del> testString: assert(myRegex.test('Franklin D. Roosevelt')); </del> <ins> testString: myRegex.lastIndex = 0; assert(myRegex.test('Franklin D. Roosevelt')); </ins> - text: Your regex <code>myRegex</code> should return <code>true</code> for the string <code>Eleanor Roosevelt</code> <del> testString: assert(myRegex.test('Eleanor Roosevelt')); </del> <ins> testString: myRegex.lastIndex = 0; assert(myRegex.test('Eleanor Roosevelt')); </ins> - text: Your regex <code>myRegex</code> should return <code>false</code> for the string <code>Franklin Rosevelt</code> <del> testString: assert(!myRegex.test('Franklin Rosevelt')); </del> <ins> testString: myRegex.lastIndex = 0; assert(!myRegex.test('Franklin Rosevelt')); </ins> - text: You should use <code>.test()</code> to test the regex. testString: assert(code.match(/myRegex.test(s*myStrings*)/)); - text: Your result should return <code>true</code>.
tests: - text: The <code>AppWrapper</code> should render to the page. testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find('AppWrapper').length === 1; })()); <del> - text: The <code>Presentational</code> component should render an <code>h2</code>, <code>input</code>, <code>button</code>, and <code>ul</code> elements. </del> <ins> - text: The <code>Presentational</code> component should render to page. </ins> testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); return mockedComponent.find('Presentational').length === 1; })()); - text: The <code>Presentational</code> component should render an <code>h2</code>, <code>input</code>, <code>button</code>, and <code>ul</code> elements. testString: assert((function() { const mockedComponent = Enzyme.mount(React.createElement(AppWrapper)); const PresentationalComponent = mockedComponent.find('Presentational'); return ( PresentationalComponent.find('div').length === 1 && PresentationalComponent.find('h2').length === 1 && PresentationalComponent.find('button').length === 1 && PresentationalComponent.find('ul').length === 1 ); })());
Usernames are used everywhere on the internet. They are what give users a unique identity on their favorite sites. You need to check all the usernames in a database. Here are some simple rules that users have to follow when creating their username. 1) Usernames can only use alpha-numeric characters. <del> 2) The only numbers in the username have to be at the end. There can be zero or more of them at the end. </del> <ins> 2) The only numbers in the username have to be at the end. There can be zero or more of them at the end. Username cannot start with the number. </ins> 3) Username letters can be lowercase and uppercase. 4) Usernames have to be at least two characters long. A two-character username can only use alphabet letters as characters. </section>
```yml tests: - text: The function <code>countOnline</code> should use a `for in` statement to iterate through the object keys of the object passed to it. <del> testString: assert(code.match(/fors*(s*(var|let)s+[a-zA-Z_$]w*s+ins+[a-zA-Z_$]w*s*)s*{/)); </del> <ins> testString: assert(code.match(/fors*(s*(var|let|const)s+[a-zA-Z_$]w*s+ins+[a-zA-Z_$]w*s*)s*{/)); </ins> - text: 'The function <code>countOnline</code> should return <code>1</code> when the object <code>{ Alan: { online: false }, Jeff: { online: true }, Sarah: { online: false } }</code> is passed to it' testString: assert(countOnline(usersObj1) === 1); - text: 'The function <code>countOnline</code> should return <code>2</code> when the object <code>{ Alan: { online: true }, Jeff: { online: false }, Sarah: { online: true } }</code> is passed to it'
- text: Your code should set the <code>font-size</code> property for the <code>h5</code> tag to 21 pixels. testString: assert($('h5').css('font-size') == '21px'); - text: Your code should set the <code>font-size</code> property for the <code>h6</code> tag to 14 pixels. <del> testString: assert($('h6').css('font-size') == '14px'); </del> <ins> testString: const regex = /h6s*{s*font-sizes*:s*14pxs*(;s*}|})/i; assert.strictEqual(true, regex.test(code)); </ins> ```
<meta content='https://cdn.freecodecamp.org/platform/universal/fcc-twitter-1120X600-social-green.png' name='twitter:image:src' /> <meta content='freeCodeCamp.org' name='twitter:title' /> <del> <meta content='Learn to code. Build projects. Earn certifications.' </del> <ins> <meta content='Learn to code at home. Build projects. Earn certifications.' </ins> + 'Since 2015, 40,000 graduates have gotten jobs at tech ' + 'companies including Google, Apple, Amazon, and Microsoft.' name='twitter:description' />
from: 'Team@freecodecamp.com', subject: 'Reset your Free Code Camp password', text: [ <del> 'You are receiving this email because you (or someone else)', </del> <ins> 'You are receiving this email because you (or someone else)n', </ins> 'requested we reset your Free Code Camp account's password.nn', <del> 'Please click on the following link, or paste this into your', </del> <ins> 'Please click on the following link, or paste this into yourn', </ins> 'browser to complete the process:nn', 'http://', req.headers.host, '/reset/', token, 'nn', <del> 'If you did not request this, please ignore this email and', </del> <ins> 'If you did not request this, please ignore this email andn', </ins> 'your password will remain unchanged.n' <del> ].join(' ') </del> <ins> ].join('') </ins> }; transporter.sendMail(mailOptions, function(err) { if (err) { return done(err); }
extends ../layout block content <del> .col-sm-8.col-sm-offset-2 form(method='POST') legend Reset Password </del> <ins> .col-sm-8.col-sm-offset-2.jumbotron form(action='/reset/#{token}', method='POST') h1 Reset Password </ins> input(type='hidden', name='_csrf', value=_csrf) .form-group label(for='password') New Password
## Description <section id='description'> You are given two arrays and an index. <del> Use the array methods <code>slice</code> and <code>splice</code> to copy each element of the first array into the second array, in order. </del> <ins> Copy each element of the first array into the second array, in order. </ins> Begin inserting elements at index <code>n</code> of the second array. Return the resulting array. The input arrays should remain the same after the function runs. </section>
```yml tests: <del> - text: The <code>globalTitle</code> variable should not change. testString: assert(globalTitle === "Winter Is Coming"); </del> - text: Your code should not use the <code>replace</code> method for this challenge. testString: assert(!code.match(/.?[sS]*?replace/g)); - text: <code>urlSlug("Winter Is Coming")</code> should return <code>"winter-is-coming"</code>.
return ( <Button bsStyle='default' <del> className={(block ? 'btn-cta-big' : '') + ' signup-btn btn-cta'} </del> <ins> className={(block ? 'btn-cta-big btn-block' : '') + ' signup-btn btn-cta'} </ins> data-test-label={dataTestLabel} href={href} onClick={() => gtagReportConversion()}
# --description-- <del> Continuing with the date theme, HTML5 also introduced the `time` element along with a `datetime` attribute to standardize times. The `datetime` attribute is an inline element that can wrap a date or time on a page. A `datetime` attribute holds a valid format of that date. This is the value accessed by assistive devices. It helps avoid confusion by stating a standardized version of a time, even if it's informally or colloquially written in the text. </del> <ins> Continuing with the date theme, HTML5 also introduced the `time` element along with a `datetime` attribute to standardize times. The `time` element is an inline element that can wrap a date or time on a page. A `datetime` attribute holds a valid format of that date. This is the value accessed by assistive devices. It helps avoid confusion by stating a standardized version of a time, even if it's informally or colloquially written in the text. </ins> Here's an example:
export const devLoginRedirect = () => { return (req, res) => { <del> // this mirrors the production approach, but without any validation </del> <ins> // this mirrors the production approach, but only validates the prefix </ins> let { returnTo, origin, pathPrefix } = getRedirectParams( req, <del> params => params </del> <ins> ({ returnTo, origin, pathPrefix }) => { pathPrefix = availableLangs.client.includes(pathPrefix) ? pathPrefix : ''; return { returnTo, origin, pathPrefix }; } </ins> ); returnTo += isRootPath(getRedirectBase(origin, pathPrefix), returnTo) <del> ? 'learn' </del> <ins> ? '/learn' </ins> : ''; return res.redirect(returnTo); };
A game is played with three piles of stones and two players. <del> On each player's turn, the player removes one or more stones from the piles. However, if the player takes stones from more than one pile, the same number of stunes must be removed from each of the selected piles. </del> <ins> On each player's turn, the player removes one or more stones from the piles. However, if the player takes stones from more than one pile, the same number of stones must be removed from each of the selected piles. </ins> In other words, the player chooses some $N > 0$ and removes:
# --description-- <del> One of the most popular shapes in the world is the heart shape, and in this challenge you'll create one using pure CSS. But first, you need to understand the `::before` and `::after` pseudo-elements. These pseudo-elements are used to add something before or after a selected element. In the following example, a `::before` pseudo-element is used to add a rectangle to an element with the class `heart`: </del> <ins> One of the most popular shapes in the world is the heart shape, and in this challenge you'll create one using pure CSS. But first, you need to understand the `::before` and `::after` pseudo-elements. ::before creates a pseudo-element that is the first child of the selected element; ::after creates a pseudo-element that is the last child of the selected element. In the following example, a `::before` pseudo-element is used to add a rectangle to an element with the class `heart`: </ins> ```css .heart::before {
The `fieldset` element is used to group related inputs and labels together in a web form. `fieldset` elements are <dfn>block-level elements</dfn>, meaning that they appear on a new line. <del> Nest the `Indoor` and `Outdoor` radio buttons within a `fieldset` element, and don't forget to indent the buttons. </del> <ins> Nest the `Indoor` and `Outdoor` radio buttons within a `fieldset` element, and don't forget to indent the radio buttons. </ins> # --hints--
id: 'execute-challenge', label: 'Run tests', /* eslint-disable no-bitwise */ <del> keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter], </del> <ins> keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, monaco.KeyMod.WinCtrl | monaco.KeyCode.Enter ], </ins> run: () => { if (props.usesMultifileEditor && !isFinalProject(props.challengeType)) { if (challengeIsComplete()) {
editor.addAction({ id: 'save-editor-content', label: 'Save editor content', <del> keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S], </del> <ins> keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_S, monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_S ], </ins> run: props.challengeType === challengeTypes.multifileCertProject && props.isSignedIn
editor.addAction({ id: 'toggle-accessibility', label: 'Toggle Accessibility Mode', <del> keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E], </del> <ins> keybindings: [ monaco.KeyMod.CtrlCmd | monaco.KeyCode.KEY_E, monaco.KeyMod.WinCtrl | monaco.KeyCode.KEY_E ], </ins> run: () => { const currentAccessibility = storedAccessibilityMode();
You should add the first `input` after the `label` text `Enter Your First Name:`, and include a space after the colon. ```js <del> assert.equal(document.querySelectorAll('label')?.[0]?.innerHTML, 'Enter Your First Name: <input>'); </del> <ins> assert.equal(document.querySelectorAll('label')?.[0]?.innerHTML.trim(), 'Enter Your First Name: <input>'); </ins> ``` You should add the second `input` after the `label` text `Enter Your Last Name:`, and include a space after the colon. ```js <del> assert.equal(document.querySelectorAll('label')?.[1]?.innerHTML, 'Enter Your Last Name: <input>'); </del> <ins> assert.equal(document.querySelectorAll('label')?.[1]?.innerHTML.trim(), 'Enter Your Last Name: <input>'); </ins> ``` You should add the third `input` after the `label` text `Enter Your Email:`, and include a space after the colon. ```js <del> assert.equal(document.querySelectorAll('label')?.[2]?.innerHTML, 'Enter Your Email: <input>'); </del> <ins> assert.equal(document.querySelectorAll('label')?.[2]?.innerHTML.trim(), 'Enter Your Email: <input>'); </ins> ``` You should add the fourth `input` after the `label` text `Create a New Password:`, and include a space after the colon. ```js <del> assert.equal(document.querySelectorAll('label')?.[3]?.innerHTML, 'Create a New Password: <input>'); </del> <ins> assert.equal(document.querySelectorAll('label')?.[3]?.innerHTML.trim(), 'Create a New Password: <input>'); </ins> ``` # --seed--
# --description-- <del> <a href="https://rosettacode.org/wiki/Cramer%27s_rule" target="_blank" rel="noopener noreferrer nofollow">Cramer's rule</a> is a formula for solving a system of linear equations by using the determinants of matrixes formed from subsets of the coefficients and right hand side values. </del> <ins> <a href="https://rosettacode.org/wiki/Cramer%27s_rule" target="_blank" rel="noopener noreferrer nofollow">Cramer's rule</a> is a formula for solving a system of linear equations by using the determinants of matrices formed from subsets of the coefficients and right hand side values. </ins> <del> The determinate of a matrix with 2 rows and two columns is given by: </del> <ins> The determinant of a matrix with 2 rows and two columns is given by: </ins> $begin{aligned}|A|={begin{vmatrix}a&bc&dend{vmatrix}}=ad-bc.end{aligned}$
assert(isValidSolution_(solve24(testCases_[1]))); ``` <del> `solve24("6789")` should return `(6*8)/(9-7)`. `(8*6)/(9-7)`, or a similar valid string </del> <ins> `solve24("6789")` should return `(6*8)/(9-7)`, `(8*6)/(9-7)`, or a similar valid string </ins> ```js assert(isValidSolution_(solve24(testCases_[2])));
assert($('p > a').length); ``` <del> The link's href value should be `https://freecatphotoapp.com`. You have either omitted the href value or have a typo. </del> <ins> The link's `href` value should be `https://freecatphotoapp.com`. You have either omitted the `href` value or have a typo. </ins> ```js const nestedAnchor = $('p > a')[0];
# --instructions-- <del> Add version "1.1.0" of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. </del> <ins> Add version `1.1.0` of the `@freecodecamp/example` package to the `dependencies` field of your `package.json` file. </ins> **Note:** `@freecodecamp/example` is a faux package used as a learning tool.
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. <del> The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the &lt;head> section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. 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. </del> <ins> The `package.json` file is the center of any Node.js project or npm package. It stores information about your project, similar to how the `head` section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. 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. </ins> <del> If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. </del> <ins> If you look at the file tree of your project, you will find the `package.json` file on the top level of the tree. This is the file that you will be improving in the next couple of challenges. </ins> One of the most common pieces of information in this file is the `author` field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project.
# --instructions-- <del> Add your name as the `author` of the project in the package.json file. </del> <ins> Add your name as the `author` of the project in the `package.json` file. </ins> **Note:** Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,). # --hints-- <del> package.json should have a valid "author" key </del> <ins> `package.json` should have a valid "author" key </ins> ```js (getUserInput) =>
Similar to how the tilde we learned about in the last challenge allows npm to install the latest PATCH for a dependency, the caret (`^`) allows npm to install future updates as well. The difference is that the caret will allow both MINOR updates and PATCHes. <del> Your current version of `@freecodecamp/example` should be "~1.2.13" which allows npm to install to the latest 1.2.x version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any 1.x.x version. </del> <ins> Your current version of `@freecodecamp/example` should be `~1.2.13` which allows npm to install to the latest `1.2.x` version. If you were to use the caret (^) as a version prefix instead, npm would be allowed to update to any `1.x.x` version. </ins> ```json "package": "^1.3.8" ``` <del> This would allow updates to any 1.x.x version of the package. </del> <ins> This would allow updates to any `1.x.x` version of the package. </ins> # --instructions--
In the last challenge, you told npm to only include a specific version of a package. That’s a useful way to freeze your dependencies if you need to make sure that different parts of your project stay compatible with each other. But in most use cases, you don’t want to miss bug fixes since they often include important security patches and (hopefully) don’t break things in doing so. <del> To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any 1.3.x version. </del> <ins> To allow an npm dependency to update to the latest PATCH version, you can prefix the dependency’s version with the tilde (`~`) character. Here's an example of how to allow updates to any `1.3.x` version. </ins> ```json "package": "~1.3.8"
# --instructions-- <del> In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (1.2.13). But now, you want to allow the latest 1.2.x version. </del> <ins> In the package.json file, your current rule for how npm may upgrade `@freecodecamp/example` is to use a specific version (`1.2.13`). But now, you want to allow the latest `1.2.x` version. </ins> Use the tilde (`~`) character to prefix the version of `@freecodecamp/example` in your dependencies, and allow npm to update it to any new _patch_ release.
Something does not look right. You added the correct `class` attribute value to the `p` element with `Donut` as its text, but you have not defined a selector for it. <del> Since the `flavor` class selector already has the properties you want, just add the `dessert` class name to it. </del> <ins> The CSS rule for the `flavor` class already sets the properties you want. Add the `dessert` class as an additional selector for this CSS rule. </ins> # --hints--
<div> <div class="spacer" <del> style="padding: 15px 0px; height: 1px;" </del> <ins> style="padding: 15px 0px;" </ins> /> <div class="container" > <div class="spacer" <del> style="padding: 15px 0px; height: 1px;" </del> <ins> style="padding: 15px 0px;" </ins> /> <div> <div
# --instructions-- <del> Write an `@each` directive that goes through a list: `blue, black, red` and assigns each variable to a `.color-bg` class, where the `color` part changes for each item. Each class should set the `background-color` the respective color. </del> <ins> Write an `@each` directive that goes through a list: `blue, black, red` and assigns each variable to a `.color-bg` class, where the `color` part changes for each item to the respective color. Each class should set the `background-color` to the respective color as well. </ins> # --hints--
> [!NOTE] > If you are using Apple Devices with M1 Chip to run the application locally, it is suggested to use Node v14.7 or above. You might run into issues with dependencies like Sharp otherwise. <ins> ## Working With Other Languages To see how the client renders in another language go to [testing the client app in a world language.](how-to-work-on-localized-client-webapp.md#Testing-the-Client-App-in-a-World-Language) </ins> ## Getting Help If you are stuck and need help, feel free to ask questions in the ['Contributors' category on our forum](https://forum.freecodecamp.org/c/contributors) or [the contributors chat room](https://discord.gg/PRyKn3Vbay).
frameContext.window.console.error = function proxyWarn( ...args: string[] ) { <del> proxyLogger(args.map((arg: string) => utilsFormat(arg)).join(' ')); </del> <ins> if (args.every(arg => !actRE.test(arg))) { proxyLogger(args.map((arg: string) => utilsFormat(arg)).join(' ')); } </ins> return oldError(...(args as [])); }; }
# --description-- <ins> The child combinator selector `>` is used between selectors to target only elements that match the second selector and are a direct child of the first selector. This can be helpful when you have deeply nested elements and want to control the scope of your styling. </ins> Use the `>` selector to target the unordered list elements within the `nav` elements, and use _Flexbox_ to evenly space the children. # --hints--
"knip": "npx -y knip@1 --include files", "knip:all": "npx -y knip@1", "prelint": "pnpm run -F=client predevelop", <del> "lint": "npm-run-all create:shared -p lint:*", </del> <ins> "lint": "NODE_OPTIONS="--max-old-space-size=7168" npm-run-all create:shared -p lint:*", </ins> "lint:challenges": "cd ./curriculum && pnpm run lint", "lint:js": "eslint --cache --max-warnings 0 .", "lint:ts": "tsc && tsc -p shared && tsc -p api",
Your `setAttribute` method should have ``song?.title ? `Play ${song.title}` : "Play"`` as the second argument. ```js <del> assert.match(code, /playButton.setAttribute(s*('|")aria-label1,s*song?.titles*?s*`Plays*${song.title}`s*:s*1Play1s*);?s*/) </del> <ins> assert.match(code, /playButton.setAttribute(s*('|")aria-label1,s*song?.titles*?s*`Plays*${song.title}`s*:s*('|")Play2s*);?s*/) </ins> ``` # --seed--