These are chat archives for FreeCodeCamp/Help

20th
Aug 2015
ctcrnitv
@ctcrnitv
Aug 20 2015 00:00
Is the “create a javascript slot machine” waypoint supposed to look like this?
fccss
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

    var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

    // Only change code below this line.

    slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;

    // Only change code above this line.

    $(".logger").html("");
    $(".logger").html("Not A Win")

    if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
      $(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
    }
    return([slotOne, slotTwo, slotThree]);
  }

  $(document).ready(function(){
     $(".go").click(function(){
       runSlots();
     });
   });
fcces
I imagined that part would be in script tags or something, not sure what’s up with fccss and fcces at the beginning and end
actually, changing those to script tags seems to make the tests work
DTing
@dting
Aug 20 2015 00:04
@skr5e i think thats a bug those should be script tags ya
ctcrnitv
@ctcrnitv
Aug 20 2015 00:07
cool. Yeah I seem some other users have already submitted that as a bug.
IllusionElements
@IllusionElements
Aug 20 2015 00:12
whats the best way to pass a javascript function into a jquery event?
Gus Suarez
@aerze
Aug 20 2015 00:17
@IllusionElements like to call from a function when an event happens
Feners4
@Feners4
Aug 20 2015 00:28
can i get some help with why my search icon is not displaying? http://codepen.io/Feners4/pen/ZGZORX
Will Moody
@willmoody
Aug 20 2015 00:36

Hey all! Having some problems with Bonfire: Title Case a Sentence:

function titleCase(str) {
  str = str.toLowerCase();
  var ind = str.split(" ");
  for (var i = 0;
      i <= ind.length - 1;
      i++) {
    ind[i].charAt(0).toUpperCase();

  }
return ind.join(" ");}

titleCase("I'm a little tea pot");

returns "i'm a little tea pot"
My understanding of for loops and how they are employed is still extremely tenuous, but I thought for sure this should work. Can anybody please help me understand why it doesn't? :]

Kolloom
@Kolloom
Aug 20 2015 00:38
@fractal-mind ind[i].charAt(0).toUpperCase(); remember that the string is immutable?
which means that you cannot change the string at all, a new string must be created instead
Will Moody
@willmoody
Aug 20 2015 00:43

@Kolloom Hmm, okay, so... I guess that means I have to write the output of the

    ind[i].charAt(0).toUpperCase();

to a new string?

DTing
@dting
Aug 20 2015 00:46
@fractal-mind you can replace the string in your ind arr
rolanjose7
@rolanjose7
Aug 20 2015 00:48
guys, i need with bonfire 3 check for palindrome
DTing
@dting
Aug 20 2015 00:48
ind[i] = ind[i].charAt(0).toUpperCase() + ...
rolanjose7
@rolanjose7
Aug 20 2015 00:49

function palindrome(str) {
var puntuation = /\W+/g;
var spacing = /\s+/g;
var strLowerCase = str.toLowerCase();
strLowerCase = strLowerCase.replace(puntuation, "");
strLowerCase = strLowerCase.replace(spacing, "");
strLowerCase = strLowerCase.split('').reverse().join('');
if (strLowerCase === str){
return true;
} else {
return false;
}
}

palindrome("racecar");

i dont know what's wrong in my code
Tom Sun
@tomsun100
Aug 20 2015 00:51
Is it me or does the Find challenge in learnyoumongo not work properly.
Will Moody
@willmoody
Aug 20 2015 00:51
@dting ahh, thanks, that's at least returning just the capital letters I need, haha. Gonna try and figure it out from there!
CamperBot
@camperbot
Aug 20 2015 00:51
fractal-mind sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 395 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 20 2015 00:51
@rolanjose7 you are comparing the processed string to a string that hasnt been modified
@rolanjose7 you need to do the same processing, removing spaces and lowercasing it.
Martin Morissette
@studur
Aug 20 2015 00:51
@rolanjose7 It looks that you are comparing the original string (str) with another where you stripped spaces and capital letters.
rolanjose7
@rolanjose7
Aug 20 2015 00:52
yeah, to check if it is a palindrome
Martin Morissette
@studur
Aug 20 2015 00:52
@dting you got me first ;)
DTing
@dting
Aug 20 2015 00:53
@rolanjose7 so bascially if you got a string like Hel$ O you are doing the lowercase, hel$ o, then you do the strip spaces and punctuation helo then you reverse it oleh then you compare that to Hel$ O
rolanjose7
@rolanjose7
Aug 20 2015 00:53
yes
Martin Morissette
@studur
Aug 20 2015 00:53
@rolanjose7 You should store the reverse string as another variable (strLowerCase2) and compare it to strLowerCase
DTing
@dting
Aug 20 2015 00:53
@rolanjose7 thats not right.
Shafiq Marediya
@shafiq702
Aug 20 2015 00:53
has anyone here completed the "Show the local weather" zipline challenge?
DTing
@dting
Aug 20 2015 00:54
you need to also lowercase and strip what you compare the reversed string to
Martin Morissette
@studur
Aug 20 2015 00:54
@shafiq702 I am working on it. I am basing mine on the simpleweather.js apps
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 00:54
function titleCase(str) {
  str = str.toLowerCase();
  var letterCap = str.split(' ');

   // cycles through the array 
  for( var i = 0; i < letterCap.length; i++)
    //capitalize the first letter in each element of the array
     letterCap = letterCap[i].charAt(0).toUppercase();
  return str;
}

titleCase("I'm a little tea pot");
nvm.. caught the error in uppsercase
Shafiq Marediya
@shafiq702
Aug 20 2015 00:55
@studur yeah I found simpleweather.js also...are there any tutorials on how to start using the api? I'm having trouble getting started with the javascript part
DTing
@dting
Aug 20 2015 00:56
@Dueldrawer8 you are replacing your array with a string inside your forloop
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 00:56
hmm.. wondering why its not capitalizing the first of each element.. in the array
DTing
@dting
Aug 20 2015 00:56
@Dueldrawer8 you need to do something like letterCap[i] = letterCap[i].charAt(0).toUppercase() + ...
also you just return str
you would want to return letterCap.join(' ') after you uppercase the first letter of each word
Martin Morissette
@studur
Aug 20 2015 00:59
@shafiq702 you can check what I have done so far at : http://codepen.io/anon/pen/KpjPNx
Barry
@image36
Aug 20 2015 00:59
'''function largestOfFour(arr) {
// You can do this!
var largest = 0;
for(var x = 0; x < arr.length; x++){
for(var y = 0; y < arr[x].length; y++){
if(arr[y]>largest){
largest = arr[y];
return largest;
}
}
}
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);'''
CamperBot
@camperbot
Aug 20 2015 00:59
:bulb: to format code use backticks! ``` more info
Barry
@image36
Aug 20 2015 01:00
function largestOfFour(arr) { // You can do this! var largest = 0; for(var x = 0; x < arr.length; x++){ for(var y = 0; y < arr[x].length; y++){ if(arr[y]>largest){ largest = arr[y]; return largest; } } } } largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
im having trouble with the return largest number bonfire any tips?
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:00
```
function titleCase(str) {
  str = str.toLowerCase();
  var letterCap = str.split(' ');

   // cycles through the array 
  for( var i = 0; i < letterCap.length ; i++){
    //capitalize the first letter in each element of the array
     letterCap = letterCap[i].charAt(0).toUpperCase();

  return letterCap.join(' ');
  }
  return str;
}

titleCase("I'm a little tea pot");
Martin Morissette
@studur
Aug 20 2015 01:01
@shafiq702 Check the simpleweather.js full demo for a starting point
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:01
@dting says letterCap.join is not a function..
DTing
@dting
Aug 20 2015 01:01
@Dueldrawer8 thats because you turned it into a string
@Dueldrawer8 inside your forloop change that to letterCap[i] = ...
Shafiq Marediya
@shafiq702
Aug 20 2015 01:02
@studur thanks! I'll check it out.
CamperBot
@camperbot
Aug 20 2015 01:02
shafiq702 sends brownie points to @studur :sparkles: :thumbsup: :sparkles:
:star: 209 | @studur | http://www.freecodecamp.com/studur
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:02
the join function turns it back into a string right?
i thought the split functino turns it into an array
Martin Morissette
@studur
Aug 20 2015 01:02
@shafiq702 You are welcome
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:03
@dting so it should still be an array inside my for loop if i used the split functino
Barry
@image36
Aug 20 2015 01:03
@Dueldrawer8 yeah it splits your sting into an array based on your parameter split(" ") would split on space
rolanjose7
@rolanjose7
Aug 20 2015 01:04
´´´
´´´

function palindrome(str) {
var puntuation = /\W+/g;
var spacing = /\s+/g;
var strLowerCase = str.toLowerCase();
var strLowerCase2 = str.toLowerCase();
strLowerCase = strLowerCase.replace([puntuation, ""],[spacing, ""]);
strLowerCase = strLowerCase.split('').reverse().join('');
strLowerCase2 = strLowerCase.replace([puntuation, ""],[spacing, ""]);
if (strLowerCase === strLowerCase2){
return true;
} else {
return false;
}
}

palindrome("not a palindrome");

and now guys?
DTing
@dting
Aug 20 2015 01:05

@image36

```function largestOfFour(arr) {
  var largest = 0;
  for(var x = 0; x < arr.length; x++){
   for(var y = 0; y < arr[x].length; y++){
    if(arr[y]>largest){ // This is incorrect should be arr[x][y]
      largest = arr[y]; // This is incorrect should be arr[x][y]
      return largest; // This returns from the function and nothing else happens
      }
    }
  }
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

```

rolanjose7
@rolanjose7
Aug 20 2015 01:05

´´´
function palindrome(str) {
var puntuation = /\W+/g;
var spacing = /\s+/g;
var strLowerCase = str.toLowerCase();
var strLowerCase2 = str.toLowerCase();
strLowerCase = strLowerCase.replace([puntuation, ""],[spacing, ""]);
strLowerCase = strLowerCase.split('').reverse().join('');
strLowerCase2 = strLowerCase.replace([puntuation, ""],[spacing, ""]);
if (strLowerCase === strLowerCase2){
return true;
} else {
return false;
}
}

palindrome("not a palindrome");
´´´

Barry
@image36
Aug 20 2015 01:06
@dting thank you!
CamperBot
@camperbot
Aug 20 2015 01:06
image36 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 397 | @dting | http://www.freecodecamp.com/dting
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:06
@dting even when i did what you said.. the output still doesnt capitalize my letters.. i dont get it
function titleCase(str) {
  str = str.toLowerCase();
  var letterCap = str.split(' ');

   // cycles through the array 
  for( var i = 0; i < letterCap.length ; i++){
    //capitalize the first letter in each element of the array
     letterCap[i] = letterCap[i].charAt(0).toUpperCase();

  return letterCap.join(' ');
  }
  return str;
}

titleCase("I'm a little tea pot");
i turned whole string into lowercase letters, i split the string into arrays
i cycle through each element in array
i then select the i'th element at the first character within the array and capitalize the letter
i then join the array back to form a string and return the string
DTing
@dting
Aug 20 2015 01:08
@rolanjose7
function palindrome(str) {
  var puntuation = /\W+/g;
  var spacing = /\s+/g;
  str = str.toLowerCase().replace(puntuation, '').replace(spacing, '');
  var reversedString = str.split('').reverse().join('');
  return str === reversedString;
}
palindrome("not a palindrome");
@Dueldrawer8 dont return inside your forLoop
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:08
@dting out I got "I a little tea pot"
rolanjose7
@rolanjose7
Aug 20 2015 01:09
@dting thanks!
CamperBot
@camperbot
Aug 20 2015 01:09
rolanjose7 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 398 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 20 2015 01:09
@Dueldrawer8
function titleCase(str) {
  str = str.toLowerCase();
  var letterCap = str.split(' ');

   // cycles through the array 
  for( var i = 0; i < letterCap.length ; i++){
    //capitalize the first letter in each element of the array
     letterCap[i] = letterCap[i].charAt(0).toUpperCase(); // You are missing something here
  }
  return letterCap.join(' ');
}
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:10
ah im guessing return str after the 1st return is wrong?
DTing
@dting
Aug 20 2015 01:11
if you return in a function, the function exits with that return value. None of the other code runs.
you are missing the rest of the letters you might want to look at String.slice or string.Substring
find slice
CamperBot
@camperbot
Aug 20 2015 01:12

find slice

:zero: js slice

DTing
@dting
Aug 20 2015 01:12
find substring
CamperBot
@camperbot
Aug 20 2015 01:12
find substring
nothing found
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:13
okay thanks
CamperBot
@camperbot
Aug 20 2015 01:13
if you want to thank someone, put an @ before their name!
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:13
thank u @dting
CamperBot
@camperbot
Aug 20 2015 01:13
dueldrawer8 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 399 | @dting | http://www.freecodecamp.com/dting
Justin Scoggin
@jscogg
Aug 20 2015 01:18
So I went away for a few days and came back to find a changed "map"... is there a blog post or something someone can link me to so I can get caught up on what's changed?
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:18
@dting how does slice help?
@dting seems like it slices only the elements in the array and not the actual words..
DTing
@dting
Aug 20 2015 01:19
"Hello".slice(1) will give you "ello"
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:19
i need the second letter in the 1st element added to the first
DTing
@dting
Aug 20 2015 01:19
slice works on strings
zkparks11
@zkparks11
Aug 20 2015 01:19
Is the javascript section broken? I cant get anything to run in edge or chrome
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:22
@dting so i add that to the end of toUpperCase()? I tried this
function titleCase(str) {
  str = str.toLowerCase();
  var letterCap = str.split(' ');

   // cycles through the array 
  for( var i = 0; i < letterCap.length ; i++){
    //capitalize the first letter in each element of the array
     letterCap[i] = letterCap[i].charAt(0).toUpperCase() + letterCap.slice(1) ;

  }
  return letterCap.join(' ');

}

titleCase("I'm a little tea pot");
Maor Levy
@Atixx
Aug 20 2015 01:23
@zkparks11 It's working for me on chrome
zkparks11
@zkparks11
Aug 20 2015 01:23
@Atixx should I download firefox? ewwww
DTing
@dting
Aug 20 2015 01:23
@Dueldrawer8 letterCap[i].slice(1)
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:24
if i leave it like letterCap instead of letterCap[i] is it printing out the whole elements within the array?
@dting thanks again
CamperBot
@camperbot
Aug 20 2015 01:26
dueldrawer8 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: dueldrawer8 already gave dting points
DTing
@dting
Aug 20 2015 01:27
@Dueldrawer8 do you get why you need the [] sorry i'm kinda distracted not really being too helpful
[i] is basically saying look at the ith element of my letterCap array
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:27
yeah
SojournerOctocat
@SojournerOctocat
Aug 20 2015 01:30
@Dueldrawer8 So you're telling it letterCap[0] should equal an uppercase character and a string, and the same for letterCap[1], etc.
Well, not quite.
Here, I added some console statements so you can see what's happening under the hood.
function titleCase(str) {
  str = str.toLowerCase();
  var letterCap = str.split(' ');

    console.log(letterCap);

   // cycles through the array 
  for( var i = 0; i < letterCap.length ; i++){
    //capitalize the first letter in each element of the array
     letterCap[i] = letterCap[i].charAt(0).toUpperCase() + letterCap.slice(1) ;
    console.log(letterCap[i]);
    console.log("   ")
  }
  return letterCap.join(' ');

}

