These are chat archives for FreeCodeCamp/Help

24th
Sep 2018
biocoder
@reBiocoder
Sep 24 2018 03:17
How should I do change front-size?
Claudio Restifo
@Marmiz
Sep 24 2018 03:26
@reBiocoder it's a CSS property :)
biocoder
@reBiocoder
Sep 24 2018 03:32
How should i use bootstrap,i hope to combine it with django
@Marmiz
Claudio Restifo
@Marmiz
Sep 24 2018 03:37

@reBiocoder bootstrap is just a CSS library.
You include it in your page like any other CSS file.

According to your needs you load it from a CDN, otherwise you have to download it and add it to your project and serve it like any other file

biocoder
@reBiocoder
Sep 24 2018 03:40
thank you,i think i should learn css
@Marmiz
darrea
@darrea_gitlab
Sep 24 2018 04:31
Can someone help em with something im stuck on
hensn5250
@hensn5250
Sep 24 2018 04:36
on what?
psyperl
@psyperl
Sep 24 2018 04:55
greetings
Joseph
@revisualize
Sep 24 2018 04:55
Hi.
psyperl
@psyperl
Sep 24 2018 04:57
hi there citizen of universe, haven't seen you for a while sir @revisualize
Ai rui 艾瑞
@aisolae
Sep 24 2018 08:00
does anyone know of any tool that could be use to create workflow chart
Aditya
@ezioda004
Sep 24 2018 08:05
@aisolae draw.io is decent.
Ai rui 艾瑞
@aisolae
Sep 24 2018 08:22
thanks @ezioda004
sarvagya3943
@sarvagya3943
Sep 24 2018 09:55
hello
Xarri Jorge
@xarrijorge
Sep 24 2018 10:35
:wave:
psyperl
@psyperl
Sep 24 2018 13:14
it's too quiet :smile:
Kyle Holm
@thekholm80
Sep 24 2018 13:14
this is as loud as i get on Monday mornings
Xarri Jorge
@xarrijorge
Sep 24 2018 13:15
HERE is some noise, literally! @psyperl
psyperl
@psyperl
Sep 24 2018 13:15
@xarrijorge :smile:
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 24 2018 13:54
Hi I'm trying to get data and I'm using React and the error said that this.setState is not a function. What should I suppose to do
?
  componentDidMount() {
    var req = new XMLHttpRequest();
    req.open('GET', 'https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/GDP-data.json', true);
    req.onload = function(json) {
    req.send();
      json = JSON.parse(req.responseText);
      this.setState({
        raw: json,
      })
    }
  }
Aditya
@ezioda004
Sep 24 2018 14:14
@isemaj_gitlab Trailing comma after json, though the error seems different. Also, shouldnt req.send() be outside .onload?
Apparently, the comma gets trimmed, so thats not the problem
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 24 2018 14:22
should I use fetch or XMLHttpRequest?
Aditya
@ezioda004
Sep 24 2018 14:23
fetch/axios would be nice
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 24 2018 14:23
oh ok
Aditya
@ezioda004
Sep 24 2018 14:23
XMLHttpRequest is too legacy at this point, a lot of boilerplate
May Kittens Devour Your Soul
@diomed
Sep 24 2018 14:34
 (•_• )
