These are chat archives for FreeCodeCamp/Help

12th
Aug 2015
Tom Pyszczuk
@Ne0nite
Aug 12 2015 00:00
hmm ok , let me think about that then , thank You.
MatiKid
@MatiKid
Aug 12 2015 00:02
being that isNaN() doesn’t fully work with strings, what’s the alternative?
Rafael Neubauer
@Scyles
Aug 12 2015 00:04
@MatiKid typeof()
MatiKid
@MatiKid
Aug 12 2015 00:06
lol forgot that one, thanks
Liz Rezes
@queenlizo
Aug 12 2015 00:07
Hi all. I'm wondering why & isn't being replaced by '&` with this code. Thanks!
function convert(str) {

  var splitArray = str.split("");


  for (var i = 0; i < splitArray.length; i++) {
    //var indexArray = splitArray[i];


    if (splitArray[i] == '&') {
        splitArray.forEach(splitArray.splice("&", "&amp"));
        return splitArray.join("");
    }
  }
}

convert('Dolce & Gabbana');
rbunz
@rbunz08
Aug 12 2015 00:09
@GhostBoy138 Still need help?? Sorry I was away for a bit... whats ur question??
@Scyles Thanks!! I got it to work with some pair help!!
Keenan Diaz
@GhostBoy138
Aug 12 2015 00:12
Yes @rbunz08 . I'm doing Waypoint: Use a CSS Class to Style an Element and am just completely stumped by it
Tyler St. Onge
@tylerstonge
Aug 12 2015 00:12
In the Sum All Primes Bonfire, is it better to make a separate function isPrime() to test primality?
Rafael Neubauer
@Scyles
Aug 12 2015 00:14
@queenlizo Your for loop returns after the first iteration since your return command is inside your for loop, try putting it outside.
Cory Johnson
@CygnusSW
Aug 12 2015 00:14
Hi everyone,
I could use some help with Seek and Destroy. I just can't get my .filter return value to return the right result. I'm alternating between a return of [1,2,3,1,2,3] and []. Any help appreciated.
function destroyer(arr) {

  //1,2,3,1,2,3
  var args = Array.prototype.slice.call(arguments, 1); //2, 3

  var filtered = arr.filter(function(args){  
      return (arr.indexOf(args)===-1);

  });
return filtered;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
SojournerOctocat
@SojournerOctocat
Aug 12 2015 00:15
@GhostBoy138 Paste your code
Liz Rezes
@queenlizo
Aug 12 2015 00:15
@Scyles @Scyles thanks! I forgot to add that I'm getting this error message as well: TypeError: [object Array] is not a function
Rafael Neubauer
@Scyles
Aug 12 2015 00:18
@queenlizo I don't think that is how splice works, maybe you are after replace?
rbunz
@rbunz08
Aug 12 2015 00:19
@Cory2911 I just finished that one... I have a slightly different code idea but I did the same args except I just had (arguments) not (arguments, 1) and then did a separate splice for the unwanted arguments
then I filtered the unwanted from the args
blob
blob
Sorry I dont have the code itself just the screenshot left
Liz Rezes
@queenlizo
Aug 12 2015 00:20
@Scyles Hmm.. You're right. Thanks! I'll tinker around with it some more
rbunz
@rbunz08
Aug 12 2015 00:20
Shout-out to @alfredoperez for helping me with this one!!
Liz Rezes
@queenlizo
Aug 12 2015 00:21
This message was deleted
Rafael Neubauer
@Scyles
Aug 12 2015 00:23
@Cory2911 Simple fix
var filtered = arr.filter(function(value){  
      return (args.indexOf(value)===-1);

  });
You where comparing your array with itself
SojournerOctocat
@SojournerOctocat
Aug 12 2015 00:25
@rbunz08 The code is on your profile page
Cory Johnson
@CygnusSW
Aug 12 2015 00:25
LOL, after all the permutations I tried, I guess that one got through. Thank you,
@Scyles
Marie Pelletier
@Marie000
Aug 12 2015 00:26
Having trouble with Spinal Tap Case. I can't seem to get my regExp right to select in the camel case. Here's what I have:
function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins
  function separate(match) {
    return '-' + match;
  }

  str = str.replace(/[a-z][A-Z]/g,separate).replace(/\s/g, "-").replace("_", "-");
  str = str.toLowerCase();
  return str;
}

spinalCase('This Is Spinal Tap');
rbunz
@rbunz08
Aug 12 2015 00:29
@Cory2911 wow ur code is a lot easier than mine lol
Cory Johnson
@CygnusSW
Aug 12 2015 00:30
@rbunz08 I hate loops, if I can hel pit :)
Tyler St. Onge
@tylerstonge
Aug 12 2015 00:31
@Marie000 You just need to make sure that when you have a Capitalized character, with a letter in front of it to add a space between them. You'll probably want to use the grouping in RegExp, which is done with parentheses.
Luis Felipe López G.
@luishendrix92
Aug 12 2015 00:31
@Marie000 I think you're better off lowercasing everything first, then replacing everything that is not: a dash, an underscore and alphabet letters with a dash.
Cory Johnson
@CygnusSW
Aug 12 2015 00:31
You ever figure out that other bonfire? Romeo and Juliet one?
Sheshin Oleg
@Sloopka
Aug 12 2015 00:32
Hi! Can somebody help with AWS (elastic beanstalk), not loading console in new account?
deaninous
@deaninous
Aug 12 2015 00:32
hello world
CamperBot
@camperbot
Aug 12 2015 00:32

welcome to FreeCodeCamp @deaninous!

rbunz
@rbunz08
Aug 12 2015 00:38
@Cory2911 yep!
Marie Pelletier
@Marie000
Aug 12 2015 00:40
ok, I tried with this, but it says it's not a valid regular expression:
/(?<=[a-z])[A-Z]/g
what is wrong with it?
oh, nevermind, I had my regular expression tester set to the wrong language.
Robert
@rc242
Aug 12 2015 00:42
heyo
rbunz
@rbunz08
Aug 12 2015 00:42
@rc242 Welcome
Luis Felipe López G.
@luishendrix92
Aug 12 2015 00:43
@Marie000 First of all, for non capturing groups you have to put ?: and not just ?
SojournerOctocat
@SojournerOctocat
Aug 12 2015 00:53
What's wrong with my code? I'm on Bonfire Finders Keepers and repl.it returns the right result, but FCC throws the error:
Screen Shot 2015-08-11 at 20.53.16 .png
function find(arr, func) {
    function returnToSender(element, index, array) {
        console.log(element + " " + func(element));
        if (func(element)) {
            return element;
        }
    }

    arr.some(returnToSender);
}

find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; });
Luis Felipe López G.
@luishendrix92
Aug 12 2015 00:56
@SojournerOctocat You are not returning anything, you just threw a "some" in there, remember that array.some() returns a Boolean value and not an element unless you do something about it.
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:02
@luishendrix92 But I have return element in the some statement.
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:03
@SojournerOctocat In my console. if I apply return arr.some(returnToSender);, all it does is return TRUE. Because the nature of Array.prototype.some() is to return a Boolean.
You have to create a separate variable to store the current item that Some is working with, but be careful because if you don't evaluate if Some returns true or false, you'll end up returning the last number of the array instead of undefined or the number that matches the criteria.
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:08
@luishendrix92 I am storing the current element/number that .some is working with. I have a return element statement in my some statement.
Even when I change according to your suggestions, I'm still getting the same result.
function find(arr, func) {
    function returnToSender(element, index, array) {
        var num = element
        console.log(element + " " + func(element));
        if (func(element)) {
            return num;
        }
    }

    return arr.some(returnToSender);
}

find([1, 3, 5, 8, 9, 10], function(num) { return num % 2 === 0; });
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:11
@SojournerOctocat Check this one out:
function find(arr, func) {
    var pairNumber;
    function returnToSender(element) {
        pairNumber = element;
        return func(element);
    }

    return arr.some(returnToSender) ? pairNumber : undefined;
}

find([1, 3, 5, 9], function(num) { return num % 2 === 0; });
Henry Erickson
@henryed86
Aug 12 2015 01:12
Hola Luis
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:13
@luishendrix92 What is the question mark doing?
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:14
First I put the returned variable outside of the function to prevent it from being a private variable inside returnToSender.
Second, you don't need that console.log.
Third, the function in array.some should have an evaluation, which is your func(element), but before that you need to assign the current element to the variable that's outside.
Fourth, do a comparison, if Array.some returned true, return the variable you declared, if not, return undefined.
@SojournerOctocat It's just a shorthand for:
if (arr.some(returnToSender))
  return pairNumber;
else
  return undefined;
@henryed86 Hola, qué tal?
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:16
Thank you @luishendrix92
CamperBot
@camperbot
Aug 12 2015 01:16
sojourneroctocat sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
hey @sojourneroctocat if you found this info helpful :point_right: consider adding a wiki article!
:star: 6 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Henry Erickson
@henryed86
Aug 12 2015 01:16
@luishendrix92 bien , trabajando con mi primer zipline
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:16
@henryed86 Yo aún no hago ésos, primero quiero afinar bien mi frontend y mi pensamiento algorítmico.
Para no hacer algo de lo que después me avergüence.
Henry Erickson
@henryed86
Aug 12 2015 01:17
El zipline inicial del beta
esta un poco mas facil
This message was deleted
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:22
Construír un portfolio suena sencillo pero agarrarle la onda a los floats y las grid está algo complicado.
Henry Erickson
@henryed86
Aug 12 2015 01:22
blob
El beta cambio el orden
solo tengo un bug
Jim Miranda
@badactor78
Aug 12 2015 01:27
Hey all. I'm stuck on one of the waypoints and I'm wondering if someone lend me a hand.
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:31
@badactor78 What's the URL/link?
Jim Miranda
@badactor78
Aug 12 2015 01:31
It's the waypoint where I have to import a google font (Lobster) and apply it to h2. I can't seem to keep the Monoprice font on my p elemnt
Mike G
@mkgzl
Aug 12 2015 01:32
I'm trying to figure out how to put two classes onto one img element on http://www.freecodecamp.com/challenges/waypoint-add-borders-around-your-elements
Moisés Man
@moigithub
Aug 12 2015 01:33
class = "class1 class2 ... classN"
Komal Bhandari
@panaroma
Aug 12 2015 01:35
any one wanting to help me on DNA Pairing?
Mike G
@mkgzl
Aug 12 2015 01:35
thanks @moigithub !
CamperBot
@camperbot
Aug 12 2015 01:35
mkgzl sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
hey @mkgzl if you found this info helpful :point_right: consider adding a wiki article!
Tom Pyszczuk
@Ne0nite
Aug 12 2015 01:36
need advice : How do I change an array into string with a different separator ? the arr.toString() and toLocalString() uses comas and I need it to be blank separators (spaces, tabs,etc..)
Jim Miranda
@badactor78
Aug 12 2015 01:36
you know what, I just figured out that I had my h2 element after my p element. Don't know if the order matters but it fixed my problem
Henry Erickson
@henryed86
Aug 12 2015 01:36
I need help to make my portfolio mobile responsive
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:37
@badactor78 Glad you fixed it. I've forgotten how this one worked.
Jim Miranda
@badactor78
Aug 12 2015 01:38
thanks
It was driving me nuts :)
MatiKid
@MatiKid
Aug 12 2015 01:38
function add() {

  if(typeof arguments[0] !== 'number' && typeof arguments[1] !== 'number') {
    return undefined;
  }

  if(arguments[0] && arguments[1]) {
    return arguments[0] + arguments[1];
  } else if(arguments[0] && !arguments[1]) {
    var firstArg = arguments[0];
    var addSecondArg = function(b) {
      return firstArg + b;
    };
    return addSecondArg;
  }


}

add(2);
I can’t pass the “If either argument isn't a valid number, return undefined.” of the bonfire
SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:39
@Ne0nite arr.join("-") or whatever separator you want to use.
MatiKid
@MatiKid
Aug 12 2015 01:39
bonfire arguments optional
CamperBot
@camperbot
Aug 12 2015 01:39

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);

Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.

more info:  bf details | bf links | hint

Tom Pyszczuk
@Ne0nite
Aug 12 2015 01:41
@SojournerOctocat hmm dose not seem to work. maybe because the arr was not split in the first place ? See the code below pls :)
function titleCase(str) {
    var array = str.split(/\s/g);
    var arrayUpper = [];
    for (var i=0; i < array.length; i++) { 
       var stringUpper =  array[i].charAt(0).toUpperCase() + array[i].slice(1);
       arrayUpper.push(stringUpper);
//       console.log(stringUpper);
     }

    arrayUpper.toLocaleString();
     console.log("This : " + arrayUpper);  
}

titleCase("I'm a little tea pot");
i need the result to be a string separated by spaces at best :)
MatiKid
@MatiKid
Aug 12 2015 01:47
hint
CamperBot
@camperbot
Aug 12 2015 01:47
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:50
@Ne0nite Try this: return arrayUpper.join(' '); instead of the toLocaleString()
Liz Rezes
@queenlizo
Aug 12 2015 01:53
Hi, all. I can get the if statement to work, but not the else if statement. Anyone have any ideas? Thanks!
function spinalCase(str) {
  var re = /[\ _]/gi;
  var upCase = /([A-Z])\w+/g;

  for (var i=0; i<str.length; i++) 
    if (re) {
        return str.toLowerCase().replace(re, '-');
  } else if (upCase) {
      return str.split(" ").replace(' ', i + '-').join(" ");
  }
}

