These are chat archives for FreeCodeCamp/Help

10th
Nov 2017
Fabien SHAN
@X140hu4
Nov 10 2017 01:39
Definitely go to other places than Paris haha
Henry
@GitHub-Henry
Nov 10 2017 01:53
@dhcodes how do you feel ff dev, is better than chrome dev tools? actually, if others have input about the new ff dev environment, please share...i looked at the ff dev intro page reminded me of 6M$ man, rebuilt better, stronger, faster...
Claudio Restifo
@Marmiz
Nov 10 2017 03:09

@GitHub-Henry I personally have no working experience with FF, using mainly React I stick with chrome for the React dev extensions an performance recording.

Last time I checked there were no options available in FF

Kyle Holm
@thekholm80
Nov 10 2017 03:12
React dev tools are awesome
Claudio Restifo
@Marmiz
Nov 10 2017 03:20
@thekholm80 ever tried react performance? Is great :)
Kyle Holm
@thekholm80
Nov 10 2017 03:21
i have not
@Marmiz what does it do?
Claudio Restifo
@Marmiz
Nov 10 2017 03:21
(it's not an extension per se - but a feature of Chrome)
You can add ?react_perf to the url you are using (probably localhost in dev) and then in the dev tool register performance. Launch an action and you'll see a graph of all the rendering you app is doing
great to catch useless rendering
Kyle Holm
@thekholm80
Nov 10 2017 03:22
oh very cool
Henry
@GitHub-Henry
Nov 10 2017 04:21
@Marmiz Thanks for the tip, looks useful. :shipit: :sparkles:
CamperBot
@camperbot
Nov 10 2017 04:21
github-henry sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1097 | @marmiz |http://www.freecodecamp.com/marmiz
artbohr
@artbohr
Nov 10 2017 04:46
@Marmiz @DarrenfJ thank you, just not sure what should I put in the deploy instead to publish to master branch
CamperBot
@camperbot
Nov 10 2017 04:46
artbohr sends brownie points to @marmiz and @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1098 | @marmiz |http://www.freecodecamp.com/marmiz
:star2: 2265 | @darrenfj |http://www.freecodecamp.com/darrenfj
Claudio Restifo
@Marmiz
Nov 10 2017 04:58
@artbohr sorry but I don't get your question
kothmane
@kothmane
Nov 10 2017 06:01
Hi everyone,
should version of bootstrap should i use for the projects challenges ?
what version*
Henry
@GitHub-Henry
Nov 10 2017 06:15
@kothmane 3 cuz most of fcc stuff was written when 3 was the 'current' version of bootstrap, so goes my thinking
Stephen James
@sjames1958gm
Nov 10 2017 11:16
@kothmane Choose whichever you want, or not at all.
Jake
@JakeDVirus
Nov 10 2017 12:12
there is a image with resolution 7201280 (width=720, height=1280). i used this as a full screen image for full screen @3x retina device. but i want to use the same image in the large devices but with the resolution 1080720 (width=1280, height=720). so basically its the rotated version. what is the best way to do it with performance in concern?
kishan17
@kishan17
Nov 10 2017 12:13
How do i fetch facebook profile picture from user's mobile number?
Marc
@MWBauer
Nov 10 2017 13:58
Oh goodness! Hey everyone!
HOw are ya'?
heroiczero
@heroiczero
Nov 10 2017 13:58
Good How are you :)
Marc
@MWBauer
Nov 10 2017 13:58
I'm ok. Spent the better part of yesterday driving from TN to Arkansas.
I'm done studying for my hunting license and so now I can focus on this again.
heroiczero
@heroiczero
Nov 10 2017 14:01
Well Welcome back. Glad Your travels went safely :smile:
Marc
@MWBauer
Nov 10 2017 14:02
thx
When did they stop storing our answers to the tasks?
heroiczero
@heroiczero
Nov 10 2017 14:07
it should still be in your profile
about @MWBauer
CamperBot
@camperbot
Nov 10 2017 14:07
:cookie: 255 | @mwbauer |http://www.freecodecamp.com/mwbauer
Marc
@MWBauer
Nov 10 2017 14:07
I'm using a new browser, Firefox Dev edition, and I knew that they wouldn't have the answers stored from the old browser. But, I can't even go to the old browser and get my answers
Moisés Man
@moigithub
Nov 10 2017 14:08
easy..
redo all again :+1:
heroiczero
@heroiczero
Nov 10 2017 14:08
lol
Marc
@MWBauer
Nov 10 2017 14:08
@moigithub that's what I'm trying to do.
I'm having a hard time with one lesson that's always given me issues.
but still, I hate that those answers aren't there.
var testObj = {
  12: "Namath",
  16: "Montana",
  19: "Unitas"
};