axios, fetch me Aditya
Kyle Holm
@thekholm80
Sep 24 2018 15:10
let aditya;
try {
  aditya  = await axios.get('Aditya');
} catch (error) {
  console.warn(error);
  process.exit(1);
}
guess i better add some error handling
alpox
@alpox
Sep 24 2018 15:19
@thekholm80 you cannot init const like this and reassign to the variable ;)
Kyle Holm
@thekholm80
Sep 24 2018 15:19
ugh you're right
Aditya
@ezioda004
Sep 24 2018 15:28
@thekholm80 Thats ugly
const handleError = func => (...params) => func(...params).catch(console.error);
async someFunc(){
  const aditya = await axios.get('Aditya');
}
const wrappedFunc = handleError(someFunc);
wrappedFunc();
Kyle Holm
@thekholm80
Sep 24 2018 15:29
.catch() is ugly too
but my code works, because here you are
i dislike it in that axios creates a response object, so the actual call response would be in aditya.data. normally i'd destructure this but i don't think i can do that with an already-declared variable?
maybe
let aditya;
try {
  const { data } = await axios.get('Aditya');
  aditya = data;
}
Aditya
@ezioda004
Sep 24 2018 15:35
That'll do, I normally dont destructure, for some reason I feel like it adds overhead in readability
Christopher McCormack
@cmccormack
Sep 24 2018 15:35
@ezioda004 it does until you use it more then it makes everything read simpler
Kyle Holm
@thekholm80
Sep 24 2018 15:35
i feel it's more clear lol maybe it's just preference?
Christopher McCormack
@cmccormack
Sep 24 2018 15:35
which isn't really that helpful for newbies still
Aditya
@ezioda004
Sep 24 2018 15:36
@cmccormack Thats true, I was considering anyone else reading my code, but I guess at one point you have to assume that people know ES6 stuff
Kyle Holm
@thekholm80
Sep 24 2018 15:37
lol you're using ... and arrow functions
and HOFs, i think they're a lot harder to parse than destructuring
Christopher McCormack
@cmccormack
Sep 24 2018 15:37
yeah if you're already using the other stuff then destructuring fits in really nice
Aditya
@ezioda004
Sep 24 2018 15:37
Out of all ES6 features, destructuring is the most unintuitive
Kyle Holm
@thekholm80
Sep 24 2018 15:38
but, A+ on the HOF. excellent use-case
Christopher McCormack
@cmccormack
Sep 24 2018 15:38
I would agree with that
Aditya
@ezioda004
Sep 24 2018 15:38
@thekholm80 Thanks, I copied
Kyle Holm
@thekholm80
Sep 24 2018 15:38
you should never admit that!
go to the grave swearing it's your own code lol
Christopher McCormack
@cmccormack
Sep 24 2018 15:40
@thekholm80 ever seen this CSS?
html {
  scroll-behavior: smooth;
}
Aditya
@ezioda004
Sep 24 2018 15:40
I'd do that but if something goes wrong, its easy to blame the other person
Kyle Holm
@thekholm80
Sep 24 2018 15:46
@cmccormack i think i came across that a while back, but at the time it was not widely-adopted and kind of buggy
Christopher McCormack
@cmccormack
Sep 24 2018 15:46
may be buggy but a nice to have if smooth scrolling is just that, nice to have
Kyle Holm
@thekholm80
Sep 24 2018 15:47
yeah
Christopher McCormack
@cmccormack
Sep 24 2018 15:48
all the buggy JS out there for that simple task, I hope it becomes adopted in every browser
psyperl
@psyperl
Sep 24 2018 15:55
buggyJS
Luc Martin
@fmartin5
Sep 24 2018 16:00
This repository is empty.
:'(
psyperl
@psyperl
Sep 24 2018 16:01
lol yeah i just made it haha
Christopher McCormack
@cmccormack
Sep 24 2018 16:03
@psyperl what's the plan with BuggyJS? a library of slow setIntervals?
psyperl
@psyperl
Sep 24 2018 16:03
lol
Luc Martin
@fmartin5
Sep 24 2018 16:05
maybe a tool to detect buggy js
May Kittens Devour Your Soul
@diomed
Sep 24 2018 16:06
Screenshot_19.png
D O R C ¥
@Dorcy-ndg3
Sep 24 2018 16:24
Havent been here in over a year and a couple of months... its great to see some people i can remember .. @diomed @Marmiz
May Kittens Devour Your Soul
@diomed
Sep 24 2018 16:28
@Dorcy-ndg3 who are you, person?
unsure why you call me people. I am FCC's pet :cat:
May Kittens Devour Your Soul
@diomed
Sep 24 2018 16:33
oh yeah, I remember you know. you're that guy who has a place in my :heart:
D O R C ¥
@Dorcy-ndg3
Sep 24 2018 16:34
hahahah
My bad
psyperl
@psyperl
Sep 24 2018 16:39
on git status docs .. it says about --ahead-behind .. i am not sure how to use it.. anyone tried that switch before?
psyperl
@psyperl
Sep 24 2018 16:56
nvm i give up .. seems like a bug or changes that i can't see it on my git status even if i switched it on
alpox
@alpox
Sep 24 2018 17:02
@psyperl whats the matter? An error message? Not being able to commit?
psyperl
@psyperl
Sep 24 2018 17:04
@alpox i am trying to get the status of current branch with the upstream .. how many ahead or behind from git status
git status have that switch but for some reason it doesn't work / it doesn't show the information
Christopher McCormack
@cmccormack
Sep 24 2018 17:20
@psyperl do you have to git fetch first?
psyperl
@psyperl
Sep 24 2018 17:21
i did
git log shows the differences
but i saw a post that someone have the info on that ahead/behind with his/her git status
i wonder if it's my version
psyperl @psyperl git version 2.17.1
Henry
@GitHub-Henry
Sep 24 2018 17:34
Any one with some time and an extra set of eyes want to help out a bit. FCC tests say my drum machine passes about 50% of their tests. I think they should pass them all. I'd appreciate another set of eyes to help me see where I'm missing the mark.
May Kittens Devour Your Soul
@diomed
Sep 24 2018 17:37
@GitHub-Henry 3rd and 4th are not good
psyperl
@psyperl
Sep 24 2018 17:37
Test suites are currently optimized for Chrome. There are known issues that we are trying to work through to make these suites fully cross-browser compatible, but it is a work in progress. For the best user experience, please use Chrome until these issues are resolved. Thanks and Happy Coding!
May Kittens Devour Your Soul
@diomed
Sep 24 2018 17:38
lop-lop
Henry
@GitHub-Henry
Sep 24 2018 17:38
I"m using chrome
psyperl
@psyperl
Sep 24 2018 17:39
yes i can't see the result because i didn't use chrome
Henry
@GitHub-Henry
Sep 24 2018 17:40
image.png
@diomed OK, looks fine to me
where's the mistake?
I'm using the chrome react tool and it looks to be in the correct order
May Kittens Devour Your Soul
@diomed
Sep 24 2018 17:44
:cat: can't debug. coz :cat: can't JS
psyperl
@psyperl
Sep 24 2018 17:47
wut? but you are on fcc, you should learn JS @diomed we have everyone that will make fun of you teach you if you are stuck with js here
Henry
@GitHub-Henry
Sep 24 2018 17:47
Some times I miss things so, I wanted another pair of eyes to verify my thought that all the tests should pass.
May Kittens Devour Your Soul
@diomed
Sep 24 2018 17:49
paging JS dr. @thekholm80
Kyle Holm
@thekholm80
Sep 24 2018 17:51
what? where? when?
May Kittens Devour Your Soul
@diomed
Sep 24 2018 17:51
here, now, up
Henry
@GitHub-Henry
Sep 24 2018 17:52
Hi Kyle, got some time to help verify my durm machine? FCC tests say about 50% of it should pass, but I think all of it should. What do you think?
Kyle Holm
@thekholm80
Sep 24 2018 17:53
Each .drum-pad's inner text should be one of the following letters (all letters must be represented): "Q", "W", "E", "A", "S", "D", "Z", "X", "C" : expected [ Array(9) ] to be a superset of [ Array(9) ]
what does your inner text say?
Henry
@GitHub-Henry
Sep 24 2018 17:54
My screen shot above shows all the letters in the correct order
it also shows a .drum-pad class with an inner text of the correct key
Kyle Holm
@thekholm80
Sep 24 2018 17:55
<div id="Q" class="drumpad-container drum-pad" data-key="81">
  Q
  <br>
  <span>Ride</span>
  <audio src="https://res.cloudinary.com/henrys/raw/upload/v1523746538/audio/wav/drumbs/ride.wav" class="clip" id="Q"></audio>
