jiebi/CodeConvo huggingface dataset:
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: Editor.displayName = 'Editor'; Editor.propTypes = propTypes; <ins> // NOTE: withRef gets replaced by forwardRef in react-redux 6, // https://github.com/reduxjs/react-redux/releases/tag/v6.0.0 </ins> export default connect( mapStateToProps, <del> mapDispatchToProps </del> <ins> mapDispatchToProps, null, { withRef: true } </ins> )(Editor);
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: }; this.containerRef = React.createRef(); <ins> this.editorRef = React.createRef(); </ins> } onResize() { this.setState({ resizing: true });
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: challengeFile && ( <Editor containerRef={this.containerRef} <ins> ref={this.editorRef} </ins> {...challengeFile} fileKey={challengeFile.key} />
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: } = this.props; return ( <Hotkeys <ins> editorRef={this.editorRef} </ins> executeChallenge={executeChallenge} innerRef={this.containerRef} introPath={introPath}
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: const keyMap = { NAVIGATION_MODE: 'escape', EXECUTE_CHALLENGE: ['ctrl+enter', 'command+enter'], <ins> FOCUS_EDITOR: 'e', </ins> NAVIGATE_PREV: ['p'], NAVIGATE_NEXT: ['n'] };
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: const propTypes = { canFocusEditor: PropTypes.bool, children: PropTypes.any, <ins> editorRef: PropTypes.object, </ins> executeChallenge: PropTypes.func, innerRef: PropTypes.any, introPath: PropTypes.string,
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: function Hotkeys({ canFocusEditor, children, <ins> editorRef, </ins> executeChallenge, introPath, innerRef,
Code change:
Is your feature request related to a problem? Please describe. It currently can take a several key presses to navigate to the editor if it does not have focus. Describe the solution you'd like It should be possible to focus on the editor with a hotkey, for example 'e'. The issue where this was mostly discussed will be closed soon, but some thoughts about implementing this appeared there:

Related discussion:
text: e.preventDefault(); if (executeChallenge) executeChallenge(); }, <ins> FOCUS_EDITOR: e => { e.preventDefault(); if (editorRef && editorRef.current) { editorRef.current.getWrappedInstance().focusOnEditor(); } }, </ins> NAVIGATION_MODE: () => setEditorFocusability(false), NAVIGATE_PREV: () => { if (!canFocusEditor) navigate(prevChallengePath);
Code change:
Describe the bug Functionally, there is no problem with distinguishing between normal and focus state because there is blinking cursor when on focus state. Filled fields will also be selected and highlighted with blue color when navigating with keyboard tab. Aesthetically, there is suggestion from on issue to invert the input boxes with dark background and light text in night mode. Border color change between normal and focus state also need some visual improvements because currently it is hard to see. To Reproduce Steps to reproduce the behavior: to http://localhost:8000/settings to switch between normal and focus state on input boxes with mouse click or keyboard tab to Describe the bug Expected behavior Refer to suggestion in Describe the bug Desktop (please complete the following information): OS: Windows 10 1809 Build .832 Browser Latest Chrome Version 77.0.3865.120 (Official Build) (64-bit)
i'll take this one

Related discussion:
text: } .form-control { <del> color: var(--theme-color); </del> <ins> color: var(--primary-color); </ins> outline: none; border-color: var(--quaternary-background); <ins> background-color: var(--primary-background); </ins> -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important;
Code change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: Running on any JS challenge outputs on the console output instead of . Related forum topic: User reported seeing when it actually should be with the following code: Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Firefox Browser Version: 70.0 Operating System: Kubuntu 19.04 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): Screenshot of bug in a different challenge: !
I don't know anything about this part of the code, but I do see JSON.stringify being used in test- and if you stringify you get back "null". Again, not sure if this is related or not just thought I would post it anyway.
Yeah, that's exactly the issue. My current plan is to use if it exists and stringify if not. I'm just not sure how to make sure this doesn't create any weirdness.
What about using the parameter function? Would that be less likely to cause any weirdness?
that sounds way better. Do you think you'll have time to put that in a PR?

Related discussion:
text: } } <ins> function replacer(key, value) { if (Number.isNaN(value)) { return 'NaN'; } return value; } </ins> const oldLog = self.console.log.bind(self.console); self.console.log = function proxyConsole(...args) { <del> logs.push(args.map(arg => '' + JSON.stringify(arg)).join(' ')); </del> <ins> logs.push(args.map(arg => '' + JSON.stringify(arg, replacer)).join(' ')); </ins> if (logs.join('n').length > MAX_LOGS_SIZE) { flushLogs(); }
Code change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: I identified three challenges where the for loop validation does not work if newlines are used in the arguments. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 79.0.3945.88 Operating System: Ubuntu 18.04 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): ! ! !

Related discussion:
text: - text: Your code should use the <code>filter</code> method. testString: assert(code.match(/.filter/g)); - text: Your code should not use a <code>for</code> loop. <del> testString: assert(!code.match(/fors*?(.+?)/g)); </del> <ins> testString: assert(!code.match(/fors*?([sS]*?)/g)); </ins> - text: '<code>filteredList</code> should equal <code>[{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}]</code>.' testString: 'assert.deepEqual(filteredList, [{"title": "Inception","rating": "8.8"},{"title": "Interstellar","rating": "8.6"},{"title": "The Dark Knight","rating": "9.0"},{"title": "Batman Begins","rating": "8.3"}]);'
Code change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: I identified three challenges where the for loop validation does not work if newlines are used in the arguments. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 79.0.3945.88 Operating System: Ubuntu 18.04 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): ! ! !

Related discussion:
text: - text: The <code>watchList</code> variable should not change. testString: assert(watchList[0].Title === "Inception" && watchList[4].Director == "James Cameron"); - text: Your code should not use a <code>for</code> loop. <del> testString: assert(!removeJSComments(code).match(/fors*?(.*?)/)); </del> <ins> testString: assert(!removeJSComments(code).match(/fors*?([sS]*?)/)); </ins> - text: Your code should use the <code>map</code> method. testString: assert(code.match(/.map/g)); - text: <code>ratings</code> should equal <code>[{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]</code>.
Code change:
<!-- NOTE: If you're reporting a security issue, don't create a GitHub issue. Instead, email We will look into it immediately. --Describe your problem and how to reproduce it: I identified three challenges where the for loop validation does not work if newlines are used in the arguments. Add a Link to the page with the problem: Tell us about your browser and operating system: Browser Name: Google Chrome Browser Version: 79.0.3945.88 Operating System: Ubuntu 18.04 If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box): ! ! !

Related discussion:
text: - text: The <code>getRating(watchList)</code> should equal 8.675. testString: assert(getRating(watchList) === 8.675); - text: Your code should not use a <code>for</code> loop. <del> testString: assert(!code.match(/fors*?(.*)/g)); </del> <ins> testString: assert(!code.match(/fors*?([sS]*?)/g)); </ins> - text: Your code should return correct output after modifying the <code>watchList</code> object. testString: assert(getRating(watchList.filter((_, i) => i < 1 || i > 2)) === 8.55);
Code change:
Advanced Node and Express section needs package versions to the instructions, as discussed in: Example: " Add <codepassport.socketio</codeversion <codeX.X.X</code, <codeconnect-mongo</codeversion <codeX.X.X</code, and <codecookie-parser</codeversion <codeX.X.X</codeas dependencies and require them as <codepassportSocketIo</code, <codeMongoStore</code, and <codecookieParser</coderespectfully. " Before this is undertaken: [x] Wait for to be merged [ ] Discuss which versions to use and how to convey this ( or )
I am leaning more toward the requirement, myself. With the carat prefix, will install the latest minor version. In theory, updates to the minor version are backwards compatible and shouldn't create any issues with the tests or challenges. However, minor versions can include depreciation notices like . The feature will still work, but this could be confusing to a camper. Using the tilde prefix means will install the latest patch version, which includes bug fixes but shouldn't lead to any depreciation notices. I think this will offer the best long-term compatibility with our tests and challenge instructions.
Well, it has happened: Last versions which definitely work: I have tested this. Now, discussion: 1) Just ask for to be installed 2) Also change the lesson/code to work with this latest version?
Hey how is this show stopper coming along?
Ah yes... I have updated the label, because it should have been removed by . Can a PR automatically remove an issue's label? Otherwise, this issue is still open and help wanted , as there are many packages which need their versioning fixed. If no one else, I can slot in some time for this tomorrow.
No rush. Thanks for confirming, I have removed the assignment since this is no longer a showstopper.
thank you so much for the Thank you for the suggestion. It helped me alot

