These are chat archives for FreeCodeCamp/Help

27th
Mar 2018
Ken Haduch
@khaduch
Mar 27 2018 00:00
@texas2010 and @thekholm80 - sorry I missed out on the regex discussion. I love regular expressions!
Kyle Holm
@thekholm80
Mar 27 2018 00:00
@khaduch haha you can keep it
Lance
@texas2010
Mar 27 2018 00:01
@khaduch that is fine.
Kyle Holm
@thekholm80
Mar 27 2018 00:01
i'm getting better, though. begrudgingly
Ken Haduch
@khaduch
Mar 27 2018 00:02
I have a long history with regex, but always something new (or rediscovered) with these lessons!
Manish Giri
@Manish-Giri
Mar 27 2018 00:03
@khaduch there are some 1 and 2 kyu regex problems on codewars, give those a shot if you're up for a challenge!
Kyle Holm
@thekholm80
Mar 27 2018 00:04
that's sadistic
Lance
@texas2010
Mar 27 2018 00:04
@khaduch do you think my code is correct? or i suppose to use ^ and $.
@Manish-Giri :wave:
Manish Giri
@Manish-Giri
Mar 27 2018 00:04
@texas2010 :wave:
Ken Haduch
@khaduch
Mar 27 2018 00:05
I’ll have to see on the computer, I’m just on the phone...
Lance
@texas2010
Mar 27 2018 00:07
@khaduch that is fine. you can look that anytime. no hurry.
Ken Haduch
@khaduch
Mar 27 2018 01:01
@texas2010 - the expression that Kyle @thekholm80 showed is correct. In order to prevent matching more than 3 occurrences of the matched group, you need to terminate the matching expression somehow, so anchoring to the beginning of line ^ and end of line $ does satisfy that condition. There might be other ways to terminate the matching, but because they specify only reusing the capture group twice, you can't do another expression to not match the capture group. So I think that that expression would be correct.
Lance
@texas2010
Mar 27 2018 01:02
oh ok. it seems i need to take regex course or watch videos. so i could understand more
@khaduch thanks!
CamperBot
@camperbot
Mar 27 2018 01:02
texas2010 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3824 | @khaduch |http://www.freecodecamp.org/khaduch
Kyle Holm
@thekholm80
Mar 27 2018 01:10
oh neat, thanks @khaduch
CamperBot
@camperbot
Mar 27 2018 01:10
thekholm80 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3825 | @khaduch |http://www.freecodecamp.org/khaduch
Gordon
@Gordon-GD
Mar 27 2018 01:23
Create a div element and include the class well, which is placed in each of your class "col-xs-6" div elements
Why two "div"?
On! I got it!
Tiffany E Caldwell
@tecald
Mar 27 2018 02:51
00.
rajja77
@rajja77
Mar 27 2018 04:33
hi im new to freecode camp beta . i tried the old version before. can someone plz tell what is the difference of both versions . ? are we still getting the chance to work with non profit organizations ? are we still getting the certificates ?
Coy Sanders
@coymeetsworld
Mar 27 2018 04:41
beta adds more content, updates others. For example adds ES6 syntax, react/redux libraries. You can check both curriculums here
https://www.freecodecamp.org/map
https://beta.freecodecamp.org/en/challenges/basic-html-and-html5/learn-how-freecodecamp-works
certs are going to change I believe but I haven't been keeping up with the recent developments or when beta will be done
rajja77
@rajja77
Mar 27 2018 05:01
@coymeetsworld thx for your reply . sure ill check both curriculum
CamperBot
@camperbot
Mar 27 2018 05:01
rajja77 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star2: 3019 | @coymeetsworld |http://www.freecodecamp.org/coymeetsworld
Coy Sanders
@coymeetsworld
Mar 27 2018 05:02
np
bbbluem
@bbbluem
Mar 27 2018 08:24
hello
Johnny
@JohnnyBizzel
Mar 27 2018 08:25
Hi
iPythoning
@iPythoning
Mar 27 2018 09:21
$(document).ready(function() {
script
});
why wrong
Claudio Restifo
@Marmiz
Mar 27 2018 09:29
@iPythoning because "script" is nothing valid.
Inside the curly braces is where you write the code you want to execute...
just writing 'script' is not enough :)
iPythoning
@iPythoning
Mar 27 2018 09:30
thx
@Marmiz thx
CamperBot
@camperbot
Mar 27 2018 09:30
ipythoning sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1195 | @marmiz |http://www.freecodecamp.org/marmiz
Claudio Restifo
@Marmiz
Mar 27 2018 09:32
:+1: happy coding
Aleksandar B.
@aleksandar-b
Mar 27 2018 12:36
guys
what does adjacent mean? Can not stand to each other?
Valid characters are Alpha, Numeric, Blank, Hyphen, Slash and Back Slash.
Blanks, Hyphen, Slash and Back Slash cannot be adjacent.
Ken Haduch
@khaduch
Mar 27 2018 12:50
@samosale - yes, that would mean that they have to have a space or something else between them.
Aleksandar B.
@aleksandar-b
Mar 27 2018 12:55
@khaduch is Blanks a white space
?
Ken Haduch
@khaduch
Mar 27 2018 12:57
@samosale - yes, that would be a white space.
Aleksandar B.
@aleksandar-b
Mar 27 2018 13:18
@khaduch tnx
CamperBot
@camperbot
Mar 27 2018 13:18
samosale sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3827 | @khaduch |http://www.freecodecamp.org/khaduch
Kyle Holm
@thekholm80
Mar 27 2018 15:12
good morning, /help
BuntyBru
@BuntyBru
Mar 27 2018 15:34
Good morning mate
gishy1
@gishy1
Mar 27 2018 15:57
@sjames1958gm thanks bro so much i have to learn
CamperBot
@camperbot
Mar 27 2018 15:57
gishy1 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9140 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Ken Haduch
@khaduch
Mar 27 2018 17:06
@thekholm80 - good morning to you...
ArcaneHunter
@ArcaneHunter
Mar 27 2018 18:53
<label>
<input type="checkbox" name="personality"> a
<input type="checkbox" name="personality"> b
<input type="checkbox" name="personality"> c
</label>