</div>
this does not equal Q
Henry
@GitHub-Henry
Sep 24 2018 17:55
the inner text of the drumpad class has a Q
Kyle Holm
@thekholm80
Sep 24 2018 17:55
it sure does
it also has a lot that isn't Q
Henry
@GitHub-Henry
Sep 24 2018 17:57
the test doesn't say it should only contain those elements
the sample contains more also
image.png
if the sample has other elements, it should be OK, so goes my thinking
waywardchild
@waywardchild2_twitter
Sep 24 2018 18:03
const func = (arr) => {
  let obj = arr.reduce((total, num) => {
    if(num === 0) {
      total["zero"] += 1
    }
    Math.sign(num) === 1 ? total["pos"] += 1 : total["neg"] += 1
    return total
  }, {"pos": 0, "neg": 0, "zero": 0})

  console.log('obj', obj) // says undefined
}
Can anyone help me understand why I get undefined returned in object. Does arr.reduce not return an object?
Henry
@GitHub-Henry
Sep 24 2018 18:06
The tests requirements and the tests don't seem to be a perfect match because things that meet the requirements don't pass, so it seems.
Kyle Holm
@thekholm80
Sep 24 2018 18:06
okay
Aditya
@ezioda004
Sep 24 2018 18:06
@waywardchild2_twitter It seems to be working? Did you mean why console.log() returns undefined?
waywardchild
@waywardchild2_twitter
Sep 24 2018 18:07
Yeah, console.log
psyperl
@psyperl
Sep 24 2018 18:07
@waywardchild2_twitter it works here too
Aditya
@ezioda004
Sep 24 2018 18:07
@waywardchild2_twitter Cause thats how its implemented, any function/method with no return statement implicitly returns undefined.
Henry
@GitHub-Henry
Sep 24 2018 18:07
@thekholm80 do you see a divergence between test requirements and my drum machine?
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:07
one can dream, right? but can there be two modals open at the same time?
Kyle Holm
@thekholm80
Sep 24 2018 18:08
@GitHub-Henry i did, but you don't want to hear it
waywardchild
@waywardchild2_twitter
Sep 24 2018 18:08
@ezioda004 ahhhh
ok thank!!
Henry
@GitHub-Henry
Sep 24 2018 18:08
@thekholm80 ok let me hear it
Kyle Holm
@thekholm80
Sep 24 2018 18:08
so if you're sure you're right, submit an issue on github
Henry
@GitHub-Henry
Sep 24 2018 18:09
where does my drum machine not meet the requirements?
Kyle Holm
@thekholm80
Sep 24 2018 18:09
also, how many times can you use ids in html?
<div id="Q" class="drumpad-container drum-pad" data-key="81">
  Q
  <br>
  <span>Ride</span>
  <audio src="https://res.cloudinary.com/henrys/raw/upload/v1523746538/audio/wav/drumbs/ride.wav" class="clip" id="Q"></audio>