Related discussion:
text: A strategy is a way of authenticating a user. You can use a strategy for allowing users to authenticate based on locally saved information (if you have them register first) or from a variety of providers such as Google or GitHub. For this project, we will set up a local strategy. To see a list of the hundreds of strategies, visit Passport's site [here](http://passportjs.org/). <del> Add `passport-local` as a dependency and add it to your server as follows: `const LocalStrategy = require('passport-local');` </del> <ins> Add `passport-local@~1.0.0` as a dependency and add it to your server as follows: `const LocalStrategy = require('passport-local');` </ins> Now you will have to tell passport to **use** an instantiated LocalStrategy object with a few settings defined. Make sure this (as well as everything from this point on) is encapsulated in the database connection since it relies on it!
Code change:
Advanced Node and Express section needs package versions to the instructions, as discussed in: Example: " Add <codepassport.socketio</codeversion <codeX.X.X</code, <codeconnect-mongo</codeversion <codeX.X.X</code, and <codecookie-parser</codeversion <codeX.X.X</codeas dependencies and require them as <codepassportSocketIo</code, <codeMongoStore</code, and <codecookieParser</coderespectfully. " Before this is undertaken: [x] Wait for to be merged [ ] Discuss which versions to use and how to convey this ( or )
I am leaning more toward the requirement, myself. With the carat prefix, will install the latest minor version. In theory, updates to the minor version are backwards compatible and shouldn't create any issues with the tests or challenges. However, minor versions can include depreciation notices like . The feature will still work, but this could be confusing to a camper. Using the tilde prefix means will install the latest patch version, which includes bug fixes but shouldn't lead to any depreciation notices. I think this will offer the best long-term compatibility with our tests and challenge instructions.
Well, it has happened: Last versions which definitely work: I have tested this. Now, discussion: 1) Just ask for to be installed 2) Also change the lesson/code to work with this latest version?
Hey how is this show stopper coming along?
Ah yes... I have updated the label, because it should have been removed by . Can a PR automatically remove an issue's label? Otherwise, this issue is still open and help wanted , as there are many packages which need their versioning fixed. If no one else, I can slot in some time for this tomorrow.
No rush. Thanks for confirming, I have removed the assignment since this is no longer a showstopper.
thank you so much for the Thank you for the suggestion. It helped me alot