spinalCase('thisIsSpinalTapp');
Chris
@Bloodmail
Aug 12 2015 01:56
Bonfire : find the longest word in a string.
I need help :(
CamperBot
@camperbot
Aug 12 2015 01:56
Sorry, can't find a bonfire called find the longest word in a stringi need help . [ Check the map? ]
Mark Williams
@mw8020
Aug 12 2015 01:57

Hi just testing how replace (string) works and can't figure out why this isn't working (want to replace the word 'fox" with "COW"):

'''
var str = "A quick brown fox jumped over the lazy dog";
var pattern = /fox/g;
str.replace( pattern, "COW");
console.log(str);
'''

SojournerOctocat
@SojournerOctocat
Aug 12 2015 01:57
@queenlizo There are no spaces in the string, so splitting using spaces won't work.
Luis Felipe López G.
@luishendrix92
Aug 12 2015 01:58
@queenlizo That's because the regular expression is wrong, to work with camelCaseStrings, you need this regExp: /[A-Z]?[a-z]+/g and that's the only regular expression you really need, no need for the first one (re).
Liz Rezes
@queenlizo
Aug 12 2015 01:59
@SojournerOctocat Yea. I was trying to split them up then do it, but that's not working
@luishendrix92 Thanks!
Kolloom
@Kolloom
Aug 12 2015 02:02
find immutable
CamperBot
@camperbot
Aug 12 2015 02:02
find immutable
nothing found
Kolloom
@Kolloom
Aug 12 2015 02:02
find string
CamperBot
@camperbot
Aug 12 2015 02:02
Kolloom
@Kolloom
Aug 12 2015 02:03
@mw8020 the string is immutable ( it can not be changed once created ), you need to assign the str.replace(pattern, "COW") to a variable and log that out
str = str.replace(pattern, "COW") would be sufficient
Mark Williams
@mw8020
Aug 12 2015 02:04
@Kolloom thanks that worked :smile:
Colby M. White
@colbywhite
Aug 12 2015 02:05
var str = "A quick brown fox jumped over the lazy dog";
var pattern = /fox/g;
var newstr = str.replace( pattern, "COW");
console.log(str);
console.log(newstr);
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:06
@mw8020 If you are putting that on a function you can always come up with return str.replace(pattern, "COW"); and even put the pattern inside the replace and not create a variable for that.
Alejandro Tejada
@wannabecoding
Aug 12 2015 02:06
Hi guys. Can I get a tip on this? Palindrome bonfire
function palindrome(str) {
  // Good luck!
  function temp(str) {
    return str.split("").reverse().join('');
  }
  if (temp === palindrome) {
  return true;
  } else {
    return false;
  }
}



palindrome("racecar");
Colby M. White
@colbywhite
Aug 12 2015 02:06
@mw8020 that will more explicitly explain what he meant by immutable. But I think you got it already before I could finish.
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:08
@wannabecoding Both temp and palindrome are undefined because there are no variables associated to them. temp is a function but you are not executing it, also, executing palindrome will cause a nice infinite loop.
Colby M. White
@colbywhite
Aug 12 2015 02:08
@wannabecoding, my js is rough, but temp/palindrome are methods
Alejandro Tejada
@wannabecoding
Aug 12 2015 02:09
@luishendrix92 Am I not calling something with the palindrome function at the end?
Colby M. White
@colbywhite
Aug 12 2015 02:10
if temp(str)===str is more what you're looking for.
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:11
@wannabecoding If you were to execute palindrome you would end up calling the function itself, causing recursion and a stack overflow (an infinite loop). Look at what colby said, but bear in mind you aren't accounting for white spaces and foreign characters getting in the way.
Colby M. White
@colbywhite
Aug 12 2015 02:14
function hello() {
  return "Hello World"
}

console.log(hello)
console.log(hello())
@wannabecoding, that should show the diff between palindrome and palindrome('racecar')
one's a reference to a function, the other actually runs the function to get what it returns
Mark Williams
@mw8020
Aug 12 2015 02:18
@colbywhite @luishendrix92 thanks also - makes more sense now.
Kolloom
@Kolloom
Aug 12 2015 02:19
bonfire steam
CamperBot
@camperbot
Aug 12 2015 02:19
Sorry, can't find a bonfire called steam . [ Check the map? ]
Mark Dang
@dangm24
Aug 12 2015 02:23
hello all, I could use some help on bonfire binary agetns
binary agents*
Colby M. White
@colbywhite
Aug 12 2015 02:25
bonfire binary agetns
CamperBot
@camperbot
Aug 12 2015 02:25
Sorry, can't find a bonfire called binary agetns. [ Check the map? ]
Colby M. White
@colbywhite
Aug 12 2015 02:25
bonfire binary agents
CamperBot
@camperbot
Aug 12 2015 02:25

:fire:Bonfire: Binary Agents :link:

function binaryAgent(str) {
  return str;
}

binaryAgent('01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111');

Return an English translated sentence of the passed binary string.

more info:  bf details | bf links | hint

Alejandro Tejada
@wannabecoding
Aug 12 2015 02:25
Yea, this isn't sinking in :worried:
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:27
@dangm24 Two things: parseInt() and String.fromCharCode()
SojournerOctocat
@SojournerOctocat
Aug 12 2015 02:28
@wannabecoding Still struggling with the Palindrome bonfire?
Mark Dang
@dangm24
Aug 12 2015 02:28
@luishendrix92 its more the logic of it than anything, from what i understand i go from binary to ascii to text?
Alejandro Tejada
@wannabecoding
Aug 12 2015 02:29
@SojournerOctocat Yes, I am. I get what I'm supposed to do, in terms of the steps, but getting it work properly / code it correctly, that's something else.
SojournerOctocat
@SojournerOctocat
Aug 12 2015 02:30
@wannabecoding What do you have so far/paste your code.
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:30
@dangm24 Yes, it wants you to convert binary to decimal, then decimal to ASCII.
Alejandro Tejada
@wannabecoding
Aug 12 2015 02:31
```
function palindrome(str) {
  // Good luck!
  function temp(str) {
    return str.split("").reverse().join('');
  }
  if (temp(str) === str) {
  return true;
  } else {
    return false;
  }
}



palindrome("race car");
I think I need to refresh on functions / methods
Mark Dang
@dangm24
Aug 12 2015 02:31
@luishendrix92 thanks!
SojournerOctocat
@SojournerOctocat
Aug 12 2015 02:33
You have to strip out spaces and punctuation. (Race car doesn't have punctuation, but other tests will.) Do you know how to use regex?
var newStr = str.replace(/\s+/g, '')
@wannabecoding That's for the spaces. Can you do the punctuation based on that?
Liz Rezes
@queenlizo
Aug 12 2015 02:34
Howdy, all. Anyone know why only the first if statement works, and not the else if statement? If I switch them around and move the else if to the top and make it an if statement, that works and the other doesn't. Thanks!
function spinalCase(str) {
  var re = /[\ _]/gi;
  var upCase = /([A-Z])\w+/g;
  var split = str.split(/(?=[A-Z])/);
    if (re) {
        return str.toLowerCase().replace(re, '-');
    } else if (upCase) {
        return split.join(" ").toLowerCase().replace(re, '-');
    }
}

spinalCase('thisIsSpinalTap');
Alejandro Tejada
@wannabecoding
Aug 12 2015 02:34
I may have to review regex again as well. I went over them earlier this week, but I think I have not been retaining everything.
Cory Johnson
@CygnusSW
Aug 12 2015 02:35

Hi everyone!

I'm looking for some feedback on how I could make this code more efficient. My code gets the job done, I didn't end up using the recommended Math.max & .min methods, so I'm wondering if there's a more efficient approach that I'm not thinking of.

function sumAll(arr) {
  var answer = 0;

  //provide a sorted array, which puts the lesser value on the left
  var sortedArray = arr.sort( function(a,b){
    return a-b;
  });

  //simple loop with i being the lowest value, and summing until the higher value
  for (i=sortedArray[0]; i <= sortedArray[1];i++){
    answer = answer + (i);
    console.log(answer);
  }

  return answer;
}

sumAll([5, 10]);
Mark Williams
@mw8020
Aug 12 2015 02:36
@wannabecoding there's a handy online practise thingy for Regex here: http://www.regexr.com/ (I'm having less trouble remembering them since I started using it)
Alejandro Tejada
@wannabecoding
Aug 12 2015 02:38
@mw8020 thanks. Going to have to head over there now
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:38
@Cory2911 I can't think of one, using max and min is as efficient as sorting, because there are only two numbers in the array, efficiency would come into play when there are more than two numbers to sort.
Cory Johnson
@CygnusSW
Aug 12 2015 02:41
@luishendrix92 So, I'm guessing for large numbers you would want to take the Math.min, and add 1 until the number reaches the Math.max. Would that be the general logic?
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:42
@Cory2911 I don't mean large numbers, just more items to sort. In this case it's fairly ok to use a for loop and sort.
Kolloom
@Kolloom
Aug 12 2015 02:44
could use some pointers on steamroller bonfire, i don't know how to get a level deeper in an array: [1, [2], [3]] to [2], [3]
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:44
This message was deleted
Rex Schrader
@SaintPeter
Aug 12 2015 02:48
@Kolloom Please share your code?
Luis Felipe López G.
@luishendrix92
Aug 12 2015 02:53
@Cory2911 Oh yes, there is one formula, sorry I messed up and got stuck in the limbo: (10*11/2)-(4*5/2)
Which could be translated to code as: return ( max * (max + 1) / 2 ) - ( (min - 1) * (min) / 2 )
This is what console says:
var max = 10;
var min = 5;
// undefined
( max * (max + 1) / 2 ) - ( (min - 1) * (min) / 2 )
// >> 45 as output
Kolloom
@Kolloom
Aug 12 2015 02:53
@SaintPeter
function checkArray (arr) {
    return arr.map(function (item) {
        return Array.isArray(item);
    })
}

function steamroller(arr) {
  while (checkArray(arr).indexOf(true) > -1) {
      //for loop (var item in arr)
        //get arr[item] that's not an array and push to another array
        //arr = arr without that arr[item]

  }
  //return another array
}

steamroller([1, [2], [3, [[4]]]]);
something like that
i think im over complicating this
Rex Schrader
@SaintPeter
Aug 12 2015 02:55
@Kolloom That seems reasonable. You just need something inside your loop to do the flattening. the easiest way to do that would be to push the individual non-array values onto an output array.
@Kolloom The reduce function is handy.
@Kolloom And you can use .some to determine if there are any arrays left in your main array
MatiKid
@MatiKid
Aug 12 2015 02:58
function add() {

  console.log(arguments[0]);

  if(typeof arguments[0] === 'number' && typeof arguments[1] === 'number') {
    return arguments[0] + arguments[1];
  } else if(typeof arguments[0] === 'number' && !arguments[1]) {
    var firstArg = arguments[0];
    var addSecondArg = function(b) {
      return firstArg + b;
    };
    return addSecondArg;
  } else {
    return undefined;
  }


}

add(2)([3]);
Still stuck with this one :worried:
Liz Rezes
@queenlizo
Aug 12 2015 02:58
Sorry to bother again, but does anyone know why the else if statement isn't working? (I changed up the code a bit from last time) Thanks!
function spinalCase(str) {
  var space = /[\ _]/gi;
  var lowCase = /([a-z])\w+/g;
  var upCase = /([A-Z])\w+/g;
  var upCaseSplit = str.split(/(?=[A-Z])/);

    if (lowCase) {
        return str.toLowerCase().replace(space, '-');
    } else if (upCase) {
        return upCaseSplit.join(" ").replace(space, '-').toLowerCase();
    }
}

spinalCase('thisIsSpinalTap');
Rex Schrader
@SaintPeter
Aug 12 2015 02:59
@queenlizo Sure - the problem is that your lowCase is a regular expression. In order to test something you need to actually apply it to something, using either .match or .test. like this:
if(myRegEx.test(someThingToTest)) {
Jesse Rafael Dizon
@jesserafael
Aug 12 2015 02:59
Hello..I'm just wondering how you guys took screenshots of the codes and posted it here..thankS
Liz Rezes
@queenlizo
Aug 12 2015 02:59
@SaintPeter Ah. I see. Thanks!
Robert
@rc242
Aug 12 2015 02:59
explain format
CamperBot
@camperbot
Aug 12 2015 02:59

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

SojournerOctocat
@SojournerOctocat
Aug 12 2015 03:03
@jesserafael Just drag the screenshot into the Gitter window.
Rex Schrader
@SaintPeter
Aug 12 2015 03:04
@MatiKid Your code looks correct, but your add(2)([3]) is wrong. Isn't it supposed to be add(2)(3)?
@SojournerOctocat @jesserafael No, do not post screenshots. They are useless. Use the formatting described above with three backticks ``` before and after your code.
MatiKid
@MatiKid
Aug 12 2015 03:05
@SaintPeter yes, but the only thing that’s not passing is:
expect(add(2)([3])).to.be.undefined;expected '23' to be undefined
Rex Schrader
@SaintPeter
Aug 12 2015 03:05
@MatiKid OH - you need to check to ensure that your function that you pass back ALSO checks the typeof for b
@MatiKid to make sure it's a number
Rob Daly
@rdaly1490
Aug 12 2015 03:06
Anyone have ideas about how to fix my destroyer function?
function destroyer(arr) {
  var args = Array.prototype.slice.call(arguments, 1);
  console.log(args);
  for(var i=0;i<arr.length;i++){
    for(var j=0;j<args.length;j++){
      if(arr[i] === args[j]){
         arr.splice(arr[i], 1);
      }
    }
  }
  console.log(arr);
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Henry Erickson
@henryed86
Aug 12 2015 03:06
Anyone here can make this bootstrap look bigger on mobile ?http://codepen.io/henryed86/pen/oXONjy
MatiKid
@MatiKid
Aug 12 2015 03:07
@SaintPeter thanks! I got it
Rex Schrader
@SaintPeter
Aug 12 2015 03:08
@henryed86 Be with you in a sec
Henry Erickson
@henryed86
Aug 12 2015 03:08
OK @SaintPeter
Rex Schrader
@SaintPeter
Aug 12 2015 03:10
@rdaly1490 I think your problem, in part, is that when you remove an item from arr, you make arr shorter, which means your value of i will be one past the current number. Essentially you end up skipping numbers every time you remove an earlier number.
@henryed86 When you say "Bigger", do you mean font? What part?
Henry Erickson
@henryed86
Aug 12 2015 03:12
Well... when I access that link on my Samsung everything looks tiny
Jesse Rafael Dizon
@jesserafael
Aug 12 2015 03:12
var speed = 65;

// Complete the condition in the ()s on line 4
if (speed>80) {
    console.log("Slow down");

} 
else {
 console.log("Drive safe");


}
Henry Erickson
@henryed86
Aug 12 2015 03:12
@SaintPeter Well... when I access that link on my Samsung everything looks tiny
Jesse Rafael Dizon
@jesserafael
Aug 12 2015 03:12
@SaintPeter thank you..
Rob Daly
@rdaly1490
Aug 12 2015 03:12
@SaintPeter thanks, so iterating backwards could remove the issue right?
Rex Schrader
@SaintPeter
Aug 12 2015 03:12
@henryed86 This Stack Overflow describes how to scale the font size: http://stackoverflow.com/questions/14537611/bootstrap-responsive-text-size
William
@minimalistStig
Aug 12 2015 03:12
Can someone help me with the exact change bonfire?
CamperBot
@camperbot
Aug 12 2015 03:12
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Jesse Rafael Dizon
@jesserafael
Aug 12 2015 03:12
@SaintPeter I just tried it here..
Henry Erickson
@henryed86
Aug 12 2015 03:12
Thanks @SaintPeter
CamperBot
@camperbot
Aug 12 2015 03:12
henryed86 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
hey @henryed86 if you found this info helpful :point_right: consider adding a wiki article!
:star: 16 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jesse Rafael Dizon
@jesserafael
Aug 12 2015 03:13
thanks @camperbot
CamperBot
@camperbot
Aug 12 2015 03:13
jesserafael sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
hey @jesserafael if you found this info helpful :point_right: consider adding a wiki article!
Kolloom
@Kolloom
Aug 12 2015 03:13
couldn't get my head around reduce
var arr = [1, [2, [3]]];
var arr2 = arr.reduce(function (item) {
    return Array.isArray(item) === true;
});
console.log(arr2); //false, suppose to be [2, [3]]

console.log(arr.map( function (item) {return Array.isArray(item)}));
//[ false, true ]
Rex Schrader
@SaintPeter
Aug 12 2015 03:13
@rdaly1490 Maybe? Might be better to do something other than remove them - for example, putting "good" numbers in another array. BTW, using the .filter function and the .indexof function makes that bonfire a LOT easier.
Rob Daly
@rdaly1490
Aug 12 2015 03:14
@SaintPeter but doesn't indexOf only show the index of the first occurrence of a number? What if there are multiple of the same number?
Rex Schrader
@SaintPeter
Aug 12 2015 03:14
@Kolloom What you need to do is use Array.concat . . . but you can ONLY do that if the item you're on is an array. If it's not, you need to make it into an array.
William
@minimalistStig
Aug 12 2015 03:15
This message was deleted
CamperBot
@camperbot
Aug 12 2015 03:15
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Aug 12 2015 03:16
@rdaly1490 Turn the problem on it's head - don't look for the 'bad' numbers in the input array, look for each number in the input array in the 'bad' array, if that makes sense
Robert
@rc242
Aug 12 2015 03:16
@minimalistStig you'll need , not '. Look by your tilde to see if you see the key.
oh god.
William
@minimalistStig
Aug 12 2015 03:16

Can someone help me with the exact change bonfire?

function drawer(price, cash, cid) {
  var change = [];
  var diff = +((cash-price).toFixed(2));
  var tid = cid.reduce(function (pre, curr) {
    return pre + curr[1];
  },0).toFixed(2);
  if (diff > tid)
    return "Insufficient Funds";
  else if (diff == tid)
    return "Closed";

  var denom = [100.00,20.00,10.00,5.00,1.00,0.25,0.10,0.05,0.01];
  for (var x = 0; x<cid.length; x++) {
    var currVal = 0;
    while (cid[x][1]>=0 && diff>=denom[x]) {
      currVal += denom[x];
      cid[x][1] -= denom[x];
      diff -= denom[x];
      console.log(currVal);
    }
    if (currVal !== 0) {
      change.push([cid[cid.length-x-1][0],currVal]);
    }
  }
  // Here is your change, ma'am.
  return change;
}

drawer(3.26, 100.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);

the answer is supposed to be [['TWENTY', 60.00], ['TEN', 20.00], ['FIVE', 15], ['ONE', 1], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.04] ] but I'm getting [['TWENTY', 30.00], ['TEN', 10.00], ['FIVE', 5], ['ONE', 61], ['QUARTER', 0.50], ['DIME', 0.20], ['PENNY', 0.03] ]

Rex Schrader
@SaintPeter
Aug 12 2015 03:16
@minimalistStig backticks - ```, below the tilde key - Note that you can EDIT your entry
William
@minimalistStig
Aug 12 2015 03:16
oh shoot
Rex Schrader
@SaintPeter
Aug 12 2015 03:16
@minimalistStig You can also delete prior entries :D
Rob Daly
@rdaly1490
Aug 12 2015 03:17
@SaintPeter aha! that's great, thatnks for the help
Robert
@rc242
Aug 12 2015 03:17
@minimalistStig what's the problem?
William
@minimalistStig
Aug 12 2015 03:18
i am passing all the tests but it pass one of them. the one where its supposed to be 60 dollars for 20
Rex Schrader
@SaintPeter
Aug 12 2015 03:19
Is anyone waiting for help that has not been helped yet?
Robert
@rc242
Aug 12 2015 03:19
@minimalistStig Don't see that as a test case.
William
@minimalistStig
Aug 12 2015 03:20
@rc242 i added the test I'm failing to the op
Robert
@rc242
Aug 12 2015 03:22
@minimalistStig looks like you have a floating point problem.
William
@minimalistStig
Aug 12 2015 03:22
@rc242 so just add a math.round() to each of the additions in the while loop?
@rc242 I tried .toFixed() but that just made everything 0
Henry Erickson
@henryed86
Aug 12 2015 03:24
@SaintPeter It didn't work
Rex Schrader
@SaintPeter
Aug 12 2015 03:24
@minimalistStig .toFixed won't work because you need a number, not a string.
@henryed86 You were unable to get the font size to change?
Robert
@rc242
Aug 12 2015 03:25
@minimalistStig one common way to get rid of floating point problems is to not use floating point numbers.
Henry Erickson
@henryed86
Aug 12 2015 03:26
@SaintPeter font stayed the same
Rex Schrader
@SaintPeter
Aug 12 2015 03:26
@henryed86 Are you sure you set the media size limits properly?
Kolloom
@Kolloom
Aug 12 2015 03:27
var arr = [1, [2, [3]]];
var arr2 = arr.reduce(function (a, b) {
    return Array(a).concat(b);
});

console.log(arr2); //[2, [3]]
what does Array(a) exactly do ? it gets rid of 1 which is not an array
Rex Schrader
@SaintPeter
Aug 12 2015 03:28
@Kolloom You need to use typeof to determine if it's an array or not. Do something different if it is an array (to make a into an array, use [a]
Robert
@rc242
Aug 12 2015 03:28
I really should have used angularjs for this twitch zipline.
Kolloom
@Kolloom
Aug 12 2015 03:28
@SaintPeter didn't answer my question though...
Henry Erickson
@henryed86
Aug 12 2015 03:29
@SaintPeter I used a media query
Rex Schrader
@SaintPeter
Aug 12 2015 03:29
@Kolloom a may or may not be an array, right? Use an if statement and and typeof to determine if it's an array or not
William
@minimalistStig
Aug 12 2015 03:30
@rc242 How would i not use floating point numbers, multiply everything by 100 first and then divide by 100 at the end?
Rex Schrader
@SaintPeter
Aug 12 2015 03:30
@henryed86 Every source on the web agrees that a media query is the way to go.
Kolloom
@Kolloom
Aug 12 2015 03:32
im quite brain dead right now, Array() seems like a function that takes an argument
Robert
@rc242
Aug 12 2015 03:33
@minimalistStig sure.
Henry Erickson
@henryed86
Aug 12 2015 03:36
@SaintPeter I'm reading the article to see if I'm missing something :package:
Rex Schrader
@SaintPeter
Aug 12 2015 03:37
@henryed86 The Chrome Dev Tools, I believe, have the facility to make your browser emulate mobile screen sizes. That may be a helpful way to test, since you can use the inspector to see if your font size is taking effect.
Robert
@rc242
Aug 12 2015 03:39
@Kolloom yeah? it just gives the Array a size..
@BerkeleyTrue is bizzy
Binny Kim
@removed~BinnyK
Aug 12 2015 03:41
anyone working on the twitch API thing? finding it tricky ...
Robert
@rc242
Aug 12 2015 03:41
@BinnyK i'm almost done with it. sup?
need to style it some.. black on white is a bit boring.
Rex Schrader
@SaintPeter
Aug 12 2015 03:42
@BinnyK You might want to ask in HelpZiplines - but we can provide help here :D
Kolloom
@Kolloom
Aug 12 2015 03:44

fiddling around a bit, from my understanding Array() packs arguments into a bigger array

console.log(Array([1])); //[[1]]
console.log(Array([1], [2])); //[[1], [2]]

console.log(Array(1)); // []
console.log(Array(2345)); // []
console.log(Array([1, [2345]])); //[[ 1, [2345] ]]
console.log(Array(1, 2)); // [1, 2]

console.log(Array('hello')); //[ 'hello' ]

but not a single number ?

Binny Kim
@removed~BinnyK
Aug 12 2015 03:46
I'm trying to break the problem into smaller steps at the mo... Its basically
  1. Fetch data from twitch api using $get
  2. Get the relevant data e.g. name, game, url
  3. somehow append it to the html?
Am i on the right path there? I know it said dont look at the code but i did have a look... (just to see if i was on the right track). But the example is written with angular? And i think this exercise is before the angular tutorials
Robert
@rc242
Aug 12 2015 03:47
BinnyK: sure, that works.
angularjs does make it easier.
Binny Kim
@removed~BinnyK
Aug 12 2015 03:49
I've been following the the curriculum mostly and the angular part is after this section haha
ok but thanks for the encouragement
Abhisek Pattnaik
@abhisekp
Aug 12 2015 03:52
@Kolloom it does everything according to specs. See https://devdocs.io/javascript/global_objects/array

@Kolloom a single numeric argument n to the Array constructor results in n length array of undefined value.
It just updates only the length property of array object without adding any other properties i.e.

{
    1: undefined,
    2: undefined,
    3: undefined,
    length: 3
}

It doesn't add the 1, 2 and 3 as the properties.

Henry Erickson
@henryed86
Aug 12 2015 03:57
@SaintPeter Text updates when I change the display size inside Codepen but only happens when I use devtools
Rex Schrader
@SaintPeter
Aug 12 2015 03:58
@henryed86 I'm afraid I don't have any addiional info on how it works. I'd have to play around with it.
Henry Erickson
@henryed86
Aug 12 2015 04:01
@SaintPeter I've still learned more , thanks
Kolloom
@Kolloom
Aug 12 2015 04:04
The code example really helps. thanks @abhisekp
Rishi Vasandani
@rvasandani
Aug 12 2015 04:05
Hey all, hows it going.. do you have to finish every challenge before moving on?
Abhisek Pattnaik
@abhisekp
Aug 12 2015 04:05
@Kolloom The code example given is wrong though. Here is the correct one.
{
    0: undefined,
    1: undefined,
    2: undefined,
    length: 3
}
  • Note the index starts from 0 not from 1
Kolloom
@Kolloom
Aug 12 2015 04:06
totally missed it, thank for the correction @abhisekp
Kyle Kinzalow
@KyleKinz
Aug 12 2015 04:08
is this not valid? <img src="http://bit.ly/fcc-kittens">
Abhisek Pattnaik
@abhisekp
Aug 12 2015 04:09
@KyleKinz sure. yes
SojournerOctocat
@SojournerOctocat
Aug 12 2015 04:09
@KyleKinz Don't most image files have a file extension?
Abhisek Pattnaik
@abhisekp
Aug 12 2015 04:09
help code formatting
CamperBot
@camperbot
Aug 12 2015 04:09

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Kyle Kinzalow
@KyleKinz
Aug 12 2015 04:10
ah i'm supposed to go to the link and grab the image I bet, eh
Abhisek Pattnaik
@abhisekp
Aug 12 2015 04:10
@KyleKinz read the instructions properly :)
Alejandro Tejada
@wannabecoding
Aug 12 2015 04:10
I'm feeling a huge change in difficulty from the earlier tracks to Bonfires... Anybody recommend a good book to help set this in better?
SojournerOctocat
@SojournerOctocat
Aug 12 2015 04:10
@KyleKinz I copied and pasted your text and it worked for me.
Kyle Kinzalow
@KyleKinz
Aug 12 2015 04:11
@_@ hrm let me refresh the page
ah, typical noob error. I was putting it in my style brackets on accident... :(
well, thanks everyone. you rock
Binny Kim
@removed~BinnyK
Aug 12 2015 04:12
http://codepen.io/testingtestingtest/pen/aOxbNE?editors=001 Can someone help me understand why my for loop isn't working?
Rex Schrader
@SaintPeter
Aug 12 2015 04:13
@BinnyK Not ever channel has a stream, I think, and if you get an error in your loop it stops executing. You're assuming things about that data which are not true in every case.
Kyle Kinzalow
@KyleKinz
Aug 12 2015 04:14
On "http://www.freecodecamp.com/challenges/waypoint-size-your-images" what about changing the images width actually makes it scale properly? why isn't it the same height but all smushed up? is css just smart like that?
i assumed you'd have to set a height and width
Binny Kim
@removed~BinnyK
Aug 12 2015 04:15
@SaintPeter hmmm ok will work on that thanks
Rex Schrader
@SaintPeter
Aug 12 2015 04:17
@BinnyK I strongly advise you to use jQuery to write to your document.
Binny Kim
@removed~BinnyK
Aug 12 2015 04:17
@SaintPeter It does seem like every time i run the loop i get given an object... Each of those object does have a 'stream' key in it... its just that some are null while some are more objects?
Rex Schrader
@SaintPeter
Aug 12 2015 04:17
@BinnyK Correct. You need to check to see if the stream === 'null'
Binny Kim
@removed~BinnyK
Aug 12 2015 04:18
I did?
I got the result... then checked if result.stream === null, else write in document...
oh maybe the quotation marks
Rex Schrader
@SaintPeter
Aug 12 2015 04:19
@BinnyK But you also var channelInfo = result.stream.channel;, BEFORE you check if stream is null
Binny Kim
@removed~BinnyK
Aug 12 2015 04:19
oh i see
Rex Schrader
@SaintPeter
Aug 12 2015 04:20
@BinnyK I'm not 100% certain that that is the entire issue - I fixed that and your code still only writes one user worth of data to the screen - but I did see the results objects in the console window. As I say, look into jQuery.append, maybe, for writing to the screen.
Binny Kim
@removed~BinnyK
Aug 12 2015 04:20
ok thanks will try that
Rex Schrader
@SaintPeter
Aug 12 2015 04:21
good luck - I'm out
Robert
@rc242
Aug 12 2015 04:21
thinking about doing the same soonish.
Abhisek Pattnaik
@abhisekp
Aug 12 2015 04:21
@wannabecoding just think on a problem more than you previously were thinking on. It takes time and patience. When I was a beginner, I use to think on a single easy problem for a day. Then eventually, it became easier and easier and then after sometime, it took me less than an hour. And currently, easy problems are solved in less than 5-10 mins.
Henry Erickson
@henryed86
Aug 12 2015 04:22
@SaintPeter OMG I wasn't including the header . Its my first time using codepen :S , it works fine now.
Rex Schrader
@SaintPeter
Aug 12 2015 04:23
@henryed86 It's always the little things . . .
Binny Kim
@removed~BinnyK
Aug 12 2015 04:23
@SaintPeter thanks
Rex Schrader
@SaintPeter
Aug 12 2015 04:23
@henryed86 "It works better if it's plugged in"
Henry Erickson
@henryed86
Aug 12 2015 04:24
@SaintPeter :D
Luis Felipe López G.
@luishendrix92
Aug 12 2015 04:35
Have you tried turning it off and on again?
Berkeley Martinez
@BerkeleyTrue
Aug 12 2015 04:46
:beep boop:
Abhisek Pattnaik
@abhisekp
Aug 12 2015 04:56
Always Remember to
RTFM :book: :books:
John Chau
@ydjjabt
Aug 12 2015 05:09
hey, u know how to use the chrome dev console debugging tool?
hey, anyone know how to use the chrome dev console debugging tool?
John Chau
@ydjjabt
Aug 12 2015 05:15
@rc242 that the exact link i m working on lol
i m lost at 'Breakpoints in Dynamic JavaScript'
i cant follow them
wontoan
@wontoan
Aug 12 2015 05:24
I'm a bit confused. What is Bonfire #28: Convert HTML Entities asking us to do?
Akhilesh7029
@Akhilesh7029
Aug 12 2015 05:27
Can anyone help me with bonfire Smallest Common Multiple?
CamperBot
@camperbot
Aug 12 2015 05:27
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Robert
@rc242
Aug 12 2015 05:28
@wontoan it's asking you to "escape" the values such that the HTML parser doesn't treat them as HTML entities.
@Akhilesh7029 what about it?
Akhilesh7029
@Akhilesh7029
Aug 12 2015 05:29
@rc242 I wrote some code but it is saying an infinite loop
Robert
@rc242
Aug 12 2015 05:30
That's a sign something is wrong with your conditional.
Akhilesh7029
@Akhilesh7029
Aug 12 2015 05:30
function smallestCommons(arr) {
var condition =0;
var temp =0;
var temp1= 0;
var count = 0;
while(condition!==10){
temp += arr1;
for(var i=arr[0];i<=arr1;i++)
{
if(temp%i===0){temp1++;}
count++;
}
if(temp1===count)condition =10;
}
return temp;
}
@rc242 yeah..
@rc242 I got whats wrong..
wontoan
@wontoan
Aug 12 2015 05:31
escape the values... such that the HTML parser doesn't treat them as HTML entities... hmm....
Robert
@rc242
Aug 12 2015 05:31
@wontoan review the description of the bonfire again.
Akhilesh7029
@Akhilesh7029
Aug 12 2015 05:31
@wontoan didnt understand
wontoan
@wontoan
Aug 12 2015 05:32
Convert the characters "&", "<", ">", '"' (double quote), and "'" (apostrophe), in a string to their corresponding HTML entities.
I understand that as translate ('Dolce & Gabanna') to 'Dolce & amp ; Gabanna'
Robert
@rc242
Aug 12 2015 05:33
bonfire html
CamperBot
@camperbot
Aug 12 2015 05:33

:fire:Bonfire: Convert HTML Entities :link:

function convert(str) {
  // &colon;&rpar;
  return str;
}

convert('Dolce & Gabbana');

Convert the characters "&", "<", ">", '"' (double quote), and "'" (apostrophe), in a string to their corresponding HTML entities.

more info:  bf details | bf links | hint

Robert
@rc242
Aug 12 2015 05:33
bf details
CamperBot
@camperbot
Aug 12 2015 05:33

:fire:Bonfire: Convert HTML Entities :link:

function convert(str) {
  // &colon;&rpar;
  return str;
}

convert('Dolce & Gabbana');
Convert the characters "&", "<", ">", '"' (double quote), and "'" (apostrophe), in a string to their corresponding HTML entities.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Robert
@rc242
Aug 12 2015 05:33
go to HTML entities.
Azhagan
@Azhagan
Aug 12 2015 05:34
Can anyone help me with Bonfire: No repeats please
CamperBot
@camperbot
Aug 12 2015 05:34
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Robert
@rc242
Aug 12 2015 05:34
explain format
CamperBot
@camperbot
Aug 12 2015 05:34

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Robert
@rc242
Aug 12 2015 05:36
@Azhagan It wants all permutations of a string with no string that has consecutive same chars (e.g., aab has two consecutive a values)
Azhagan
@Azhagan
Aug 12 2015 05:38
@rc242 so if aab has 6 permutations(aab, aba, baa, aab, aba, baa) then pick the ones without consecutive repetitions (aba, aba); Is this correct.
Robert
@rc242
Aug 12 2015 05:38
@Azhagan yes.
repeated strings don't matter.
Muatasim Qazi
@muatasimqazi
Aug 12 2015 05:39
Hi everyone, I have completed all the basic courses on CodeAcademy, from basic HTML5 and CSS until Basic JavaScript as shown on the Map. Now, I have reached the Basic Algorithm Scripting level. Even though I was able to successfully complete the CodeAcademy’s JS course, I find Bonfire beyond my skill level and very challenging. Did I miss something in between, or if you’d like to suggest any other courses I should take before starting Bonfire. Thanks!
Azhagan
@Azhagan
Aug 12 2015 05:39
@rc242 k Understood Should we do it by trying out all strings or formula.
Robert
@rc242
Aug 12 2015 05:40
@muatasimqazi Read the "More info" portions of the bonfires. They normally give you hints on what to use.
@Azhagan It's a nasty combinatoric. However, you can shorten the work by using memoization.
Azhagan
@Azhagan
Aug 12 2015 05:42
@rc242 thanks
Muatasim Qazi
@muatasimqazi
Aug 12 2015 05:42
@rc242: Thanks for the reply. I have been following that. However, the code that I need to type in is very unfamiliar to me. JS on CodeAcademy didn’t cover any of that.
Robert
@rc242
Aug 12 2015 05:44
@muatasimqazi Feel free to use whatever resources you need or review the Javascript portions again.
Muatasim Qazi
@muatasimqazi
Aug 12 2015 05:48
@rc242 Could you suggest anything in particular?
Robert
@rc242
Aug 12 2015 05:52
@muatasimqazi if you're having problems, you can ask a question here, and someone may be able to assist you. You may also want to review the Basic Javascript portion again.
@muatasimqazi you can also look at a reference guide @ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
Think I'm about to crash.
Muatasim Qazi
@muatasimqazi
Aug 12 2015 05:56
@rc242 Thanks a lot. This is really helpful. Have a good night!
Alpay
@mangoser
Aug 12 2015 06:03
@muatasimqazi hello, i wanted to add something.actually codeacademy teaches you the very basics of that topic or language. after you finish anyone, and faces with questions you can think that this beyonds me. this is normal. codeacademy's teaches you to basics with cool browser editor and fun applications that's just all :)
Muatasim Qazi
@muatasimqazi
Aug 12 2015 06:04
@mangoser thanks for the reply. I see. I didn’t expect the learning curve from codeacademy to the next level of Bonfire would be that steep.
Brian Daub
@briandaub
Aug 12 2015 06:09
Hey everyone
I was wondering if anyone was willing to offer some help.
George
@sushiyea
Aug 12 2015 06:18
I need help with Waypoint: Line up Form Elements Responsively with Bootstrap
#16
Ozy Design & Software
@OzySky
Aug 12 2015 06:18
@sushiyea yeah..
George
@sushiyea
Aug 12 2015 06:18
I know its totally wrong just can't figure where

<div class='row'>

<div class='col-xs-5'>




<div class='col-xs-7'>
<input type='text' class='form-control' placeholder='cat photo URL' required> </div>

<button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'> </i>
Submit </button>

</form>
just can't figure where to close my Div Class ?
AJ Gibson
@gibsonio
Aug 12 2015 06:24
bonfire "diff two arrays".....where am i going wrong with the code below. I feel that i'm getting close:
function diff(arr1, arr2) {

    function solver(value, index) {

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

            if(index === arr1.indexOf(arr1[i]) && value !== arr1[i]) {

                return value;
            }
        }
    }

    return arr2.filter(solver);

}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
CamperBot
@camperbot
Aug 12 2015 06:24
Sorry, can't find a bonfire called diff two arrayswhere am i going wrong with the code below i feel that im getting closefunction diffarr1 arr2 function solvervalue index forvar i 0 i arr1length i ifindex arr1indexofarr1i value arr1i return value return arr2filtersolver diff1 2 3 5 1 2 3 4 5. [ Check the map? ]
dc
@dcsan
Aug 12 2015 06:25
bf diff
CamperBot
@camperbot
Aug 12 2015 06:25

:fire:Bonfire: Diff Two Arrays :link:

function diff(arr1, arr2) {
  var newArr = [];
  // Same, same; but different.
  return newArr;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Compare two arrays and return a new array with any items not found in both of the original arrays.

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Aug 12 2015 06:31
@sushiyea
help code format
CamperBot
@camperbot
Aug 12 2015 06:31

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

George
@sushiyea
Aug 12 2015 06:32

' <div class='row'>
<div class='col-xs-5'>

<input type='text' class='form-control' placeholder='cat photo URL' required>

 <div class='col-xs-7'> 

<button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'> </i>
Submit </button>

     </form>
       </div>

</div>'

Abhisek Pattnaik
@abhisekp
Aug 12 2015 06:33
@ydjjabt are you still lost on breakpoints?
@sushiyea read the wiki How to type backticks `
George
@sushiyea
Aug 12 2015 06:34
thanks
George
@sushiyea
Aug 12 2015 06:40

` <div class='row'>
<div class='col-xs-5'>

<input type='text' class='form-control' placeholder='cat photo URL' required>

 <div class='col-xs-7'> 

<button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'> </i>
Submit </button>

     </form>
       </div>

</div>`

Jonathan Reasor
@abraxasrex
Aug 12 2015 06:42
Hey errybody. question: is there a way to access the code that i used to complete bonfire in the past? i've been saving a lot of my code, but there's a specific piece(the roman numeral challenge) that I want to revisit, but for some reason I didn't save it....
Luis Felipe López G.
@luishendrix92
Aug 12 2015 06:43
@abraxasrex Open freecodecamp, then click on your avatar (top right corner) and check your solutions, they're sorted chronologically.
Jonathan Reasor
@abraxasrex
Aug 12 2015 06:44
@luishendrix92 not working. just gives me the option to update my profile.
@luishendrix92 actually, nvmind, it just needed me to establish my username. duh. thanks for the help!
Ezekiel dela Peña
@ezekielvdp
Aug 12 2015 06:45

Hi I've finished bonfire#19

function sumAll(arr) {
  function getMinOfArray(numArray) {
    return Math.min.apply(null, numArray);
  }
  function getMaxOfArray(numArray) {
    return Math.max.apply(null, numArray);
  }

  if(Array.isArray(arr) && arr.length === 2) {
    var array = arr;
    console.log(array);
    var minNum = getMinOfArray(arr);
    console.log(minNum);
    var maxNum = getMaxOfArray(arr);
    console.log(maxNum);
    var sumOfAllNumber = 0;
    for(var i = minNum; i <= maxNum; i++) {
      sumOfAllNumber += i;
    } 
    return sumOfAllNumber;
  } else {
    return "Make sure the value is on array and got only 2 values.";
  }
}

but only used the min and max function not the reduce. I wanted to see any solution that used all the references given by the freecodecamp (which is min, max and reduce)

George
@sushiyea
Aug 12 2015 06:50

` <div class='row'>
<div class='col-xs-7'>

<input type='text' class='form-control' placeholder='cat photo URL' required>
</div>
<div class='col-xs-5'>
<button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'> </i>
Submit </button>

</div>
</form>`

Mistereo
@Mistereo
Aug 12 2015 06:52
@ezekielvdp my solution was:
function sumAll(arr) {
  var a = Math.min(arr[0], arr[1]);
  var b = Math.max(arr[0], arr[1]);
  return (b + a) * (b - a + 1) / 2;
}
Jen
@calaminejen
Aug 12 2015 06:53
Hello everyone. I'm looking for some help on the Longest Word bonfire. This is what I have so far:
function findLongestWord(str) {
  var wordArray = str.split(' ');
  for (i = 1; i >= wordArray.length; i++) {
    if (wordArray[i].length > wordArray[i-1].length) {
      var longestWord = wordArray[i].length;
      return(longestWord.length);
    } else {
      continue;
    }
  }
}

findLongestWord('The quick brown fox jumped over the lazy dog');
Ezekiel dela Peña
@ezekielvdp
Aug 12 2015 06:53
@Mistereo wow such a good code! thanks!
Jen
@calaminejen
Aug 12 2015 06:53
of course this is not working. but why?
Woolwit
@Woolwit
Aug 12 2015 06:55
Confused about Convert HTML Entities http://www.freecodecamp.com/challenges/bonfire-convert-html-entities When I Run code (with the default code as is) to see the tests, I see things like: should escape characters: expected 'Dolce & Gabbana' to equal 'Dolce & Gabbana', where I thought it should equal "Dolce &#38; Gabbana". Anyone see what I'm missing here?
Mistereo
@Mistereo
Aug 12 2015 06:55
@calaminejen i >= wordArray.length this is always false if wordArray.length > 1
Ezekiel dela Peña
@ezekielvdp
Aug 12 2015 06:56
@calaminejen you didn't declare i
and your condition will always result to false.
for(var i = 0; i < wordArray.length; i++)
Jen
@calaminejen
Aug 12 2015 06:57
oh doy. thanks @Mistereo and @ezekielvdp .
Mistereo
@Mistereo
Aug 12 2015 06:57
it's not the only problem however :)
Jen
@calaminejen
Aug 12 2015 06:58
well, yes. but probably the stupidest one!
Woolwit
@Woolwit
Aug 12 2015 07:00
@calaminejen Have a look at your code here: http://pythontutor.com/visualize.html#togetherjs=HzKVOGHqN6 It's a sharing platform. I'll walk you through a bit if you like. You can step through your code and see where it breaks.
Ezekiel dela Peña
@ezekielvdp
Aug 12 2015 07:01
@Woolwit wow, nice resoures there I have been using codeacademy's IDE for a time now lol. Thanks for this!
Brian Daub
@briandaub
Aug 12 2015 07:01
Anyone that can offer additional help to me on Bonfire 14?
CamperBot
@camperbot
Aug 12 2015 07:01
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Mistereo
@Mistereo
Aug 12 2015 07:02
@codeJunkie01 ask you questions.
@codeJunkie01 we can pair at floobits, if you want.
Brian Daub
@briandaub
Aug 12 2015 07:04
what is floobits
Mahtab
@RoadToCode822
Aug 12 2015 07:06
Is there any way to do free code camp ofline ?
Ozy Design & Software
@OzySky
Aug 12 2015 07:08
@Woolwit you need to replace & with &amp;, don't forget the semicolon! ( btw the console shows the same output - since &amp; translates to &)
Luis Felipe López G.
@luishendrix92
Aug 12 2015 07:13
@RoadToCode822 Maybe forking the entire repo?
Woolwit
@Woolwit
Aug 12 2015 07:16
Thanks @ozydesign that was what was confusing me... the console translating to an &
CamperBot
@camperbot
Aug 12 2015 07:16
woolwit sends brownie points to @ozydesign :sparkles: :thumbsup: :sparkles:
hey @woolwit if you found this info helpful :point_right: consider adding a wiki article!
:star: 7 | @ozydesign | http://www.freecodecamp.com/ozydesign
Ozy Design & Software
@OzySky
Aug 12 2015 07:16
@Woolwit no problems
John Chau
@ydjjabt
Aug 12 2015 07:17
@abhisekp i m pass breakpoints. i m at the DOM breakpoint and event listener
Woolwit
@Woolwit
Aug 12 2015 07:20
@abhisekp I don't even see that on the map, must be way out there. Congratulations... http://www.freecodecamp.com/map
Ezekiel dela Peña
@ezekielvdp
Aug 12 2015 07:28
@Mistereo Hi, can I ask how did you come up with the formula you've used.
Mistereo
@Mistereo
Aug 12 2015 07:37
@ezekielvdp it's basic school math :)
wontoan
@wontoan
Aug 12 2015 07:37
thanks @luishendrix92
CamperBot
@camperbot
Aug 12 2015 07:37
wontoan sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
hey @wontoan if you found this info helpful :point_right: consider adding a wiki article!
:star: 7 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Luis Felipe López G.
@luishendrix92
Aug 12 2015 07:38
@wontoan No problem, see you around next time.
Ezekiel dela Peña
@ezekielvdp
Aug 12 2015 07:38
@Mistereo thought so. lol. Ok thanks. :smile:
Mistereo
@Mistereo
Aug 12 2015 07:41
@ezekielvdp you can read this story about Gauss: https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss#Anecdotes
Cornelious Tujare
@Andy9860
Aug 12 2015 07:59
@Andy9860
hello everyone need some help
m unable to log in to my account
its showing email not found
Abhisek Pattnaik
@abhisekp
Aug 12 2015 08:18
@Andy9860 why are you mentioning yourself?
Ask @QuincyLarson
Soumya Rauth
@soumyaRauth
Aug 12 2015 08:44
How do I paste a code
Matthew Barber
@Honno
Aug 12 2015 08:49
@soumyaRauth
``` (shift+enter)
insert code (shift+enter)
```
Bogdan Uifalean
@bogdanuifalean
Aug 12 2015 09:09
Hello world! Any suggestions on what API I could use for the Show the Local Weather Zipline?
CamperBot
@camperbot
Aug 12 2015 09:09

welcome to FreeCodeCamp @bogdanuifalean!

Soumya Rauth
@soumyaRauth
Aug 12 2015 09:13

function chunk(arr, size) {
// Break it up.
var lenArr=arr.length;
var i;
var j;
var newArr=[i][j];
var p=arr[0];

var rowNum=lenArr/size;

for(var column=0;column<rowNum;column++){

  for(var row=0;row<size;row++)
  {

    newArr[row][column].push(p);
    p=arr[row+1];

  }

}

return newArr;

}

chunk(['a', 'b', 'c', 'd'], 2);

How do is paste code.. Should i do it line by line and scope by scope.
Matthew Barber
@Honno
Aug 12 2015 09:15

@soumyaRauth
```
// Break it up.
var lenArr=arr.length;
var i;
var j;
var newArr=[i][j];
var p=arr[0];
var rowNum=lenArr/size;
for(var column=0;column<rowNum;column++){

for(var row=0;row<size;row++)
{
newArr[row][column].push(p);
p=arr[row+1];
}

}
return newArr;
}
chunk(['a', 'b', 'c', 'd'], 2);
```

wait wut
uhh
It's a bit glitchy @soumyaRauth
Can I see someones symmetric difference solution? Here's mine
function sym() {
  var arrays = arguments;
  var differences = [];
  var checkDiff = function(item) {
      console.log("item = " + item);
      return this.indexOf(item) === -1;
    };
  if(arrays.length > 1) {
    differences = arrays[0].filter(checkDiff, arrays[1]).concat(arrays[1].filter(checkDiff, arrays[0]));
    var checkArray = arrays[0].concat(arrays[1]);
    console.log("checkArray = " + checkArray);
    for(var i = 2; i < arrays.length; i++) {
      var arguNext = arrays[i];
      differences = differences.filter(checkDiff, arguNext).concat(arguNext.filter(checkDiff, differences));
    }
  } else {
    differences = differences.concat(arrays[0]);
  }
  differences = differences.filter(function(item, index) {
    return differences.indexOf(item) === index;
  });
  return differences;
}
Mistereo
@Mistereo
Aug 12 2015 09:19
@Honno check your pm.
Pascal
@pfilippi24
Aug 12 2015 09:32
@Honno you also got a pm from me
Matthew Barber
@Honno
Aug 12 2015 09:33
im famous
Roy
@CruelCoin
Aug 12 2015 09:50

Hi All. How do i determine the effiency of my code?
If i enter the following code into the following tool: http://www.pythontutor.com/visualize.html#mode=edit

function slasher(arr, howMany)
{
  var newArray = [];
  if (howMany === 0){
    return arr;
  }
  else if (howMany >= arr.length){
    return [];
  }
  else{
    newArray = arr.slice(howMany);
  }
  return newArray;
}
slasher([1, 2, 3], 2);

The tool tells me that it executed fully in 7 steps.
Should i be trying to minimise the number of steps, or should i focus on big-O notation instead?

Leander Van Reeth
@reneald
Aug 12 2015 10:15
Could someone look at my code for Bonfire: Title Case a Sentence? It works, but I think that there's a more elegant solution.
Soumya Rauth
@soumyaRauth
Aug 12 2015 10:15
How do I paste the whole code here... ?
Eko Julianto Salim
@ekojsalim
Aug 12 2015 10:15
@soumyaRauth surround it with triple backticks ```
enter ``` press shift-enter, paste in your code, press ctrl-enter
@reneald just post it here
Leander Van Reeth
@reneald
Aug 12 2015 10:16
function titleCase(str) {
  var strSplit = str.split('');

  for (i = 0; i < strSplit.length; i++){
    if (i === 0){
      strSplit[i] = strSplit[i].toUpperCase();
    }
    else if (str.charAt(i-1) === ' ') {
      strSplit[i] = strSplit[i].toUpperCase();
    }
    else{
      strSplit[i] = strSplit[i].toLowerCase();
    }
  }
  str = strSplit.join('');
  return str;
}

titleCase("I'm a little tea pot");
Soumya Rauth
@soumyaRauth
Aug 12 2015 10:16

`function chunk(arr, size) {
var newArr=[];
var newArr2=[];
var lenArr=arr.length;

for(i=0;i<lenArr;i+size){

newArr=arr.slice(i,i+size);
newArr2.push(newArr);

}

return newArr2;

}

chunk(['a', 'b', 'c', 'd'], 2);`

Still not working!!!!!
Eko Julianto Salim
@ekojsalim
Aug 12 2015 10:17
@soumyaRauth triple backticks (```) and make the backticks on its own line
Soumya Rauth
@soumyaRauth
Aug 12 2015 10:18
three backticks on every line?? @ekojsalim
Eko Julianto Salim
@ekojsalim
Aug 12 2015 10:18
on the first and last line
enter ``` press shift-enter, paste in your code, press ctrl-enter
Soumya Rauth
@soumyaRauth
Aug 12 2015 10:18
function chunk(arr, size) {
  var newArr=[];
  var newArr2=[];
  var lenArr=arr.length;

 for(i=0;i<lenArr;i+size){

    newArr=arr.slice(i,i+size);
    newArr2.push(newArr);

  }


  return newArr2;

}

chunk(['a', 'b', 'c', 'd'], 2);
Eko Julianto Salim
@ekojsalim
Aug 12 2015 10:19
there you go :)
Soumya Rauth
@soumyaRauth
Aug 12 2015 10:19
@ekojsalim Thankksssssssssssssss a lot....
Eko Julianto Salim
@ekojsalim
Aug 12 2015 10:19
@reneald ok
Soumya Rauth
@soumyaRauth
Aug 12 2015 10:19
I am going to do it again... it's kinda fun. :)
Eko Julianto Salim
@ekojsalim
Aug 12 2015 10:19
:)
@reneald don't make i global there
you can shorten your code by using str.split(" ") instead
it will split by words
using map would make it more functional and a bit clearer
Leander Van Reeth
@reneald
Aug 12 2015 10:22
@ekojsalim Ok thanks, let me see how that works out
Leander Van Reeth
@reneald
Aug 12 2015 10:41
@ekojsalim I've boiled it down to this:
function titleCase(str) {
  str = str.toLowerCase();
  var strSplit = str.split(" ");

  for (i = 0; i < strSplit.length; i++){
      strSplit[i] = strSplit[i].charAt(0).toUpperCase() + strSplit[i].slice(1);      
  }
  str = strSplit.join(" ");
  return str;
}

titleCase("I'm a little tea pot");
Honeyful101
@Honeyful101
Aug 12 2015 10:42
Hey guys. On Waypoint: Override Styles With Important, I have ticked all the boxes, except for 'your h2 element should be red'. Any help is appreciated!
Leander Van Reeth
@reneald
Aug 12 2015 10:42
@ekojsalim I've never used map before, I've read some information about it but am not really sure how to use it in this case
Leander Van Reeth
@reneald
Aug 12 2015 10:55
@ekojsalim I did it!
function titleCase(str) {
  str = str.toLowerCase();
  var strSplit = str.split(" ");
  var strSplitTitleCase = strSplit.map(function(x){
    return x.charAt(0).toUpperCase() + x.slice(1);
  }
  );
  str = strSplitTitleCase.join(" ");
  return str;
}

titleCase("I'm a little tea pot");
thanks @ekojsalim
CamperBot
@camperbot
Aug 12 2015 10:56
reneald sends brownie points to @ekojsalim :sparkles: :thumbsup: :sparkles:
hey @reneald if you found this info helpful :point_right: consider adding a wiki article!
:star: 214 | @ekojsalim | http://www.freecodecamp.com/ekojsalim
Leander Van Reeth
@reneald
Aug 12 2015 11:00
@Honeyful101 Did you give your h2 element the correct classes?
Jose Gonzalez
@sneezyxl
Aug 12 2015 11:00
If so please message me I need of course some help lol.
fcc*
Honeyful101
@Honeyful101
Aug 12 2015 11:06
@reneald I have <h2 class='blue-text !important; urgently-red'> and then all the following text
Leander Van Reeth
@reneald
Aug 12 2015 11:09
@Honeyful101 you misplaced the !important declaration
it should go in your CSS code
Jose Gonzalez
@sneezyxl
Aug 12 2015 11:10
^
Leander Van Reeth
@reneald
Aug 12 2015 11:10
and you should add it to the class that should override other classes
Honeyful101
@Honeyful101
Aug 12 2015 11:11
Alright. Thanks
Eko Julianto Salim
@ekojsalim
Aug 12 2015 11:19
@reneald great job :)
a shorter version would be this
function titleCase(str) {
    return str.toLowerCase().split(" ").map(function(item) {
        return item.charAt(0).toUpperCase() + item.substr(1);
    }).join(" ");
}
Jose Gonzalez
@sneezyxl
Aug 12 2015 11:20
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink !important;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id='orange-text' class='pink-text blue-text' style='color: white'>Hello World!</h1>
@Honeyful101
Matthew Barber
@Honno
Aug 12 2015 11:28
Hey guys for bonfire exact change, what should I be returning? Say the change is 2 quarters, should it be like, [["QUARTER", 2]]?
Peter Daily
@thepeted
Aug 12 2015 11:36
@Honno - here was mine: [["QUARTER", 0], ["DIME", 0], ["NICKEL", 0], ["PENNY", 0.3]]
Matthew Barber
@Honno
Aug 12 2015 11:36
mhm thanks @thepeted
Leander Van Reeth
@reneald
Aug 12 2015 11:36
@ekojsalim I saw that solution on your FCC portfolio (I wasn't trying to stalk you, I swear! It just happened!), it's quite impressive! Stringing together multiple methods doesn't come naturally to me (yet).
Eko Julianto Salim
@ekojsalim
Aug 12 2015 11:38
@reneald
thanks :D
yeah, just practice chaining methods :)
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:11