titleCase("I'm a little tea pot");
Barry
@image36
Aug 20 2015 01:35
function largestOfFour(arr) { // You can do this! var largest = []; for(var x = 0; x < arr.length; x++){ for(var y = 0; y < arr[x].length; y++){ largest.push(Math.max.apply(Math, arr[y])); return largest; } } } largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
SojournerOctocat
@SojournerOctocat
Aug 20 2015 01:35
help format
DTing
@dting
Aug 20 2015 01:35
wiki code-formatting
CamperBot
@camperbot
Aug 20 2015 01:35

: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

zkparks11
@zkparks11
Aug 20 2015 01:36
Tried using the javascript course in firefox, chrome, and edge, but when I click the run button nothing happens! Am I missing something? I can't get past the first exercise even
Barry
@image36
Aug 20 2015 01:36
function largestOfFour(arr) {
  // You can do this!
  var largest = [];
  for(var x = 0; x < arr.length; x++){
   for(var y = 0; y < arr[x].length; y++){
      largest.push(Math.max.apply(Math, arr[y]));
     return largest;
      }
    }
  }
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
SojournerOctocat
@SojournerOctocat
Aug 20 2015 01:39
@Dueldrawer8 The line should read: letterCap[i] = letterCap[i].charAt(0).toUpperCase() + letterCap[i].slice(1) ;
Randy Goldsmith
@Dueldrawer8
Aug 20 2015 01:39
whats the second for loop for?
yes i completed it.. thanks @SojournerOctocat
CamperBot
@camperbot
Aug 20 2015 01:40
dueldrawer8 sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sojourneroctocat
DTing
@dting
Aug 20 2015 01:40
@image36 if you are using Math.max.apply you dont need another for loop
@image36
function largestOfFour(arr) {
  var largest = [];
  for(var x = 0; x < arr.length; x++){
    largest.push(Math.max.apply(null, arr[x]));
  }
  return largest;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
@image36 or
function largestOfFour(arr) {
  return arr.map(function(subArr) {
    return Math.max.apply(null, subArr);
  });
}
Math.max.apply(null, arr[x]) will return the largest value in arr[x] you dont need to iterate over arr[x]
zkparks11
@zkparks11
Aug 20 2015 01:44
Anyone? Help a newb out here
Mary
@marycontrary
Aug 20 2015 01:45
@zkparks11 try a hard refresh in chrome. CTRL + Shift + R.
Max
@MaxRubyDev
Aug 20 2015 01:51

I'm working on the jQuery Waypoint: Target the same element with multiple jQuery selectors . Here's my code:

<script>
  $(document).ready(function() {
    $("button .btn #target1").addClass("animated")
    $("button .btn #target1").addClass("shake")
    $("button .btn #target1").addClass("btn-primary")
  });
</script>

I have all green checkmarks except one red circle X next to Your #target1 element should have the classes animated‚ shake and btn-primary. Why?

I already did a hard refresh on it too.
Dan Raley
@danraley
Aug 20 2015 01:52
@dcsan incase anyone in this room was wondering about your mention earlier for the bot news wiki post I moved it to the wiki room
Petar Popovic
@Petar-np
Aug 20 2015 01:53
Help need please
CamperBot
@camperbot
Aug 20 2015 01:53
no wiki entry for: need please
:pencil: click here to create one now!after creating your page type update to reload it here
Petar Popovic
@Petar-np
Aug 20 2015 01:54
this is not working, why?
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return Math.floor(Math.random()*(9 - 0 +1 )) + 0;
}
zkparks11
@zkparks11
Aug 20 2015 01:55
hard refresh worked for chrome, but not edge. and I have to do it for every exercise. Any thoughts on why?
@marycontrary Thanks!
CamperBot
@camperbot
Aug 20 2015 01:55
zkparks11 sends brownie points to @marycontrary :sparkles: :thumbsup: :sparkles:
:star: 334 | @marycontrary | http://www.freecodecamp.com/marycontrary
Mary
@marycontrary
Aug 20 2015 01:56
@zkparks11 That, I don't know. Sounds like a system wide issue though.
Will Moody
@willmoody
Aug 20 2015 01:57

I feel like an idiot, I don't understand why this

function largestOfFour(arr) {
  // You can do this!
  return arr.split();
}

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

returns arr.split is not a function?
is it because they're nested arrays that I can't split them?

SojournerOctocat
@SojournerOctocat
Aug 20 2015 01:58
@fractal-mind I think you have to put something in split, a la arr. split("")
Will Moody
@willmoody
Aug 20 2015 01:58
@SojournerOctocat I get the same result doing that, actually; that's what I tried first
chantilly lovelace
@chantillylace
Aug 20 2015 01:59
I'm having trouble with JavaScript WayPoint Challenge 20.
Will Moody
@willmoody
Aug 20 2015 01:59
I reset the whole thing and retried it with only a return command in case I had messed something up unintentionally
chantilly lovelace
@chantillylace
Aug 20 2015 02:00

More detail://var numbers = [1,2,3];
//console.log(numbers); // logs [1,2,3]
//var removed = numbers.pop();
//console.log(numbers); // logs [1,2]
//console.log(removed); // logs 3

var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
myArray.pop()
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return('myArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z));})(myArray, removed);

What have I done wrong?
SojournerOctocat
@SojournerOctocat
Aug 20 2015 02:01
@fractal-mind Ah, split is to split a string into an array.
It doesn't split an array.
Will Moody
@willmoody
Aug 20 2015 02:02
@SojournerOctocat Oho, I see, thanks
CamperBot
@camperbot
Aug 20 2015 02:02
fractal-mind sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sojourneroctocat
FX
@lightningneon
Aug 20 2015 02:03
anyone here want to screenhero with me? I just need some help on the first challenge on JavaScript. Thanks
CamperBot
@camperbot
Aug 20 2015 02:03
if you want to thank someone, put an @ before their name!
Mary
@marycontrary
Aug 20 2015 02:03
@chantillylace Try combining your myArray.pop(); with var removed = myArray;
Also you are missing a semi-colon after myArray.pop().
Max
@MaxRubyDev
Aug 20 2015 02:06
I figured it out. Apparently for multiple selectors you have to have a comma, not a space, between the selectors. (Why can't I delete my own post?!)
RC Maples
@rcmaples
Aug 20 2015 02:16
So, just gonna throw this out there. I really dislike APIs. On the plus side I finally finished the Quote Generator zipline. So wheeeee!
Sean
@seanr707
Aug 20 2015 02:22
@rcmaples eh, APIs aren't usually so terrible, better than having to copy and paste everything
RC Maples
@rcmaples
Aug 20 2015 02:24
@seanr707 I’d never used one before and had to do a lot of reading / trial and error to get it working. In the end thought, @dting recommended using $.ajax() and I was able to get it working. :D the API I was working on at first had horrible doc. The one I ended up using was better documented.
Sean
@seanr707
Aug 20 2015 02:27
@rcmaples yes, documentation, or lack there of, can ruin an API, also if you were getting that ...HEADER..something... error, try and look for a json proxy
RC Maples
@rcmaples
Aug 20 2015 02:27
@seanr707 :+1:
Derek Frankel
@TuvyaYis
Aug 20 2015 02:29
hello, how do you use the .pop(); function to remove MORE than just the last element in an array?
say i want to remove the 2nd string + 2 in.... var myArray = ["John", 23, ["cat", 2]];
RC Maples
@rcmaples
Aug 20 2015 02:33
@TuvyaYis If you’re on the pop waypoint, the goal is to remove ["cat",2] which is a nested array in the array, so is considered one item.
var myArray = ["John", 23, ["cat", 2]];

var removed = myArray.pop(); // This should be ["cat", 2] and myArray should now be ["John", 23]
// removed now equal [“John”, 23]
Derek Frankel
@TuvyaYis
Aug 20 2015 02:41
okay thanks... i guess the "popping" removed the last nest
CamperBot
@camperbot
Aug 20 2015 02:41
if you want to thank someone, put an @ before their name!
Derek Frankel
@TuvyaYis
Aug 20 2015 02:42
wow... thank you @camperbot... lol
CamperBot
@camperbot
Aug 20 2015 02:42
tuvyayis sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 48 | @camperbot | http://www.freecodecamp.com/camperbot
Derek Frankel
@TuvyaYis
Aug 20 2015 02:43
@rcmaples TY!
chicachicamji
@chicachicamji
Aug 20 2015 02:44
can anyone help me find the bug in this code?
function largestOfFour(arr) {
  function titleCase(str) {
  str=str.toLowerCase();
  var firstSplit = str.split(' ');
  var myArray = [];
  for(var x = 0; x < firstSplit.length; x++) {
    var currentWord=firstSplit[x];
    var editedWord="";
    var firstCharacter=firstSplit[x].charAt(0).toUpperCase();
    for(var y=1;y<currentWord.length;y++){
      editedWord=editedWord+currentWord[y];
    }
    editedWord=firstCharacter+editedWord; 
    myArray.push(editedWord);    
  }
  return myArray.join(' ');
}
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
oops i just saw it lol
xDDDD
facepalm
chantilly lovelace
@chantillylace
Aug 20 2015 02:50
thank you@rcmaples! Your post just enlightened me on what I was not doing on that very waypoint challenge.
CamperBot
@camperbot
Aug 20 2015 02:50
if you want to thank someone, put an @ before their name!
chicachicamji
@chicachicamji
Aug 20 2015 02:51
can anybody tell me why this code isn't working?
function largestOfFour(arr) {
  var Largest;
  var largestArray = [];
  for(var x = 0; x < arr.length; x++) {
    for(var y = 0; y < arr[x].length; y++) {
      if(arr[x][0] < arr[x][1]) {
        Largest = arr[x][1];
      } if(Largest < arr[x][2]) {
        Largest = arr[x][2];
      } if(Largest < arr[x][3]) {
        Largest = arr[x][3];
      }
    }
    largestArray.push(Largest);
  }
  return largestArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Ross Johnson
@txguy87
Aug 20 2015 02:54
blob
blob
I've been stuck on this for a while, am I doing it wrong or is it a bug?
chicachicamji
@chicachicamji
Aug 20 2015 02:56
@txguy87 do myDog.bark = "arf!";
Ross Johnson
@txguy87
Aug 20 2015 02:56
wow, i am a dumbass
thank you @chicachicamji
CamperBot
@camperbot
Aug 20 2015 02:57
txguy87 sends brownie points to @chicachicamji :sparkles: :thumbsup: :sparkles:
:star: 194 | @chicachicamji | http://www.freecodecamp.com/chicachicamji
Richard Gottleber
@rgottleber
Aug 20 2015 02:57
bonfire DNA Pairing
CamperBot
@camperbot
Aug 20 2015 02:57

:fire:Bonfire: DNA Pairing :link:

function pair(str) {
 return str;
}

pair("GCG");

The DNA strand is missing the pairing element. Match each character with the missing element and return the results as a 2d array.

more info:  bf details | bf links | hint

chicachicamji
@chicachicamji
Aug 20 2015 03:02
bonfire Return Largest Number
CamperBot
@camperbot
Aug 20 2015 03:02

:fire:Bonfire: Return Largest Numbers in Arrays :link:

function largestOfFour(arr) {
  // You can do this!
  return arr;
}

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

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

more info:  bf details | bf links | hint

chicachicamji
@chicachicamji
Aug 20 2015 03:03
i dont know why i did that, it seems like a cool new feature
Reggie
@Reggie01
Aug 20 2015 03:04

@chicachicamji What if

arr[x][0] < arr[x][1]

is false

Richard Gottleber
@rgottleber
Aug 20 2015 03:04
Hi, is there a way to add camperbot to my own room?
and use it's abilities.. I can add him but he never responds
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 03:05
@chicachicamji I'd look into array.sort() and array.slice() that might make your life easier.
Rex Schrader
@SaintPeter
Aug 20 2015 03:10
@lightningneon What's the trouble?
FX
@lightningneon
Aug 20 2015 03:11
@SaintPeter Thank you for responding! :) Well I just dont know how to start this code. I tried to do the 2 different ways of commenting but I just dont know what its asking me to do
CamperBot
@camperbot
Aug 20 2015 03:11
lightningneon sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 224 | @saintpeter | http://www.freecodecamp.com/saintpeter
chicachicamji
@chicachicamji
Aug 20 2015 03:11
@Reggie01 thanks I fixed it, that was stupid of me, I assumed the code code would magically know what to do in that case -- lesson learned
function largestOfFour(arr) {
  var Largest;
  var largestArray = [];
  for(var x = 0; x < arr.length; x++) {
    for(var y = 0; y < arr[x].length; y++) {
      if(arr[x][0] < arr[x][1]) {
        Largest = arr[x][1];
      } if(arr[x][0] > arr[x][1]) {
        Largest = arr[x][0];
      } if(Largest < arr[x][2]) {
        Largest = arr[x][2];
      } if(Largest > arr[x][2]) {
        Largest = Largest;
      } if(Largest < arr[x][3]) {
        Largest = arr[x][3];
      } if(Largest > arr[x][3]) {
        Largest = Largest;
      }
    }
    largestArray.push(Largest);
  }
  return largestArray;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
CamperBot
@camperbot
Aug 20 2015 03:11
chicachicamji sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 146 | @reggie01 | http://www.freecodecamp.com/reggie01
Rex Schrader
@SaintPeter
Aug 20 2015 03:12
@lightningneon You need to make one of each comment type:
// This is an inline type comment

/* This is a multi-line
    Comment */
@lightningneon There is no "Code" per se - just comments.
@chicachicamji This may be a silly question, but why aren't you using your inner loop to loop through the cases? You have that y variable just sitting there :D
FX
@lightningneon
Aug 20 2015 03:13
@SaintPeter I did that last night and today but nothing happened and now when I did it again it works. haha so weird. Thank you :D
CamperBot
@camperbot
Aug 20 2015 03:13
lightningneon sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: lightningneon already gave saintpeter points
IllusionElements
@IllusionElements
Aug 20 2015 03:14

Does anyone know how to do something like

https://twitter.com/intent/tweet?text={{quote.text}} - {{quote.author}}

without enabling angular, is there something i can specifically do in JS to do so?

Rex Schrader
@SaintPeter
Aug 20 2015 03:14
@lightningneon There have been some site issues that have prevented submissions off and on. That might have been the issue.
chantilly lovelace
@chantillylace
Aug 20 2015 03:15
@txguy87
Rex Schrader
@SaintPeter
Aug 20 2015 03:16

@IllusionElements Yes, you need to use the + operator for strings. Make your URL a string and build it by adding strings together. IE:

var url = "https://twitter.com/intent/tweet?text=" + encodeURI(quote.text + " - "  + quote.author)

You need the encodeURI because you can't have spaces in your URLs

Reggie
@Reggie01
Aug 20 2015 03:17
@chicachicamji glad you figured it out!! You only had to solve for the initial check so you could have kept the code nearly the same.
function largestOfFour(arr) {
  var Largest;
  var largestArray = [];
  for(var x = 0; x < arr.length; x++) {
    for(var y = 0; y < arr[x].length; y++) {
      if(arr[x][0] < arr[x][1]) {
        Largest = arr[x][1];
      } else {
         Largest = arr[x][0];  // just added a else statement to your original code
      }
       if(Largest < arr[x][2]) {
        Largest = arr[x][2];
      } if(Largest < arr[x][3]) {
        Largest = arr[x][3];
      }
    }
    largestArray.push(Largest);
  }
  return largestArray;
}
chantilly lovelace
@chantillylace
Aug 20 2015 03:17
@txguy87 I was stuck in the same place.
thank you @chicachicamji for the help!
CamperBot
@camperbot
Aug 20 2015 03:18
chantillylace sends brownie points to @chicachicamji :sparkles: :thumbsup: :sparkles:
:star: 196 | @chicachicamji | http://www.freecodecamp.com/chicachicamji
Rex Schrader
@SaintPeter
Aug 20 2015 03:18
@IllusionElements You're going to need to write your url string via the .attr jQuery function, or by building the entire anchor tag (<a>) as a string
smellyd
@smellyd
Aug 20 2015 03:18
How do you implement a cover page for a site? I'm not sure if you create a div and show/hide or is it a separate file?
Michael Sullivan
@scotist
Aug 20 2015 03:18
Hi everyone! I've been stuck on the Palindrome exercise for a long time. Not sure where I'm going wrong. Any suggestions?
function palindrome(str) {
  var repStr = str.replace(/str/gi,"").toLowerCase();
  var checkPalindrome = repStr.split("").reverse().join("");

  if(repStr === checkPalindrome){ return true; }else{ return false; }

}
Rex Schrader
@SaintPeter
Aug 20 2015 03:19
@scotist Your regular expression looks wrong. Give it a try over here: http://regex101.com
IllusionElements
@IllusionElements
Aug 20 2015 03:20
@SaintPeter but how would I make that into a button then? im trying to add the tweet function to my quote machine
Rex Schrader
@SaintPeter
Aug 20 2015 03:20
@scotist Otherwise, your code looks exactly right. You just need to tune the Regexp to remove the correct stuff.
@IllusionElements You can do it as a link. You pretty much have to do it as a link, because a button would need JS to make it navigate.
FX
@lightningneon
Aug 20 2015 03:22
@SaintPeter Thank you again :)
CamperBot
@camperbot
Aug 20 2015 03:22
lightningneon sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: lightningneon already gave saintpeter points
Michael Sullivan
@scotist
Aug 20 2015 03:22
@SaintPeter , thanks for the tip. I'll take a look and see if it works! I appreciate it.
CamperBot
@camperbot
Aug 20 2015 03:22
scotist sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 225 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Aug 20 2015 03:22
@IllusionElements The anchor tag is going to look like this:
<a href="https://twitter.com/intent/tweet?text=some%20text%20here">Tweetit!</a>
@IllusionElements The trick is to build that href on the fly. You can leave the href blank in your HTML and then use jQuery to rewrite it whenever you fetch a quote. You can use the .attr() function of jQuery to write the href attribute. Like this:
$('.someClass').attr('href', 'http://www.example.com');
@IllusionElements just remember that you'll need to encodeURI any text that you append to the URL or it may not work properly. You may also want to ensure that the quote + author + spaces and dashes length is not greather than 140 characters.
IllusionElements
@IllusionElements
Aug 20 2015 03:25
@SaintPeter alright thanks
CamperBot
@camperbot
Aug 20 2015 03:25
illusionelements sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 226 | @saintpeter | http://www.freecodecamp.com/saintpeter
IllusionElements
@IllusionElements
Aug 20 2015 03:27
and that would execute whenever the document loads, without any need to refresh correct?
Rex Schrader
@SaintPeter
Aug 20 2015 03:30
@IllusionElements Without knowing how your code works, I can't say. I will say this: Whenever you fetch a new quote, be it at page load or by clicking a button, you will need to update your tweet URL. I presume you have a function that will write your quote to the page already, just add your tweet url update to that. I can take a look at your code, if you'd like.
Jose Lora
@Jolferz
Aug 20 2015 03:31
Hello everyone, how do I show a code with the color formatting? I try using the `` at the start and finish of the code... but it always shows as if I used only one. Anyone knows what I could be doing wrong?
This message was deleted
Rex Schrader
@SaintPeter
Aug 20 2015 03:32
@Jolferz the backticks need to be on a line of their own. Use Shift-Enter to get blank lines without submitting.
wiki format
Jose Lora
@Jolferz
Aug 20 2015 03:32
@SaintPeter Thank you!
CamperBot
@camperbot
Aug 20 2015 03:32
jolferz sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 227 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Aug 20 2015 03:32
Dagnabbit, someone broke that wiki link
IllusionElements
@IllusionElements
Aug 20 2015 03:32
@SaintPeter im not sure how to add it in, but if you could look at the code i'd be grateful, thanks! http://codepen.io/illusionelements/pen/YXoyod
CamperBot
@camperbot
Aug 20 2015 03:32
illusionelements sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: illusionelements already gave saintpeter points
Rex Schrader
@SaintPeter
Aug 20 2015 03:34
@IllusionElements The method you are using for retriving your quote is just not going to work long term. You need to do an Ajax query (look up the jQuery $.get or $.getJSON functions). You are simply not going to be able to use your current method. It's only good for fetching a single quote per page refresh.
@IllusionElements Here is an overview which is ok: https://learn.jquery.com/ajax/
Michael Sullivan
@scotist
Aug 20 2015 03:36

@SaintPeter , again, thanks for your help! You were right, and I got it to work, but to be honest I'm not sure why it worked.

That's a bit frustrating.

CamperBot
@camperbot
Aug 20 2015 03:36
scotist sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: scotist already gave saintpeter points
Rex Schrader
@SaintPeter
Aug 20 2015 03:37
@scotist Was the Regex confusing to you? I know that the regex101 site has a pretty decent explainer
@scotist If you want to share it with me, I might be able to explain it in depth
@scotist I mean, anything for a scotsman ;)
IllusionElements
@IllusionElements
Aug 20 2015 03:38

@SaintPeter

 $('#random').click(function() {
    $.ajax({
      url: "http://api.forismatic.com/api/1.0/",
      jsonp: "jsonp",
      dataType: "jsonp",
      data: {
        method: "getQuote",
        lang: "en",
        format: "jsonp"
      },
      success: function(quote) {
        $('#quote').html(quote.quoteText)
        $('#author').html(quote.quoteAuthor)
      }
    });
  })
});

so this method would not work long term?

Rex Schrader
@SaintPeter
Aug 20 2015 03:38
@IllusionElements Huh, have you not done a "save" on your code in a while?
@IllusionElements because the code you linked was what I'd seen earlier today.
Michael Sullivan
@scotist
Aug 20 2015 03:39

Here's what I used, following an example of something similar I saw elsewhere:

function palindrome(str) {
  var repStr = str.replace(/[^A-Z0-9]/gi,"").toLowerCase();
  var checkPalindrome = repStr.split("").reverse().join("");

  if(repStr === checkPalindrome){ return true; }else{ return false; }

}

"I mean, anything for a scotsman ;)"

I'm named after the medieval philosopher John Duns Scotus!

Rex Schrader
@SaintPeter
Aug 20 2015 03:39
@IllusionElements You may want to turn on auto-save
IllusionElements
@IllusionElements
Aug 20 2015 03:40
@SaintPeter I just resaved it if you could check again
Rex Schrader
@SaintPeter
Aug 20 2015 03:41
@scotist ok, the [ ] braces define a "Character Class" - they basically allow you to say "Any one of these characters, or range of characters" The carat ^ at the start of the character class says "Match anything BUT these characters" - it inverts the match. So by saying "[^A-Z0-9]" you're saying "Match anything that is not between A-Z or 0-9"
@IllusionElements Ahh, much better. Ok, you can just add your URL writing to your success function. Go scroll up and see what I've said about it, I should have given you all of the building blocks.
Michael Sullivan
@scotist
Aug 20 2015 03:42
@SaintPeter, that's very helpful, thank you.
CamperBot
@camperbot
Aug 20 2015 03:42
scotist sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: scotist already gave saintpeter points
Rex Schrader
@SaintPeter
Aug 20 2015 03:42
@scotist NP
@IllusionElements The one last piece I would suggest you do is put your entire AJAX call into a function all its own, so you can call it either during the document.ready or when you click your button. That way you don't have to repeat code. IE:
function doFetchQuote() {
   $.ajax(
/* AJAX CODE HERE */
   );
}
IllusionElements
@IllusionElements
Aug 20 2015 03:45
@SaintPeter for that do i include the success? or just the ajax call on its own?
Rex Schrader
@SaintPeter
Aug 20 2015 03:46
@IllusionElements success is part of the ajax call. The whole kit and kaboodle down to the last });
seleneyue
@seleneyue
Aug 20 2015 03:48
What does Bonfire: where are thou want us to do?
does it want to find objects that have that property, or have the same value for that property?
Christian Petersen
@fnky
Aug 20 2015 03:50
no, the last and first property.
But eventually let's say you have an array [{foo: 1, bar: 2}, {foo: 1}]
and pass {foo: 1} it should return all objects with equilivant value of foo — which in this case should return both objects
IllusionElements
@IllusionElements
Aug 20 2015 03:53
@SaintPeter hmm I did what you said but it is still not working
This message was deleted
FX
@lightningneon
Aug 20 2015 03:58
var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// don't change code above here