</div>
count your qs
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:10

Q

psyperl
@psyperl
Sep 24 2018 18:10
ha duplicate Q!
Kyle Holm
@thekholm80
Sep 24 2018 18:10
i made my case, i don't want to argue with you. either you hear what i say or you don't. i'm not going to spend my day trying to convince you
psyperl
@psyperl
Sep 24 2018 18:11
@thekholm80 1 , @GitHub-Henry 0
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:11
that's that guy from Star Trek, right?
Henry
@GitHub-Henry
Sep 24 2018 18:11
i missed that, see that's why I need another set of eyes
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:12
@ezioda004 could modal open 2 modals? or a set of modal divs
Henry
@GitHub-Henry
Sep 24 2018 18:13
@thekholm80 thanks
Aditya
@ezioda004
Sep 24 2018 18:13
@diomed Depending on how you've implemented the modal, its possible
You can do modalception
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:13
no point of thanking people anymore, since camperbot is dead
psyperl
@psyperl
Sep 24 2018 18:14
you are right @diomed thanks
Henry
@GitHub-Henry
Sep 24 2018 18:14
@diomed well there is gratitude
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:14
ha! useless
Aditya
@ezioda004
Sep 24 2018 18:14
Pfff, I was init for the brownies
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:14
exactly!
that's what it was all about
psyperl
@psyperl
Sep 24 2018 18:14
about @ezioda004
i honestly forgot about brownies
Aditya
@ezioda004
Sep 24 2018 18:15
Daily reminder: Camper bot died for our bad code
Kyle Holm
@thekholm80
Sep 24 2018 18:16
i make his sacrifice worth it
i'm drowning in bad code
Henry
@GitHub-Henry
Sep 24 2018 18:17
@thekholm80 do you see anything else. I removed the extra Id
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:18
info:
id: 'ezioda004
name: Aditya
nationality: Indian
webpage: https://ezioda004.github.io/
description: nice fellow, always helpful, introvert, possibly insomniac, possibly doesn't go outside
abilites: JS ninja, mad CSS skills ... etc.
FCC value: priceless
Aditya
@ezioda004
Sep 24 2018 18:18
Hey I go outside
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:19
:cat:s in India rarely see you outside
Henry
@GitHub-Henry
Sep 24 2018 18:20
@ezioda004 nice portfolio site
Kyle Holm
@thekholm80
Sep 24 2018 18:20
@GitHub-Henry here's the test code
      it(`Within #drum-machine I can see 9 clickable "drum pad"
      elements, each with a class name of "drum-pad", a unique id that describes
      the audio clip the drum pad will be set up to trigger, and an inner text
      that corresponds to one of the following keys on the keyboard: Q, W, E, A,
      S, D, Z, X, C. The drum pads MUST be in this order.`,
      function() {
        // using .isAtLeast() and .includeMembers() in this challenge so that
        // users have the freedom to add more than 9 drum pads
        let drumPadInnerText = [];
        drumPads.forEach(pad => {
          drumPadInnerText.push(pad.innerText.replace(/\s/g, ''));
          assert.strictEqual(
            pad.hasAttribute('id'),
            true,
            'Each .drum-pad element must have an id attribute '
          );
        });
        assert.isAtLeast(
          drumPads.length,
          9,
          'There should be at least 9 elements with the class "drum-pad" '
        );
        // drumPadInnerText is the superset, the array of letters is the subset.
        assert.includeMembers(
          drumPadInnerText,
          [ 'Q', 'W', 'E', 'A', 'S', 'D', 'Z', 'X', 'C' ],
          'Each .drum-pad\'s inner text should be one of the following ' +
          'letters (all letters must be represented): "Q", "W", "E", "A", ' +
          '"S", "D", "Z", "X", "C" '
        );
      });