can someone tell me whats the difference between this one ^ and this one ?

<label>
<input type="checkbox" name="personality"> a
</label>
<label>
<input type="checkbox" name="personality"> b
</label>
<label>
<input type="checkbox" name="personality"> c
</label>

Kyle Holm
@thekholm80
Mar 27 2018 19:00
@ArcaneHunter http://jsbin.com/hezesewedo/edit?html,output while they render the same, they have different functionality. try clicking on the labels instead of the boxes to see how the label click listener raises up to the controlled element
ArcaneHunter
@ArcaneHunter
Mar 27 2018 19:02
oh, thank u
If I click on letter instead of the boxes it marks the exact box in the second one and in the first on it marks just the first option
Kyle Holm
@thekholm80
Mar 27 2018 19:03
yep! the label wrapping an input will transfer it's 'clicks' to the input
or you could do <input type='checkbox' id='myCheckBox'><label for='myCheckBox'>label text</label> to get the same functionality
Sam Goldberg
@sgoldber61
Mar 27 2018 20:26
I'm getting Invalid Host header on my react heroku app, and I have absolutely no idea why...
Kyle Holm
@thekholm80
Mar 27 2018 20:27
that's weird
have you checked your logs on heroku?
Sam Goldberg
@sgoldber61
Mar 27 2018 20:28
No obvious red errors
Manish Giri
@Manish-Giri
Mar 27 2018 20:32
maybe add
devServer: {
  disableHostCheck: true
}
in webpack config
Sam Goldberg
@sgoldber61
Mar 27 2018 20:33
Where is webpack config?
Meaning, in my file structure here where would I put it?
Kyle Holm
@thekholm80
Mar 27 2018 20:35
running webpack on heroku?
Sam Goldberg
@sgoldber61
Mar 27 2018 20:37
I actually don't know what webpack is... I've always just based my client folder on a create-react-app
Kyle Holm
@thekholm80
Mar 27 2018 20:37
did you do a production build before deploying to heroku?
Sam Goldberg
@sgoldber61
Mar 27 2018 20:38
yes
Kyle Holm
@thekholm80
Mar 27 2018 20:38
and your server is serving the bundle, not running your dev build?
i generally don't even push my dev files to heroku, just server code and my bundle
Sam Goldberg
@sgoldber61
Mar 27 2018 20:41
ahh i'm not running npm run build in the client
maybe that will fix it sec.
Sam Goldberg
@sgoldber61
Mar 27 2018 21:39
Yes yes yes it finally works! Done with this stupid stock market app
Kyle Holm
@thekholm80
Mar 27 2018 21:42
@sgoldber61 good job!
Sam Goldberg
@sgoldber61
Mar 27 2018 21:44
@thekholm80 thanks!!
CamperBot
@camperbot
Mar 27 2018 21:44
sgoldber61 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1748 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kyle Holm
@thekholm80
Mar 27 2018 21:46
@sgoldber61 will you finish mine for me?
Sam Goldberg
@sgoldber61
Mar 27 2018 21:49
LOL
it's so tedious i know
Kyle Holm
@thekholm80
Mar 27 2018 21:50
i did the fun part, it's hard to motivate through the rest
Sam Goldberg
@sgoldber61
Mar 27 2018 21:51
Yeah, it's so hard to motivate. I'm actually am, starting from now, going to study up JavaScript algorithms for the Codesmith bootcamp interview.
Because... i'm tired of being so alone and slow-paced
Kyle Holm
@thekholm80
Mar 27 2018 21:51
that's a good idea
Gulsvi
@gulsvi
Mar 27 2018 21:58
@sgoldber61 I've seen a bunch of these - is codesmith a remote/online course, or do you have to go to New York/LA for the courses? Curious about attending one after I graduate...and not sure which one to choose
Don't want to travel to some city I don't live in, if possible, and don't have any where I live
Kyle Holm
@thekholm80
Mar 27 2018 21:59
@gulsvi i think at least one of the bootcamps in my area has student housing included
Gulsvi
@gulsvi
Mar 27 2018 22:01
@thekholm80 I'm guessing that gets real expensive though... some of these want 10% of my first year salary, which might be more acceptable if it helps me land a good job. I just don't know which ones are actually good at this point. So many to choose from.
Kyle Holm
@thekholm80
Mar 27 2018 22:02
it is pretty pricey; the "Immersive" course - which includes housing - is $10,900 for 13 weeks
more than i'd be willing to spend, for sure
Kyle Holm
@thekholm80
Mar 27 2018 23:22
does Array.prototype.map() always return a new array the same length as the calling array?
Ken Haduch
@khaduch
Mar 27 2018 23:39
@thekholm80 - no
Kyle Holm
@thekholm80
Mar 27 2018 23:40
@khaduch i've tried to conditionally return in the callback (resulting in a smaller new array) and it's filling the indices i don't return with undefined