@reneald Maybe even shorter ... :P or maybe a bit complicated ;)

function titleCase(str) {
  return str.replace(/(\w)([\w']*)/g, function (match, $1, $2){
    return $1.toUpperCase() + $2.toLowerCase();
  });
}

If you like to see different solns. to a given problem, do check out http://j.mp/abhisekpFCCSolns

Mark Casavantes
@AOA1USA
Aug 12 2015 12:27
<div class='col-xs-4'>
  <label><input  class="form-control" type='checkbox' name='personality'> Loving</label>
</div>
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:27

@Honno @ekojsalim In FCC/Help, please type just the following

help code format

in a new message to show relevant wiki page about code formatting

Mark Casavantes
@AOA1USA
Aug 12 2015 12:27
Give the text input in your form the class "form-control".
Matthew Barber
@Honno
Aug 12 2015 12:28
help code format
CamperBot
@camperbot
Aug 12 2015 12:28

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Matthew Barber
@Honno
Aug 12 2015 12:28
I knew that? xD @abhisekp
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:29
@Honno that's for beginner's reference. Not for you. :point_up: August 12, 2015 5:58 PM
Matthew Barber
@Honno
Aug 12 2015 12:30
huh
Mark Casavantes
@AOA1USA
Aug 12 2015 12:30
This is my first post here so I know I am a beginner.
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:31
@Honno in some previous message, I saw you struggling to explain code formatting to @soumyaRauth :point_up: August 12, 2015 5:58 PM
Matthew Barber
@Honno
Aug 12 2015 12:32
ahah I see, thanks, I'll use that later @abhisekp
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:33
@AOA1USA that was your 3rd post here as I see it. :P
@AOA1USA which waypoint you're in?
Mark Casavantes
@AOA1USA
Aug 12 2015 12:35
Waypoint: Style Text Inputs as Form Controls
I have tried many attempts without success to get the following to pass and I have no clue what I am doing wrong.
Give the text input in your form the class "form-control".
    <div class='col-xs-4'>
      <label><input  class="form-control" type='checkbox' name='personality'> Loving</label>
    </div>
@abhisekp Yes, I wanted to return a line and it entered my text. I am getting used to how this forum works. Thanks.
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:39
@AOA1USA But the instructions in this page is different http://www.freecodecamp.com/challenges/waypoint-style-text-inputs-as-form-controls

@AOA1USA It asks to

  • Give your form's text input field a class of "form-control".
  • Give your form's submit button the classes "btn btn-primary".
  • Also give this button the Font Awesome icon of "fa-paper-plane".

You can add the "fa-paper-plane" Font Awesome icon by adding <i class="fa fa-paper-plane"></i> within your submit button element.

help rtfm
CamperBot
@camperbot
Aug 12 2015 12:41

:point_right: rtfm [wiki]

RTFM is an initialism for the expression "Read The F**king Manual"

RTFM Comic

:pencil: read more about rtfm on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:41
@AOA1USA :point_up: August 12, 2015 6:11 PM
Mehrosh
@mehroshh
Aug 12 2015 12:41
lol @camperbot
Daniel Neumann
@NeuwDk
Aug 12 2015 12:42
Does anyone know why the stylish css doesn't work in "Waypoint: Build Web Apps with Express.js"?
nevermind, I figured it out.
Mehrosh
@mehroshh
Aug 12 2015 12:47
what was it? @NeuwDk
Mark Casavantes
@AOA1USA
Aug 12 2015 12:47
@abhisekp I did everything else and I got a check mark for it. The only part I have trouble with is the "form-control".
Mehrosh
@mehroshh
Aug 12 2015 12:47
paste your code here, if you must @AOA1USA
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:50
@AOA1USA paste your updated code here now.
Mark Casavantes
@AOA1USA
Aug 12 2015 12:51
@camperbot I guess I do not understand the manual. Is there an error in my code? Is my code in the wrong place? I didn't post a question until I gave it a good try.
Daniel Neumann
@NeuwDk
Aug 12 2015 12:53
@mehroshh Instead of just passing in the location, I had to pass an object with a src key and then the location as the value to that key.
Emad
@RedElv
Aug 12 2015 12:54
hello can any one help me with Waypoint: Wrap an Anchor Element within a Paragraph
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:54
@AOA1USA will you please post your soln.
Emad
@RedElv
Aug 12 2015 12:54
blob
I done most of the requirements of the challenge but I have one left
Mehrosh
@mehroshh
Aug 12 2015 12:55
makes sense. thanks @NeuwDk
Emad
@RedElv
Aug 12 2015 12:55
:(
Daniel Neumann
@NeuwDk
Aug 12 2015 12:55
@mehroshh are you at the same exercise?
Mehrosh
@mehroshh
Aug 12 2015 12:56
nope @NeuwDk im on bonfires
Daniel Neumann
@NeuwDk
Aug 12 2015 12:57
@mehroshh Ah, ok :) Happy coding!
Mehrosh
@mehroshh
Aug 12 2015 12:57
you too @NeuwDk xD
@RedElv your code looks fine to me
Abhisek Pattnaik
@abhisekp
Aug 12 2015 12:58
@RedElv soln. click here :point_up: August 12, 2015 6:23 PM
Liz Rezes
@queenlizo
Aug 12 2015 13:49
Good morning all! Can anyone tell me why this else if statement isn't working in this? Thanks!
function spinalCase(str) {
  var space = /[\ _]/gi;
  var lowCase = /([a-z])\w+/g;
  var upCase = /(?=[A-Z])/;
  var upCaseSplit = str.split(upCase);
  var strSplit = " ";

    if(lowCase.test(str) === true) {
        return str.toLowerCase().replace(space, '-');
    } else if(upCase.test(upCaseSplit) === true) {
        return upCaseSplit.join(" ").replace(space, '-').toLowerCase();
    }
}

spinalCase('thisIsSpinalTap');
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:53
@queenlizo how did you send that photo?
Liz Rezes
@queenlizo
Aug 12 2015 13:53
help markdownn
CamperBot
@camperbot
Aug 12 2015 13:53
no wiki entry for: markdownn
:pencil: click here to create one now!after creating your page type update to reload it here
Joris Labie
@labiej
Aug 12 2015 13:53
help format
CamperBot
@camperbot
Aug 12 2015 13:53

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Mehrosh
@mehroshh
Aug 12 2015 13:54
help chat
CamperBot
@camperbot
Aug 12 2015 13:54

:point_right: casual chat rooms [wiki]

The following are our casual chat rooms.

Please note that all chat rooms listed here are publicly accessible and indexed by search engines, so only share email addresses or other sensitive information in private messages.

Chat Room Description
Hardware chat about computer hardware and Internet of Things
GameDev chat about designing and developing video games
Gaming chat about gaming of all kinds, such as video games and table top games
TVandMovies chat about TV shows and movies
Sports chat about sports
Music chat about music
Art and Photography chat about art, photography and videography
Business chat about business and entrepreneurship
Saving chat about saving, investing, and home economics
SelfImprovement chat about productivity, self improvement and quantified self

By joining these chat rooms, you accept our Code of Conduct. If you think we should add a chat room, please message @quincylarson in Gitter.

Official Free Code Camp chat rooms
:pencil: read more about casual chat rooms on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Aug 12 2015 13:54
@KrishaanKhubchand that's not a photo though
Mehrosh
@mehroshh
Aug 12 2015 13:54
omg i was just kidding alright
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:55
how do i send my screen? i've taken a screenshot already @abhisekp
Abhisek Pattnaik
@abhisekp
Aug 12 2015 13:55
@mehroshh no. You're not. :-1:
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:55
Well a print screen ... @abhisekp
Mehrosh
@mehroshh
Aug 12 2015 13:55
i was kidding about the help thing. drag and drop works quite well for me xD
Joris Labie
@labiej
Aug 12 2015 13:55
@queenlizo I think you might be missing a flag for the upCase-regex
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:55
file:///C:/Users/Owner/Pictures/Screenshot_1.png
Joris Labie
@labiej
Aug 12 2015 13:55
@KrishaanKhubchand don't use print-screens just post the code
Liz Rezes
@queenlizo
Aug 12 2015 13:56
@labiej Hmm.... I'll play around with that. Thanks!
Joris Labie
@labiej
Aug 12 2015 13:56
a "g" after the final / might fix it
Liz Rezes
@queenlizo
Aug 12 2015 13:56
@labiej Ah. Let me try that.
Mehrosh
@mehroshh
Aug 12 2015 13:56
11250023_812379878880728_6669805774810582350_n.jpg
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:56

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

<style>
.red-text {
color: red;
}

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



}

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>