the last assert is where you're failing
Aditya
@ezioda004
Sep 24 2018 18:21
@GitHub-Henry Thanks
Henry
@GitHub-Henry
Sep 24 2018 18:21
each drum pad has that inner text in that order, so i'm not understanding.
psyperl
@psyperl
Sep 24 2018 18:22
how much did you pay for that @ezioda004 ?
May Kittens Devour Your Soul
@diomed
Sep 24 2018 18:22
@ezioda004 make me Overlapped Bar Chart
Henry
@GitHub-Henry
Sep 24 2018 18:22
the sample has other elements so I'm not sure why my other elements should matter
Aditya
@ezioda004
Sep 24 2018 18:22
@psyperl 2 weeks of no_lifeing
psyperl
@psyperl
Sep 24 2018 18:22
lol
Aditya
@ezioda004
Sep 24 2018 18:23
@diomed Oh no highschool flashbacks, I loathe statistics
Henry
@GitHub-Henry
Sep 24 2018 18:26
@thekholm80 so, i'm assuming you don't see anything else that seems to be an issue?
Kyle Holm
@thekholm80
Sep 24 2018 18:27
i see that the test isn't passing and i've read the code for the test
Henry
@GitHub-Henry
Sep 24 2018 18:28
I see that the .drum-pad has inner text in the correct order, any other places that need looking at
Aditya
@ezioda004
Sep 24 2018 18:28
Is drumPads, .drum-pad?
Henry
@GitHub-Henry
Sep 24 2018 18:28
i use drum-pad
DrumPad is the name of my react element, drum-pad is the name of the class I use for test requirements
Aditya
@ezioda004
Sep 24 2018 18:30
Probably remove that <span> since text from that will also be included in the innerText of .drum-pad
Henry
@GitHub-Henry
Sep 24 2018 18:31
I removed the span and other stuff
Aditya
@ezioda004
Sep 24 2018 18:32
Oh, I was looking at the link you posted
Weird, first it passes 6/8 tests afterwards it passes 4/8
Henry
@GitHub-Henry
Sep 24 2018 18:33
I removed the span and br and test #3 still fails
See anything else that needs addressing where requirements are not met?
Since removing the span br elements didn't change the results of any of the tests, I put them back
Henry
@GitHub-Henry
Sep 24 2018 18:38
The Id issue has been fixed.
Kyle Holm
@thekholm80
Sep 24 2018 18:39