something like

const oldArray = [1, 2, 0, 3];
const newArray = oldArray.map(el => {
  if (el > 0) {
    return el;
  }
});
console.log(newArray); // [1, 2, undefined, 3]

but my callback logic is a little more complex

i ended up using something more like const newArray = oldArray.filter().map()
it just sucks that it's a 2 step process
Ken Haduch
@khaduch
Mar 27 2018 23:43
@thekholm80 - oh... well my answer is based on the fact that if you have "gaps" in the array data, like if you create an array like this; var inArray = [1, 2, 3, 4, 5]; and then add a couple elements like this: inArray[inArray.length + 2] = 6; and inArray[inArray.length + 4] = 7; You will have an array going in that is longer than the one that is returned from .map() I think in your case, you are returning the default undefined if you aren't doing the return el; and that is what gets plugged in, because there isn't any way to return nothing, is there?
you'd want to use .filter() I think?
oh, yeah, I just read your other comments...
How about .reduce()? You can do anything with .reduce()? :)
Kyle Holm
@thekholm80
Mar 27 2018 23:46
i tried reduce but i think my return was incorrect
one sec, i'll give an example

i tried something like

const arr = [1, 2, 0, 3];

const newArr = arr.reduce((a, b) => {
  if (b > 0) {
    return [...a, b];
  }
}, []);

and got TypeError: a is not iterable

Kyle Holm
@thekholm80
Mar 27 2018 23:53
seems strange to me because
const arr = [];

console.log([...arr]); // []