lastName.Length = 7;



// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(lastNameLength) !== "undefined"){(function(){return(lastNameLength);})();}
is the lastName.Length correct?
Christian Petersen
@fnky
Aug 20 2015 03:59
no it should be .length with lowercase l but why do you want to change it
Robert
@rc242
Aug 20 2015 03:59
To whomever posted that forismatic quote API. Thanks. My other API only gives new quotes every several hours or so. :-1:
CamperBot
@camperbot
Aug 20 2015 03:59
if you want to thank someone, put an @ before their name!
Robert
@rc242
Aug 20 2015 04:00
@IllusionElements er, and it was you. Thanks, y0.
CamperBot
@camperbot
Aug 20 2015 04:00
rc242 sends brownie points to @illusionelements :sparkles: :thumbsup: :sparkles:
:star: 226 | @illusionelements | http://www.freecodecamp.com/illusionelements
IllusionElements
@IllusionElements
Aug 20 2015 04:00
@rc242 np, any chance you've figured out how to tweet the quote out?
FX
@lightningneon
Aug 20 2015 04:00
?
IllusionElements
@IllusionElements
Aug 20 2015 04:01
@rc242 I seem to be having trouble getting that part to work
FX
@lightningneon
Aug 20 2015 04:01
@fnky where you talking about my post? haha sorry got confused
Robert
@rc242
Aug 20 2015 04:01
@IllusionElements What problems are you having?
FX
@lightningneon
Aug 20 2015 04:01
were*
Christian Petersen
@fnky
Aug 20 2015 04:02
Yep @lightningneon
FX
@lightningneon
Aug 20 2015 04:02
@fnky I tried it and it didnt work :(
Christian Petersen
@fnky
Aug 20 2015 04:03
''.length is read-only
Robert
@rc242
Aug 20 2015 04:03
@IllusionElements Did you take a look at this ? https://dev.twitter.com/web/tweet-button/web-intent
IllusionElements
@IllusionElements
Aug 20 2015 04:04
@rc242 nvm i'm an idiot I forgot to run the function after I defined it
Christian Petersen
@fnky
Aug 20 2015 04:04
You cannot set length of a string... well you can but it does not set it as it will always re-calculate the length of the string and return it @lightningneon
FX
@lightningneon
Aug 20 2015 04:04
@fnky sorry i still dont get it. Im just a newbie :( first day on my JS
Christian Petersen
@fnky
Aug 20 2015 04:04
No issue in that! It's great to learn something new :D
FX
@lightningneon
Aug 20 2015 04:05
@fnky Thanks for motivating me xD
CamperBot
@camperbot
Aug 20 2015 04:05
lightningneon sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Christian Petersen
@fnky
Aug 20 2015 04:05
So what you're trying to do is setting the length of lastName, but you can't really do that
FX
@lightningneon
Aug 20 2015 04:05
@fnky so what should I do?
Christian Petersen
@fnky
Aug 20 2015 04:05
But as length returns a Number you can compare it to other Number e.g.
FX
@lightningneon
Aug 20 2015 04:06
Im crying right now in my head T_T
hahaha
Christian Petersen
@fnky
Aug 20 2015 04:06
if (lastName.length === 7) { // its 7 } else { // it's anything but 7 }
aah ok
So in your example you need to declare a variable lastNameLength
However what you did was you created a property .Length on lastName.
FX
@lightningneon
Aug 20 2015 04:09
I know because on the challenge its also asking me to put the .Length haha
Christian Petersen
@fnky
Aug 20 2015 04:09
And since everything in JavaScript is an object lastName is a String object and you added a property Length to it (which is bad in JS) so what you'll have to do is
var lastNameLength = 7
Whoa weird challenge, where do you take this challenge?
Rex Schrader
@SaintPeter
Aug 20 2015 04:10
@IllusionElements Move the encodeURI inside the parentheses
Rex Schrader
@SaintPeter
Aug 20 2015 04:11
@IllusionElements Like this:
$('#tweet').attr('href','https://twitter.com/intent/tweet?text='+quote.quoteText+quote.quoteAuthor+"@yfsaaron".encodeURI());
Christian Petersen
@fnky
Aug 20 2015 04:11
Ah I think you mis-read the challenge then
FX
@lightningneon
Aug 20 2015 04:12
@fnky I got it now
xD
@fnky Thanks! :)
CamperBot
@camperbot
Aug 20 2015 04:12
lightningneon sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Christian Petersen
@fnky
Aug 20 2015 04:12
Oh wait
No actually there's one tiny error in the challenge
FX
@lightningneon
Aug 20 2015 04:12
@fnky I solved the challenge
oh
what is it?
Christian Petersen
@fnky
Aug 20 2015 04:13

Instead of

Use the .length property to count the number of characters in the lastNameLength variable.

it should be

Use the .length property to count the number of characters in the lastName variable.

FX
@lightningneon
Aug 20 2015 04:14
I did this
Christian Petersen
@fnky
Aug 20 2015 04:14

Rather it should be

Use the .length on the lastName variable to get the number of characters.

FX
@lightningneon
Aug 20 2015 04:14
var lastNameLength = 8;
lastName.Length = 0;
Christian Petersen
@fnky
Aug 20 2015 04:14

What you want to do in this case is change

lastNameLength = lastName;

to

lastNameLength = lastName.length;
FX
@lightningneon
Aug 20 2015 04:16
Thats so weird that it will accept any kind of code as long as you put same word
@fnky Thank you for showing me the right way to do it
CamperBot
@camperbot
Aug 20 2015 04:17
lightningneon sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Christian Petersen
@fnky
Aug 20 2015 04:20
Well lastName.Length and lastNameLength are different
lastName.Length tries to get a property Length off lastName (which is a String, and does not exist) and lastNameLength is a variable in of itself.
Philip
@philipjs
Aug 20 2015 04:25
hi all, I'm stuck on Waypoint: Set the ID of an Element, not sure where to put the "id"
Lucas
@Kuroimitsukai
Aug 20 2015 04:28
hello guys, I'm having an issue with "Waypoint: Target HTML Elements with Selectors Using jQuery"
Todd Johnson
@TJohnson93
Aug 20 2015 04:29
Hi guys this Waypoint: Target the same element with multiple jQuery Selectors I’m not sure what this criteria means - Only add one class with each of your three selectors.
This is my JavaScript:
$('button.btn#target1').addClass('animated shake btn-primary');
@Kuroimitsukai Whats the issue?
francves
@francves
Aug 20 2015 04:29
hey guys i have a problem with jquery
Todd Johnson
@TJohnson93
Aug 20 2015 04:29
@philipjs
<h1 id=“idname”></h1>
francves
@francves
Aug 20 2015 04:29
Waypoint: Target a Specific Child of an Element Using jQuery
Todd Johnson
@TJohnson93
Aug 20 2015 04:30
@francves What’s your code so far?
Philip
@philipjs
Aug 20 2015 04:30
Ta @TJohnson93
Todd Johnson
@TJohnson93
Aug 20 2015 04:30
@philipjs Your welcome
Lucas
@Kuroimitsukai
Aug 20 2015 04:30
@TJohnson93 To the best of my ability I believe this is correct with what I have so far.
'''<script>
$(document).ready(function() {
$("button").addclass("animated bounce")
});
</script>'''
CamperBot
@camperbot
Aug 20 2015 04:30
:bulb: to format code use backticks! ``` more info
Lucas
@Kuroimitsukai
Aug 20 2015 04:31
my apologizes for using the wrong key there for the markdown :(
francves
@francves
Aug 20 2015 04:31
I use nth with the second element but takeme all parent class
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
Todd Johnson
@TJohnson93
Aug 20 2015 04:31
@Kuroimitsukai look at the name of your addclass function
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 04:32
@TJohnson93 they want you to add one of each of those classes (animated, shake btn-primary) to each of the selectors listed. it's pretty much just to demonstrate that they stack.
Todd Johnson
@TJohnson93
Aug 20 2015 04:32
@Kuroimitsukai Also your missing a semicolon at the end of your line
francves
@francves
Aug 20 2015 04:32
thanks for hel @TJohnson93
CamperBot
@camperbot
Aug 20 2015 04:32
francves sends brownie points to @tjohnson93 :sparkles: :thumbsup: :sparkles:
:star: 2 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
Todd Johnson
@TJohnson93
Aug 20 2015 04:32
@ChadKreutzer Ahh I see thanks… Too effecient ;)
CamperBot
@camperbot
Aug 20 2015 04:32
tjohnson93 sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 226 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Todd Johnson
@TJohnson93
Aug 20 2015 04:32
Brownie Points?
Lucas
@Kuroimitsukai
Aug 20 2015 04:32
@TJohnson93 my god, I feel like an idiot lol. Thanks for the help. I sat there for like 15 minutes and didn't see that.
CamperBot
@camperbot
Aug 20 2015 04:32
kuroimitsukai sends brownie points to @tjohnson93 :sparkles: :thumbsup: :sparkles:
:star: 3 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
Todd Johnson
@TJohnson93
Aug 20 2015 04:33
@francves What do you need to do?
francves
@francves
Aug 20 2015 04:33

the script:

$("#left-well:nth-child(2)").addClass("animated bounce");
$("#right-well:nth-child(2)").addClass("animated bounce");

Chad Kreutzer
@ChadKreutzer
Aug 20 2015 04:34
@TJohnson93 it's part of the new update. you give brownie points to someone every time you thank them using the @ notation for their name. I'm not sure what they're good for though beyond "the fun of it"
CamperBot
@camperbot
Aug 20 2015 04:34
chadkreutzer sends brownie points to @tjohnson93 :sparkles: :thumbsup: :sparkles:
:star: 4 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 04:34
lol. and apparently the regex is really lax for it. lmao
Todd Johnson
@TJohnson93
Aug 20 2015 04:34
@ChadKreutzer Ahh ok cheers
francves
@francves
Aug 20 2015 04:35
I use nth with the second element but take me all parent class, not the second element
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
Peter Benjamin
@petermbenjamin
Aug 20 2015 04:35

I need assistance with Odd Fibonacci Bonfire. My code passes all but 1 test.

function sumFibs(num) {
  var fibArr = [1,1],
      i = 2,
      fibSeq = function(seed){
    while (fibArr[i-2]+fibArr[i-1] < seed){
      fibArr.push(fibArr[i-2]+fibArr[i-1]);
      i++;
    }
      };

  fibSeq(num);

  var odds = function(x){
    return x%2;
  };

  var sumOdds = function(prev,cur){
    return prev+cur;
  };

  var sumOddFibs = fibArr.filter(odds).reduce(sumOdds);
  return sumOddFibs;
}

sumFibs(75025);

Any ideas?

Todd Johnson
@TJohnson93
Aug 20 2015 04:36
@francves try:
$("#left-well.target:nth-child(2)").addClass("animated bounce”);
Robert
@rc242
Aug 20 2015 04:36
@pmbenjamin Which test did it fail?
Peter Benjamin
@petermbenjamin
Aug 20 2015 04:36
the sumFibs(75025)
the prior 5 tests passed successfully. The 6th test fails. The outcome is 60,696 whereas the test expects 135,721
francves
@francves
Aug 20 2015 04:38
not work men @TJohnson93 :/
Todd Johnson
@TJohnson93
Aug 20 2015 04:38
@francves Hang on let me try
Peter Benjamin
@petermbenjamin
Aug 20 2015 04:38
@rc242 I've console logged my code in an attempt to debug, but can't seem to pinpoint it.
Robert
@rc242
Aug 20 2015 04:38
bf fibonacci
CamperBot
@camperbot
Aug 20 2015 04:38

:fire:Bonfire: Sum All Odd Fibonacci Numbers :link:

function sumFibs(num) {
  return num;
}

sumFibs(4);

Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.

more info:  bf details | bf links | hint

Robert
@rc242
Aug 20 2015 04:40
it would appear that 75025 is a fibonacci number.
Todd Johnson
@TJohnson93
Aug 20 2015 04:40
@TJohnson93 I think you had a weird quotation at the end: copy this...
 $("#left-well.target:nth-child(2)").addClass("animated bounce");
Peter Benjamin
@petermbenjamin
Aug 20 2015 04:40
ah, my while loop is not including the fibonacci number
Robert
@rc242
Aug 20 2015 04:40
@pmbenjamin yep.
Todd Johnson
@TJohnson93
Aug 20 2015 04:41
Whats camperbot doing with the Bonfire post?
Peter Benjamin
@petermbenjamin
Aug 20 2015 04:42
Thank you @rc242 . That's what I get for working half in repl.it and half in FreeCodeCamp. I had the <= comparison in repl.it but not FreeCodeCamp.
CamperBot
@camperbot
Aug 20 2015 04:42
pmbenjamin sends brownie points to @rc242 :sparkles: :thumbsup: :sparkles:
:star: 149 | @rc242 | http://www.freecodecamp.com/rc242
francves
@francves
Aug 20 2015 04:43

Dont work @TJohnson93 the tutorial says:

"Make the second child in each of your well elements bounce.

Here's how you would give the third element in each well bounce: $(".target:nth-child(3)").addClass("animated bounce");"

Todd Johnson
@TJohnson93
Aug 20 2015 04:43
@francves Ahh ok
Peter Benjamin
@petermbenjamin
Aug 20 2015 04:43
@TJohnson93 , if you type bf followed by part of a title, CamperBot will look for a Bonfire that contains that part in the title and print out the description of the bonfire challenge
It's supposed to save you from having to go to "Map" and manually look for the Bonfire challenge in question.
Mahtab
@RoadToCode822
Aug 20 2015 04:48

For http://freecodecamp.com/challenges/waypoint-create-a-javascript-slot-machine:
I’m getting an error:

You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers.

This is my code:

    slotOne = Math.floor(Math.random() * (3 - 1 + 1) + 1);
    slotTwo = Math.floor(Math.random() * (3 - 1 + 1) + 1);
    slotThree = Math.floor(Math.random() * (3 - 1 + 1) + 1);
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 04:49
@mobesa Thank you
CamperBot
@camperbot
Aug 20 2015 04:49
thehighpriestess sends brownie points to @mobesa :sparkles: :thumbsup: :sparkles:
:star: 221 | @mobesa | http://www.freecodecamp.com/mobesa
Todd Johnson
@TJohnson93
Aug 20 2015 05:00
@pmbenjamin Thats a really helpful new feature
Rex Schrader
@SaintPeter
Aug 20 2015 05:06
@RoadToCode822 You're missing a parantheses, did you find it?
Christian Petersen
@fnky
Aug 20 2015 05:06
where?
Rex Schrader
@SaintPeter
Aug 20 2015 05:06
After the first + 1
Christian Petersen
@fnky
Aug 20 2015 05:07
No, it does return correctly a number between 1 and 3
Yawar Jamal
@yj7o5
Aug 20 2015 05:07
'''
CamperBot
@camperbot
Aug 20 2015 05:07
:bulb: to format code use backticks! ``` more info
Mahtab
@RoadToCode822
Aug 20 2015 05:07
where
prameela
@prameelak
Aug 20 2015 05:07
Can anyone help me on the problem
Bonfire :Check For Palindrome
Mahtab
@RoadToCode822
Aug 20 2015 05:07
@SaintPeter
Yawar Jamal
@yj7o5
Aug 20 2015 05:07
```
Christian Petersen
@fnky
Aug 20 2015 05:07
aah, i see
Rex Schrader
@SaintPeter
Aug 20 2015 05:08
@prameelak Sure, do you know how to share your code?
help format
CamperBot
@camperbot
Aug 20 2015 05:08

:point_right: pasting formatted code in gitter [wiki]

Using Gitter's markdown syntax will make your code more readable for your fellow campers.

Use three ticks [ ` ] -- on American keyboards, that's the key in the corner between [1] and [Tab]. Then press [Enter]+[Shift]. Gitter will usually fill in the closing ticks for you, but if they aren't there remember to end your code with a line of three ticks. Ticks must always be on their own lines. When you are ready to send your message press [Ctrl]+[Enter].

You can edit your previously sent messages by hovering over the message and clicking the ..., so if you accidentally paste unformatted code, just fix it.

If your code is long, you can create a Gist and paste the link in Gitter. This also allows fellow campers to collaborate with you more directly.
:pencil: read more about pasting formatted code in gitter on the FCC Wiki

Christian Petersen
@fnky
Aug 20 2015 05:08
Math.floor(Math.random() * (3 - 1 + 1)) + 1;
rather than
 Math.floor(Math.random() * (3 - 1 + 1) + 1);
Rex Schrader
@SaintPeter
Aug 20 2015 05:08
@fnky Yup
Yawar Jamal
@yj7o5
Aug 20 2015 05:08
function palindrome(str) {
  var lower = str.toLowerCase();
  return lower.split('').reverse().join(' ') == lower;
}
whats wrong with this can any one help
Christian Petersen
@fnky
Aug 20 2015 05:08
But it still gives the same error.
And it's not descriptive enough.
Plus it doesn't change anything
Rex Schrader
@SaintPeter
Aug 20 2015 05:09
@yj7o5 Sure - when you're doing palindromes you don't count spaces or punctuation, so you need to remove them.
Yawar Jamal
@yj7o5
Aug 20 2015 05:09
why do you have (3 + 1 -1)
Christian Petersen
@fnky
Aug 20 2015 05:09
Math.random only returns a random number between 0 and 1
Yawar Jamal
@yj7o5
Aug 20 2015 05:09
oh i see so i have to remove all the spaces
Rex Schrader
@SaintPeter
Aug 20 2015 05:09
@yj7o5 Because that's what the instructions make you do
Christian Petersen
@fnky
Aug 20 2015 05:09
so you have (max + min - min) + min
to add to the result of Math.random
Rex Schrader
@SaintPeter
Aug 20 2015 05:10
@yj7o5 Spaces and other stuff, too. Like commas and things.
Yawar Jamal
@yj7o5
Aug 20 2015 05:10
but does that mean i have to remove each every punctuation
Rex Schrader
@SaintPeter
Aug 20 2015 05:10
@yj7o5 A regular expression is a great way to do it.
Christian Petersen
@fnky
Aug 20 2015 05:10
No???
Rex Schrader
@SaintPeter
Aug 20 2015 05:10
@yj7o5 Yes, ALL of them. That's why I suggest a regex
jb299
@jb299
Aug 20 2015 05:10
Did anyone use arr.some on bf finders keepers?
Christian Petersen
@fnky
Aug 20 2015 05:10
Wait wat, sorry haha two topics at once
tjstinso
@tjstinso
Aug 20 2015 05:10
@fnky you only need
Math.random(max-min) + min
Yawar Jamal
@yj7o5
Aug 20 2015 05:10
oh yeah got it many thanks @SaintPeter
CamperBot
@camperbot
Aug 20 2015 05:10
yj7o5 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 229 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Aug 20 2015 05:10
@yj7o5 You can test your regex here: http://regex101.com
Christian Petersen
@fnky
Aug 20 2015 05:10
Math.random() doesn't take any arguments @tjstinso
Yawar Jamal
@yj7o5
Aug 20 2015 05:11
cool
Rex Schrader
@SaintPeter
Aug 20 2015 05:11
@jb299 I did not, nor could I think of a way to do so.
tjstinso
@tjstinso
Aug 20 2015 05:11
sorry math.random() * (max-min) + min
Madmoneymike
@Madmoneymike
Aug 20 2015 05:11
After I finsh the FreeCodeCamp tutorials will i be able to get a Computer Programming job?
Christian Petersen
@fnky
Aug 20 2015 05:12
No that would return from max to min +1
Rex Schrader
@SaintPeter
Aug 20 2015 05:12
@Madmoneymike After you finish the program, plus do some non-profit projects, you SHOULD be able to find a programming job. It's really the "real world" non-profits that give you a leg up
Christian Petersen
@fnky
Aug 20 2015 05:12
e.g. Math.random() * (3 - 1) + 1 would be between 1 2
Madmoneymike
@Madmoneymike
Aug 20 2015 05:13
WoW interesting thanks @SaintPeter
CamperBot
@camperbot
Aug 20 2015 05:13
madmoneymike sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 230 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Aug 20 2015 05:13
@Madmoneymike Of course, Your Milage may Vary. Some job markets need more programmers. And, hate to say it, but some people are not cut out to program.
Madmoneymike
@Madmoneymike
Aug 20 2015 05:13
I see
Rex Schrader
@SaintPeter
Aug 20 2015 05:14
@Madmoneymike It is my firm belief, though, that if you're willing to put in the time and work at it that you can become a passable programmer. It's not rocket science, it's just another skill.
Christian Petersen
@fnky
Aug 20 2015 05:14
passión
Madmoneymike
@Madmoneymike
Aug 20 2015 05:14
Yeah I like doing this as a passion
Christian Petersen
@fnky
Aug 20 2015 05:15

Imo

You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers.

is not descriptive.

Rex Schrader
@SaintPeter
Aug 20 2015 05:15
Of course .. . I don't have a job doing it yet . . . Although I have done programming for money on various side projects.
Madmoneymike
@Madmoneymike
Aug 20 2015 05:15
Im only 16 years old and I rather be coding than playing video games
tjstinso
@tjstinso
Aug 20 2015 05:15
@fnky ah then yea just add one to make it inclusive as opposed to exclusive. why isnt it working? does it give you an error in console as well or just on fcc
Madmoneymike
@Madmoneymike
Aug 20 2015 05:15
nice @SaintPeter
Rex Schrader
@SaintPeter
Aug 20 2015 05:16
I used to run a gaming guild for like 10 years . . . I knew my days were numbered when I enjoyed writing code for the website more than playing the latest MMO
Christian Petersen
@fnky
Aug 20 2015 05:16
Nope no error related to the actual challenge
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 05:17
@Madmoneymike take it from someone who was there, if you love programming, don't let a girl tell you to stop doing it.
Madmoneymike
@Madmoneymike
Aug 20 2015 05:17
Yeah haha I played alot of FPS shooters and WoW quite a bit and I told myself I need to do something else haha
Christian Petersen
@fnky
Aug 20 2015 05:17
But it in no way tells me what is wrong, as I do exactly as the spec says. So the problem is miscommunication on their part
Madmoneymike
@Madmoneymike
Aug 20 2015 05:17
@ChadKreutzer thanks for the advice
CamperBot
@camperbot
Aug 20 2015 05:17
madmoneymike sends brownie points to @chadkreutzer :sparkles: :thumbsup: :sparkles:
:star: 227 | @chadkreutzer | http://www.freecodecamp.com/chadkreutzer
Christian Petersen
@fnky
Aug 20 2015 05:18
Ok it's a bug.
Rex Schrader
@SaintPeter
Aug 20 2015 05:18
@ChadKreutzer @Madmoneymike If you're 16, DEFINITELY let a girl stop you from doing it. You can program later ;)
Anyway, I'm off for the night - TTYL
Madmoneymike
@Madmoneymike
Aug 20 2015 05:19
haha @SaintPeter havea good night
Christian Petersen
@fnky
Aug 20 2015 05:19

So if you do

function randomSlot() {
 return Math.floor(Math.random() * (3 - 1 + 1)) + 1
}

or anything besides repeating your self like this (non-DRY)

slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
You're going to have a hard time.
It's wrong to write spec that depends on specific syntax and code rather than result.
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 05:19
@SaintPeter @SaintPeter I did let a girl stop me from doing it. She dumped me freshman year of college and I was 4 years out of the loop programming and in a completely different program at school.
tjstinso
@tjstinso
Aug 20 2015 05:25
I havent done that waypoint as it was added pretty recently, but just know the waypoints are there to help you learn syntax by pounding it into your system (ie the codeacademy way), not a necessity. Regardless, it’s strange to force you to avoid a when it would be better practice.
Catelyn
@skatelyn
Aug 20 2015 05:37
So...I just finished the first zipline... if anyone would like to give me any feedback http://codepen.io/skatelyn/full/KpjMdj/
DTing
@dting
Aug 20 2015 05:38
@skatelyn nice. some of the headings are a bit hard to read but looks good!
Lightwaves
@Lightwaves
Aug 20 2015 05:39
"champion of lost causes" AMEN lol
I can understand that one .
Catelyn
@skatelyn
Aug 20 2015 05:39
Of course, i would edit that to make a professional site...i just thought i'd try something funny/witty for the zipline
@dting which headings?
Lightwaves
@Lightwaves
Aug 20 2015 05:40
About The Designer - Catelyn Neal is pretty hard to read
CamperBot
@camperbot
Aug 20 2015 05:40
you need to ask about @someone!
Lightwaves
@Lightwaves
Aug 20 2015 05:41
@skatelyn jeez I wish I had a head for numbers
math majors please rub off your math sense onto me
Catelyn
@skatelyn
Aug 20 2015 05:42
i changed it now
Lightwaves
@Lightwaves
Aug 20 2015 05:43
@skatelyn what branch of math? Pure or Applied
That is better and the color still goes with the scheme
Catelyn
@skatelyn
Aug 20 2015 05:44
@Lightwaves pure...took a break from working on my PhD to learn 'Full Stack Web Development'
why does @camperbot think we should ask about @someone
thanks @Lightwaves and @dting for the feedback
CamperBot
@camperbot
Aug 20 2015 05:46
skatelyn sends brownie points to @lightwaves and @dting :sparkles: :thumbsup: :sparkles:
:star: 402 | @dting | http://www.freecodecamp.com/dting
:star: 165 | @lightwaves | http://www.freecodecamp.com/lightwaves
Lightwaves
@Lightwaves
Aug 20 2015 05:48
I think it may have been because of the about the designer thing
Catelyn Neal
nope wasn't the name in the message huh wonder what it could have been?
About The Designer - Catelyn Neal is pretty hard to read
CamperBot
@camperbot
Aug 20 2015 05:48
you need to ask about @someone!
Lightwaves
@Lightwaves
Aug 20 2015 05:49
yep that was the trigger still don't understand why though
DTing
@dting
Aug 20 2015 05:54
@skatelyn sorry I meant the "About The Designer - Catelyn Neal" and "Portfolio (Coming Soon)" are a little hard to see because there isnt much contrast.
gravesr1993
@gravesr1993
Aug 20 2015 05:57
http://codepen.io/GeoffStorbeck/full/RPbGxZ/ how do you do the animation of that filling? I can't seem to find anything like it or how to do it from looking around on my own and I don't want to look at the code
DTing
@dting
Aug 20 2015 05:57
@skatelyn I'm not sure if it is what you wanted but you can put a max-width on the thumbnail class to prevent them from expanding after you reach a certain limit:

.thumbnail {
  max-width: 360px;
}
Catelyn
@skatelyn
Aug 20 2015 05:59
thanks @dting
CamperBot
@camperbot
Aug 20 2015 05:59
skatelyn sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: skatelyn already gave dting points
DTing
@dting
Aug 20 2015 06:00
@gravesr1993 that is writen in angular they just 2 way bind a style attr on the span
gravesr1993
@gravesr1993
Aug 20 2015 06:02
I have a feeling that shouldn't be where it is in the FCC map then, because that's right after basic javascript bonfires lol, angular courses are way near the end
DTing
@dting
Aug 20 2015 06:03
@gravesr1993 and increment that height value. Thats one way, svg is another alternative. Greensock library.
@gravesr1993 well the animation is optional. You could do it without the animation and and come back and add it in when you feel comfortable
chicachicamji
@chicachicamji
Aug 20 2015 07:07
what does .pop() do to an array?
what happens for example if I do .pop(6)?
pop removes the last element and returns it. doesn't take an argument.
Christian Petersen
@fnky
Aug 20 2015 07:29
what about .disco() or .soul()
Paul Ballardin
@outsmart
Aug 20 2015 07:39
hey happy campers. A quick question about the recent changes to the course structures. Can someone point me in the direction of a post or info on the nature of the changes and whats happened to all our previous exercises that have now been removed (ie who new jquery section)?
Luis Felipe López G.
@luishendrix92
Aug 20 2015 07:41
explain 2015
CamperBot
@camperbot
Aug 20 2015 07:41

:point_right: august 2015 improvements [wiki]

Email login and password reset is fixed!

If you have any issues with Free Code Camp, please let us know: https://github.com/freecodecamp/freecodecamp/issues/new

:pencil: read more about august 2015 improvements on the FCC Wiki

Paul Ballardin
@outsmart
Aug 20 2015 07:44
hey @TJohnson93 cool. How did you deploy it to a remot url?
Todd Johnson
@TJohnson93
Aug 20 2015 07:44
@outsmart ??
Paul Ballardin
@outsmart
Aug 20 2015 07:45
@TJohnson93 its not on codepen
Todd Johnson
@TJohnson93
Aug 20 2015 07:45
@outsmart My Ziplines?
Paul Ballardin
@outsmart
Aug 20 2015 07:46
Correct.. @TJohnson93 did you use codeine?
not codeine, but codpen
Todd Johnson
@TJohnson93
Aug 20 2015 07:46
I have my own web server & domain name
Paul Ballardin
@outsmart
Aug 20 2015 07:47
cool, I was wondering if codepen allowed you to deploy like that that is all…
Christian Petersen
@fnky
Aug 20 2015 07:47
No, codepen does not allow deployment
— natively that is
Paul Ballardin
@outsmart
Aug 20 2015 07:49
this was my quote machine @TJohnson93 - looks like yuo went to a whole heap extra effort - well done!
DTing
@dting
Aug 20 2015 07:49
@outsmart codepen's are just static pages i used a gulp-webapp to host all the codepen stuff I did on githubpages. http://dting.github.io/fccportfolio/
Todd Johnson
@TJohnson93
Aug 20 2015 07:50
@outsmart What do you mean your quote machine?
Paul Ballardin
@outsmart
Aug 20 2015 07:50
sorry, let the link off http://codepen.io/outsmart/pen/ZGNNKP @TJohnson93
Todd Johnson
@TJohnson93
Aug 20 2015 07:52
@outsmart Im a big fan of Chuck Norris
Paul Ballardin
@outsmart
Aug 20 2015 07:52
nice work @dting
Todd Johnson
@TJohnson93
Aug 20 2015 07:52
@dting Love you portfolio site… Bootstrap?
DTing
@dting
Aug 20 2015 07:53
ya its a startboostrap theme.
i made it before there was a zipline for it so I'm not sure if i met all the requirements hah
thanks @outsmart @TJohnson93
CamperBot
@camperbot
Aug 20 2015 07:54
dting sends brownie points to @outsmart and @tjohnson93 :sparkles: :thumbsup: :sparkles:
:star: 5 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
:star: 128 | @outsmart | http://www.freecodecamp.com/outsmart
Todd Johnson
@TJohnson93
Aug 20 2015 07:55
I really like it… I have had a portfolio site for a while… It just went through a redesign though… Your welcome to have a look here
Its based on the Freelancer.com profile site
and built upon Semantic UI
DTing
@dting
Aug 20 2015 07:57
@TJohnson93 that looks really nice!
Todd Johnson
@TJohnson93
Aug 20 2015 07:57
@dting thanks :)
CamperBot
@camperbot
Aug 20 2015 07:57
tjohnson93 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 404 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 20 2015 07:59
@TJohnson93 a couple of the certs are perpetual loading. not sure if that is intentional
Todd Johnson
@TJohnson93
Aug 20 2015 08:00
Yeah it is because they are currently being obtained
DTing
@dting
Aug 20 2015 08:00
ahh gotcha
Todd Johnson
@TJohnson93
Aug 20 2015 08:02
Yeah
BlueHurricane
@BlueHurricane
Aug 20 2015 08:21
How do u put two classes in an element? Could u just put class ="" class="" side by side?
Richard Vankoningsveld
@richyvk
Aug 20 2015 08:23
Hi all. Anyone got any thoughts on the JS slot machine waypoints? I'm curious about the jQuery selector used, e.g. $($(".slot")[0]).
Using $('.slot:eq(0)') seems nicer to me.
Are either of these methods considered better practice than the other?
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 08:33
@BlueHurricane
class="class1 class2 class3..."
BlueHurricane
@BlueHurricane
Aug 20 2015 08:33
Ohh ok thank!
Da Cheezy Mobsta
@mobesa
Aug 20 2015 08:40
about @SaintPeter
CamperBot
@camperbot
Aug 20 2015 08:40
:star: 230 | @saintpeter | http://www.freecodecamp.com/saintpeter
Da Cheezy Mobsta
@mobesa
Aug 20 2015 08:40
about @richyvk
CamperBot
@camperbot
Aug 20 2015 08:40
:star: 145 | @richyvk | http://www.freecodecamp.com/richyvk
DTing
@dting
Aug 20 2015 08:45
@richyvk I think they just wanted to keep things simple, and simple is subjective. I would have gone with your method or rather $('.slot').eq(0)
Richard Vankoningsveld
@richyvk
Aug 20 2015 08:46
@dting yeah, I thought that. Just curious. good to know you're alternative also works :)
@dting although also interesting to know you can target pretty much any element specifically with jQuery by wrapping the selector in a $([n]) though, at least I'm asuming you can do that??
Richard Vankoningsveld
@richyvk
Aug 20 2015 08:54
about @dting
CamperBot
@camperbot
Aug 20 2015 08:54
you need to ask about @someone!
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 09:00
Waypoint bring your javascript
hmmm.
ah well. Waypoint bring your javascript slot machine to life keeps hanging for me. is anyone else having that problem?
DTing
@dting
Aug 20 2015 09:01
@richyvk ya. you probably wouldn't want to do that tho in any sort of dynamic page.
bf Waypoint bring your javascript
CamperBot
@camperbot
Aug 20 2015 09:01
Sorry, can't find a bonfire called waypoint bring your javascript. [ Check the map? ]
DTing
@dting
Aug 20 2015 09:02
oh heh its a waypoint lemme see
@ChadKreutzer copy paste in the code
because the way they continually check your code when you type $($ you hit an infinite recursion and the page freezes
Chad Kreutzer
@ChadKreutzer
Aug 20 2015 09:04
yup. @dting I figured it out. I just worked around it by typing the whole thing before adding that first $
Rabin Shrestha
@jyapujuju
Aug 20 2015 09:23
Waypoint: Access Array Data with Indexes
var myData = myArray[1,2,3];
what is wrong..
Owen
@owencampbell
Aug 20 2015 09:26
@jyapujuju 1,2,3 isn't a valid index... Arrays begin at 0 so you'll need to some something like myArray0 (in this example would equal 1)
Christian Petersen
@fnky
Aug 20 2015 09:50
myArray[0]
myArray[1]
myArray[2]
myArray[3]

// if myArray is an array with arrays with one item
myArray[0][0]
myArray[1][0]
myArray[2][0]
myArray[3][0]
Toni Burley
@Toni-Burley
Aug 20 2015 09:52
Help! I'm stuck on the Waypoint : Invert Regular Expressions Matches with JavaScript. The second test is clearing but I'm not understanding why the first isn't. Can anyone offer some guidance?
CamperBot
@camperbot
Aug 20 2015 09:52
no wiki entry for: im stuck on the waypoint invert regular expressions matches with javascript the second test is clearing but im not understanding why the first isnt can anyone offer some guidance
:pencil: click here to create one now!after creating your page type update to reload it here
Christian Petersen
@fnky
Aug 20 2015 09:53
go homer @camperbot your drank
Toni Burley
@Toni-Burley
Aug 20 2015 09:53
Do we have to create a wiki to ask a question?
Christian Petersen
@fnky
Aug 20 2015 09:54
No haha, it's just drunk
Toni Burley
@Toni-Burley
Aug 20 2015 09:54
@fnky ohhh okay!
ErickX93
@ErickX93
Aug 20 2015 09:54
can someone pls help me with the random quote generator? I don't know how to use API
Christian Petersen
@fnky
Aug 20 2015 09:54
can you post the link to the waypoint and your code @Toni-Burley

@fnky my code:
var test = (function(){
var testString = "How many spaces are there in this sentence?";

// Only change code below this line.

var expression = /\s/gi;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
return(testString.match(expression).length);
})();(function(){return(test);})();

Rabin Shrestha
@jyapujuju
Aug 20 2015 09:56
var myArray = [1,2,3];
// Only change code below this line.
myArray[0];
var myData= myArrary[0];
error againa
Toni Burley
@Toni-Burley
Aug 20 2015 09:57
Let me refresh on markdown
var test = (function(){ var testString = "How many spaces are there in this sentence?"; // Only change code below this line. var expression = /\s/gi; // Only change code above this line. // We use this function to show you the value of your variable in your output box. return(testString.match(expression).length); })();(function(){return(test);})();
Christian Petersen
@fnky
Aug 20 2015 09:58
3 ticks ```
on start and end
Toni Burley
@Toni-Burley
Aug 20 2015 09:58
var test = (function(){ var testString = "How many spaces are there in this sentence?"; // Only change code below this line. var expression = /\s/gi; // Only change code above this line. // We use this function to show you the value of your variable in your output box. return(testString.match(expression).length); })();(function(){return(test);})();
Owen
@owencampbell
Aug 20 2015 10:00
@jyapujuju You spelt myArray wrong (myArrary)
Christian Petersen
@fnky
Aug 20 2015 10:00
@Toni-Burley It has to be an uppercase Sas in /\S/gi
ErickX93
@ErickX93
Aug 20 2015 10:01
can someone please help me with using an API?
Christian Petersen
@fnky
Aug 20 2015 10:01
Sure @ErickX93 go ahead
Toni Burley
@Toni-Burley
Aug 20 2015 10:01
@fnky I tried that and it will not work
i have to use this API
Christian Petersen
@fnky
Aug 20 2015 10:02
var expression = /\S/gi;
ErickX93
@ErickX93
Aug 20 2015 10:02
however, i have no idea how to add it to my page
Toni Burley
@Toni-Burley
Aug 20 2015 10:02
@fnky blaaahhhh I reset the code and tried again and it worked
ErickX93
@ErickX93
Aug 20 2015 10:02
Instead of the quote already there, i want a quote randomly generated from that API
Christian Petersen
@fnky
Aug 20 2015 10:02
I don't see any attempt in implementation :/
If you're using jQuery check out ajax jquery example @ErickX93
ErickX93
@ErickX93
Aug 20 2015 10:04
ok
thanks
CamperBot
@camperbot
Aug 20 2015 10:04
if you want to thank someone, put an @ before their name!
Christian Petersen
@fnky
Aug 20 2015 10:04
@Toni-Burley Alright, well it's weird they say use /\+S/gi thats going to match a +S rather than whitespace
Toni Burley
@Toni-Burley
Aug 20 2015 10:05
@fnky it's really weird bc Im not sure why we are required to use /\S+/ since it's the inversion of `/\s+\/
Why we *aren't required sorry @fnky
Christian Petersen
@fnky
Aug 20 2015 10:07
Yes but since you have the gi flags (global, ignore case) it's not really inverted. What happens is usually \s matches any whitespace and \S the anything but whitespace. But when you use flag i it'll also ignore case on these two. However the string is now matched as if it was one of the cases (lowercase e.g.) and \S will now match any whitespace.
the + operator means 'find any character of that matches the same pattern until there's no more'

e.g.

'abcdeg     hijklmn'
 ^----^     ^-----^

/\S+/ as well as /\S+/gi matches all characters but whitespace.

'abcdeg    hijklmn'
       ^--^

/\s+/ as well as /\s+/gi matches all whitespace only

Christian Petersen
@fnky
Aug 20 2015 10:13
Ok apparently... it doesn't conform to wether i was set.
madworld64
@madworld64
Aug 20 2015 10:17
Having a problem. When I logged in lost most of my waypoints pre-jquery when I had all completed. Am I stuck to redo them?#
Toni Burley
@Toni-Burley
Aug 20 2015 10:17
So no + with capital \S but with littse `\s+' @fnky
Christian Petersen
@fnky
Aug 20 2015 10:21
No, + simply means extend the match from the first match to the last
e.g. the above will match the abcdeg and hijklmn
but without + it would match a b c d e g and h i j k l m
individual characters
and since you had to count every character, and not whitespace, you had to omit the + because we didn't want to match words
@Toni-Burley
Andi
@p3rand0r
Aug 20 2015 10:24

Sorry if i bother , can someone explain to me the Bonfire: Truncate a string, as i dont really understand the question well. I completed it but i kinda cheated doing
[code]function truncate(str, num) {
// Clear out that junk in your trunk
if(str.length>num){
var i=str.slice(0,num-3)+"...";
return i;
}else{
return str;
}
}

truncate('A-tisket a-tasket A green and yellow basket', 11); [\code]

Christian Petersen
@fnky
Aug 20 2015 10:24
Alright wanna pair so I can explain why your method is not quite 'cheating'? :D
@p3rand0r
there's no cheating in coding, only different ways of doing it
Andi
@p3rand0r
Aug 20 2015 10:25
@fnky well it is as you can see on line var i=str.slice(0,num-3)+"...";
Christian Petersen
@fnky
Aug 20 2015 10:25
unless you monkey patch, but that's a whole other story
cheating according to the description or yourself?
Andi
@p3rand0r
Aug 20 2015 10:27
i added the num-3 so i can pass the exercise but why do i need to put the -3? is really that simple, doing the exercise by trials?
Christian Petersen
@fnky
Aug 20 2015 10:28
the num - 3 in your case takes off 3 from num. since you wanted 11 characters and then truncate that's would work quite well, but I can agree that there are many different ways you can approach this
Andi
@p3rand0r
Aug 20 2015 10:28
maybe i should search for any words, if the a word is truncated in half display it without being truncated, but im not sure if the exercise is like that :/
@fnky I know what it does, but is that a correct way to do it?
Christian Petersen
@fnky
Aug 20 2015 10:29
I think you misunderstand me. There's no specific correct way of doing it.
You did use the slice method. But I hope you mean, how is another approach I could take on this
Toni Burley
@Toni-Burley
Aug 20 2015 10:31
Ahhh got it! @fnky
Christian Petersen
@fnky
Aug 20 2015 10:31

Another approach, which is totally identical to what you did is this (which was what I did)

function truncate(str, num) {
  // Clear out that junk in your trunk
  return (str.length > num) ? str.slice(0, num - 3) + '...' : str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

@p3rand0r

Toni Burley
@Toni-Burley
Aug 20 2015 10:31
Thank you @fnky
CamperBot
@camperbot
Aug 20 2015 10:31
toni-burley sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Christian Petersen
@fnky
Aug 20 2015 10:31
No problem @Toni-Burley :D
Toni Burley
@Toni-Burley
Aug 20 2015 10:32
yeaaaaa, @camperbot is a little off his game
Andi
@p3rand0r
Aug 20 2015 10:32
@fnky Well not actually, i could use substr and instead of silce as another approach , but my question is: is ok if i do it with the num-3 ?
Christian Petersen
@fnky
Aug 20 2015 10:32
It's totally fine! After all it's exactly what you want
You wan't to take off the length of the three dots (which are ...)
Andi
@p3rand0r
Aug 20 2015 10:33
@fnky oh ok :) got it ! By the way, have you already finished the bonfire?
Christian Petersen
@fnky
Aug 20 2015 10:33
and slice the str from start to the num minus the length of ellipsis
Yes :)
Andi
@p3rand0r
Aug 20 2015 10:34
@fnky oh i got it :) Thanks for the help!
CamperBot
@camperbot
Aug 20 2015 10:34
p3rand0r sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Christian Petersen
@fnky
Aug 20 2015 10:34
always happy to help :D
Rabin Shrestha
@jyapujuju
Aug 20 2015 10:34
worked thanks @owencampbell <3
CamperBot
@camperbot
Aug 20 2015 10:34
jyapujuju sends brownie points to @owencampbell :sparkles: :thumbsup: :sparkles:
:star: 106 | @owencampbell | http://www.freecodecamp.com/owencampbell
Andi
@p3rand0r
Aug 20 2015 10:35
@fnky p.s and you have some really great design man ;) , keep the good job going!
Christian Petersen
@fnky
Aug 20 2015 10:35
Thank you @p3rand0r! Appreciate the kind words :D
CamperBot
@camperbot
Aug 20 2015 10:35
if you want to thank someone, put an @ before their name!
Christian Petersen
@fnky
Aug 20 2015 10:35
thanks @p3rand0r
CamperBot
@camperbot
Aug 20 2015 10:35
fnky sends brownie points to @p3rand0r :sparkles: :thumbsup: :sparkles:
:star: 112 | @p3rand0r | http://www.freecodecamp.com/p3rand0r
Andi
@p3rand0r
Aug 20 2015 10:37
@fnky my pleasure :)
p.s can i ask what are the repos you have in your profile?
Christian Petersen
@fnky
Aug 20 2015 10:41
The ones I made?
  • The first is Sketch plugin
  • second is a CSS3 UISwitch
  • third is a color scheme for Sublime Text
@p3rand0r
You can see my codepens at http://codepen.io/cbp
Andi
@p3rand0r
Aug 20 2015 10:45
@fnky When i hover the mouse on your name it shows:
30 followers 67 repos 40 following
Christian Petersen
@fnky
Aug 20 2015 10:45
These are my github repositories https://github.com/fnky?tab=repositories
I'm an avid Githubber
Andi
@p3rand0r
Aug 20 2015 10:46
@fnky Oh i see :D , thanks for the help.... AGAIN! :D
CamperBot
@camperbot
Aug 20 2015 10:46
if you want to thank someone, put an @ before their name!
Chirag Patel
@CPatel217
Aug 20 2015 10:47
hey guys Im on the last basic javascript waypoint (slot machine) and im adding the code for all three slots but the first condition is not being met for some reason
Christian Petersen
@fnky
Aug 20 2015 10:47
:D
Chirag Patel
@CPatel217
Aug 20 2015 10:47
condition is "use the provided code three times. one for each slot"
Christian Petersen
@fnky
Aug 20 2015 10:47
Can you send me the way to the waypoint and your code
@CPatel217
Chirag Patel
@CPatel217
Aug 20 2015 10:47
adding exactly this
  $($(".slot")[0]).html("<img src = '" + images[slotOne-1] + "'>");
    $($(".slot")[1]).html("<img src = '" + images[slotTwo-1] + "'>");
    $($(".slot")[2]).html("<img src = '" + images[slotThree-1] + "'>");
Christian Petersen
@fnky
Aug 20 2015 10:48
I think you have an extra $( infront
Chirag Patel
@CPatel217
Aug 20 2015 10:50
thats the code they give
Christian Petersen
@fnky
Aug 20 2015 10:50
really
Chirag Patel
@CPatel217
Aug 20 2015 10:50
yea let me try it tho
Christian Petersen
@fnky
Aug 20 2015 10:50
:shipit:
Chirag Patel
@CPatel217
Aug 20 2015 10:51
nope it should be like that
Christian Petersen
@fnky
Aug 20 2015 10:52
Can you send me the link to the waypoint
Chirag Patel
@CPatel217
Aug 20 2015 10:52
yea or else the img's dont show
sure
Christian Petersen
@fnky
Aug 20 2015 10:53
This worked for me
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '">');
Did you put it below the $('.logger') stuff
Chirag Patel
@CPatel217
Aug 20 2015 10:54
yea i copy pasted your code and its working
wat the??!
i had the same thing
Christian Petersen
@fnky
Aug 20 2015 10:55
Probably either whitespacing or something weird. I've noticed a lot of bugs in these waypoints
e.g. it's checking for specific syntax, which is just horrible
you can't make DRY functions, it'll punish you.
Which is just baaaad practice.
Chirag Patel
@CPatel217
Aug 20 2015 10:56
ok
i feel like the new waypoints in the beginning are way too easy
Christian Petersen
@fnky
Aug 20 2015 10:56
They're not meant to be hard, really
They're meant to excersise your brain rather than giving you food for thought
Chirag Patel
@CPatel217
Aug 20 2015 10:57
i know but a little challenge would be nice...on the other hand it feels good to breeze through them so quick
well thanks...I'll continue with it
CamperBot
@camperbot
Aug 20 2015 10:59
if you want to thank someone, put an @ before their name!
galacticfan
@galacticfan
Aug 20 2015 11:23
Hey guys, any chance someone could help me use an API in javascript?
Looks like my code hangs when it makes the request as the alert box doesn't show
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en", false);
xhr.send();
alert(xhr.status);
Jack Biddlecombe
@JackBid
Aug 20 2015 11:43
sorry if this is the wrong room to ask, but ive got a problem with zipline where when I click I've completed this challenge nothing happens
Krzysztof Miąsko
@kmiasko
Aug 20 2015 11:44
@JackBid they're working on it.. try to use ctrl + enter
Jack Biddlecombe
@JackBid
Aug 20 2015 11:45
@kmiasko already tried that unfortunately no luck
Krzysztof Miąsko
@kmiasko
Aug 20 2015 11:48
@JackBid it wasn't working in my chromium, but worked in firefox
try different browsers
Jack Biddlecombe
@JackBid
Aug 20 2015 11:49
@kmiasko Oh right, I'll give that a try, if that doesn't work I'll submit a bug report and just continue on with the course. Can always submit them later if they fix it I guess!
michaelmenace
@michaelmenace
Aug 20 2015 11:53
Hey could anyone help with bonfire: return largest numbers in arrays
I get an error, cannot read property 'length' of undefined
function largestOfFour(arr) {
  // You can do this!
  var largestFromTheArrays = [];
  var largestOfSubArray = 0;
  // goes through each element in the array
  for (var i = 0; i < largestOfFour.length; i++) {
    // goes through each element in the subarray
    for (var j = 0; j < largestOfFour[i].length; j++) {
      // finds the largest number in the subarray and stores it in largestOfSubArray
      if (largestOfFour[i][j] > largestOfSubArray) {
       largestOfSubArray = largestOfFour[i][j];
      }
      // pushes the largestOfSubArray into the array largestFromTheArrays
      largestFromTheArrays.push(largestOfSubArray);
    }
  }
  return largestFromTheArrays;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
CamperBot
@camperbot
Aug 20 2015 11:53
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
michaelmenace
@michaelmenace
Aug 20 2015 11:53
bonfire return largest numbers in arrays
CamperBot
@camperbot
Aug 20 2015 11:53

:fire:Bonfire: Return Largest Numbers in Arrays :link:

function largestOfFour(arr) {
  // You can do this!
  return arr;
}

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

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

more info:  bf details | bf links | hint

Krzysztof Miąsko
@kmiasko
Aug 20 2015 11:54
@JackBid they're working on the bug, it was submitted :)
Jack Biddlecombe
@JackBid
Aug 20 2015 11:54
@kmiasko firefox worked! Thanks!
CamperBot
@camperbot
Aug 20 2015 11:54
jackbid sends brownie points to @kmiasko :sparkles: :thumbsup: :sparkles:
:star: 196 | @kmiasko | http://www.freecodecamp.com/kmiasko
Forresst
@forresst
Aug 20 2015 11:58
how participe to translate in french in translation Trello board ?
Forresst
@forresst
Aug 20 2015 12:02
OK ! "If you're able to help us, you can join our translation Trello board by sending @quincylarson your email address in Gitter." In which room Gitter?
Forresst
@forresst
Aug 20 2015 12:03
Thank !
CamperBot
@camperbot
Aug 20 2015 12:03
if you want to thank someone, put an @ before their name!
Todd Johnson
@TJohnson93
Aug 20 2015 12:10
@camperbot What are Brownie points for?
worth a shot haha
Sean
@seanr707
Aug 20 2015 12:12
@TJohnson93 Just a sign of how active someone is at the camp
Todd Johnson
@TJohnson93
Aug 20 2015 12:12
@seanr707 Yeah I figured that much out… Just curious as to if that was the only reason :P
Christian Petersen
@fnky
Aug 20 2015 12:14
Rather, a sign of how much people thank you
CamperBot
@camperbot
Aug 20 2015 12:14
if you want to thank someone, put an @ before their name!
Christian Petersen
@fnky
Aug 20 2015 12:14
You wish @camperbot
Sean
@seanr707
Aug 20 2015 12:15
@camperbot thank ya bud
CamperBot
@camperbot
Aug 20 2015 12:15
seanr707 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 55 | @camperbot | http://www.freecodecamp.com/camperbot
Sean
@seanr707
Aug 20 2015 12:15
poor camperbot, he gives so much, but receives so little.
Todd Johnson
@TJohnson93
Aug 20 2015 12:16
@camperbot Thank you
CamperBot
@camperbot
Aug 20 2015 12:16
tjohnson93 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 56 | @camperbot | http://www.freecodecamp.com/camperbot
Todd Johnson
@TJohnson93
Aug 20 2015 12:16
@camperbot Thank you
@camperbot Thank you
CamperBot
@camperbot
Aug 20 2015 12:16
tjohnson93 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:warning: tjohnson93 already gave camperbot points
Todd Johnson
@TJohnson93
Aug 20 2015 12:16
@camperbot Thank you
nice recognised spam thank yous
CamperBot
@camperbot
Aug 20 2015 12:16
if you want to thank someone, put an @ before their name!
Christian Petersen
@fnky
Aug 20 2015 12:16
@camperbot get a robot girl
This message was deleted
Name Description
@camperbot Not really worth it, but gets the job done when he needs to.
galacticfan
@galacticfan
Aug 20 2015 12:19
Any javascript gurus here?
Christian Petersen
@fnky
Aug 20 2015 12:20
ask away :-)
galacticfan
@galacticfan
Aug 20 2015 12:21
@fnky Okay, I'm trying to make a XMLHttpRequest but it my alert box never seems to show, any ideas?
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en", false);
xhr.send();
alert(xhr.status);
ConfusedAndLost
@ConfusedAndLost
Aug 20 2015 12:21
Good morning
Christian Petersen
@fnky
Aug 20 2015 12:23
I don't know why it doesn't alert but, because it's asynchronous, you'll need to use onreadystatechange as described https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/onreadystatechange
Oh and probably the reason why it doesn't show the alert, is because of an error is thrown @galacticfan that will stop all code execution.
galacticfan
@galacticfan
Aug 20 2015 12:26
@fnky it's not async as I set that bool to false :)
hmm okay
Christian Petersen
@fnky
Aug 20 2015 12:26
Where do you run it from?
galacticfan
@galacticfan
Aug 20 2015 12:26
codepen.io
Christian Petersen
@fnky
Aug 20 2015 12:28
Read this for CodePen with AJAX https://blog.codepen.io/2013/09/23/ajax-codepen/ @galacticfan
Jeff Huang
@a49678321
Aug 20 2015 12:28
Is anybody can help me about the bonfire : Exact change?
CamperBot
@camperbot
Aug 20 2015 12:28
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:29

Question about CSS. Is there any way to combine these two?

.navbar-default .navbar-nav>li>a {
color: #ffffff;
}

.navbar-default .navbar-nav>li>a:hover {
color: #ffffff;
}

Christian Petersen
@fnky
Aug 20 2015 12:29
that's overly specific selectors you have there
but you can use comma seperated selectors to match multiple
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:29
Well....I wasn't able to override Bootstrap
I got this from looking in dev tools...
I know. It's quite ugly. However, what else can I do?
galacticfan
@galacticfan
Aug 20 2015 12:30
@TheHighPriestess Try using the !important next to your style to check to see if you selected it correctly, i.e. spelt it correctly
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:30
I did..and it didn't work.
galacticfan
@galacticfan
Aug 20 2015 12:31
Then you're selecting it wrong
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:31
When I looked in dev tools...Bootstrap was overidding it
Christian Petersen
@fnky
Aug 20 2015 12:31
You have to declare bootstrap before your own styles.
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:31
well...I'm using Codepen...which I'm not familiar with
because that's what I thought...that my styles would take precedence
but they're not
this is a problem
I initially used this:
ul.nav li a {
color: #ffffff; !important;
}
Christian Petersen
@fnky
Aug 20 2015 12:32
And then select the right element, which is .navbar-nav > ul > li and .navbar-nav > ul > li:hover
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:32
and it didn't work
Christian Petersen
@fnky
Aug 20 2015 12:33
But to make life easier, you can add a nav-bar-item class to your li
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:33
.navbar-nav > ul > li {
color: #ffffff;
}
That doesn't work either
Bootstrap is overidding my styles
Christian Petersen
@fnky
Aug 20 2015 12:34
Link to your pen?
Christian Petersen
@fnky
Aug 20 2015 12:35
@galacticfan Apparently forismatic.com doesn't allow Access-Control-Allow-Origin
galacticfan
@galacticfan
Aug 20 2015 12:37
@fnky Hmm, that must be it, I'm guessing that means I can't use the api then?
Christian Petersen
@fnky
Aug 20 2015 12:39
The selector is .navbar-default .navbar-nav > li > a @TheHighPriestess
Unfortunately no, however if it supports JSONP you have a chance @galacticfan
galacticfan
@galacticfan
Aug 20 2015 12:40
It does!
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:40
@fnky aaaahh....o
got it
Christian Petersen
@fnky
Aug 20 2015 12:40
Awesome, use that :D
galacticfan
@galacticfan
Aug 20 2015 12:40
Thanks @fnky
CamperBot
@camperbot
Aug 20 2015 12:40
galacticfan sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:40
@fnky Thanks
CamperBot
@camperbot
Aug 20 2015 12:40
thehighpriestess sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Christian Petersen
@fnky
Aug 20 2015 12:41
@TheHighPriestess You can inspect elements and see the top most selector being applied and overwrite that specific selector :-)
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:41
anyone able to help me out with this? I got the first part but I dont get the 2nd part. var myArray = ["John", 23, ["cat", 2]]; // Only change code below this line. myArray.pop(); var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
its for the Waypoint: Manipulate Arrays With pop in javascript
galacticfan
@galacticfan
Aug 20 2015 12:42
myArray is what's left
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:42
@fnky Yes, this is how I did it. I took it from dev tools
galacticfan
@galacticfan
Aug 20 2015 12:42
@edianibarrola and pop() removes the last element I believe
Christian Petersen
@fnky
Aug 20 2015 12:43
myArray.pop() // => removes that last element, and returns it
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:43
yea but its not passing
unless im misunderstanding the question
galacticfan
@galacticfan
Aug 20 2015 12:43
@edianibarrola var removed = myArray.pop()
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:43
“ Use the .pop() function to remove the last item from myArray. "
ohhh
galacticfan
@galacticfan
Aug 20 2015 12:44
:)
That way you get the last item
In your code, both arrays equaled ["John", 23]
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:45
I see now. Thanks @galacticfan
CamperBot
@camperbot
Aug 20 2015 12:45
edianibarrola sends brownie points to @galacticfan :sparkles: :thumbsup: :sparkles:
:star: 216 | @galacticfan | http://www.freecodecamp.com/galacticfan
Christian Petersen
@fnky
Aug 20 2015 12:46
@galacticfan if you struggle with it, here's a guide http://cjihrig.com/blog/remote-ajax-calls-using-jsonp/
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:46
the javascript course needs a bit more explanation compared to the jquery and html/css ones
Christian Petersen
@fnky
Aug 20 2015 12:46
I don't even know why you learned jQuery before JS.
It's like learning Boost before learning C++, or Ruby on Rails before Ruby
I think we've had this discussion at FCC before
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:48
I cant answer that for you. I think someone told me it was easier to get a feel for javascript by using jquery since i kinda understood html and css
Christian Petersen
@fnky
Aug 20 2015 12:48
Not at all. jQuery has it's own API, which doesn't learn you anything about JS
Mbos95
@Mbos95
Aug 20 2015 12:48
@fnky thanks
CamperBot
@camperbot
Aug 20 2015 12:48
mbos95 sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Jeff Huang
@a49678321
Aug 20 2015 12:49
Guys , I have some problem with Exact Change
function drawer(price, cash, cid) {
  var ncid = [1, 5, 10, 25, 100, 500, 1000, 2000, 10000];
  var narr= [];
  var ban = Math.round((cash-price)*100);
  var totarr = cid.map(function(x){return Math.round(x[1]*100);});
  var tot = totarr.reduce(function(a, b){return a + b ;});
  if(ban < tot)
    {
      for(var i = ncid.length-1; i>= 0 ;i--)
        {
           var sum = 0;
           while(ban >= ncid[i] && cid[i][1] !== 0)
             {
               ban -= ncid[i];
               totarr[i][0] -= ncid[i];
               sum += ncid[i];
             }
          narr.push([cid[i][0], sum/100]);
        }
    }
  else if(ban > tot) return 'Insufficient Funds';
  else if(ban === tot) return 'Closed';
  return narr.filter(function(x){return x[1] !== 0;}).reverse();
}

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]]);
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:49
yea im starting to see that now that im on the javascript course… it seems i just preloaded my brain with more confusing bits of code.
Jeff Huang
@a49678321
Aug 20 2015 12:49
It's all about decimal point
Christian Petersen
@fnky
Aug 20 2015 12:49
Tell us the problem null@a496783
null@a496783
exactly
Had you learned JS before jQuery, you'd have understood how jQuery worked and how you could use JS at certain points you couldn't use jQuery (or shouldn't)
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:50
@edianibarrola I learned the basics of programming years ago...and it helped a lot. I don't know how I would have managed without it.
Christian Petersen
@fnky
Aug 20 2015 12:51
I started with VB.NET and now I'm working with several languages. I like to understand a language and how it works
e.g. even looking into the V8 source code
Edian Ibarrola
@edianibarrola
Aug 20 2015 12:51
im taking the cs50x course in two weeks so im trying to get a grasp on as much as i can before i start. any recommendations other than html/css/javascript?
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:52
I first learned to program using Pascal
@edianibarrola Codeacademy's Javascript course is good.
Christian Petersen
@fnky
Aug 20 2015 12:52
Literally I made a GUI in VB.NET to track ip
A bit more read, but certainly worth it if you care about bits too eloquent javascript
Pat
@patsine
Aug 20 2015 12:53
Having a problem with Find the Longest Word in a String. Can I paste code here?
sure @patsine
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:53
@edianibarrola It's very basic...but will give you an intro to Javascript
Pat
@patsine
Aug 20 2015 12:53

function findLongestWord(str) {
var lnst = 0;
var test = str.split(' ');
console.log (str, test);

for (i=0; i<= test.length; i++){
if (test[i].length > lnst) {
lnst = test[i].length;
}
console.log (test[i], test[i].length, lnst);
}
return lnst;
}

findLongestWord('The quick brown fox jumped over the lazy dog');

Jeff Huang
@a49678321
Aug 20 2015 12:53
Ok, my code return this:
[['PENNY', 0.04], ['DIME', 0.2], ['QUARTER', 0.5], ['ONE', 1], ['FIVE', 15], ['TEN', 20], ['TWENTY', 60]]
and it should return like this:
[['PENNY', 0.04], ['DIME', 0.2], ['QUARTER', 0.5], ['ONE', 1], ['FIVE', 15], ['TEN', 20.00], ['TWENTY', 60.00]]
Pat
@patsine
Aug 20 2015 12:53
All works fine and the console.log returns exactly what I want, but somewhere it chokes on 'length'
The length seems to be working for awhile so not sure what's up. Seems like it must be syntax
Elizabeth Hatleli
@TheHighPriestess
Aug 20 2015 12:58

@patsine I put your code in dev tools and it highlighted this line:

if (test[i].length > lnst)

Uncaught TypeError: Cannot read property 'length' of undefined

Tim Millar
@tim-millar
Aug 20 2015 12:59

@michaelmenace you are trying to call length on objects that are not arrays, e.g. here:

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

largestOfFour is a function and does not have a length property.

Bianca Mihai
@biancamihai
Aug 20 2015 12:59
@patsine the problem is in your for loop
Pat
@patsine
Aug 20 2015 13:00
So that is the test for the length of the string in array position i. Yet my console.log 2 lines down doesn't choke on that and prints just the right thing
Bianca Mihai
@biancamihai
Aug 20 2015 13:00
ex: [1,2,3] index 0:1, index 1:2, index:2:3
Tim Millar
@tim-millar
Aug 20 2015 13:00
Incidentally, there is a very concise and simple solution to largestOfFour involving map.
Pat
@patsine
Aug 20 2015 13:00
So why is the type wrong in one line but returning the right thing in another????
Bianca Mihai
@biancamihai
Aug 20 2015 13:01
@patsine because the index starts at 0 when you loop yo have to stop at n-1 if the length is n
Pat
@patsine
Aug 20 2015 13:02
@biancamihai duh!!! thanks. that's a dumb error on my part!
CamperBot
@camperbot
Aug 20 2015 13:02
patsine sends brownie points to @biancamihai :sparkles: :thumbsup: :sparkles:
:star: 232 | @biancamihai | http://www.freecodecamp.com/biancamihai
Bianca Mihai
@biancamihai
Aug 20 2015 13:02
:)
Christian Petersen
@fnky
Aug 20 2015 13:03
My head was struggling the for loop
reduce all the way :sparkles:
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 13:03
Is there a reason you can't pass a number as the thisArg with Array.filter()?
grets311
@emh1010
Aug 20 2015 13:05
once you complete a bonfire, can you view a recommended solution? I know there are many ways to solve a problem through coding, but being able to see how a more seasoned programmer would solve the problem would be helpful.
Christian Petersen
@fnky
Aug 20 2015 13:09
@pillphil You can [1, 2, 3, 0].filter(function(x) { return x > this }, 0)
as well as Array.prototype.filter.call([1, 2, 3, 0], function(x) { return x > this }, 0)
Todd Johnson
@TJohnson93
Aug 20 2015 13:12
@emh1010 That would be a nice feature
You could probably find other solutions on Github… I usaully put my solutions on there, I’m sure others would as well
Christian Petersen
@fnky
Aug 20 2015 13:13
Yeah we talked about that earlier, it would be cool if those recommended solutions were user-made and community-voted
grets311
@emh1010
Aug 20 2015 13:14
@TJohnson93 Thanks I will look into trying that.
CamperBot
@camperbot
Aug 20 2015 13:14
emh1010 sends brownie points to @tjohnson93 :sparkles: :thumbsup: :sparkles:
Bianca Mihai
@biancamihai
Aug 20 2015 13:14
still you have to understand how a for, while, do while loop works before you start to use forEach, map, reduce, filter etc ...
CamperBot
@camperbot
Aug 20 2015 13:14
:star: 7 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
Cristián Berríos
@crisberrios
Aug 20 2015 13:16
morning Bianca
Jeff Huang
@a49678321
Aug 20 2015 13:17
I have some problem with Exact Change
function drawer(price, cash, cid) {
  var ncid = [1, 5, 10, 25, 100, 500, 1000, 2000, 10000];
  var narr= [];
  var ban = Math.round((cash-price)*100);
  var totarr = cid.map(function(x){return Math.round(x[1]*100);});
  var tot = totarr.reduce(function(a, b){return a + b ;});
  if(ban < tot)
    {
      for(var i = ncid.length-1; i>= 0 ;i--)
        {
           var sum = 0;
           while(ban >= ncid[i] && cid[i][1] !== 0)
             {
               ban -= ncid[i];
               totarr[i][0] -= ncid[i];
               sum += ncid[i];
             }
          narr.push([cid[i][0], (sum/100).toFixed(2)]);
        }
    }
  else if(ban > tot) return 'Insufficient Funds';
  else if(ban === tot) return 'Closed';
  return narr.filter(function(x){return x[1] !== 0;}).reverse();
}

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]]);
my code return this:
[['PENNY', 0.04], ['DIME', 0.2], ['QUARTER', 0.5], ['ONE', 1], ['FIVE', 15], ['TEN', 20], ['TWENTY', 60]]
and it should return like this:
[['PENNY', 0.04], ['DIME', 0.2], ['QUARTER', 0.5], ['ONE', 1], ['FIVE', 15], ['TEN', 20.00], ['TWENTY', 60.00]]
Bianca Mihai
@biancamihai
Aug 20 2015 13:19
hi @crisberrios how are you?
michaelmenace
@michaelmenace
Aug 20 2015 13:19
@tim-millar thanks for the help, I got it to work. But what is a more concise way to achieve the same thing?
CamperBot
@camperbot
Aug 20 2015 13:19
michaelmenace sends brownie points to @tim-millar :sparkles: :thumbsup: :sparkles:
:star: 110 | @tim-millar | http://www.freecodecamp.com/tim-millar
Jeff McCullough
@jmac412
Aug 20 2015 13:21

Screen Shot 2015-08-20 at 9.21.23 AM.png

I'm getting stuck at this point on this exercise. Any advice would be appreciated. Thanks.

Matthew Barber
@Honno
Aug 20 2015 13:23

How does this work?

  app.controller("GalleryController", function() {
      this.current = 0;
    this.setCurrent = function(newGallery) {
      this.current = newGallery || 0;
    };
  });

setCurrent will make current newGallery, or if no value is passed, current = 0

CamperBot
@camperbot
Aug 20 2015 13:23
:trollface: troll problems? notify admins here
Cristián Berríos
@crisberrios
Aug 20 2015 13:24
@biancamihai fine thanks, leaving for work with lots of rain :S, wish me luck.
CamperBot
@camperbot
Aug 20 2015 13:24
crisberrios sends brownie points to @biancamihai :sparkles: :thumbsup: :sparkles:
Matthew Barber
@Honno
Aug 20 2015 13:24
@jmac412 , you need a value to replace the regex with
CamperBot
@camperbot
Aug 20 2015 13:24
:star: 233 | @biancamihai | http://www.freecodecamp.com/biancamihai
Matthew Barber
@Honno
Aug 20 2015 13:24
@jmac412 also reverse doesn't work on strings, only arrays
iirc
Marcus Eisele
@eiselems
Aug 20 2015 13:24
anyone here knows how bootstrap scrollspies work?
Bianca Mihai
@biancamihai
Aug 20 2015 13:24
:)) good luck @crisberrios !
Marcus Eisele
@eiselems
Aug 20 2015 13:24
want my navmenu to automatically update its state when scrolling to specific parts of my page
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 13:27
Thanks @fnky Turns out I was using it right. I was using !== instead of != for the comparison which is why it wasn't working.
CamperBot
@camperbot
Aug 20 2015 13:27
pillphil sends brownie points to @fnky :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for fnky
Matthew Barber
@Honno
Aug 20 2015 13:29
is 0 false and 1 true when used as a boolean in js?
Bianca Mihai
@biancamihai
Aug 20 2015 13:31
@Honno 1===true will give you false but 1==true will give you true
Sean
@seanr707
Aug 20 2015 13:32
^That
Bianca Mihai
@biancamihai
Aug 20 2015 13:32
0===false will give you false but 0===false will give you true
Sean
@seanr707
Aug 20 2015 13:32
0==false will give you true
Clint
@clint77
Aug 20 2015 13:34
Matthew Barber
@Honno
Aug 20 2015 13:34
ah thanks all
CamperBot
@camperbot
Aug 20 2015 13:34
if you want to thank someone, put an @ before their name!
ErickX93
@ErickX93
Aug 20 2015 13:35
@biancamihai Hi, nice to see a romanian here :smile:
guys, can someone help me implementing an API in my code? I've hit my head against the wall for quite some time now
Marie Pelletier
@Marie000
Aug 20 2015 13:36
I am going through the basic JS again, and cannot figure out why I am not passing the Generate Random Numbers within a Range. Here's my code:
Bianca Mihai
@biancamihai
Aug 20 2015 13:36
there are a few of us here ;) @ErickX93
Marie Pelletier
@Marie000
Aug 20 2015 13:36
var min = 0;
var max = 12;
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return(Math.floor(Math.random()*(9-0+1))+0);
}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return(myFunction());})();
Bianca Mihai
@biancamihai
Aug 20 2015 13:37
what is the problem with the API @ErickX93 ?
ErickX93
@ErickX93
Aug 20 2015 13:38
I don't know how to implement it
I need it for the problem with random quotes
everything else works perfectly, i even introduced an array of quotes
but i want to learn how to introduce an api for that
Christian Petersen
@fnky
Aug 20 2015 13:40
dont fcc give urls to APIs?
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 13:40
@marie000 you should be using the variables instead of hard coding the numbers, and the final zero should be within the bracket to the left of it
actually scratch that buit about the zero
Christian Petersen
@fnky
Aug 20 2015 13:40
most APIs don't support cross origin, and I don't know wether the ziplines tell you how to use JSONP
ErickX93
@ErickX93
Aug 20 2015 13:41
Nothing about JSON yet
in the courses
Christian Petersen
@fnky
Aug 20 2015 13:41
I see everyone talking about quotes apis
ErickX93
@ErickX93
Aug 20 2015 13:41
but it does tell you in the requirements that you can use an API if you want
Christian Petersen
@fnky
Aug 20 2015 13:41
So i'd imagine there's a zipline for it
ErickX93
@ErickX93
Aug 20 2015 13:41
yea, this one
Marie Pelletier
@Marie000
Aug 20 2015 13:41
thanks @pillphil I didn't see the variables up there. I think I'm trying to go too fast.
CamperBot
@camperbot
Aug 20 2015 13:41
marie000 sends brownie points to @pillphil :sparkles: :thumbsup: :sparkles:
CamperBot
@camperbot
Aug 20 2015 13:41
:star: 207 | @pillphil | http://www.freecodecamp.com/pillphil
Marcus Eisele
@eiselems
Aug 20 2015 13:42
anybody here experience with twitter bootstrap's scrollspies? Can't figure it out somehow :/?
Clint
@clint77
Aug 20 2015 13:42
@Marie000 yes. @pillphil is right. replace your 9 and 0 with the variable at the top of the page min and max.
Bianca Mihai
@biancamihai
Aug 20 2015 13:44
@ErickX93 take a look at this call: curl -X POST --data 'method=getQuote&format=json&lang=en' http://api.forismatic.com/api/1.0/
this call on POst will give you a random quote in english in json format
so every time you make the call you should get a new quote
ex: {"quoteText":"The ladder of success is never crowded at the top. ", "quoteAuthor":"Napoleon Hill ", "senderName":"", "senderLink":"", "quoteLink":"http://forismatic.com/en/325178fb83/"}
ErickX93
@ErickX93
Aug 20 2015 13:48
thanks @biancamihai
CamperBot
@camperbot
Aug 20 2015 13:48
if you want to thank someone, put an @ before their name!
ErickX93
@ErickX93
Aug 20 2015 13:48
but where do i put that curl -X POST :confused:
or a better question, where can i learn more about this?
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 13:51
@Marie000 I think the commetn about 1-9 is a bit misleading
Serse
@Sersee
Aug 20 2015 13:57
guys, can somebody explain me the design of http://freecodecamp.com/signin ?
@camperbot
Todd Johnson
@TJohnson93
Aug 20 2015 14:02
@Sersee What do you mean?
Serse
@Sersee
Aug 20 2015 14:03
My navbar and footer are responsive too, but the div looks awful on a big screen
Bianca Mihai
@biancamihai
Aug 20 2015 14:03
@ErickX93 that was a call from the command line, what do you want to use for the ajax calls?
if jquery take a look at http://api.jquery.com/jquery.ajax/
if you use angular take a look at https://docs.angularjs.org/api/ng/service/$http
:)
Serse
@Sersee
Aug 20 2015 14:06
my connection is terrible, Excuse me if the messages are not send in order
ErickX93
@ErickX93
Aug 20 2015 14:06
I want to use it for this website : http://codepen.io/ErickX93/pen/MwMbwq (ignore the cheesy quotes, i showed it to my gf before)
yea, i believe the info on jquery is what i need, right? or js
Bianca Mihai
@biancamihai
Aug 20 2015 14:07
;)
create a function
getQuote
and call this function when you need a new quote
it this function make your ajax call
is this one buggy?
Serse
@Sersee
Aug 20 2015 14:09
@TJohnson93 . I want to test my skills (haven't done any design for a while) and to reproduce a similar design with the one you cand find on ffc
Serse
@Sersee
Aug 20 2015 14:09
Everything works fine, except the div
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 14:10
@sidgupta what's the issue?
Serse
@Sersee
Aug 20 2015 14:10
And I can't figure out how it was done
Giacomo
@Jack1618
Aug 20 2015 14:11
Hi' I'm having issues with palindrome. I don't know ho
Crysicia
@Crysicia
Aug 20 2015 14:11
@Kuroimitsukai What's the issue ?
Todd Johnson
@TJohnson93
Aug 20 2015 14:11
@Sersee Ahh ok which part are you stuck on?
Lucas
@Kuroimitsukai
Aug 20 2015 14:12
@Crysicia I've written pretty much what is shown in the example and I'm only getting an output of "5"
Siddharth Gupta
@sidgupta234
Aug 20 2015 14:12
@phillphil second test case would never get accepted? I dont understand what that is.
Nnxoxo
@Nnxoxo
Aug 20 2015 14:12
@Kuroimitsukai paste ur code here
Lucas
@Kuroimitsukai
Aug 20 2015 14:13
var ourArray = []; for (var i = 0; i < 5; i++) { ourArray.push(i); }
like I said basically what is shown in the example
Giacomo
@Jack1618
Aug 20 2015 14:13
Hi, I'm having issues with palindromes. I don't know how to extract only the letters from a string.
E.g. in the sentence "Hello, how are you?" I would like to return "hellohowareyou". Any suggests? Thank you!
Nnxoxo
@Nnxoxo
Aug 20 2015 14:13
and u have only 5?
Crysicia
@Crysicia
Aug 20 2015 14:13
@Kuroimitsukai The Array contain 0,1,2,3,4 but that return 5 in my case too
Lucas
@Kuroimitsukai
Aug 20 2015 14:13
yes
Crysicia
@Crysicia
Aug 20 2015 14:15
But that's work... I can go to the next challenge... Strange...
Nnxoxo
@Nnxoxo
Aug 20 2015 14:15
@Jack1618 use reg expression to delete all characters like (/,*%^#$^ and etc), after split the string and make some logic and join it
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 14:15
@sidgupta234 Are you using lastNameLength = lastName.length;?
Lucas
@Kuroimitsukai
Aug 20 2015 14:16
@Crysicia ya I only get the output of 5, but I don't get the option for challenge complete
Nnxoxo
@Nnxoxo
Aug 20 2015 14:16
@Kuroimitsukai, tell me exactly ur problem what is strange for u?
Todd Johnson
@TJohnson93
Aug 20 2015 14:16
var ourArray = [];
 for (var i = 0; i < 5; i++) { 
    ourArray.push(i); 
}
should output ourArray[0,1,2,3,4];
Serse
@Sersee
Aug 20 2015 14:16
@TJohnson93 The div is not responsive (I'm using col-xs-12) and I can't make its size to cover only the text I'm displaying
Christian Petersen
@fnky
Aug 20 2015 14:16
which is .length = 5
Todd Johnson
@TJohnson93
Aug 20 2015 14:17
@Sersee Are you building on CodePen? can I see?
Lucas
@Kuroimitsukai
Aug 20 2015 14:17
@Nnutthowze, I'm having an issue with http://freecodecamp.com/challenges/waypoint-iterate-with-javascript-for-loops. Its only instead pushes 1-4 it only does 5. My code is for (var i = 0; i < 5; i++) { ourArray.push(i); }
Christian Petersen
@fnky
Aug 20 2015 14:17
@sidgupta234 ?
Crysicia
@Crysicia
Aug 20 2015 14:18
@TJohnson93 the outpout is... 5
Giacomo
@Jack1618
Aug 20 2015 14:18
@Nnutthowze I've understood that I have to put a regEx as an argument of String.replace(); , but I don't know wich particular regEx.
Serse
@Sersee
Aug 20 2015 14:18
@TJohnson93 , i lost the code last nigth, but in 10 mins I'll finish it again
Nnxoxo
@Nnxoxo
Aug 20 2015 14:18
@Kuroimitsukai use myArray instead of ourArray
@Kuroimitsukai and all will work correctly
Christian Petersen
@fnky
Aug 20 2015 14:18
@Kuroimitsukai remember arrays start at 0, so does your i
Crysicia
@Crysicia
Aug 20 2015 14:18
@Kuroimitsukai It's myArray not ourArray
Lucas
@Kuroimitsukai
Aug 20 2015 14:19
got it :)
Crysicia
@Crysicia
Aug 20 2015 14:19
Nice
Siddharth Gupta
@sidgupta234
Aug 20 2015 14:19

@fnky `var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// don't change code above here

lastNameLength = lastName;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(lastNameLength) !== "undefined"){(function(){return(lastNameLength.length);})();}
`

Lucas
@Kuroimitsukai
Aug 20 2015 14:19
I'm too tired lol
Todd Johnson
@TJohnson93
Aug 20 2015 14:19
@Crysicia Sorry you are correct 12.20am here is QLD, Australia… starting to get a bit sleepy
Siddharth Gupta
@sidgupta234
Aug 20 2015 14:19

```var firstNameLength = 0;
var lastNameLength = 0;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// don't change code above here

lastNameLength = lastName;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(lastNameLength) !== "undefined"){(function(){return(lastNameLength.length);})();}
```

Christian Petersen
@fnky
Aug 20 2015 14:19
@sidgupta234 You have to only place a single property on something
Nnxoxo
@Nnxoxo
Aug 20 2015 14:20
@Jack1618 have u learnt regular expression tutorials?
Christian Petersen
@fnky
Aug 20 2015 14:20
If you read the description, it tells you :-)
Siddharth Gupta
@sidgupta234
Aug 20 2015 14:20
am sorry code wont format.
Todd Johnson
@TJohnson93
Aug 20 2015 14:20
@sidgupta234 What problem are you having?
Nnxoxo
@Nnxoxo
Aug 20 2015 14:20
@sidgupta234 after first ``` type shift+enter and will be fine
PhilipWoulfe
@PhilipWoulfe
Aug 20 2015 14:20
@sidgupta234 you are assigning lastNameLength the value of "Lovelace", not the length
Christian Petersen
@fnky
Aug 20 2015 14:20
I just think he didn't read the description properly through
Nnxoxo
@Nnxoxo
Aug 20 2015 14:21
@TJohnson93
Siddharth Gupta
@sidgupta234
Aug 20 2015 14:21
@fnky @pillphil I'll read the question again (y).
Christian Petersen
@fnky
Aug 20 2015 14:21
:+1:
Todd Johnson
@TJohnson93
Aug 20 2015 14:22
@Nnutthowze thanks
Nnxoxo
@Nnxoxo
Aug 20 2015 14:22
@TJohnson93 thanks
CamperBot
@camperbot
Aug 20 2015 14:22
nnutthowze sends brownie points to @tjohnson93 :sparkles: :thumbsup: :sparkles:
:star: 11 | @tjohnson93 | http://www.freecodecamp.com/tjohnson93
Nnxoxo
@Nnxoxo
Aug 20 2015 14:22
lol
Giacomo
@Jack1618
Aug 20 2015 14:22
@Nnutthowze yes, but maybe I was absent-minded, but I don't remember a regEx that can do that on the tutorial...