// Only change code below this line;

var playerNumber;       // Change this Line
var player = testObj;
REmember this one? I was never good at this.
heroiczero
@heroiczero
Nov 10 2017 14:10
@MWBauer need to change var playerNumber; // Change this Line and you need testObj //something in your next line to access the object with a key
Moisés Man
@moigithub
Nov 10 2017 14:10
objects are key:value pairs
soo on that example.. the numbers 12,16,19 are the keys
using the keys u able to access the values
Marc
@MWBauer
Nov 10 2017 14:12
so testObj[16] should get me the name?
Moisés Man
@moigithub
Nov 10 2017 14:12
on that exercise.. they want u to change playerNumber variable.. to "hold" the number key (whatever it ask u to get)
and use that variable to access its value.. using bracket notation
Marc
@MWBauer
Nov 10 2017 14:13
var playerNumber = testObj[16]; should display Montana
heroiczero
@heroiczero
Nov 10 2017 14:13
They give you a variable playerNumber in your testObjwhere there are player numbers. Set the number to playerNumber
Moisés Man
@moigithub
Nov 10 2017 14:14
playerNumber should have a "number" only
heroiczero
@heroiczero
Nov 10 2017 14:15
and use that variable to access the player (the value in the object) by using the testObj and the key (the variable playerNumber)
Sorin Ruse
@sorinr
Nov 10 2017 14:15
@NeelDVirus here is a js lib that may help you. not sure if it works on background-image
Marc
@MWBauer
Nov 10 2017 14:16
Ok. Thank you. I have it now.
I kept thinking that there were 2 different notations that needed to be made.
Daniel
@dkapexhiu
Nov 10 2017 14:34
hi! i have created a website using bootstrap. the problem is that when i open chrome devtools the site is not responsive but when i resize the chrome window the page is responsive.. how can i do to make the website responsive even in chrome devtools?
Marc
@MWBauer
Nov 10 2017 14:46
Using Objects for Lookup is confusing me. If you build the table the way they show you, then there is no result var to report. And yet, you aren't supposed to change the var result = ""
Ken Haduch
@khaduch
Nov 10 2017 14:53
@dkapexhiu - I'm not sure if this will help you, but in the Chrome devtools, up on the toolbar, there is a button with an arrow pointing into a box, and next to it, a button that shows "devices" - "Toggle device toobar" - this emulates different phone / tablet devices. I don't know if it will help you to solve the problem that you are trying to solve?
Moisés Man
@moigithub
Nov 10 2017 14:54
u can always REASSIGN values after @MWBauer
Ken Haduch
@khaduch
Nov 10 2017 14:56
@dkapexhiu - circled in red on this screenshot
image.png
Marc
@MWBauer
Nov 10 2017 15:13
Got that one
Ken Haduch
@khaduch
Nov 10 2017 15:49
@MWBauer - I was just reviewing your posts from this morning. Welcome back!
What I do (or try to do) is keep a running text file, using a text editor like Notepad++ or any text editor, and pasting a copy of completed work, and interesting notes that I find in the chats, or related stuff for freeCodeCamp. I have learned not to trust that work will just stay around, although that also makes the file a risky venture :) But some redundancy is better than none!
Of course that might not help you at this point if the previous work has been lost, but just a good idea to put files / info where you know you can get them!
Darren
@DarrenfJ
Nov 10 2017 15:58
morning fCC.. just poppin in to say hi to everyone before the madness of the day...
Kyle Holm
@thekholm80
Nov 10 2017 15:58
@DarrenfJ :wave:
Darren
@DarrenfJ
Nov 10 2017 15:58
@thekholm80 hey buddy!
Ken Haduch
@khaduch
Nov 10 2017 15:58
@DarrenfJ - hey there, Darren - thanks for stopping by! Hope that you have a great Friday and weekend...
CamperBot
@camperbot
Nov 10 2017 15:58
khaduch sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2266 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Nov 10 2017 15:59
also thanks to all the people who tirelessly stay and help out.. you know who ya'all are
kudos and thanks etc etc..
Kyle Holm
@thekholm80
Nov 10 2017 15:59
right back at ya!
Darren
@DarrenfJ
Nov 10 2017 15:59
@khaduch i'm totally looking forward to the weekend tbh... but it snowed today here
bah!
was hoping for a longer fall
Ken Haduch
@khaduch
Nov 10 2017 16:00
@DarrenfJ - yeah? Wow! They are talking about snow down here, not sure when it might happen, but the forecast is for 17 degrees F tonight...
Kaz Baig
@kbaig
Nov 10 2017 16:01
Snowing in Chicago as well today, though not anywhere further south in IL
Darren
@DarrenfJ
Nov 10 2017 16:01
@artbohr i think it's in the setting of GitHub. to set up master as a published page.. the ghpages still works btw, and i tend to use that since i know it better and keep forgetting what I have to change to get the master to publish...
welcome to winter
i love fall but could do without winter
ok gotta run to my meeting
thanks @khaduch for always being encouraging to us all every day.. it is muchly appreciated
CamperBot
@camperbot
Nov 10 2017 16:03
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3491 | @khaduch |http://www.freecodecamp.com/khaduch
Darren
@DarrenfJ
Nov 10 2017 16:03
and tanks @thekholm80 for just hanging out and being cool
Ken Haduch
@khaduch
Nov 10 2017 16:04
@DarrenfJ :+1:
Darren
@DarrenfJ
Nov 10 2017 16:04
i'll thanks you all gentlemanly && proper in 15 or 20 minutes ;)
later roomies
Daniel
@dkapexhiu
Nov 10 2017 16:07
yes exactly @khaduch when i click that button i have the site non responsive.. thank you
CamperBot
@camperbot
Nov 10 2017 16:07
dkapexhiu sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3492 | @khaduch |http://www.freecodecamp.com/khaduch
Marc
@MWBauer
Nov 10 2017 16:19
@khaduch Hey. Great idea. I was using a paper notebook to keep my work and notes. Even now I'm adding more notes. It seems I may missed some of the lessons along the way. lol
Ken Haduch
@khaduch
Nov 10 2017 16:25
@MWBauer - I like paper notebooks, too, but it's so much easier to cut and paste, and searching is easier in a text file... :)
Darren
@DarrenfJ
Nov 10 2017 17:02
just popping in to say thanks @thekholm80 keep coding on brutha!
CamperBot
@camperbot
Nov 10 2017 17:02
darrenfj sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1591 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Darren
@DarrenfJ
Nov 10 2017 17:04