Mehrosh
@mehroshh
Aug 12 2015 13:56
see drag and drop always works xD
Joris Labie
@labiej
Aug 12 2015 13:57
now use formatting
Abhisek Pattnaik
@abhisekp
Aug 12 2015 13:57
help code format
CamperBot
@camperbot
Aug 12 2015 13:57

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:57
can someone tell me why this is not red?
Abhisek Pattnaik
@abhisekp
Aug 12 2015 13:57
@KrishaanKhubchand :point_up: August 12, 2015 7:27 PM
Joris Labie
@labiej
Aug 12 2015 13:57
because your css is a mess
Liz Rezes
@queenlizo
Aug 12 2015 13:58
@labiej Hmm... No. Not working. I'm going to play around with the regex some
Joris Labie
@labiej
Aug 12 2015 13:58
you need to make a NEW class urgently-red independent of blue-text
@queenlizo I don't understand look-ahead and lookbacks myself so good luck
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 13:58
i'm completeley lost
Abhisek Pattnaik
@abhisekp
Aug 12 2015 13:59
@KrishaanKhubchand Even we're lost looking at it. Please paste in proper format.
Mehrosh
@mehroshh
Aug 12 2015 14:00
let your blue-text class stay untouched . define a new one named .urgently-red below it with a property color: red !important; @KrishaanKhubchand
crap
typos
Abhisek Pattnaik
@abhisekp
Aug 12 2015 14:01
@KrishaanKhubchand :point_up: August 12, 2015 7:27 PM
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 14:01

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