Related discussion:
text: Currently, you cannot determine who is connected to your web socket. While `req.user` contains the user object, that's only when your user interacts with the web server, and with web sockets you have no `req` (request) and therefore no user data. One way to solve the problem of knowing who is connected to your web socket is by parsing and decoding the cookie that contains the passport session then deserializing it to obtain the user object. Luckily, there is a package on NPM just for this that turns a once complex task into something simple! <del> Add `passport.socketio`, `connect-mongo@~3.2.0`, and `cookie-parser` as dependencies and require them as `passportSocketIo`, `MongoStore`, and `cookieParser` respectively. Also, we need to initialize a new memory store, from `express-session` which we previously required. It should look like this: </del> <ins> Add `passport.socketio@~3.7.0`, `connect-mongo@~3.2.0`, and `cookie-parser@~1.4.5` as dependencies and require them as `passportSocketIo`, `MongoStore`, and `cookieParser` respectively. Also, we need to initialize a new memory store, from `express-session` which we previously required. It should look like this: </ins> ```js const MongoStore = require('connect-mongo')(session);
Code change:
Advanced Node and Express section needs package versions to the instructions, as discussed in: Example: " Add <codepassport.socketio</codeversion <codeX.X.X</code, <codeconnect-mongo</codeversion <codeX.X.X</code, and <codecookie-parser</codeversion <codeX.X.X</codeas dependencies and require them as <codepassportSocketIo</code, <codeMongoStore</code, and <codecookieParser</coderespectfully. " Before this is undertaken: [x] Wait for to be merged [ ] Discuss which versions to use and how to convey this ( or )
I am leaning more toward the requirement, myself. With the carat prefix, will install the latest minor version. In theory, updates to the minor version are backwards compatible and shouldn't create any issues with the tests or challenges. However, minor versions can include depreciation notices like . The feature will still work, but this could be confusing to a camper. Using the tilde prefix means will install the latest patch version, which includes bug fixes but shouldn't lead to any depreciation notices. I think this will offer the best long-term compatibility with our tests and challenge instructions.
Well, it has happened: Last versions which definitely work: I have tested this. Now, discussion: 1) Just ask for to be installed 2) Also change the lesson/code to work with this latest version?
Hey how is this show stopper coming along?
Ah yes... I have updated the label, because it should have been removed by . Can a PR automatically remove an issue's label? Otherwise, this issue is still open and help wanted , as there are many packages which need their versioning fixed. If no one else, I can slot in some time for this tomorrow.
No rush. Thanks for confirming, I have removed the assignment since this is no longer a showstopper.
thank you so much for the Thank you for the suggestion. It helped me alot

