These are chat archives for FreeCodeCamp/Help

26th
Jun 2015
Lightwaves
@Lightwaves
Jun 26 2015 00:02
change the pattern to /\W/g
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:04
guys if i want to store my even numbers in an array? how could i do it?
rtrom
@rtrom
Jun 26 2015 00:05
@Lightwaves thanks! Still getting some syntax errors though-"Unexpected token ("
Robert Ozimek
@robertozimek
Jun 26 2015 00:08
@rtrom your reverse function is the issue
its got a dot between it and the () reverse() instead of reverse.()
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:09
got it to work!!
var myrandom = function () {
    var maximum = [];
    var myEvenValues = [];
    for (var i=0; i < 3; i++) {
        //Generates the 3 numbers
        maximum.push(Math.floor(Math.random()*100));     
        console.log ('The numbers between 40 and ' + maximum[i]);
        for (var x=40; x<maximum[i]; x++) {
            //even numbers
            if (x%2 === 0) {
            myEvenValues.push(x);
            }
        } console.log(myEvenValues);

    };
console.log ('The three numbers are: ' + maximum);
}
myrandom();
rtrom
@rtrom
Jun 26 2015 00:09
@robertozimek Thanks a ton!
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:12
blob
guys need help. This code often work and often does the even numbers for values under 40... why is this?
Lightwaves
@Lightwaves
Jun 26 2015 00:14
it's the way you you wrote the second for loop
Moisés Man
@moigithub
Jun 26 2015 00:15
im at calculator zipline.. but i dont know how to use the % button
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:16
how is the for loop getting through the logical statement x<maximum[i] when clearly maximum[i] represents a number less than 40?
Moisés Man
@moigithub
Jun 26 2015 00:17
if i do... 100 x 10 % <-- this is easy.. 10% = 0.1 x 100 = 10
but if i do 100 + 10% <-- this gimme 111.1111111 .. so what the ... goin on! ? :)
Robert Ozimek
@robertozimek
Jun 26 2015 00:18
@AlfonB6 yeah but you start from x = 40 and counting up
Tom DeFrank
@TomDeFrank
Jun 26 2015 00:18
avoid floats moig
try .1 + .1 + .1 :)
Robert Ozimek
@robertozimek
Jun 26 2015 00:20
@AlfonB6 you may want to be decrementing not incrementing so i— rather than i++ and x < maximum[i] to x > maximum
x > maximum[i]*
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:24
nope still not working with
for (var x=40; x > maximum[i]; x--)
Robert Ozimek
@robertozimek
Jun 26 2015 00:24
actually now that I took a close look at your code, I see the issue is that x > maximum[i]
in the case of 40 and 2
so your loop just fails because x=40 is less than maximum[i]
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:27
i want it to fail
and not go through the loop for the numbers that are smaller than 40
Robert Ozimek
@robertozimek
Jun 26 2015 00:28
ahh I see
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:28
that is why i think x < maximum[i] will hit true and run for numbers bigger than 40
and run a single line for numbers bellow 40 obtained from maximum[i]
Robert Ozimek
@robertozimek
Jun 26 2015 00:29
well its the direct copy of the array before it
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:30
yeah so number above 40 hit true in the for loop and start storing in the array; stop when over maximum[i]
but if maximum[i] initially is smaller then 40 (x<maximum[i] is false) the loop should not be run and jump to call the empty array
Robert Ozimek
@robertozimek
Jun 26 2015 00:32
I see so you need to do a test in the beginning of the outer for loop and make sure it breaks out of the loop if the number is less than 40
because only your second loop fails not your first one
and you still have the console.log outside of the second loop so they will print those results whether the second loop fails or not
for(var i=0; i < 3; i++) {
        //Generates the 3 numbers
    maximum.push(Math.floor(Math.random()*100));
    if(maximum[i] < 40) {
         break;
    }
…
@AlfonB6
jhillix
@jhillix
Jun 26 2015 00:42
I probably shoulda asked this here:
Anybody else having issues with the codecademy link in "Waypoint: Trigger jQuery Effects"? When I click the link the page locks up. I'm using Safari Version 8.0.6 (10600.6.3
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:42
@robertozimek thank you! you are right, it used the previously filled array. I put the empty array outside the for loop so it gets empty every maximum[i]
Robert Ozimek
@robertozimek
Jun 26 2015 00:45
@jhillix I just tested it using the Safari using the same version and build and workds fine for me
glad you found the solution
jhillix
@jhillix
Jun 26 2015 00:47
Hrm, okay, thanks @robertozimek
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 00:53
@robertozimek could you help me with the rest of the excercises? from: http://ynonperek.com/javascript-exer.html
im on number 4 of 10
Robert Ozimek
@robertozimek
Jun 26 2015 00:56
@AlfonB6 yeah sure, so for this next one its pretty simple, you just reverse the for loop
maybe would be better to create a function that does the second for loop and that way you can easily flip the numbers
Scott
@macengr
Jun 26 2015 01:57

So today I did the Roman Numeral bonfire successfully, but I think I brute forced it - here's my code, is there a more elegant way to do it... ```
function convert(num) {
var digits = (num).toString(10).split("").reverse();
var romNum = "";

if (parseInt(digits[0]) == 9) {
romNum = "IX";
} else if (parseInt(digits[0]) == 8) {
romNum = "VIII";
} else if (parseInt(digits[0]) == 7) {
romNum = "VI";
} else if (parseInt(digits[0]) == 6) {
romNum = romNum + "VI";
} else if (parseInt(digits[0]) == 5) {
romNum = "V";
} else if (parseInt(digits[0]) == 4) {
romNum = "IV";
} else if (parseInt(digits[0]) == 3) {
romNum = "III";
} else if (parseInt(digits[0]) == 2) {
romNum = "II";
} else if (parseInt(digits[0]) == 1) {
romNum = "I";
} else {
romNum = romNum;
}

var romNum1 ="";

if (parseInt(digits1) == 3) {
romNum1 = "XXX";
} else if (parseInt(digits1) == 2) {
romNum1 = "XX";
} else if (parseInt(digits1) == 1) {
romNum1 = "X";
} else {
romNum1 = "";}

var romNum2 = romNum1 + romNum;

return romNum2;
}

convert(5);
'''

Ken
@cruzken
Jun 26 2015 02:06
wow im about to start the roman numeral one. was about to do a brute force way as well
Alfonso Balsera Martinez
@AlfonB6
Jun 26 2015 02:23
hello guys. who can review my code and help me not repeat my self?
var myrandom = function () {
    //Random number between 1000 and 999
    var myNum = Math.floor(Math.random() * (9e3 - 1e3)) + 1e3;
    //Each digit into a value of the array
    var myarr = myNum.toString().split('');
    //This is where the digits are going to be summed
    var digitSumRestul = 0;
    console.log ('The number is: ' + myNum); 

    for (var i = 0; i < myarr.length; i++) {
        digitSumRestul += parseInt(myarr[i]);    //Loop each value, turn it into a number, and add it.
     }
    console.log('The sum of the digist are: ' + digitSumRestul);

    var lastDigit = digitSumRestul.toString().split(''); //Same process as before, in this case i use digitSumRestul instead of a random number :( 
    var lastDigitResult = 0;
    for (var x = 0; x < lastDigit.length; x++) {
        lastDigitResult += parseInt(lastDigit[x]);
    } 
    console.log('The sum of the sum is: ');

    return lastDigitResult;

}
myrandom();
Cody Welsh
@CWelshE
Jun 26 2015 03:00
Is there a typo on the second Convert HTML Entities test? It says assert.strictEqual('<>', '<>', 'should escape characters'); instead of assert.strictEqual(convert('<>'), '<>', 'should escape characters');.
@macengr I did it like this:
function convert(num) {
  var numOfX = Math.floor(num / 10);
  var numOfEtc = num % 10;
  var retStr = "";
  var romanNums = {1: "I", 2: "II", 3: "III",
                   4: "IV", 5: "V", 6: "VI",
                   7: "VII", 8: "VII", 9: "IX"};
  for (var i = 0; i < numOfX; i++)
  {
    retStr += "X";
  }
  retStr += romanNums[numOfEtc];
  return retStr;
}
Mathieu Roy
@Mathieu-Roy
Jun 26 2015 03:12
@CWelshE yes, there's a typo
Cody Welsh
@CWelshE
Jun 26 2015 03:12
Aww mannnn
I guess I'll skip that one for now
@terakilobyte probably knows and has fixed it already :P
Nathan
@terakilobyte
Jun 26 2015 03:14
yeah it's primed and fixed on staging branch in our repo
save your code and skip it for now, revisit in a few days
sorry!
Cody Welsh
@CWelshE
Jun 26 2015 03:14
No problem :P
Terrell Vest
@MirPresT
Jun 26 2015 04:08
Is the SumAll Primes bonfire working correctly?
test wise ...
Steven Elrod
@ske88
Jun 26 2015 04:15
I need help please with "Override Styles with !important" - I have 5 out of 6 parts correct, but my h2 element is not red.
Rasheed Bustamam
@abustamam
Jun 26 2015 04:19
post your code please? @ske88
Steven Elrod
@ske88
Jun 26 2015 04:19

<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>

<style>
.red-text {
color: red;
}
h2 !important: .urgently-red { color: red !important;} .blue-text {color: blue;} {font-family: Lobster, Monospace;}

p {
font-size: 16px;
font-family: Monospace;
}
</style>

<h2 class='blue-text urgently-red'>CatPhotoApp</h2>

<p class='red-text'>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class='red-text'>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Timothy Touch
@timtouch
Jun 26 2015 04:30
@ske88 put ``` the lines before and after your code to format it
` is the key above tab
Steven Elrod
@ske88
Jun 26 2015 04:33
at the top and very bottom of all code put 3 of them?
Timothy Touch
@timtouch
Jun 26 2015 04:35
Have a separate line for them
Steven Elrod
@ske88
Jun 26 2015 04:35
great thanks
Timothy Touch
@timtouch
Jun 26 2015 04:37
also, you don't put the !important: before the .urgently-red
Steven Elrod
@ske88
Jun 26 2015 04:42
There may be a glitch because the text still isn't red, it's blue
Soham
@appfobia
Jun 26 2015 04:51
@FreeCodeCamp Is there any way I can show my JS streak map (http://www.freecodecamp.com/map) of freecodecamp to others (outside freecodecamp). Because I can only see it after logging in.
Rasheed Bustamam
@abustamam
Jun 26 2015 04:52
you have reverse.()
oops
Soham
@appfobia
Jun 26 2015 05:27
var Iam = testing;
Stephanie Morrison
@Stephaceae
Jun 26 2015 06:11
Hoping for help: I’m at Waypoint: Wrap an Anchor Element within a Paragraph.
I believe I have successfully ‘wrapped’ my a element in my new p element… but the challenge won’t check that point off...
Screen Shot 2015-06-26 at 4.12.54 pm

hmm:

<p>click here for <a www.catphotoapp.com> cat photos.</a> </p>

Stephanie Morrison
@Stephaceae
Jun 26 2015 06:18
Nevermind. Got it… they wanted it all to be in the same section!
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 07:45
Hi, I’m struggling with the Convert HTML entities Bonfire

```
function convert(str) {
return str.replace(/&/, "&AMP");
}

convert('Dolce & Gabbana');

function convert(str) {
  return str.replace(/&/, "&AMP");
}

convert('Dolce & Gabbana');
for some reason, this doesn’t pass the test I’m working.
Eko Julianto Salim
@ekojsalim
Jun 26 2015 07:48
@edgarshurtado try using &amp;
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 07:48
I’m suppose to change the character “&" to its HTML entity, but it’s not working
I did, same result
@ekojsalim is the same, doesn’t work =(
Eko Julianto Salim
@ekojsalim
Jun 26 2015 07:49
probably your regex then
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 07:50
Captura de pantalla 2015-06-26 a la(s) 09.49.34.jpg
Eko Julianto Salim
@ekojsalim
Jun 26 2015 07:50
@edgarshurtado return str.replace(/\&/, "&amp;");
that is the correct version
you need to escape the &
and use &amp;
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 07:50
ooh
right
thank you so much ekojsalim
Eko Julianto Salim
@ekojsalim
Jun 26 2015 07:51
np :)
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 07:51
@ekojsalim
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:04
same problem with the symbols “>” and “<“. I already tried to scape them, but doesnt work =(
Terrell Vest
@MirPresT
Jun 26 2015 08:07
anyone up right now willing to give me some guidance on the lowest common multiple bonfire... spent two hrs creating a solution only to find out why the whole method would only work for certain ranges....
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:09
I haven’t get there yet, soz @MirPresT
Eko Julianto Salim
@ekojsalim
Jun 26 2015 08:11
@edgarshurtado what is your problem wit the < and >?
@MirPresT can youtell me your current approach ?
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:12
same as before, but this time i tried escaping characters as well
when I have to test ’<>'
Terrell Vest
@MirPresT
Jun 26 2015 08:13
@ekojsalim yes ...
Vos
@KrisVos130
Jun 26 2015 08:15
@MirPresT Yeah I can give you some guidance on that bonfire
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:15
function convert(str) {
  str = str.replace(/\&/, "&amp;");
  str = str.replace(/>/, "&gt;");
  str = str.replace(/</, “&lt;");

  return str;
}

convert('Dolce & Gabbana');
the same thing as before, but it didn’t pass the test. I’ve tried already escaping < and >
Eko Julianto Salim
@ekojsalim
Jun 26 2015 08:19
@edgarshurtado hmmm I think the bonfire is bugged
the github repo says the answer is &lt;&gt;
which is your answer
Freddy
@Lemony-Andrew
Jun 26 2015 08:19
Has anyone here done the Time Server in learnyounode?
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:19
yes, it’s weird.
Eko Julianto Salim
@ekojsalim
Jun 26 2015 08:19
yeah, I think some people mentioned that this is bugged too
Freddy
@Lemony-Andrew
Jun 26 2015 08:20
What is bugged too?
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:20
Ok, Should I report it on github?
Freddy
@Lemony-Andrew
Jun 26 2015 08:20
@edgarshurtado no need, it's been reported plenty of times
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:20
ok, so I should just jump over?
Freddy
@Lemony-Andrew
Jun 26 2015 08:21
jump on over
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:22
ok , thank you. I hope they fix it in order to finish the whole curriculum. Imagine that we can’t do our final project due to a bug xD
Freddy
@Lemony-Andrew
Jun 26 2015 08:22
That isn't true! As long as you understand what you're doing you'll be just fine.
Edgar S. Hurtado
@edgarshurtado
Jun 26 2015 08:23
but the button to join a Non-profit project is just available when you’ve finished the whole curriculum
Freddy
@Lemony-Andrew
Jun 26 2015 08:23
By the time you've reached the buttom I'm sure you'll be able to start
bottom*
Even if you have some deficiency
Athul Ganesh
@athul777
Jun 26 2015 10:27

Hey guys, I had a conceptual question regarding CSS positioning and layouts. I was trying to use only boxes to practice creating a layout for a site and I encountered a strange problem:
'''

<html>
<head>
<link rel='stylesheet' href='TestProject.css' type='text/css'>
<link rel='stylesheet' href='bootstrap.css'>
<title>
Test Website
</title>
</head>
<div class='some-weird-box-thing'>
<body>
<div class='head-box'>
<div class = 'box1'>
</div>
<div class = 'box2'>
</div>
</div>

        <div class='body-box'>
            <div class = 'box3'>
            </div>
            <div class = 'box4'>
            </div>
            <div class = 'box5'>
            </div>
        </div>    

    </body>
</div>

</html>
'''
Here is the corresponding stylesheet:
'''
.head-box {
background-color: black;
width: auto;
height: auto;
display: flex;
}

.box1 {
background-color: red;
height: 300px;
flex: 1;
}

.box2 {
background-color: green;
height: 300px;
flex: 3;
}

.body-box {
margin-top: 50px;
margin-right: 200px;
margin-left: 200px;
margin-bottom: 100px;
width: auto;
display: flex;
}

.box3 {
background-color: yellow;
height: 550px;
margin-right: 50px;
flex: 2;
}

.box4 {
background-color: blue;
height: 550px;
margin-left: 50px;
margin-right: 50px;
flex: 2;
}

.box5 {
background-color: gray;
height: 550px;
margin-left: 50px;
flex: 2;
}

body {
background-color: black;
}
'''

The main issue was that the background of the body (which I set as black) was not displayed anywhere on my page.
Here is a picture of the results page:

Screen Shot 2015-06-26 at 3.12.18 am.png
As you can see, the black background is not to be seen. I don't understand why this is?
Any help would be appreciated! Thanks in advance!
Destino Dello
@destino92
Jun 26 2015 10:29
hello world can anyone help me with the Spinal Tap Case bonfire please?
function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  var str = str.charAt(0).toLowerCase() + str.slice(1);

  return str.replace(/\s?_?([A-Z])/g,function(match,$1){
    return '-'+ $1.toLowerCase();
  });
}
jrtmns
@jrtmns
Jun 26 2015 10:59
is there just a thing as \w+? in regex?
nevermind
kick0n
@kick0n
Jun 26 2015 11:29
@athul777 - try setting .body-box <div>'s background-color to black.
Destino Dello
@destino92
Jun 26 2015 11:29
@jrtmns thanks for the head up but it still confusing i still have to do something about the first word
jrtmns
@jrtmns
Jun 26 2015 11:31
?
Destino Dello
@destino92
Jun 26 2015 11:32
@jrtmns
function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

  return str.replace(/\s?_?(\w+)/g,function(match,$1){
    var word = $1.charAt(0).toLowerCase() + $1.slice(1);
    return '-'+ word;
  });
}
did you just plant a seed of confusion in my mind
jrtmns
@jrtmns
Jun 26 2015 11:34
ah no I didn't notice the regex in your function there, was talking to myself
sorry for the confusion
you're ahead of me so can't help you at this point
Rasheed Bustamam
@abustamam
Jun 26 2015 11:35
@athul777 can you make a jsfiddle?
@destino92 that's an interesting way of doing it... keep in mind '-' + word will always return -sentences-like-this
I was able to get all cases except for camelCase to pass with this..
return str.toLowerCase().replace(/\s/g, '-').replace(/\_/g, '-');
i'll let you figure out how to get camelcase to pass :)
Athul Ganesh
@athul777
Jun 26 2015 11:40
@kick0n Thanks for your suggestion, but it didn't work.
This was the result:
Screen Shot 2015-06-26 at 4.39.53 am.png
I tried using the div some-weird-box-thing by using the code:
.some-weird-box-thing {
background-color: black;
}
and got this:
Screen Shot 2015-06-26 at 3.18.08 am.png
@abustamam I ran my original code on JSFiddle and it worked fine:
Screen Shot 2015-06-26 at 4.44.35 am.png
kick0n
@kick0n
Jun 26 2015 11:45
@athul777 The .some-weird-box-thing <div> is outside of your body. That's why setting its background to black works on fiddle. Try removing it completely and your original code should work
Athul Ganesh
@athul777
Jun 26 2015 11:45
@abustamam Now I have no idea what the issue was. How is it that JSFiddle and my browser showed different results?
Rasheed Bustamam
@abustamam
Jun 26 2015 11:47
can you share the link to your jsfiddle?
ill check it later @athul777 , @mention me so i remember to check :P
Athul Ganesh
@athul777
Jun 26 2015 11:52
@kick0n It didn't work, removing the div didn't have any effect in either JSFiddle or my browser.
sure, thanks @abustamam , I'll need to create a JSFiddle account
Destino Dello
@destino92
Jun 26 2015 11:56
@abustamam thanks will let you if i knock it
kick0n
@kick0n
Jun 26 2015 12:41
@athul777 it seems that for some reason, bootstrap's css for <body> background-color isn't being overidden by your custom css. problem can be simply solved by using !important.

body {
background-color: black !important;
}

.head-box {
background-color: black;
width: auto;
height: auto;
display: flex;
}

.box1 {
background-color: red;
height: 300px;
flex: 1;
}

.box2 {
background-color: green;
height: 300px;
flex: 3;
}

.body-box {
margin-top: 50px;
/margin-right: 200px;
margin-left: 200px;
margin-bottom: 100px;
/
width: auto;
display: flex;
}

.box3 {
background-color: yellow;
height: 550px;
margin-right: 50px;
flex: 2;
}

.box4 {
background-color: blue;
height: 550px;
margin-left: 50px;
margin-right: 50px;
flex: 2;
}

.box5 {
background-color: gray;
height: 550px;
margin-left: 50px;
flex: 2;
}

<!DOCTYPE html>

<html>
<head>
<link rel='stylesheet' href='TestProject.css' type='text/css'>
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<title>
Test Website
</title>
</head>

<body>
<div class='head-box'>
<div class = 'box1'>
</div>
<div class = 'box2'>
</div>
</div>

<div class='body-box'>
<div class = 'box3'>
</div>
<div class = 'box4'>
</div>
<div class = 'box5'>
</div>
</div>

</body>


</html>

hope this helps.
Steven Elrod
@ske88
Jun 26 2015 12:52
<h2 class='blue-text urgently-red'>This is a test!!! No questions...</h2>
Colin H.
@clnhll
Jun 26 2015 13:09
should I use socket.io for the bonus part of the third basejump
Alex Khomenko
@Clarity-89
Jun 26 2015 13:34
Hello, can anyone help me with Make a Person bonfire?
I don't get how to make getFirstName() ethod to return name if I didn't defined it via this.firstName
RaissaHughes
@RaissaHughes
Jun 26 2015 14:24

Hey guys... i just have a silly question...

say i have 2 diff variables.. computerChoice & userChoice... then later when i use my compare and select choice1, & choice2..... does the computer automatically know there are 2 diff ones... kinda confused... im a layman im sorry!!

Ariel
@ArielLeslie
Jun 26 2015 14:49
@RaissaHughes I'm confused by your question. Do you want to send me your code in a PM and show me what you mean?
RaissaHughes
@RaissaHughes
Jun 26 2015 14:49
@arielleslie yes please :)
Edward Fridie
@efridie
Jun 26 2015 15:07
Bootstrap ? -Waypoint: Add Font Awesome Icons to our Buttons. Do you keep the current class when you "Add an i element with the classes "fa" and "fa-thumbs-up" ?
Ariel
@ArielLeslie
Jun 26 2015 15:10
This message was deleted
@efridie Keep what you've already done. Just add to it.
Robert Lin
@Rlin415
Jun 26 2015 15:17
anyone interested in pairing up for Map the Debris?
Edward Fridie
@efridie
Jun 26 2015 15:19
This is probable easier than I am making it. <button class='btn btn-block btn-primary' <i class="fa fa-thumbs-up"></i>>Like</button> What am I doing wrong?
thegluestickman
@thegluestickman
Jun 26 2015 15:21
there's no ending > on your first button tag
Edward Fridie
@efridie
Jun 26 2015 15:22
Thanks
thegluestickman
@thegluestickman
Jun 26 2015 15:22
no problem!
TopEgret
@topegret
Jun 26 2015 15:31
Hi everyone, for the Bonefire :Diff Two Arrays. my code passed all the tests except the last one, it says "assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');... empty array: expected [] to deeply equal [ Array(3) ]. "
Any idea how to return an array +any empty array?
TopEgret
@topegret
Jun 26 2015 15:46
Hi... never mind, got the bug fixed.
if(arr1.length==0 ||arr2.length==0){
newArr = arr1.concat(arr2);
return newArr;
BL Hill
@montythemack
Jun 26 2015 16:17
function sym(args) {
  var arr = [];
  var newArr=[];

  for(var x in arguments){
    arr.push(arguments[x]);
  }
  var flattened = arr.reduce(function(a, b) {
  return a.concat(b);
});

  for(var i = 0; i < flattened.length; i++){
    if(flattened.indexOf(flattened[i]) === flattened.lastIndexOf(flattened[i])){
      newArr.push(flattened[i]);
    }
  }

  return newArr;
}
sym([1, 2, 5], [2, 3, 5], [3, 4, 5]);
Bonfire: Symmetric Difference. Anyone know why this won't pass?
Moisés Man
@moigithub
Jun 26 2015 16:18
result should be.. [1,4] @montythemack
BL Hill
@montythemack
Jun 26 2015 16:18
correct but it's not passing the tests?
Moisés Man
@moigithub
Jun 26 2015 16:19
so u checked result is correct.. as array.. not object
add some console.log to ur code..
BL Hill
@montythemack
Jun 26 2015 16:20
the directions are to return an array... @moigithub
Moisés Man
@moigithub
Jun 26 2015 16:21
what this does ?? flattened.lastIndexOf(flattened[i])
BL Hill
@montythemack
Jun 26 2015 16:22
checks to see if the number is in the array more than once
"Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays."
Moisés Man
@moigithub
Jun 26 2015 16:24
so.. ur code flatten arrays, find unique and push in newArr
BL Hill
@montythemack
Jun 26 2015 16:27
yes @moigithub
Moisés Man
@moigithub
Jun 26 2015 16:33
code looks good.. tested on repl.it and works.. dont know why not passing tests.. (wich one exactly not passing ?? )
Jessi L Wasell
@JessiW
Jun 26 2015 16:34
Hi - I'm working on Bonfire: Mutations - all of the tests are returning correct except two that were supposed to return true and are returning false instead. Could someone look at my code?
function mutation(arr) {
  var arrZero = arr[0].toLowerCase();
  var arrOne = arr[1].toLowerCase();
  var answer = 0;

  for(var i = 0;i<arrOne.length; i++) {

    if(arrZero.indexOf(arrOne[i])) {
      return true;
  }
  else {
    return false;
    }
  }
}
mutation(['hello', 'hey']);
I just took var answer out - realized I wasn't using it at all - still the same result though :)
Lightwaves
@Lightwaves
Jun 26 2015 16:35
could your logic be flipped?
Jessi L Wasell
@JessiW
Jun 26 2015 16:36
what do you mean?
Lightwaves
@Lightwaves
Jun 26 2015 16:36
my brain is currently mush
sec
Jessi L Wasell
@JessiW
Jun 26 2015 16:36
okay
Lightwaves
@Lightwaves
Jun 26 2015 16:37
oh wait indexOf doesn't return truthy values
Jessi L Wasell
@JessiW
Jun 26 2015 16:37
okay - why not? hadn't read that....
Lightwaves
@Lightwaves
Jun 26 2015 16:38
it returns the index not if it exist
Bleh bad explaination if it exist it returns the index otherwise it returns -1
Jessi L Wasell
@JessiW
Jun 26 2015 16:38
that's right - I remember that now...
so should I change my return true and return false statements?
Justin Walters
@FFX01
Jun 26 2015 17:09
Anyone know how to get past the bug on bonfire: "Convert HTML Entities"?
I've been trying to fix the assertion function, but it's not working.
FreeCodeCamp/freecodecamp#1123
EngineeredEdge
@EngineeredEdge
Jun 26 2015 17:19
Alright FCC, I'm on my first zipline and I'm having a little trouble. I'm not sure if it's a scoping issue, an order of operations issue, or something else. does anyone have a minute?
@FFX01 i believe ther eis a bug with that
bonfire
the less than / greater than don't work, correct?
Justin Walters
@FFX01
Jun 26 2015 17:20
@EngineeredEdge : Yeah. I just submitted a report to the repository. Check it out: FreeCodeCamp/freecodecamp#1123
EngineeredEdge
@EngineeredEdge
Jun 26 2015 17:20
@FFX01 i've seen this problem a few times in the past week
Justin Walters
@FFX01
Jun 26 2015 17:21
@EngineeredEdge Any Idea how to force the test to pass?
EngineeredEdge
@EngineeredEdge
Jun 26 2015 17:21
nay, just move on and come back in a week or so
by move on i mean, go to the next bonfire
FCC doesn't force you to complete them in order
Justin Walters
@FFX01
Jun 26 2015 17:23
@EngineeredEdge did not know that. Will do. thank you.
Carsten Jaksch
@kris4de
Jun 26 2015 17:54
To all german speaking campers: Please help us (me :smile: ) translate FCC. https://trello.com/b/m7zhwXka
Stjepan Mazalovic
@stjema
Jun 26 2015 18:47
@greasan how can i help? where to translate?
http://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/4?curriculum_id=506324b3a7dffd00020bf661#
var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "(206) 555-5555"
    }


    steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: "(206) 555-551"
    };
};
i need help to here. objects array - SyntaxError: Unexpected identifier
Justin Walters
@FFX01
Jun 26 2015 18:49
@stjema you need a comma after the closing "{" for bill.
@stjema also, you don't need the semi colon after the closing bracket for steve.
Stjepan Mazalovic
@stjema
Jun 26 2015 18:50
comma where?
oO
{ is opening?
Carsten Jaksch
@kris4de
Jun 26 2015 18:50
@stjema You will find all information in the linked Trello board, within the list "Notes". You should be able to use Git, if you want to contribute.
number: "(206) 555-5555"
}, <-
There. :smile:
Stjepan Mazalovic
@stjema
Jun 26 2015 18:51
ah thanks
@greasan ..... the steps are too much for translating that stuff..... that is non-productive
let me make a .txt file and i will do it
oh no wait xD that was for programming
Carsten Jaksch
@kris4de
Jun 26 2015 18:56
Huh?
Stjepan Mazalovic
@stjema
Jun 26 2015 18:56
what are JSON files??
Carsten Jaksch
@kris4de
Jun 26 2015 18:58
JavaScript Object Notation. Like XML, but made for JavaScript.
Justin Walters
@FFX01
Jun 26 2015 19:01
@stjema Sorry, meant "}"
Stjepan Mazalovic
@stjema
Jun 26 2015 19:01
i know html for years and still don't know what xml is xD
MDN is a very useful site.
Stjepan Mazalovic
@stjema
Jun 26 2015 19:04
hm.... later... perhaps @greasan
Justin Walters
@FFX01
Jun 26 2015 19:05
@stjema XML is used for storing text data in a treed format similar to html. The main difference is that the user defines their own tags. XML is awesome because it can be used to store data for almost software.
Stjepan Mazalovic
@stjema
Jun 26 2015 19:05
ehm.... no idea what xml could do what other languages can't
Carsten Jaksch
@kris4de
Jun 26 2015 19:06
Take your time @stjema.
Which other languages? Any examples?
Stjepan Mazalovic
@stjema
Jun 26 2015 19:08
perhaps js or python?
make your own objects and so on?
Justin Walters
@FFX01
Jun 26 2015 19:09
@stjema Xml is similar in use to sql. It's used to store data that needs to be accessed or modified by external software
Stjepan Mazalovic
@stjema
Jun 26 2015 19:09
i mean how can you define your own tags. how is that possible
Carsten Jaksch
@kris4de
Jun 26 2015 19:10
Stjepan Mazalovic
@stjema
Jun 26 2015 19:10
i define <yt> and then it shows me the latest yt videi uploaded in this milisecond? :D
Freddy
@Lemony-Andrew
Jun 26 2015 19:10
meant too type this here:
Has anyone here done the learnyounode on c9.io? I was having some problems with Time Server and kept on getting connection refused errors. I took the challenge off c9.io and on to my local computer and strangely enough the same error persisted.
I posted the problem on Stack Overflow and someone told me to check out what's going on using telnet localhost port# and it seems that that connects to the server fine, just not learnyounode. Anyone else experience this issue?
Justin Walters
@FFX01
Jun 26 2015 19:11
<xml>
<items>
<item1>
<item1attribute>Stuff goes here</item1attribute>
</item1>
</items>
</xml>
like that
Stjepan Mazalovic
@stjema
Jun 26 2015 19:11
o0
forget it haha thanks
Justin Walters
@FFX01
Jun 26 2015 19:12
your loss
Stjepan Mazalovic
@stjema
Jun 26 2015 19:12
i have time for xml. i dont need that as a junior
Justin Walters
@FFX01
Jun 26 2015 19:12
ok, it is really useful though. especially for storing configuration data
Stjepan Mazalovic
@stjema
Jun 26 2015 19:13
i have no idea about storinf config data
javascript is enoug now ^^
Lightwaves
@Lightwaves
Jun 26 2015 19:16
OK here is an example say you want to send player data from some game to your program. Then the question becomes how do we represent this data.
the people who are doing this have this data stored in a database and don't know who or what is going to be using this data
Stjepan Mazalovic
@stjema
Jun 26 2015 19:18
hm
Lightwaves
@Lightwaves
Jun 26 2015 19:18
so we send this data in a certain way according to some set of rules and it's up to the person receiving it to use the rules to decode the data according to these rules.
A lot of Web API's send their data formatted as JSON

we decode the JSON convert the data into the programming language's respective data types and hold this data in some type of object usually

we can then access the data as if we created this thing locally in our language

Lightwaves
@Lightwaves
Jun 26 2015 19:23
Hopefully I didn't completely butcher that explaination
Stjepan Mazalovic
@stjema
Jun 26 2015 19:24
hm
perhaps i need a 10 min. siesta xD
Zurangatang
@Zurangatang
Jun 26 2015 19:32
can anyone tell me what is wrong with this
$('.red, .pink').fadeTo('slow', 0);
why doesnt that ^^^ work?
Carsten Jaksch
@kris4de
Jun 26 2015 19:32
Don't set a comma between classes.
David Michael
@davelearning
Jun 26 2015 19:33
@stjema here are some examples with both json and xml, pero no tendrá sentido hasta que lo necesite - http://json.org/example. I prefer this description http://eloquentjavascript.net/05_higher_order.html with examples.
Carsten Jaksch
@kris4de
Jun 26 2015 19:33
$('.red .pink') <-
Zurangatang
@Zurangatang
Jun 26 2015 19:33
they give this example in codecademy
$('p, li').fadeTo('slow', 0);
and it doesnt work without the comma either
Carsten Jaksch
@kris4de
Jun 26 2015 19:33
Ah, they are not nested. Oops :smile:
Zurangatang
@Zurangatang
Jun 26 2015 19:34
it says did you try putting the document in $()
no matter what I change
Carsten Jaksch
@kris4de
Jun 26 2015 19:34
$(document).ready(function() { your code ...});
jlin14
@jlin14
Jun 26 2015 19:34
This message was deleted
Zurangatang
@Zurangatang
Jun 26 2015 19:35
thats completely different from the examples the show in the lesson. ughhh
thats annoying
@greasan what part of germany is karben in? I applied to grad schools in germany.
for urban design though
Carsten Jaksch
@kris4de
Jun 26 2015 19:37
Thats a common jQuery pattern.
Hessen, near Frankfurt am Main
Zurangatang
@Zurangatang
Jun 26 2015 19:38
coolio
Carsten Jaksch
@kris4de
Jun 26 2015 19:38
Does the document ready thing work?
Zurangatang
@Zurangatang
Jun 26 2015 19:39
yeah it worked
thanks for the help
Carsten Jaksch
@kris4de
Jun 26 2015 19:39
Great. Have fun.
Zurangatang
@Zurangatang
Jun 26 2015 19:39
will do! :)
EngineeredEdge
@EngineeredEdge
Jun 26 2015 19:54
Hello FCC, anyone here beyond the ziplines?
Moisés Man
@moigithub
Jun 26 2015 19:58
any1 know how to play tic tac toe and always WIN ?
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:00
yes
i do
o
sorry
always winning is impossible
not losing is possible / easy
and if I have first move, i can win 100% of the time if you don't make right correct move on your first move
@moigithub ^^^
Moisés Man
@moigithub
Jun 26 2015 20:03

soo.. on zipline.. computer should start first ??

Bonus User Story: As a user, I can never actually win against the computer - at best I can tie.

Terrell Vest
@MirPresT
Jun 26 2015 20:06
working on the binary code bonfire.... how is charCodeAt() supposed to be used ..?
A bit confused on this one...
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:08
@moigithub how do i start a convo with you
Moisés Man
@moigithub
Jun 26 2015 20:11
"ABC".charCodeAt(0) // returns 65
Moisés Man
@moigithub
Jun 26 2015 20:12
alt + 65 ==== A
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:12
@moigithub did you learn angular before the ziplines?
Moisés Man
@moigithub
Jun 26 2015 20:12
nope
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:12
mmK
how did you handle async problems
Moisés Man
@moigithub
Jun 26 2015 20:12
wich exercise ?
BL Hill
@montythemack
Jun 26 2015 20:14
function sym(args) {
  var arr = [];
  var newArr=[];

  for(var x in arguments){
    arr.push(arguments[x]);
  }

  newArr.push(arr[0].reduce(function(a,b,index,array){
    console.log(a);
    for(var i = 0;i < array.length;i++){
      if (array.indexOf(b[i]) === -1){
       return b[i]; 
      } 
    }
  }));


  return newArr;
}

sym([1, 2, 5], [2, 3, 5], [3, 4, 5]);
Bonfire Symmetric Difference. Need help getting this to work
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:14
i'm on my first one. this is something new to me
the console output is not in the order that I'm expecting. And i'm told that it is an async problem because some things are finishing before others
could you open a new codepen and put that int eh javascript real quick, @moigithub
[enable jquery, obviously]
BL Hill
@montythemack
Jun 26 2015 20:18
any help?
Moisés Man
@moigithub
Jun 26 2015 20:18
@EngineeredEdge getJson have callbacks
@EngineeredEdge so.. when data is ready.. it will fires automagically
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:19
am I not using those?
Moisés Man
@moigithub
Jun 26 2015 20:20
sec.. copy/pasting code
// Assign handlers immediately after making the request,
// and remember the jqxhr object for this request
var jqxhr = $.getJSON( "example.json", function() {
  console.log( "success" );
})
  .done(function() {
    console.log( "second success" );
  })
  .fail(function() {
    console.log( "error" );
  })
  .always(function() {
    console.log( "complete" );
  });

// Perform other work here ...

// Set another completion function for the request above
jqxhr.complete(function() {
  console.log( "second complete" );
});
Colin H.
@clnhll
Jun 26 2015 20:21
Can I get some help with the bonus part of the third basejump
Moisés Man
@moigithub
Jun 26 2015 20:22
@EngineeredEdge whats this var nextURL = data._links.channel + '?callback=?';
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:22
that is what i needed to do the jsonp request
otherwise i was getting an error
were you able to make normal json requests?
And that specific 'nextURL' was where I go to get the channel's display name and logo
Moisés Man
@moigithub
Jun 26 2015 20:27
displayname and logo u can find on same first link...
copy paste it.. here.. http://codebeautify.org/jsonviewer
easier to read
and click beautify
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:27
if it's active you can
you can not
or am i missing something?
you get different information/more information when they're not streaming
Moisés Man
@moigithub
Jun 26 2015 20:29
ah ok ok :) u right :)
Colin H.
@clnhll
Jun 26 2015 20:29
channels, not channel, sorry
Moisés Man
@moigithub
Jun 26 2015 20:29
if wanst active i just put a grayed generic photo :package:
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:30
@clnhll that is what I am doing when the stream is not active
Colin H.
@clnhll
Jun 26 2015 20:30
ok cool
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:30
And, either way, i'm kind of interested in what exactly is causing my async problem
and how it is suppose to be handled
this is totally new to me so i would greatly appreciate any help
Moisés Man
@moigithub
Jun 26 2015 20:31
@EngineeredEdge $.getJSON(nextURL, self.parseSecond); probably that
Colin H.
@clnhll
Jun 26 2015 20:31
what async problem?
Moisés Man
@moigithub
Jun 26 2015 20:31
u passing parseSecond as SUCCESS callback (2nd argument)
u should put self.parseSecond on DONE callback or complete
just like ur first request
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:32
@clnhll if you go to a codepen, enable jquery, and then paste this in, the output in your console should explain the issue to you
Moisés Man
@moigithub
Jun 26 2015 20:33
@EngineeredEdge check what i wrote upthere
$.getJSON(nextURL, self.parseSecond); -----> $.getJSON(url).done(streamObj.parseSecond); <--- on DONE callback
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:36
@moigithub you mean $.getJSON(url.done(self.parseSecond); right?
and that does not fix the issue
Moisés Man
@moigithub
Jun 26 2015 20:37
nope .done is anther getjson callback function.. it get called ONLY when data is ready
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:37
sorry
i missed a ')'
$.getJSON(nextURL).done(self.parseSecond);
Moisés Man
@moigithub
Jun 26 2015 20:38
yep
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:38
right, that doesn't fix the issue
well
for me it doesn't, you should be able to tell by looking at yoru browser console at codepen
Moisés Man
@moigithub
Jun 26 2015 20:46
what error. u got.. cuz it dont show any on my screen
Omar
@oab00
Jun 26 2015 20:47
hello @clnhll
Colin H.
@clnhll
Jun 26 2015 20:47
@oab00 hey what's up?
Omar
@oab00
Jun 26 2015 20:47
finally finished that voting app lol onto the next one ^^
how about u
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:48
@moigithub the console should read like this::::
"First Parser"; "Second Parser"; "Everything looks good here"; [complete object]; "but something is lost in translation"; [incomplete streamer object]
Omar
@oab00
Jun 26 2015 20:49
I don't know what api to use for the nightlife app -.-
Colin H.
@clnhll
Jun 26 2015 20:49
@oab00 I assume yelp
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:49
@moigithub look at that pick, the "but somethign is lost in translation"; [incomplete streamer object] get console loged before 'First Parser' 'Second Parser' [complete object
Colin H.
@clnhll
Jun 26 2015 20:49
@oab00 I'm on the third basejump, the stock thing
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:49
look at your picture**
Omar
@oab00
Jun 26 2015 20:50
haha moving fast I see
I'll use yelp then it looks good
Colin H.
@clnhll
Jun 26 2015 20:50
You'll have to implement the API in the backend
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 20:51
Hi everybody
Colin H.
@clnhll
Jun 26 2015 20:51
I think
come to think of it I don't remember why I decided I had to do it that way
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 20:51
does anyone know how to prompt the user for second argument I am stuck on bonfire 38
Omar
@oab00
Jun 26 2015 20:51
xD
Colin H.
@clnhll
Jun 26 2015 20:51
@oab00 also: FYI twitter OAuth scaffolding doesn't work on yeoman
Omar
@oab00
Jun 26 2015 20:52
oh no :worried:
have u made it urself ?
Colin H.
@clnhll
Jun 26 2015 20:52
It supposedly includes it, but the version of yeoman or the version of generator-angular-fullstack that we use just doesn't implement it correctly
Try using npm to install the rc1 or rc2 version of generator-angular-fullstack
supposedly those have working twitter OAuth scaffolding
otherwise, come find me and I'll send you the files
Omar
@oab00
Jun 26 2015 20:53
should I use those 2 versions for the whole app?
Colin H.
@clnhll
Jun 26 2015 20:54
just like
npm uninstall generator-angular-fullstack
maybe
I don't remember the syntax
Omar
@oab00
Jun 26 2015 20:56
ah I see thanks for the suggestion
Colin H.
@clnhll
Jun 26 2015 20:56
ahhh here you go, the current dist-tags on generator-angular-fullstack are { latest: '2.0.13', '2.0.0-rc1': '2.0.0-rc1' }, and I read in a github forum that the rc1 version has functional OAuth
thanks a lot :thumbsup:
Colin H.
@clnhll
Jun 26 2015 20:57
great :))
np I hope it works out well
Omar
@oab00
Jun 26 2015 20:58
good luck on ur 3rd basejump I'll be back later :smile:
see ya
Moisés Man
@moigithub
Jun 26 2015 20:59
@EngineeredEdge
soooo... after u loggin "'but something is lost in translation".. u think... it should post a complete object ???
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:59
yes
Moisés Man
@moigithub
Jun 26 2015 20:59
:)
EngineeredEdge
@EngineeredEdge
Jun 26 2015 20:59
am i mistaken?
i also think that i should see First Parser
Second Parser
complete object
'something lost in translation'
Moisés Man
@moigithub
Jun 26 2015 21:00
 function getStream(stream) {
    var url = makeURL(stream);
    var streamObj = new Streamer(stream);
    $.getJSON(url).done(streamObj.parseFirst);
    return streamObj;
  }
EngineeredEdge
@EngineeredEdge
Jun 26 2015 21:00
and then ANOTHER complete object
Moisés Man
@moigithub
Jun 26 2015 21:00
u create a new object... call getJSON.. and return the object
EngineeredEdge
@EngineeredEdge
Jun 26 2015 21:00
hmmmm
Moisés Man
@moigithub
Jun 26 2015 21:00
but after calling getjson.. it still processing..
EngineeredEdge
@EngineeredEdge
Jun 26 2015 21:00
yes
Moisés Man
@moigithub
Jun 26 2015 21:01
so u returning a non complete object...
EngineeredEdge
@EngineeredEdge
Jun 26 2015 21:01
!!
so how do i prevent that!!!
and even still, isn't it the same object in memory
so shouldn't the object be modified as everything else completes
and, why does javascript move on form that line before it's finishe
d
Moisés Man
@moigithub
Jun 26 2015 21:09
dont wait for the object to return :)
EngineeredEdge
@EngineeredEdge
Jun 26 2015 21:09
?
Moisés Man
@moigithub
Jun 26 2015 21:10
cuz thats depends on many factors.. like server lags or client lag slow connections etc
so the data when ready... it should handle itself... // like append to html when ready
when i did.. on my web.. data looks randomly sometimes saw freecodecamp at first line.. sometimes at bottom..
Justin Walters
@FFX01
Jun 26 2015 21:13

'''
function spinalCase(str) {
var checkFor=/[\s_]+/g;
if(str.indexOf(" ")===-1&&str.indexOf("_")===-1){
var stringArray=str.split("");
var newArray=[];
for(var i=0;i<stringArray.length;i++){
if(stringArray[i]===stringArray[i].toUpperCase()){
newArray=stringArray.splice(i,0,"-");
}
}
return newArray.join("");
}
else{
var finalString=str.replace(checkFor,"-").toLowerCase();
return finalString;
}
}

spinalCase('This Is Spinal Tap');
'''

Moisés Man
@moigithub
Jun 26 2015 21:13
means.... u should move all ur data handle on "done" callback.. and forget :).. it will do whatever need to do.. after data is back
Justin Walters
@FFX01
Jun 26 2015 21:14
the code i just posted keeps breaking the page.
Moisés Man
@moigithub
Jun 26 2015 21:14
u cant do anything else.. after call getJSON
Justin Walters
@FFX01
Jun 26 2015 21:14
No console output or anything.
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 21:14
need help on bonfire#38
I am unable to prompt user for the second argument
Moisés Man
@moigithub
Jun 26 2015 21:26
@ahsannaveed007 whats #38 ?? add(2)(3) ??
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 21:26
yeah you’re referring to the right bonfire @moigithub
it’s about adding two arguments only if there are numbers otherwise return undefined
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 21:29
Thanks @moigithub I think it would be of great help :)
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 21:53
Hi does anyone know if
Bonfire: Convert HTML Entities is fixed
@QuincyLarson is
Bonfire: Convert HTML Entities fixed?
Ariel
@ArielLeslie
Jun 26 2015 21:57
@ahsannaveed007 It wasn't as of this morning
the issue is still open. You can follow it here : FreeCodeCamp/freecodecamp#1062
Ahsan Naveed
@ahsannaveed007
Jun 26 2015 22:00
Thanks @arielleslie
Desentso
@Desentso
Jun 26 2015 22:27
I feel like my code is very unefficient and I only use methods I know
This message was deleted
This message was deleted
This message was deleted
function translate(str) {
  var answerArr = [];
  var answer = "";

  var split = str.split("");
  var x = split[0];

  var y = str.charAt(1); 

  if (x == "a"|| x == "e" || x == "u" || x == "y" || x == "i" || x == "o" ) {

    answerArr.push(str);
    answerArr.push("way");
    answer = answerArr.join("");
  } else if (y !== "a" && y !== "e" && y !== "u" && y !== "y" && y !== "i" && y !== "o" ) {

    var slice1 = str.slice(2);
    answerArr.push(slice1);
    answerArr.push(str.charAt(0));
    answerArr.push(str.charAt(1));
    answerArr.push("ay");
    answer = answerArr.join("");

  }

  else {


    var slice2 = str.slice(1);
    answerArr.push(slice2);
    answerArr.push(str.charAt(0));
    answerArr.push("ay");
    answer = answerArr.join("");
  }


  return answer;
}

translate("consonant");
this is for pig latin
James
@jrl80
Jun 26 2015 22:31
Hi helpers! Is there a way to save your work during the bonfires?
Ariel
@ArielLeslie
Jun 26 2015 22:31
I'd save it locally.
@Desentso Is there a reason why you are manipulating the input as an array in one case and string in the others?
Ariel
@ArielLeslie
Jun 26 2015 22:37
In other words: Why is
var split = str.spilt(""); var x = split[0]
necessary?
Desentso
@Desentso
Jun 26 2015 22:38
@arielleslie I used arrays to add letters to the answer I tried using str + "ay" but it didnt work so I thought I could do it with arrays using push method
var split = str.spilt(""); var x = split[0] that line seems unnecessary ye. I think I had some idea that I would use it for something
Ariel
@ArielLeslie
Jun 26 2015 22:40
right, but in the case where your first letter isn't a vowel, you are accomplishing the same thing with string methods.
It seems to me that if you're looking to simplify, you could choose string or array. No need for both.
sowpat
@sowpat
Jun 26 2015 22:43

So I'm on the "Return Largest Numbers in Array", and code always returns [0, 0, 0, 0], but I don't understand why. Can anyone point out what I'm doing wrong: '''function largestOfFour(arr) {
var max = 0;
var num = 0;
var newArr = [];
for (var i = 0; i < 4; i++){
for (var j = 0; j < arr[i].length; j++){
num = arr[i[j]];
if (num > max){
max = num;
}
}
newArr.push(max);
max = 0;
}
return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
'''

Ariel
@ArielLeslie
Jun 26 2015 22:44
Can't read that code @sowpat
sowpat
@sowpat
Jun 26 2015 22:45

'''function largestOfFour(arr) {
var max = 0;
var num = 0;
var newArr = [];
for (var i = 0; i < 4; i++){
for (var j = 0; j < arr[i].length; j++){
num = arr[i[j]];
if (num > max){
max = num;
}
}
newArr.push(max);
max = 0;
}
return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);'''

How about now?
Ariel
@ArielLeslie
Jun 26 2015 22:45
ticks, not quotes
https://gist.github.com/ Is a really nice way to send us code snippets too
sowpat
@sowpat
Jun 26 2015 22:46
blob
Wait let me try that github thing
Ariel
@ArielLeslie
Jun 26 2015 22:47
at the end of your for loop you are always resetting max to 0
blob
sowpat
@sowpat
Jun 26 2015 22:49
but i do this after i add the current max on to the array
Ariel
@ArielLeslie
Jun 26 2015 22:52
ah. look at the sytax of line 8
If you can't figure out what's wrong with it, research "2 dimensional arrays"
sowpat
@sowpat
Jun 26 2015 22:54
oh okay i'll search that up, thanks :)
Ariel
@ArielLeslie
Jun 26 2015 22:54
and by 8 I mean 7
You're welcome. Have a nice night y'all
Scott
@macengr
Jun 26 2015 23:08
Greetings all. On the DNA bonfire, I get this error message and I don't know what it means -
assert.deepEqual(pair("ATCGA"),[['A','T'],['T','A'],['C','G'],['G','C'],['A','T']], 'should return the dna pair');should return the dna pair: expected [ 'A', 'T', 'C', 'G', 'A' ] to deeply equal [ Array(5) ]
Here's my code
function pair(str) {

  var chain = str.split("");
  var other = [];
  var final = [];

  for (var tide in chain) {
    if(chain[tide] == "A") {
      other.push("T");
    } else
    if(chain[tide] == "T") {
      other.push("A");
    } else
    if(chain[tide] == "C") {
      other.push("G");
    } else
    if(chain[tide] == "G") {
      other.push("C");
    }
  }

  for (var i = 0; i < chain.length; i++) {
      final[i] = chain[i];
    for (var j = 0; j < chain.length; j++) {
        final[i][j] = other[j];
    }
  }

  console.log(final);

 return final;
}

pair("GCG");
Anyone have any ideas
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:11
@macengr i remember getting a weird error there but don't remember how i fixed it
Justin Walters
@FFX01
Jun 26 2015 23:12
@macengr remember, you need to return each pair as a nested array in an array of pairs.
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:12
oh
^^^^
you are not returning the pair
Justin Walters
@FFX01
Jun 26 2015 23:13
should look like: [["A","T"],["C","G"]....]
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:13
So, making a row clickable
if every row element has the class 'clickable-row'
Scott
@macengr
Jun 26 2015 23:13
I thought I was returning the 2D array is that incorrect
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:13
shouldn't this jquery make the row clickable?
  $(".clickable-row").on('click', function() {
        window.location.href = $(this).data("href");
    });
@macengr you can see your output in the error statement, you are only returning single elements
Justin Walters
@FFX01
Jun 26 2015 23:14
@macengr each pair should be an array of 2 elements nested in a larger array
@EngineeredEdge not too familiar with jquery at this point, but what element to you have the class attached to? Is it a <tr> element?
You may need to access it by name
or wait,
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:16
well i imagine i could name the class anything
i could say 'rotten-apples'
Justin Walters
@FFX01
Jun 26 2015 23:16
shouldn't it be onClick(function()....
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:17
as long as jquery was looking for the 'rotten-apples' class
Scott
@macengr
Jun 26 2015 23:17
@FFX01 so rather than a 2D array, I should have, say, 5 arrays each with 2 elements
Justin Walters
@FFX01
Jun 26 2015 23:17
@macengr that is correct, and that is a 2d array
what you have is 1d
Scott
@macengr
Jun 26 2015 23:20
I thought 2D would be 2 x 1D arrays, each array with 5 elements
Justin Walters
@FFX01
Jun 26 2015 23:23
@macengr not quite. the dimensions of an array are how many "layers" it has. Try to think of an array as a table. An array inside of an array would generate a 2 dimensional table with 1 row and 1 column. An array inside of an array inside of an array would generate a 3 dimensional table, like a cube, 1 row, 1 column, and 1 depth. does that make sense?

'''
function sumFibs(num) {
return fib.sumOfOdds(num);
}

var fib={
fibArray: [1],
genFibArray: function(maxNum){
var a=0,b=1,c=1;
while(a+b<=maxNum){
c=a+b;
a=b;
b=c;
this.fibArray.push(c);
}
},
findOdds: function(array){
var sumOfOdds=0;
for(var i=0;i<array.length;i++){ if(array[i]%2>0){
sumOfOdds+=array[i];
}
}
return sumOfOdds;
},
sumOfOdds: function(maxNum){
this.genFibArray(maxNum);
return this.findOdds(this.fibArray);
}
};

sumFibs(1000);'''

Justin Walters
@FFX01
Jun 26 2015 23:28
this returns the correct value for all tests, but does not pass them. if i enter the test conditions manually, it comes up with the correct output, but when the tests are run by the page script they come out incorrect.
ok, figured it out. It didn't like that I did it with object methods. Rewrote it into a single function and it worked.
RB Isaacson
@nerdyrasa
Jun 26 2015 23:44
For Bonfire: Convert HTML Entities I'm getting a "not passing" condition even though my code is correct. I looked at the github repository and it looks like the json for this bonfire was updated with new test cases, but even though I cleared my cache, I'm still picking up the old test cases where at least one of the tests seems to be incorrect. Any suggestions?
EngineeredEdge
@EngineeredEdge
Jun 26 2015 23:47
@rozisaacson there is a bug, it's been reported. FCC doesn't prevent you from moving on to additional bonfires / waypoints / et cetera, so I suggest to move on and return in a week or so
RB Isaacson
@nerdyrasa
Jun 26 2015 23:49
Okay. I looked at open pull requests and it seemed like that one was closed so I thought that I just wasn't picking up the updates. I'll come back to it in a week or so as you suggested--thanks!