i edited the html to

<div class="drum">
  <div id="Q" class="drumpad-container drum-pad" data-key="81">
    Q
    <audio src="https://res.cloudinary.com/henrys/raw/upload/v1523746538/audio/wav/drumbs/ride.wav" class="clip" id="Q"></audio>
  </div>
  ...
</div>

and it passed, so the test has issues with all the extra stuff

err let me edit that
Henry
@GitHub-Henry
Sep 24 2018 18:39
that's weird, i removed the span and br and still didn't pass
i'll try again
Kyle Holm
@thekholm80
Sep 24 2018 18:40
you can extrapolate from that
Henry
@GitHub-Henry
Sep 24 2018 18:40
@thekholm80 you really like the word extrapolate
@thekholm80 kyle, the master JS ninja is correct again, thanks
Kyle Holm
@thekholm80
Sep 24 2018 18:45
i think we all make assumptions about our code. in TDD (like this) it's probably not a good idea to assume that because something works, it should pass the tests. the two things can be mutually exclusive
well, no that was poorly expressed. on a Venn diagram all code that passes the tests will work, but not all code that works will pass the tests
Henry
@GitHub-Henry
Sep 24 2018 18:46
another set of eyes is helpful
Kyle Holm
@thekholm80
Sep 24 2018 18:48
and honestly it could be something as simple as removing the <div> elements you wrapped around each <div id="..." class="drumpad-container drum-pad" ...> element
Henry
@GitHub-Henry
Sep 24 2018 18:49
i'll tinker with that, appreciate the tips
nearmint
@nearmint
Sep 24 2018 19:02
Is there always someone here to help? :)
That's amazing
Kyle Holm
@thekholm80
Sep 24 2018 19:08
i know why @ezioda004 never leaves home
Aditya
@ezioda004
Sep 24 2018 19:12
@thekholm80 Word to liveby, I'm definitely getting one of those
Edward Haigh
@AnOxfordDev
Sep 24 2018 19:14
@ezioda004 - I love your portfolio site, it's awesome
Aditya
@ezioda004
Sep 24 2018 19:16
@AnOxfordDev Thanks
darrea
@darrea_gitlab
Sep 24 2018 20:40
could i possible pick someones brain
this is what im doing wrong
Make sure your form has an action attribute which is set to /submit-cat-photo
May Kittens Devour Your Soul
@diomed
Sep 24 2018 20:43
@darrea_gitlab what's your code for that?
darrea
@darrea_gitlab
Sep 24 2018 20:43
<form action=/"submit-cat-photo"> <input type="text" placeholder="cat photo URL"></form>
May Kittens Devour Your Soul
@diomed
Sep 24 2018 20:46
look where your slash is /
action="/submit-cat-photo"
darrea
@darrea_gitlab
Sep 24 2018 20:47
wow
lol
May Kittens Devour Your Soul
@diomed
Sep 24 2018 20:47
yup
darrea
@darrea_gitlab
Sep 24 2018 20:47
thank you