Related discussion:
text: Going back to the information security section, you may remember that storing plaintext passwords is *never* okay. Now it is time to implement BCrypt to solve this issue. <del> Add BCrypt as a dependency, and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account, and when you check to see that a password is correct on login. </del> <ins> Add `bcrypt@~5.0.0` as a dependency, and require it in your server. You will need to handle hashing in 2 key areas: where you handle registering/saving a new account, and when you check to see that a password is correct on login. </ins> Currently on our registration route, you insert a user's password into the database like so: `password: req.body.password`. An easy way to implement saving a hash instead is to add the following before your database logic `const hash = bcrypt.hashSync(req.body.password, 12);`, and replacing the `req.body.password` in the database saving with just `password: hash`.
Code change:
Advanced Node and Express section needs package versions to the instructions, as discussed in: Example: " Add <codepassport.socketio</codeversion <codeX.X.X</code, <codeconnect-mongo</codeversion <codeX.X.X</code, and <codecookie-parser</codeversion <codeX.X.X</codeas dependencies and require them as <codepassportSocketIo</code, <codeMongoStore</code, and <codecookieParser</coderespectfully. " Before this is undertaken: [x] Wait for to be merged [ ] Discuss which versions to use and how to convey this ( or )
I am leaning more toward the requirement, myself. With the carat prefix, will install the latest minor version. In theory, updates to the minor version are backwards compatible and shouldn't create any issues with the tests or challenges. However, minor versions can include depreciation notices like . The feature will still work, but this could be confusing to a camper. Using the tilde prefix means will install the latest patch version, which includes bug fixes but shouldn't lead to any depreciation notices. I think this will offer the best long-term compatibility with our tests and challenge instructions.
Well, it has happened: Last versions which definitely work: I have tested this. Now, discussion: 1) Just ask for to be installed 2) Also change the lesson/code to work with this latest version?
Hey how is this show stopper coming along?
Ah yes... I have updated the label, because it should have been removed by . Can a PR automatically remove an issue's label? Otherwise, this issue is still open and help wanted , as there are many packages which need their versioning fixed. If no one else, I can slot in some time for this tomorrow.
No rush. Thanks for confirming, I have removed the assignment since this is no longer a showstopper.
thank you so much for the Thank you for the suggestion. It helped me alot

Related discussion:
text: The following challenges will make use of the `chat.pug` file. So, in your `routes.js` file, add a GET route pointing to `/chat` which makes use of `ensureAuthenticated`, and renders `chat.pug`, with `{ user: req.user }` passed as an argument to the response. Now, alter your existing `/auth/github/callback` route to set the `req.session.user_id = req.user.id`, and redirect to `/chat`. <del> Add `http` and `socket.io` as a dependency and require/instantiate them in your server defined as follows: </del> <ins> Add `socket.io@~2.3.0` as a dependency and require/instantiate it in your server defined as follows, with `http` (comes built-in with Nodejs): </ins> ```javascript const http = require('http').createServer(app);