@Marmiz thanks for the tip man.. that looks very very useful

You can add ?react_perf to the url you are using (probably localhost in dev) and then in the dev tool register performance. Launch an action and you'll see a graph of all the rendering you app is doing

artbohr
@artbohr
Nov 10 2017 17:30
@Marmiz I used this tutorial https://medium.freecodecamp.org/surge-vs-github-pages-deploying-a-create-react-app-project-c0ecbf317089 , to publish to github pages, but I'm not sure that I understand how to publish to master branch instead of ghpages branch, also updating the ghpages branch would be deploying again? because I see they are not in sync or merging the changes from master to ghpages branch? Also I see it like an extra complexity, maybe I'm wrong here, not sure
Marc
@MWBauer
Nov 10 2017 20:30
Need help building a basic regex.
/([A-Z])\w+/g To make this seek out numbers as well, I would /([a-z]), [0-9])\w+/g right?
Stephen James
@sjames1958gm
Nov 10 2017 20:57
@MWBauer /[A-Z0-9]/g this will match a letter or number
/([a-z]), [0-9])\w+/g this will match letter then comma then space then number then \w+
Marc
@MWBauer
Nov 10 2017 21:18
THX
Marc
@MWBauer
Nov 10 2017 21:23
i could use that with a return method, right?
Stephen James
@sjames1958gm
Nov 10 2017 21:28
@MWBauer return? or you mean replace?
Marc
@MWBauer
Nov 10 2017 21:28
MR. STEPHEN JAMES!
:wave:
:cocktail:
Stephen James
@sjames1958gm
Nov 10 2017 21:29
@MWBauer :beer:
Marc
@MWBauer
Nov 10 2017 21:29
How are you?
mmmmm...beer.
Stephen James
@sjames1958gm
Nov 10 2017 21:29
Good
Marc
@MWBauer
Nov 10 2017 21:29
Glad to hear it.
Stephen James
@sjames1958gm
Nov 10 2017 21:29
30 minutes to the weekend
Marc
@MWBauer
Nov 10 2017 21:29
I was just looking thru my notes trying to figure out how I would slip a regex into the middle of something.
function palindrome(str) {
var lowerCase = str.toLowerCase();
var lcArray = Array.prototype.filter.call(lowerCase, function(ch) {
  return "a" <= ch && ch <= "z" || "0" <= ch && ch <= "9";
  });
   /[A-Z0-9]/g
var lcStr = lcArray.join("");
You see the return "a" statement? I think you built that.
Anyways, the shortened form is the regex.
would it be return /A or is there another method?
Stephen James
@sjames1958gm
Nov 10 2017 21:31
@MWBauer You can use regex with a function returning boolean
return //.test(ch);
remember filter is expecting a true/false return
Marc
@MWBauer
Nov 10 2017 21:33
I don't understand this statement. return stops an action and reports. // is for noting something
Stephen James
@sjames1958gm
Nov 10 2017 21:35
@MWBauer // was fill in the regex that you want
Specifically for this case
return /[A-Z][0-9]/g.test(ch);
Marc
@MWBauer
Nov 10 2017 21:36
the return statement works. I'm just trying to find the shorter version.
the regex would do it, but how do I implement it?
Stephen James
@sjames1958gm
Nov 10 2017 21:37
return /[A-Z][0-9]/g.test(ch); replace your return with this is returns true if ch is a number or letter
Marc
@MWBauer
Nov 10 2017 21:37
More than anything, I'm gonna' comment it out just so that I can have the 2 versions available
right
thanks.
Stephen James
@sjames1958gm
Nov 10 2017 21:38
Oops
Marc
@MWBauer
Nov 10 2017 21:38
oops?
Stephen James
@sjames1958gm
Nov 10 2017 21:38
return /[A-Z0-9]/g.test(ch);
remove the ][ in the center
Randell Dawson
@RandellDawson
Nov 10 2017 21:42
@sjames1958gm - since lowerCase contains only lower case values, wouldn't it be
return /[a-z0-9]/g.test(ch);
Stephen James
@sjames1958gm
Nov 10 2017 21:44
@randelldawson Yeah, well with the g flag it doesn't matter functionally, but it would be more semantic,
Randell Dawson
@RandellDawson
Nov 10 2017 21:45
If it were flag i, I could see that.
Stephen James
@sjames1958gm
Nov 10 2017 21:46
oh, duh - my bad you are correct - Friday afternoon space out - :stars:
@MWBauer mea culpa
@randelldawson thx
CamperBot
@camperbot
Nov 10 2017 21:48
sjames1958gm sends brownie points to @randelldawson :sparkles: :thumbsup: :sparkles:
:cookie: 306 | @randelldawson |http://www.freecodecamp.com/randelldawson
Marc
@MWBauer
Nov 10 2017 21:50
@sjames1958gm youa culpa? sounds great sir.
AH! Just looked that up.
Randell Dawson
@RandellDawson
Nov 10 2017 21:58
@MWBauer - I assume you were just testing out use of call on the Array.prototype.filter to make it work, but you could have also used a regex with:
var lcStr = str.toLowerCase().replace(/[^A-Z0-9]/i,"");
Marc
@MWBauer
Nov 10 2017 22:05
@randelldawson that's what I was trying to do. thanks.
CamperBot
@camperbot
Nov 10 2017 22:05
mwbauer sends brownie points to @randelldawson :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @randelldawson |http://www.freecodecamp.com/randelldawson
Marc
@MWBauer
Nov 10 2017 22:09
What does C do in regex?
it looks like i wrote /c^| )/g
does that make sense?
Marc
@MWBauer
Nov 10 2017 22:18

function titleCase(str) {
var lowerCase = str.toLowerCase();
var title = lowerCase.replace(/c^| )[a-z])/g, function(subStr) {
  return subStr.toUpperCase();
});
  return title;
}
I'm getting an invalid regex
Marc
@MWBauer
Nov 10 2017 22:44
anyone here?
regexr says the exp is fine. but when I put it in the editor it doesn't like it