<style>
.red-text {
color: red;
}

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



}

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>`

Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 14:02
oh my goodness the`` thing isn't working
Mehrosh
@mehroshh
Aug 12 2015 14:02
start with three of them @KrishaanKhubchand
Joris Labie
@labiej
Aug 12 2015 14:02
read the next message very carefully
help format
CamperBot
@camperbot
Aug 12 2015 14:02

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

``` ⇦ Type 3 backticks, then press [shift + enter ⏎]

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 14:03
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<style>
  .red-text {
    color: red;
  }

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



  }

  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>
I DID ITT
okay, now what have i done wrong guys?
Mehrosh
@mehroshh
Aug 12 2015 14:03
yes you have @KrishaanKhubchand xD
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 14:03
finally @mehroshh
Joris Labie
@labiej
Aug 12 2015 14:04
don't modify the .blue-text class
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 14:04
so why isn't my text red?
Joris Labie
@labiej
Aug 12 2015 14:04
create a new one
Mehrosh
@mehroshh
Aug 12 2015 14:04
try this @KrishaanKhubchand :
.blue-text {
font-family: Lobster, Monospace;
    color: blue;
}
.urgently-red {
 color: red !important;
}
Krishaan Khubchand
@KrishaanKhubchand
Aug 12 2015 14:05
perfect! thank you @mehroshh !
Mehrosh
@mehroshh
Aug 12 2015 14:06
you need two classes independent of each other. here the blue-text one says i need to give everything a font of this and a blue color. but since your uregently-red has !important in it. it overrides whatever is being implied by blue-text and instead bathe everything with blood @KrishaanKhubchand
you welcome
Karin Meersman
@mientje
Aug 12 2015 14:14
I'm working on the random quote machine and I have problems tweeting my quote. I've created my own arry and I can produce the quotes. I can install a button with the button generator or something with intent. The twitter window opens but I can't copy the quote into the tweet window. I can fill in the text manually and then it will appear : < a href = "https://twitter.com/intent/tweet?text=result" (the word 'result' will be in the tweet) or I can use the button generator and then the name of my function will appear. I feel pretty overwhelmed by the documentation. Could I solve this with dom-manipulation (know little about that but am willing to ponder deeply on this question), do I have to insert one of the twitter doc scripts (and put them in separate files).Please help, this is SO exhausting.
Abhisek Pattnaik
@abhisekp
Aug 12 2015 14:16
@mientje are you writing an essay? :(
Could you please break down the para?
Karin Meersman
@mientje
Aug 12 2015 14:19
I need to copy a quote into a tweet.
The twitter doc is BIG and puzzle-like, pieces are scattered everywhere.
Peter Daily
@thepeted
Aug 12 2015 14:21
@mientje you can use JS to create the web intent URL based on your quote and JQuery to insert the link in to the DOM
or something like that?!
Twitter has a tweet button widget that can do this automatically, although it doesn't play nice with dynamic content.
I found the twitter button one of the trickiest bits of the random quote generator challenge, but rest assured there are several different ways of doing it
Karin Meersman
@mientje
Aug 12 2015 14:22
I can insert that but it will not copy the quote into the tweet.
Peter Daily
@thepeted
Aug 12 2015 14:23
@mientje Are you generating the link anew each time you generate a new quote?
Karin Meersman
@mientje
Aug 12 2015 14:23
Web intent could work with a bit of dom manipulation?
Peter Daily
@thepeted
Aug 12 2015 14:23
@mientje Yes.
Karin Meersman
@mientje
Aug 12 2015 14:24
Ok, will try that
Peter Daily
@thepeted
Aug 12 2015 14:24
@mientje as a hint, I would check out this JS method
encodeURIComponent
Karin Meersman
@mientje
Aug 12 2015 14:25
Thank you, am checking it out!
By the way, I use a button, when I click on it, the quote is generated (with a Math,random number) and the tweet is a second button
So the quote is not generated when I click on the tweet button, though when I use the button generator and some twitter script I inserted, the name of my function appeared
Peter Daily
@thepeted
Aug 12 2015 14:30
@mientje Think that approach is fine
I have a function that sets up the intent URL at the same time as generating a new random quote.
If you get stuck then you can give me a shout - I'm finishing off doing the quote generator myself at the mo - just need to finish off the layout now.
Chocobowings
@chocobowings
Aug 12 2015 14:40
Hi guys. I need some help with Bonfire: No repeats please
Russell Westberry
@russbus
Aug 12 2015 14:44
This message was deleted
Karin Meersman
@mientje
Aug 12 2015 14:47
@thepeted Thank you for the hints - didn't know this encodeURI thing existed - really helpful
@chocobowings What is the problem exactly?
Chocobowings
@chocobowings
Aug 12 2015 14:56
@mientje A bit stuck on working the math...Cause i know that factorial will give me all the permutations but i am not sure how to get the ones without repetition... :S
Coira Ellison
@Coira
Aug 12 2015 15:02
@chocobowings I couldn't work out the maths, I generated all the permutations instead and filtered it
it must be possible to find a formula, but I feel I'd need to know more about combinatorics to do so
Dayne Wright
@daynewright
Aug 12 2015 15:03
Is anyone currently going through this: http://jhusain.github.io/learnrx/ ?
Chocobowings
@chocobowings
Aug 12 2015 15:03
@Coira That's how i feel...
Karin Meersman
@mientje
Aug 12 2015 15:06
@chocobowings I was very bad at maths, hopeless rather, so I didn't boter with it and made a big ugly listmaker listing all permutations. Then I used a regex to take out all the ones with repetitions in them and pushed them into a new list, used the length and that was it. What have you got so far?
@Daynewr I used none of it in the following exercises though I was quite impressed. Very difficult. I looked at all the solutions and then tried to make the exercises again. Several times.
Chocobowings
@chocobowings
Aug 12 2015 15:08
@mientje Not much just a function calculating all permutations (factorial basically) and one function weeding out the strings with only one character repeated
Karin Meersman
@mientje
Aug 12 2015 15:09
@chocobowings Do you get them in a list or have you calculated how many there are?
Abhisek Pattnaik
@abhisekp
Aug 12 2015 15:10
@Daynewr once i was doing learnrx. I do have some answers.
Chocobowings
@chocobowings
Aug 12 2015 15:10
@mientje Just the number of permutations....
@mientje I guess going with the list will be easier :S
Coira Ellison
@Coira
Aug 12 2015 15:14
I might ask around later when it's busier, see if anyone managed to calculated it
Karin Meersman
@mientje
Aug 12 2015 15:15
@chocobowings Yeah, tried that for a week - I started with creating the permutations of three characters, then expanded that - It was quite difficult but a lot easier than the maths - splice was a key for me, send something and I can look at the code
Dayne Wright
@daynewright
Aug 12 2015 15:16
@mientje @abhisekp Thanks guys. I can walk through the answers and see how they are determined, but at this point I definitely can not reproduce a lot of them on my own.
I am just curious how much time I need to spend going through this before moving on to ziplines and future tasks.
Karin Meersman
@mientje
Aug 12 2015 15:21
@Daynewr It's difficult stuff but if you look at the answers it starts to make sense (though the explanation of those functions is really hard, I find the exercises easier to understand) -
Dayne Wright
@daynewright
Aug 12 2015 15:22
Yeah..I agree. Reviewing the exercises is easier than the explanation.
Ok..I think my plan will be to keep walking through them so I understand them and then move on
Abhisek Pattnaik
@abhisekp
Aug 12 2015 15:23
@Daynewr so don't look at it now. Complete other JS tuts and then move to learnrx
Karin Meersman
@mientje
Aug 12 2015 15:24
@Daynewr @abhisekp Absolutely, don't spend too much time on this
Dayne Wright
@daynewright
Aug 12 2015 15:26
thanks @abhisekp
CamperBot
@camperbot
Aug 12 2015 15:26
daynewr sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
hey @daynewr if you found this info helpful :point_right: consider adding a wiki article!
Mehrosh
@mehroshh
Aug 12 2015 15:26
I keep getting random violent urges while im working on a new bonfire
CamperBot
@camperbot
Aug 12 2015 15:26
:star: 24 | @abhisekp | http://www.freecodecamp.com/abhisekp
Dayne Wright
@daynewright
Aug 12 2015 15:26
thanks @mientje
CamperBot
@camperbot
Aug 12 2015 15:26
daynewr sends brownie points to @mientje :sparkles: :thumbsup: :sparkles:
hey @daynewr if you found this info helpful :point_right: consider adding a wiki article!
:star: 132 | @mientje | http://www.freecodecamp.com/mientje
Mehrosh
@mehroshh
Aug 12 2015 15:26
help brownie points
CamperBot
@camperbot
Aug 12 2015 15:26
no wiki entry for: brownie points
:pencil: click here to create one now!after creating your page type update to reload it here
Mehrosh
@mehroshh
Aug 12 2015 15:27
help points
CamperBot
@camperbot
Aug 12 2015 15:27

:point_right: points [wiki]

you can get points from being thanked by people
:pencil: read more about points on the FCC Wiki
Mehrosh
@mehroshh
Aug 12 2015 15:27
awww
Moisés Man
@moigithub
Aug 12 2015 15:28
thanks @mehroshh
CamperBot
@camperbot
Aug 12 2015 15:28
moigithub sends brownie points to @mehroshh :sparkles: :thumbsup: :sparkles:
hey @moigithub if you found this info helpful :point_right: consider adding a wiki article!
Moisés Man
@moigithub
Aug 12 2015 15:28
there ur brownies :P
Abhisek Pattnaik
@abhisekp
Aug 12 2015 15:28
about @moigithub
Mehrosh
@mehroshh
Aug 12 2015 15:28
thanks @moigithub
CamperBot
@camperbot
Aug 12 2015 15:28
mehroshh sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
hey @mehroshh if you found this info helpful :point_right: consider adding a wiki article!
Mehrosh
@mehroshh
Aug 12 2015 15:29
there you go too xD
can we mess around @camperbot
xD
help Quincy Larson
CamperBot
@camperbot
Aug 12 2015 15:29
no wiki entry for: quincy larson
:pencil: click here to create one now!after creating your page type update to reload it here
Mehrosh
@mehroshh
Aug 12 2015 15:29
lol
Abhisek Pattnaik
@abhisekp
Aug 12 2015 15:30
@mehroshh go to https://gitter.im/camperbot/testing and mess around.
Mehrosh
@mehroshh
Aug 12 2015 15:30
update
CamperBot
@camperbot
Aug 12 2015 15:30
updating wiki...
Updating 4d40fe9..9d0e1ea Fast-forward
quincy-larson.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 quincy-larson.md
done code: 0
:computer:
Mehrosh
@mehroshh
Aug 12 2015 15:31
help qunicy larson
CamperBot
@camperbot
Aug 12 2015 15:31
no wiki entry for: qunicy larson
:pencil: click here to create one now!after creating your page type update to reload it here
Mehrosh
@mehroshh
Aug 12 2015 15:31
help quincy larson
CamperBot
@camperbot
Aug 12 2015 15:31

:point_right: quincy larson [wiki]

He is the founder of this lovely community!
:pencil: read more about quincy larson on the FCC Wiki
Mehrosh
@mehroshh
Aug 12 2015 15:31
cool this works xD
Lightwaves
@Lightwaves
Aug 12 2015 15:50
hello mehroshh
Mehrosh
@mehroshh
Aug 12 2015 15:51
hi @Lightwaves so good to see you back
how have you been?
remember that one time we were talking about how there should be a counter for how many time a camper is thanked by other fellow campers? @Lightwaves that thing's already been implemented xD
Lightwaves
@Lightwaves
Aug 12 2015 15:52
@mehroshh I've been well, keeping abreast of all the small issues that keep coming with with what I'm working on.
Mehrosh
@mehroshh
Aug 12 2015 15:52
thanks @Lightwaves
CamperBot
@camperbot
Aug 12 2015 15:52
mehroshh sends brownie points to @lightwaves :sparkles: :thumbsup: :sparkles:
hey @mehroshh if you found this info helpful :point_right: consider adding a wiki article!
:star: 131 | @lightwaves | http://www.freecodecamp.com/lightwaves
Abhisek Pattnaik
@abhisekp
Aug 12 2015 15:52
@mehroshh @Lightwaves travelling at speed of EM waves is really hot. :P
Lightwaves
@Lightwaves
Aug 12 2015 15:52
haha I shall emit my positive thoughts as photons and send them to you thanks @abhisekp
Mehrosh
@mehroshh
Aug 12 2015 15:53
@abhisekp i found this one actually work as a pain remover xD
Kameron Robinson
@RobinsonKameron
Aug 12 2015 16:02
I need help with my Person constructor anyone have ideas?
var Person = function(firstAndLast) {
 // Getters
    this.getFullName = function(){
          return firstAndLast;
    };
    this.getLastName = function(){
          return firstAndLast.split(' ')[0];
    };
    this.getFirstName = function(){
          return firstAndLast.split(' ')[1];
    };

 // Setters
    this.setFullName = function(fullName){
        firstAndLast = fullName;
        return firstAndLast;
    };

    this.setFirstName = function(first){
        firstAndLast = first + " " + firstAndLast.split(' ')[1];
        return firstAndLast;
    };
    this.setLastName = function(last){
        firstAndLast = firstAndLast.split(' ')[0] + " " + last;
        return firstAndLast;
    };

    return firstAndLast;
};

var bob = new Person('Bob Ross');
bob.getFullName();
Ozy Design & Software
@OzySky
Aug 12 2015 16:06
@RobinsonKameron shows nine methods right?
Moisés Man
@moigithub
Aug 12 2015 16:11
@RobinsonKameron setters NOT need returns.. also.. first name its the "first" element so index 0,,, and lastName its index 1
Raul Tomescu
@RaulTsc
Aug 12 2015 16:18
botstatus
CamperBot
@camperbot
Aug 12 2015 16:18
All bot systems are go!
botVersion: 0.0.8a
env: prod
botname: camperbot
Brock
@br0ck
Aug 12 2015 16:18
I am trying to find a partner to work through things together. Is there a spot that's better for pairing up?
Mehrosh
@mehroshh
Aug 12 2015 16:20
help chat
CamperBot
@camperbot
Aug 12 2015 16:20

:point_right: casual chat rooms [wiki]

The following are our casual chat rooms.

Please note that all chat rooms listed here are publicly accessible and indexed by search engines, so only share email addresses or other sensitive information in private messages.

Chat Room Description
Hardware chat about computer hardware and Internet of Things
GameDev chat about designing and developing video games
Gaming chat about gaming of all kinds, such as video games and table top games
TVandMovies chat about TV shows and movies
Sports chat about sports
Music chat about music
Art and Photography chat about art, photography and videography
Business chat about business and entrepreneurship
Saving chat about saving, investing, and home economics
SelfImprovement chat about productivity, self improvement and quantified self

By joining these chat rooms, you accept our Code of Conduct. If you think we should add a chat room, please message @quincylarson in Gitter.

Official Free Code Camp chat rooms
:pencil: read more about casual chat rooms on the FCC Wiki

Mehrosh
@mehroshh
Aug 12 2015 16:21
CamperBot
@camperbot
Aug 12 2015 16:21
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Mehrosh
@mehroshh
Aug 12 2015 16:22
bonfire Mutations
CamperBot
@camperbot
Aug 12 2015 16:22

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

mutation(['hello', 'hey']);

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

Logan Tegman
@ltegman
Aug 12 2015 16:32
@br0ck Check out the Lets Pair channel at https://gitter.im/FreeCodeCamp/LetsPair
Mistereo
@Mistereo
Aug 12 2015 16:48
@natac13 you can fallback to geoip if html5 Geolocation Api is blocked or don't available :)
@natac13 I mean something like http://www.telize.com to get latitude/longitude.
Cody Bouscaren
@codybousc
Aug 12 2015 16:50

Hey all, I'm having some trouble with Bonfire #16. Can anyone offer some advice on a better way to approach it? So far, my code returns "["[object Object] ", "[object Object] [object Object] ", "[object Object] [object Object] [object Object] "]"

```
function where(collection, source) {
var text = "";
var arr = [];
for (source in collection) {
text += collection[source] + " ";
arr.push(text);
}
return arr;
}

console.log(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }));

function where(collection, source) {
    var text = ""; 
    var arr = []; 
    for (source in collection) {
        text += collection[source] + " ";
        arr.push(text);         
    }
    return arr;    
}

console.log(where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' }));
rbunz
@rbunz08
Aug 12 2015 16:51
@codybousc instead of doing source in collection try objects in collection
@codybousc I did it in the following steps....
// get source property name
//get the objects in collection
//check to see if the collection object has the same property as the source
//check to see if the property values match
//push the object into a new array
//return the array
Cody Bouscaren
@codybousc
Aug 12 2015 16:53
@rbunz08 do you mean literally replace source with 'objects'?
rbunz
@rbunz08
Aug 12 2015 16:54
yea
Because right now your asking it to get the source argument within the collections arugument
Cody Bouscaren
@codybousc
Aug 12 2015 16:54
hmm. that gives me the same output
rbunz
@rbunz08
Aug 12 2015 16:55
hmm
function where(collection, source) {
  var arr = [];
  // get source property name
  var sourceProp = Object.keys(source);

 //get the objects in collection
  for (var objects in collection) {
    var collectionObject = collection[objects];
This is how I started.... then I checked to see if the collectionObject had the same property as what was given in the source argument
If it did then I got it to see if the values were the same...
If they were then I pushed the object into a new array
Your code looks more concise..mine was pretty long with some embedded if statements so if you can adapt what I did to fit what you have that would prob be best lol
Cody Bouscaren
@codybousc
Aug 12 2015 16:59
@rbunz08 that definitely helps! thank you!
rbunz
@rbunz08
Aug 12 2015 17:00
@codybousc np!
Can someone help me adapt this code please?? The idea is to compare two arrays and return a new array with all the items not found in either of the original arrays. I can get my code to work if the two arrays are numbers but it does not work if the arrays are a series of strings... for example ...
function diff(arr1, arr2) {

  //slice the two arrays 
  array1 = arr1.slice();
  array2 = arr2.slice();
  console.log("array 1 " + array1);
  console.log("array 2 " + array2);

  //filter out the numbers that are the same
  var filtered = arr2.filter(function(value){  
      return (array1.indexOf(value) === -1);

  });
  console.log("filtered Array" + filtered);

  //return the final filtered array
  return filtered;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);

This works great for the array given....it returns '4' because that is the only number not repeated in either array..
However if I change the bottom to

diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']);

it returns an empty array...

Moisés Man
@moigithub
Aug 12 2015 17:05
what this does ?? array1 = arr1.slice();
Lightwaves
@Lightwaves
Aug 12 2015 17:06
@moigithub It seems like it just does a copy of the array
rbunz
@rbunz08
Aug 12 2015 17:06
I thought it separated the numbers in the array but maybe not... lol
Moisés Man
@moigithub
Aug 12 2015 17:06
@Lightwaves i know :P
since u doing console.log u can check what u getting...
Blairlosaria
@Blairlosaria
Aug 12 2015 17:07
Can someone help me how to do this. :(
Untitled.png
Moisés Man
@moigithub
Aug 12 2015 17:08
@rbunz08 diff.. its not only a-b.. but
finalResult =(a-b) + (b-a)
rbunz
@rbunz08
Aug 12 2015 17:10
@moigithub Yea but I am not sure how to make both happen
Russell Westberry
@russbus
Aug 12 2015 17:10
Can't figure a way to do this sum of all numbers in a range bonfire without .reduce() being redundant.
Moisés Man
@moigithub
Aug 12 2015 17:10

@rbunz08

 var filtered = arr2.filter(function(value){  
      return (array1.indexOf(value) === -1);
  });

what that does ??

rbunz
@rbunz08
Aug 12 2015 17:10
@russbus I just did that one...paste ur code?
@moigithub I have changed it to...
function diff(arr1, arr2) {

  //filter out the numbers that are the same
  var filtered = arr1.filter(function(value){  
      return (arr2.indexOf(value) === -1);

  });

  //return the final filtered array
  return filtered;
}

diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']);
but that says to check the first argument and filter out any values that are in the second argument
the === - 1 says that if the values are false (false means the index would be -1 because it would not be there)
Moisés Man
@moigithub
Aug 12 2015 17:12
yea that works too.. using a copy of arr1 or the original, will be the same :)..
so... in resume.. the filter will be doin a-b
Alexander Schuneman
@AxSch
Aug 12 2015 17:13

I’m on bonfire two, and can’t figure out whats wrong with my code:
function factorialize(num) {
if(num < 0){
return -1;
}
else if(num === 0){
return 0;
}
else{
return (num * factorialize(num -1));
}

}

factorialize(10);

rbunz
@rbunz08
Aug 12 2015 17:13
so now it works the other way around but how do I get it to look at a-b and b-a
Moisés Man
@moigithub
Aug 12 2015 17:13
now u need to do b-a and "concat" both results
instead of filtering arr1 out arr2..
u need to do the other way.. filter arr2 out arr1
(switch the variables) :)
rbunz
@rbunz08
Aug 12 2015 17:16
@moigithub got it!!!
function diff(arr1, arr2) {

  //filter out the numbers in arr1 that are in arr2
  var filtered1 = arr1.filter(function(value){  
      return (arr2.indexOf(value) === -1);

  });
  //filter out the numbers in arr12 that are in arr1
  var filtered2 = arr2.filter(function(value){  
      return (arr1.indexOf(value) === -1);

  });
  //add the two above results together
  var filtered = filtered1.concat(filtered2);

  //return the final filtered array
  return filtered;
}

diff(['diorite', 'andesite', 'grass', 'dirt', 'pink wool', 'dead shrub'], ['diorite', 'andesite', 'grass', 'dirt', 'dead shrub']);
Moisés Man
@moigithub
Aug 12 2015 17:16
^_^ congratz!!
Russell Westberry
@russbus
Aug 12 2015 17:17
@rbunz08
function sumAll(arr) {
  var fullArr = [];
  var low = Math.min(arr[0], arr[1]);
  var high = Math.max(arr[0], arr[1]);
  for (var i = low; i <= high; i++) {
    fullArr.push(i);
  }
  return fullArr.reduce(function(a, b) {
    return a + b;
  });
}

sumAll([1, 4]);

function sumAll2(arr) {
  var sum = 0;
  var low = Math.min(arr[0], arr[1]);
  var high = Math.max(arr[0], arr[1]);
  for (var i = low; i <= high; i++) {
    sum += i;
  }
  return sum;
}

sumAll2([1, 4]);
They both work. I just don't get why you'd use the one with .reduce() in this case (as the site recommends). Is there a simpler way to get a range I'm missing?
Moisés Man
@moigithub
Aug 12 2015 17:18
@AxSch if u multiply any num * 0 what result u get ???
rbunz
@rbunz08
Aug 12 2015 17:19

alter your full.Arr to... something like

var total = array.reduce(function(a, b) {
return a + b;
});

return(total);
}

Russell Westberry
@russbus
Aug 12 2015 17:25
What I'm saying is, there doesn't seem to be a reason to use .reduce() at all, unless I'm missing something.
Moisés Man
@moigithub
Aug 12 2015 17:26
its just an exercise, to take u to learn Array.reduce
Russell Westberry
@russbus
Aug 12 2015 17:28
@moigithub If that's the case, the exercise should provide a range of numbers as the argument instead of making you generate one.
Moisés Man
@moigithub
Aug 12 2015 17:28
using for/loop only will be faster cuz... u no need to create the array to use reduce(wich its another loop -internally)
Sean
@seanr707
Aug 12 2015 17:30
@moigithub maybe for that simple example, but in the later exercises for loops will become cumbersome
Briana Swift
@brianamarie
Aug 12 2015 17:38
Hello everybody! I'm trying to solidify my understanding of CDNs (content delivery networks) and want to check that I'm on the right path. Are these statements correct?
  1. A CDN falls somewhere between the servers at the data center that store data and the internet service providers.
  2. CDNs goal is to establish higher quality network connections.
  3. CDNs accomplish this by providing more routes that can accomodate large amounts of traffic.
Mahtab
@RoadToCode822
Aug 12 2015 17:44
Not sure why this code isn't working when i'm trying to return largest numbers in arrays
function largestOfFour(arr) {
  var num = [];
  var longest = 0;
  for (i=0; i<arr.length; i++){
    var subArray = arr[i];
      for(j=0; j<subArray.length; j++){
        if(longest < subArray[j]) {
        longest = subArray[j];
    }
        num.push(longest);

  }
  return num;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Russell Westberry
@russbus
Aug 12 2015 17:52
@RoadToCode822 Double-check your brackets.
Briana Swift
@brianamarie
Aug 12 2015 17:53
Right now, your loop is going through all of the numbers in the first array. It's pushing 4 because it becomes longest, then 5 becomes longest. Since there's no numbers bigger than 5 for the rest of arr[0], longest stays 5. I don't know why it's not iterating through every sub array in arr, but that's because nested loops always melt my brain
There also needs to be another } after your return.
I took out the nested array to get that conclusion:
function largestOfFour(arr) {
  var num = [];
  var longest = 0;

      for(j=0; j<arr[0].length; j++){
        if(longest < arr[0][j]) {
        longest = arr[0][j];
    }
        num.push(longest);

  }
  return num;
}


largestOfFour([[4, 5, 6, 12], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
If you run that, it returns [4, 5, 6, 12]
Briana Swift
@brianamarie
Aug 12 2015 18:01
That part has to do with where you're push occurs in regards to other closures }
I think your biggest problem is you're missing } before the num.push
Moisés Man
@moigithub
Aug 12 2015 18:09
@brianamarie
  1. CDNs accomplish this by providing more routes that can accomodate large amounts of traffic.
    i think...
    lot of servers around the globe, so if u in "A city " it connect to closer server (probably A,B or C server) instead go "Z city server"
Rex Schrader
@SaintPeter
Aug 12 2015 18:11
@moigithub @brianamarie CDN = Contend Delivery Network - they have large numbers of servers which are "networkly" close to various nodes on the Intent. They may be physically closer, but they're really just more "bandwidth" closer. The idea is that they serve content faster by going through fewer hops. They also have higher capacity - usualy more servers and more bandwidth - then a single server.
Briana Swift
@brianamarie
Aug 12 2015 18:22
@moigithub @SaintPeter Awesome. So ISPs pay CDNs to improve their service, or do CDNs pay ISPs and data centers or websites pay CDNs?
Rex Schrader
@SaintPeter
Aug 12 2015 18:25
@brianamarie I'm guessing the CDNs need to pay for their infrastucture and they get paid by whomever they're hosting content for, but I don't know the economics of it. Google, I know, offer free CDN for certain web technologiles, like jQuery.
Briana Swift
@brianamarie
Aug 12 2015 18:27
Great, thank you!
Sean Wahl
@Koriban
Aug 12 2015 18:28
is it me or is something mucked up on code academy right now?
Dayne Wright
@daynewright
Aug 12 2015 18:34
Question for you guys on your approach to the ziplines (or development in general):
In what order do you do the HTML, CSS, JS coding? Is the best way to just lay it out with HTML, then get the API calls and functionality and THEN tweak the CSS? Is there a best practice? (might be a dumb question..)
Joris Labie
@labiej
Aug 12 2015 18:35
I usually focus on getting a simple layout to test my JS (and make things that happen visible) before the layout
Doesn't really matter though
Marc Davenport
@oneate7
Aug 12 2015 18:37
@Daynewr - I've been building the basic JS to make sure that I can get the API working and such, building the layout in HTML/CSS in a separate pen, and then adding the JS to that new pen.
George
@sushiyea
Aug 12 2015 18:40
I need help with
Waypoint: Line up Form Elements Responsively with Bootstrap #16
This message was deleted
` <br>
<div class='row'>
<div calss='col-xs-7'>
<input type='text' class='form-control' placeholder='cat photo URL' required>
</div>
<div class='col-xs-5'>
<button type='submit' class='btn btn-primary'><i class='fa fa-paper-plane'></i> Submit</button>
</div>
</form>'
William Wagner
@wcwagner
Aug 12 2015 18:46
Is navigator.geolocation the best method for grabbing a users latitude/longitude ?
Eugene Finn
@eugene-finn
Aug 12 2015 18:52
what the difference between var age = prompt(); and var age = +prompt(); ?
Sean
@seanr707
Aug 12 2015 18:57
do you mean +=?
rhansen00
@rhansen00
Aug 12 2015 18:58
the plus at the front will convert the response to a number
otherwise, you'll get a string
Feners4
@Feners4
Aug 12 2015 19:05
any help with why I keep getting an angular error in my console:
http://codepen.io/Feners4/pen/ZGZORX
amwakatsuki
@amwakatsuki
Aug 12 2015 19:20
I can't figure out how to pass all the tests in the bonfire: Mutations. I pass the first but not the rest
function mutation(arr) {
  var a=arr[0].toLowerCase();
  var b=arr[1].toLowerCase().split('');
  for (var i=0;i<b.length;i++) {
    if(a.indexOf(b[i]) ===-1);{
      return false;
    }

  }

}

mutation(['hello', 'hey']);
Omar
@oab00
Aug 12 2015 19:23
@Feners4 if you need ngAnimate you have to include it as an external resource
//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-animate.min.js
or otherwise remove it from var app = angular.module('wikiApp', []);
Clayton
@cjg040103
Aug 12 2015 19:24
anybody know whats wrong with my function?
var friends = {
    bill: {
        firstName: 'Bill',
        lastName: '',
        number: '',
        address: []
        },
    steve: {
        firstName: 'Steve',
        lastName: '',
        number: '',
        address: []
    }
};
var list = function () {
    for (var key in object) {
        console.log(key);
    }
};
Omar
@oab00
Aug 12 2015 19:26
@amwakatsuki you never returned true only false :o
Feners4
@Feners4
Aug 12 2015 19:27
@oab00 yeah, figured that out!lol, thanks tho
Omar
@oab00
Aug 12 2015 19:28
@cjg040103 you need to put an argument in the list function
Clayton
@cjg040103
Aug 12 2015 19:29
what do u meen?
Omar
@oab00
Aug 12 2015 19:29
between the () brackets
var list = function() {
Clayton
@cjg040103
Aug 12 2015 19:30
hmmm... k i get it... but what tho...
ummm... 1sec.
Omar
@oab00
Aug 12 2015 19:30

you're using

for (var key in object) {
    console.log(key);
}

but object is not defined

Clayton
@cjg040103
Aug 12 2015 19:32
@oab00 thx! all i had 2 do was change object to friends and put friends in between the ().
l8r.
Dayne Wright
@daynewright
Aug 12 2015 19:33
I am trying to use $.getJSON() but need to pass an API key. How do I add that to the call?
Clayton
@cjg040103
Aug 12 2015 19:40
NOW what's wrong?
var friends = {
    bill: {
        firstName: 'Bill',
        lastName: '',
        number: '',
        address: []
        },
    steve: {
        firstName: 'Steve',
        lastName: '',
        number: '',
        address: []
    }
};
var list = function (friends) {
    for (var key in friends) {
        console.log(key);
    }
};
var search = function(name) {
    if(name = bill) {
        return console.log(bill.firstName);
        console.log(bill.lastName);
        console.log(bill.number);
        console.log(bill.address);
    } else if(name = steve) {
        return console.log(steve.firstName);
        console.log(steve.lastName);
        console.log(steve.number);
        console.log(steve.address);
    } else {
        return false;
    };
}
Omar
@oab00
Aug 12 2015 19:40
@Daynewr depends on the api you're using
they usually go as a parameter in the url
Omar
@oab00
Aug 12 2015 19:45
step 2 make a for loop?
Clayton
@cjg040103
Aug 12 2015 19:45
huh?
Omar
@oab00
Aug 12 2015 19:45
in the hints
Clayton
@cjg040103
Aug 12 2015 19:45
This message was deleted
i'm stoopid.
i didn't even LOOK at the hints.
Dayne Wright
@daynewright
Aug 12 2015 19:46
@oab00 was trying to use this: https://www.mashape.com
Clayton
@cjg040103
Aug 12 2015 19:46
well... thx anyway.
@Daynewr oh.
Dayne Wright
@daynewright
Aug 12 2015 19:48
It gives me a key and I thought it was just on the end of the URL but it doesn’t seem to work
Omar
@oab00
Aug 12 2015 19:48
which api tho ?
Coira Ellison
@Coira
Aug 12 2015 19:49
@cjg040103 did you manage to solve your problem?
does that help?
Feners4
@Feners4
Aug 12 2015 19:51
how can I use my input form to get that input in my javascript and use that input data..
http://codepen.io/Feners4/pen/ZGZORX
Dayne Wright
@daynewright
Aug 12 2015 19:55
@oab00 I just assumed there was a general way that keys are passed to get access to APIs
softeg
@softeg
Aug 12 2015 19:56

Hello,
I need help in bonfire us postal regex my regex don't work correctly

re = /(1\s|1)?((\d+){3}|[(](\d+){3}[)])[\s-]?(\d+){3}[\s-]?(\d+){4}/g

i dont want to match this number 2 (757) 622-7382
how i limit regex to begin only with 1 or not ?

CamperBot
@camperbot
Aug 12 2015 19:56
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Omar
@oab00
Aug 12 2015 19:56
@Daynewr yeah they're generally used as a parameter in the url but this one seems to require it to be put in headers not sure how to do that sadly
X-Mashape-Key header specifically
Clayton
@cjg040103
Aug 12 2015 19:57
@Coira no...
var friends = {
    bill: {
        firstName: 'Bill',
        lastName: '',
        number: '',
        address: []
        },
    steve: {
        firstName: 'Steve',
        lastName: '',
        number: '',
        address: []
    }
};
var list = function(friends) {
    for (var key in friends) {
        console.log(key);
    }
};
var search = function(name) {
    for (var a in friends) {
    };
    if(friends[a].firstName === name) {
        console.log(friends[a]);
        return friends[a];
    } else {
        return false;
    };
}
Dayne Wright
@daynewright
Aug 12 2015 19:57
@oab00 ok. Thanks. Do you know a quote one that is just simple? I just need to get an understanding of how all this works and just want something that I can use now.
Clayton
@cjg040103
Aug 12 2015 19:57
thats what i hav now.
Omar
@oab00
Aug 12 2015 19:58
@Daynewr personally I used this one http://quotesondesign.com/api-v4-0/
Coira Ellison
@Coira
Aug 12 2015 19:59
@cjg040103 closer, but look at your for function, you've closed it off without any code in
Clayton
@cjg040103
Aug 12 2015 19:59
what?
Dayne Wright
@daynewright
Aug 12 2015 19:59
@oab00 THANKS! :)
thanks @oab00
CamperBot
@camperbot
Aug 12 2015 20:00
daynewr sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
hey @daynewr if you found this info helpful :point_right: consider adding a wiki article!
:star: 183 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 12 2015 20:00
@Feners4 you have ng-model='searchTxt' for the input in your html
meaning you can use $scope.searchTxt in the controller :)
CamperBot
@camperbot
Aug 12 2015 20:00
:trollface: troll problems? notify admins here
Coira Ellison
@Coira
Aug 12 2015 20:00
@cjg040103 you ended your for loop, then you put an if statement after it
Clayton
@cjg040103
Aug 12 2015 20:00
ya so?
Feners4
@Feners4
Aug 12 2015 20:01
@oab00 lol
Coira Ellison
@Coira
Aug 12 2015 20:01
put your if inside the for loop
Omar
@oab00
Aug 12 2015 20:02
@Feners4 console.log($scope.searchTxt);
Feners4
@Feners4
Aug 12 2015 20:02
@oab00 thanks
Omar
@oab00
Aug 12 2015 20:02
happy to help :)
Clayton
@cjg040103
Aug 12 2015 20:02
ohhhhhhhhhhhhhhhhhhhhh... @Coira thx! :smile:
Coira Ellison
@Coira
Aug 12 2015 20:02
@cjg040103 then there's something else you need to do after that, but we'll get to that
@cjg040103 np :), let me know if you understand why you have to do it that way
Clayton
@cjg040103
Aug 12 2015 20:05
ya i understand... i cant have a for loop without code in between
now what else do i need to do?
i'm stuck again
Cody Bouscaren
@codybousc
Aug 12 2015 20:06
I realize that this answer greatly depends on the amount of previous coding experience that an individual has, but what would you all say that the average time to complete the 'Basic Algorithm' portion?
I guess I'm wondering how they break down the 800 hours they say it takes to complete the first half of the course.
Clayton
@cjg040103
Aug 12 2015 20:07
ummm... a few months i guess.
Coira Ellison
@Coira
Aug 12 2015 20:09
@cjg040103 i suppose you can have a for loop without code in, but it doesn't do anything
@cjg040103 post code again?
Clayton
@cjg040103
Aug 12 2015 20:09
i'll b bak l8r. gonna watch a movie w/ my brother.
Coira Ellison
@Coira
Aug 12 2015 20:10
@cjg040103 ok, have fun :)
Matt Sweeney
@msweeney1
Aug 12 2015 20:10
Stuck on Waypoint: Mobile Responsive Images. I have the following code but the Go to my next challenge button is still not working for me to move forward.
<a href='#'><img class='smaller-image thick-green-border img-responsive' src='https://bit.ly/fcc-kittens2'/></a>
John A Maloney
@perezvon
Aug 12 2015 20:17
@msweeney1 The src of the second image is an http://, not an https://.
Matt Sweeney
@msweeney1
Aug 12 2015 20:18
that worked, I appreciate it!
John A Maloney
@perezvon
Aug 12 2015 20:19
@msweeney1 My pleasure
Russell Westberry
@russbus
Aug 12 2015 20:21
Is this a weird/bad way to handle recursion?
function diff(arr1, arr2) {

  // Same, same; but different.
  var newArr = [];
  for (var i = 0; i < arr1.length; i++) {
    if (arr2.indexOf(arr1[i]) === -1) {
      newArr.push(arr1[i]);
    }
  }
  if (arguments[2] === false) { 
    return newArr;
  }
  return newArr.concat(diff(arr2, arr1, false));
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Feners4
@Feners4
Aug 12 2015 20:31
@oab00 jmm, my data entry is always producing undefined, how can i get my code to save the user input?
Coira Ellison
@Coira
Aug 12 2015 20:31
@russbus I don't know if it's good or bad, but it's interesting
undefined is weird in javascript
Omar
@oab00
Aug 12 2015 20:33
@Feners4 then define the undefined !
initialise it to something like an empty text
Daniel Smith
@DanielSmithProfessional
Aug 12 2015 20:42
blob
What did I oops on?
The "Uncaught TypeError" is throwing me...
William
@minimalistStig
Aug 12 2015 20:46
Can someone help me with the Inventory update Bonfire? I have no idea how to start it
CamperBot
@camperbot
Aug 12 2015 20:46
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ozy Design & Software
@OzySky
Aug 12 2015 20:47
@DanielSmithProfessional can you post your code here?
Clayton
@cjg040103
Aug 12 2015 20:49
This message was deleted
Daniel Smith
@DanielSmithProfessional
Aug 12 2015 20:50
@ozydesign Is the screenshot I posted visible? I am having issues with something... That console message is new to me.
Ozy Design & Software
@OzySky
Aug 12 2015 20:50
@DanielSmithProfessional I want to run your code, and typing all of that is a pain....
Daniel Smith
@DanielSmithProfessional
Aug 12 2015 20:51
@ozydesign I see, one sec
My code has been lost to the endless abyss of F5 apparently, I'll retype it.
Dayne Wright
@daynewright
Aug 12 2015 20:59
I need a little help with my Random Quote Generator on what to pass to the click() for the button:
Bastien Lemaire
@blemaire
Aug 12 2015 21:01
@Daynewr you need to create a method which returns the new quote and call that method on the click
Daniel Smith
@DanielSmithProfessional
Aug 12 2015 21:02
^my code giving me a nasty new error
blob
Dayne Wright
@daynewright
Aug 12 2015 21:04
@blemaire So I can set my entire $.getJSON to a method?
Bastien Lemaire
@blemaire
Aug 12 2015 21:04
@Daynewr should be fine, yes
Dayne Wright
@daynewright
Aug 12 2015 21:05
ok..will attempt that. Thanks
Ozy Design & Software
@OzySky
Aug 12 2015 21:05
@DanielSmithProfessional running that on repl.it (and viewing the Chrome JS console) shows no errors...
Dayne Wright
@daynewright
Aug 12 2015 21:07
@blemaire It seems to load on click now, but not on doc load and only on click once:
Ozy Design & Software
@OzySky
Aug 12 2015 21:07
@ozydesign btw you should put var before assigning a variable inside a function
Daniel Smith
@DanielSmithProfessional
Aug 12 2015 21:07
@ozydesign It might be the arguments FCC is feeding it
@DanielSmithProfessional Will do
Bastien Lemaire
@blemaire
Aug 12 2015 21:08
@Daynewr simply call the method when document is ready

<p data-height="268" data-theme-id="0" data-slug-hash="jPRMNL" data-default-tab="result" data-user="daynewr" class='codepen'>See the Pen <a href='http://codepen.io/daynewr/pen/jPRMNL/'>Random Quote Generator</a> by Dayne Wright (<a href='http://codepen.io/daynewr'>@daynewr</a>) on <a href='http://codepen.io'>CodePen</a>.</p>

<script async src="//assets.codepen.io/assets/embed/ei.js"></script>

<p data-height="268" data-theme-id="0" data-slug-hash="jPRMNL" data-default-tab="result" data-user="daynewr" class='codepen'>See the Pen <a href='http://codepen.io/daynewr/pen/jPRMNL/'>Random Quote Generator</a> by Dayne Wright (<a href='http://codepen.io/daynewr'>@daynewr</a>) on <a href='http://codepen.io'>CodePen</a>.</p>

<script async src="//assets.codepen.io/assets/embed/ei.js"></script>

how do you embed codepen projects?
Dayne Wright
@daynewright
Aug 12 2015 21:10
Just link to the page
@Daynewr add this line quoteMaker(); on line 2
Dayne Wright
@daynewright
Aug 12 2015 21:12
ok. Now it runs on load but not on click
I am sure I am just missing something simple here…just can’t figure it out
Coira Ellison
@Coira
Aug 12 2015 21:15
@DanielSmithProfessional put var in front of your variables when you first declare them (e.g. var structure = [3, 3, 4];)
@DanielSmithProfessional err that face isn't meant to be there, but you get the idea
@DanielSmithProfessional when you leave var out, it makes the variable global, and that seems to be screwing something up in fcc's end
Bastien Lemaire
@blemaire
Aug 12 2015 21:16
@Daynewr To be fair I would create a method which returns the quote and an other which updates the dom...
Dayne Wright
@daynewright
Aug 12 2015 21:31
@blemaire attempted that but not sure I did it correctly
DTing
@dting
Aug 12 2015 21:37
@Daynewr The problem is your selectors
@Daynewr after the first time your function runs. you no longer have a 'strong span' because you replaced it
Dayne Wright
@daynewright
Aug 12 2015 21:38
ah
So is there a better way than using replaceWith() and just adding the dom selectors back?
This message was deleted
Bastien Lemaire
@blemaire
Aug 12 2015 21:45
@Daynewr
$(document).ready(function() {

  newQuote();

  function newQuote() {
    $.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=", function(quote) {
      displayQuote(quote);
    });
  }

  function displayQuote(quote) {
    $('strong span').html(quote[0].content);
    $('footer span').html('- ' + quote[0].title);
    $('.source a').attr('href', quote[0].link);
  }

  $('button').click(function() {
    newQuote();
  });

});
Abhisek Pattnaik
@abhisekp
Aug 12 2015 22:10
@blemaire @Daynewr using .find() is better than descendant selector http://stackoverflow.com/a/3177782/1262108
Updated for current browsers http://stackoverflow.com/a/27268165/1262108
Dayne Wright
@daynewright
Aug 12 2015 22:26
thanks @abhisekp
CamperBot
@camperbot
Aug 12 2015 22:26
daynewr sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
hey @daynewr if you found this info helpful :point_right: consider adding a wiki article!
:star: 26 | @abhisekp | http://www.freecodecamp.com/abhisekp
Ayo
@ayondot
Aug 12 2015 22:55
how do i return the element that causes arr.some() method to return true in bonfire Finders Keepers
Moisés Man
@moigithub
Aug 12 2015 22:57
create a variable on parent scope
modify inside the callback
Benjamin
@b1ggb3n86
Aug 12 2015 22:57
did anybody else use a counter to find the index on "Where do I belong" bonfire??? if not, how did you?
amwakatsuki
@amwakatsuki
Aug 12 2015 23:04
@oab00 Thanks for pointing me in the right direction. It took awhile to figure it out but i got it.
Moisés Man
@moigithub
Aug 12 2015 23:07
This message was deleted
This message was deleted
CamperBot
@camperbot
Aug 12 2015 23:07

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Aug 12 2015 23:07
bf where do i belong
CamperBot
@camperbot
Aug 12 2015 23:07

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
  // Find my place in this sorted array.
  return num;
}

where([40, 60], 50);

Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Aug 12 2015 23:08
bf details
CamperBot
@camperbot
Aug 12 2015 23:08

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
  // Find my place in this sorted array.
  return num;
}

where([40, 60], 50);
Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).
For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (0th index), but less than 2 (1st index).
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Moisés Man
@moigithub
Aug 12 2015 23:11
@b1ggb3n86 u can push the element sort ascending and use indexOf to return the index
Benjamin
@b1ggb3n86
Aug 12 2015 23:12
how would you use indexOf?
@moigithub
Moisés Man
@moigithub
Aug 12 2015 23:13
[10,20,30].indexOf(20) <-- will return 1
array index start on 0
Benjamin
@b1ggb3n86
Aug 12 2015 23:15
awesome. i didn't use that. i did this...
Moisés Man
@moigithub
Aug 12 2015 23:15
i did .. sort.. for/loop + if condition
Benjamin
@b1ggb3n86
Aug 12 2015 23:16
i used a for loop to go through arr. then if statement to check if num === arr[i].
once it matched. index = i
Moisés Man
@moigithub
Aug 12 2015 23:17
yep same as mine :)
Ash Roulston
@AshRoulston
Aug 12 2015 23:17
confirm("Are you ready to play?");
var age = (prompt("What's your age?");
if(age < 13) {
    console.log(confirm("You may play at your own risk"))
    } else {
    console.log("Break a leg!")
    }
How do I fix this? it is saying syntax error.
Benjamin
@b1ggb3n86
Aug 12 2015 23:17
lol. indexOf seems like it would be more streamlined
Moisés Man
@moigithub
Aug 12 2015 23:18
var age = (prompt("What's your age?");
u have 2 open parenthesis.. and onlly 1 close
remove the first ( at prompt
Benjamin
@b1ggb3n86
Aug 12 2015 23:18
thank you @moigithub
CamperBot
@camperbot
Aug 12 2015 23:18
b1ggb3n86 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
hey @b1ggb3n86 if you found this info helpful :point_right: consider adding a wiki article!
Ash Roulston
@AshRoulston
Aug 12 2015 23:20
@moigithub thanks it wants me to have that one there, but yes I definitely need to close it :)
Lauren
@midori87
Aug 12 2015 23:26
Ok, so I am on Waypoint 25, trying to add the !important class but I'm not sure where I should be putting it?
Joe
@reitmanj
Aug 12 2015 23:36
Zipline Show Local Weather. I have two API calls. The first gets the geo location information and passes that to the weather API. Is there a way to make sure the first API call finishes retrieving the data before passing it on to the second function that gets the weather information? I put a call to the second function within the first as shown below. It seems to work most of the time but not always.
 //Geo lookup
  $.getJSON("http://ip-api.com/json?callback=?", function(data) {
    zip = data.zip;
    city = data.city;
    getWeather();
  });

  // Get weather data
  function getWeather() {
    $.getJSON("http://api.openweathermap.org/data/2.5/weather?zip=" + zip + ",us&units=imperial&APPID=37f7c555d6f32209b12dc68ef8eef53b", function(data) {
      windSpeed = Math.round(data.wind.speed);
      windDir = data.wind.deg.toFixed(0);
      condition = data.weather[0].description;
      currentTemp = data.main.temp.toFixed(0) + 'F';
      humidity = data.main.humidity + "&#37";
      clouds = data.clouds.all + "&#37";
      tempC = ((parseInt(currentTemp, 0) - 32) * 5 / 9).toFixed(0) + 'C';
    });
  };
HayleeNeal
@HayleeNeal
Aug 12 2015 23:37
I'm having a little trouble with this, can anone tell me how to add a font class to the html code?

<style>
.red-text {
color: red;
}

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

<h2 class='red-text'>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>

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

Moisés Man
@moigithub
Aug 12 2015 23:39
@midori87 next to the attribute u wanna give HIGHER priority... like
.myclass {
color: yellow !important;
}
Moisés Man
@moigithub
Aug 12 2015 23:44

@HayleeNeal this goes on top

<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
ussually its goes inside <header> tag.. but no need on this simulated environment..
then on ur font-family attribute.. u add the name separating with spaces

    font-family: Monospace, myotherfont, superfont, uglyfont, cutefont;
@reitmanj u get errors ?
Joe
@reitmanj
Aug 12 2015 23:49
@moigithub No errors. On occasion some of the weather data will be missing.
Tom Mayer
@orismanager
Aug 12 2015 23:51
Hey Everbody!