These are chat archives for FreeCodeCamp/Help

30th
Aug 2015
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:00
its replacing everything just fine.. but that's the error i get
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:00
@ faustor21 try '&': "&"
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:00
any help?
@pillphil ok, let me try that, i'll be back,, thanks by the way
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:01
@faustor21 and the same for the other symbols
Tim
@timmcallister
Aug 30 2015 00:01
or more specifically, are there any weather sites that offer an API that doesn't require a key?
IllusionElements
@IllusionElements
Aug 30 2015 00:03
for the twitch zipline how do I have it so that the api call loops through everything in the array and runs idividually, or how do I change this to work? http://codepen.io/illusionelements/pen/mebZVR
@timmcallister openweather
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:04
@pillphil , nope.. the same.. this one of the test its running:

assert.match(convert('Dolce & Gabbana'), /Dolce &(amp|AMP|#x00026|#38); Gabbana/, 'should escape characters');
should escape characters: expected 'Dolce & Gabbana' to match /Dolce &(amp|AMP|#x00026|#38); Gabbana/
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:05
can you print the code you tried
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:05
What i don't understand it's why is expecting /Dolce &(amp|AMP|#x00026|#38); Gabbana/ and not ' /Dolce &(amp|AMP|#x00026|#38); Gabbana'
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:06
it's looking for & or & or...
Tim
@timmcallister
Aug 30 2015 00:07
@IllusionElements openweather needs a key
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:08
@pillphil this is the code i tried as you suggested :
function convert(str) {
  var regexp =  /[\&\<\>\'"]/gi;
  var entities = {'&': "&amp|&AMP"};


  return  str.replace(regexp,function(match){
    return entities[match];
  });
}

convert('Dolce & Gabbana');//Dolce & Gabbana
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:08
function convert(str) {
  var regexp =  /[\&\<\>\'"]/gi;
  var entities = {'&': "&amp;", '<': "&(lt|LT|#x0003C|#60);",
                 '>':"&(gt|GT|#x0003E|#62);", "'": "&(apos|#x00027|#39);",
                 '"': "&(quot|QUOT|#x00022|#34);"};

  // &colon;&rpar;
  return  str.replace(regexp,function(match){
    return entities[match];
  });
}
I only did code for the first one
&(amp|AMP|#x00026|#38); means &amp; OR &AMP; OR &#x00026; OR &#38;
so use any one of these values
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:10
@pillphil , It work..
I see.. what a moron i am
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:11
I didn't understand it at first, regex is still pretty new to me
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:11
@pillphil thanks... that's what happend whe you just copy the expecting output to test your stuff
:worried:
CamperBot
@camperbot
Aug 30 2015 00:11
faustor21 sends brownie points to @pillphil :sparkles: :thumbsup: :sparkles:
:star: 234 | @pillphil | http://www.freecodecamp.com/pillphil
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:12
@pillphil .. thank you :+1:
CamperBot
@camperbot
Aug 30 2015 00:12
faustor21 sends brownie points to @pillphil :sparkles: :thumbsup: :sparkles:
:warning: faustor21 already gave pillphil points
PhilipWoulfe
@PhilipWoulfe
Aug 30 2015 00:12
That was my first attempt too. :)
Fausto Ramírez L.
@faustor21
Aug 30 2015 00:13
lol :smile:
IllusionElements
@IllusionElements
Aug 30 2015 00:51
Anyone know how to loop through an array to pass onto a json url?
Tim P
@xTimpi
Aug 30 2015 00:59
Hi guys, I’m working on the Stylize fcc news zipline and I’m almost done, but I can’t get it to look like the given pen, I always get weird height-blankspaces and I just don’t know how to google a fix for this with bootstrap, can someone please take a brief look at my pen and guide me in the right direction?
Rex Schrader
@SaintPeter
Aug 30 2015 01:01
@IllusionElements Well, you need to launch each request seperately. I suggest wrapping a function around the AJAX call. Here is a super simplified overview:
var myData = [ 1, 2, 3, 4, 5 ];

function grabAjax(item) {
     var url = "http://www.example.com/path/to/api/query?lookup" + item + "&callback=?";
     $.getJSON(url, successFunction);
}

// Don't forget, this will be called asynchrnously and in no particular order.
function successFunction(data) {
    /* Do something with JSON data */
}

// Actually initiate function:
myData.forEach(grabAjax);
@xTimpi I think it has to do with the fact that you're sorted by rows. Everything floats left and when it can't fit into the space left by a tall item, there is a space under that item. One thing might be to give a max height to your images. Use them as a background and use background-size: cover - that means they'll always fill up the space you asign them to.
Rex Schrader
@SaintPeter
Aug 30 2015 01:07
@xTimpi According to this Stack Overflow, you can't get what you want with Bootstrap "out of the box". They suggest Masonry
Tim P
@xTimpi
Aug 30 2015 01:08
@SaintPeter the images have a max-height, they are always as wide as the panel they are on and the width scales accordingly
DTing
@dting
Aug 30 2015 01:08
@SaintPeter i dont think you should be passing "JSONP" as your 3rd argument to the $.getJSON function @SaintPeter
Rex Schrader
@SaintPeter
Aug 30 2015 01:08
@xTimpi Then what makes some stories taller than others?
@dting Why not?
Tim P
@xTimpi
Aug 30 2015 01:08
@SaintPeter yeah that looks exactly like what I need, thank you! May I ask what you googled? I was totally stumped when I tried to reasearch
CamperBot
@camperbot
Aug 30 2015 01:08
xtimpi sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 419 | @saintpeter | http://www.freecodecamp.com/saintpeter
DTing
@dting
Aug 30 2015 01:08
cuz it doesnt take a datatype argument like the $.get
Rex Schrader
@SaintPeter
Aug 30 2015 01:10
@xTimpi google "bootstrap different height data, no spaces", which seems rambling, but I'm aiming for finding someone else's question. I think the stack overflow was the 3rd result.
@dting Well, huh. There ya go. I've been giving folks bad information :D
DTing
@dting
Aug 30 2015 01:10

$.getJSON knows it's jsonp:

JSONP
If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead. See the discussion of the jsonp data type in $.ajax() for more details.

ya the third argument is a success callback
actually im not exactly sure how that works
maybe it knows that your function isnt a data argument because it's a function and then the 3rd argument is ignored not sure
Moisés Man
@moigithub
Aug 30 2015 01:12
$.getJSON(url [,data] [, successCallback])
Rex Schrader
@SaintPeter
Aug 30 2015 01:12
Magic :D
Data is defintely an optional value - most folks use it with url and success
DTing
@dting
Aug 30 2015 01:12
ya im wondering why
$.getJSON(url, successFunction, 'JSONP'); works
maybe it uses type checking or something and just ignores that 'JSONP'
Rex Schrader
@SaintPeter
Aug 30 2015 01:13
@dting I imagine that it checks to see if the 3rd argument is a function . . . or if the second is it ignores the 3rd?
Anyway, I edited my response and I'll stop giving out bad information
DTing
@dting
Aug 30 2015 01:14
ive seen it from a couple different people
haha so you aren't the only one
Rex Schrader
@SaintPeter
Aug 30 2015 01:14
I am almost certainly to blame
I probably told someone and they've passed it on
DTing
@dting
Aug 30 2015 01:15
yay i made my simon game play itself http://codepen.io/dting/full/yYBZrE/
Rex Schrader
@SaintPeter
Aug 30 2015 01:17
LOL
Simple Simon
Moisés Man
@moigithub
Aug 30 2015 01:19
delay and queue are jquery functions ??
DTing
@dting
Aug 30 2015 01:22
ya
Rex Schrader
@SaintPeter
Aug 30 2015 01:22
Are you using the animation queue?
DTing
@dting
Aug 30 2015 01:22
ya lol
Moisés Man
@moigithub
Aug 30 2015 01:22
i put setTimeout everywhere.. was confusing :)
This message was deleted
Hans van Riet
@hansinla
Aug 30 2015 01:35
@dting sorry, doesn’t do anything. Safari on OS X
Jake Bryant
@jbryant8706
Aug 30 2015 01:46

Why didn't it response to jQuery?

$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "green");
$(".target:nth-child(2)").addClass("animated bounce");

});
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("color", "green");
$(".target:nth-child(2)").addClass("animated bounce")});
Andrea Goulet
@andreagoulet
Aug 30 2015 01:47
Anyone else getting a server error from MDN?
jtingley
@jtingley
Aug 30 2015 01:51
@andreagoulet yes
Andrea Goulet
@andreagoulet
Aug 30 2015 01:57
@jtingley well, at least I know it’s not just me. these bonfires just got a lot harder. ;)
DTing
@dting
Aug 30 2015 01:57
This message was deleted
hmm
Andrea Goulet
@andreagoulet
Aug 30 2015 02:00
w00t! just came back up!
DTing
@dting
Aug 30 2015 02:01
@hansinla hmm i guess oscillator.start() requires an argument for safari
@hansinla thanks
CamperBot
@camperbot
Aug 30 2015 02:01
dting sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 326 | @hansinla | http://www.freecodecamp.com/hansinla
IllusionElements
@IllusionElements
Aug 30 2015 02:42
@SaintPeter i followed what you said, and for some reason it prints out the first item into an array that's the length of the first one
Rex Schrader
@SaintPeter
Aug 30 2015 02:44
@IllusionElements Remember that this is async operation. Don't do something just after you call myData.forEach(grabAjax); and expect to have values. This line will execute very quickly. It doesn't wait for the Ajax functions to return - they will be coming back in the next seconds and calling their success functions. Any operations you need to do on the data you're getting back will need to be done inside the success functions.
IllusionElements
@IllusionElements
Aug 30 2015 02:45
@SaintPeter
var offline = [];
var online = [];
var stat = [];
var user = ["freecodecamp", "storbeck", "terakilobyte", "habathcx", "RobotCaleb", "thomasballinger", "noobs2ninjas", "beohoff", "troydangaming", "brunofin", "twitch", "streamerhouse","medrybw","insomniacgamers12345"];
var users = user.join(',')
var id = "qfujbqegh33c7oxpx6eawsy947rixk1";
var userOnline = online.join(',');
var userOffline = offline.join(',');
var url = 'https://api.twitch.tv/kraken/streams?channel=' + user + '&limit=20&callback=?'
var str = "";

function getTwitch(user) {
   $.ajax({
    url: url,
    jsonp: 'jsonp',
    dataType: 'jsonp',
    success: twitchSucc,
    error: twitchErr,
   });
}

function twitchSucc(twitch){
  var streamsObj = twitch.streams[0];
  var chanLinks = streamsObj.channel._links;
  var userList = streamsObj.channel.status;

  if(streamsObj.channel.status===null){
    offline.push(streamsObj.channel.display_name);
    console.log(offline);
  } else if(streamsObj.channel.status !== null){
    online.push(streamsObj.channel.display_name);
    console.log(online);
  }
}

function twitchErr(err){
  console.log("ERROR!")
};

 user.forEach(getTwitch);

$(document).ready(function(){

  $('#resp').html(offline.join(','));
});
Nothings being declared after it
This outputs : "troydangaming" 14 times
Rex Schrader
@SaintPeter
Aug 30 2015 02:48
@IllusionElements Right - see how you're pushing your data in your success functions? Those success functions may take seconds or even minutes to be called. Your code below, where you're trying to populate your #resp with data from offline? offline won't have data until one or more success functions have been called - and you won't know when that'll be. Instead to storing your data, instead just push it to the page. Put your page maniupulation code in the success function (or a function called from there).
IllusionElements
@IllusionElements
Aug 30 2015 02:52
@SaintPeter but all it's doing is pushing troydan gaming to the page, none of the others
Rex Schrader
@SaintPeter
Aug 30 2015 02:53
@IllusionElements Move this code: $('#resp').html(offline.join(',')) into the success functions and make it .append instread - just use it to output the display name
IllusionElements
@IllusionElements
Aug 30 2015 02:58
@SaintPeter makes no difference http://codepen.io/illusionelements/pen/mebZVR
Rex Schrader
@SaintPeter
Aug 30 2015 02:59
@IllusionElements Move this var url = 'https://api.twitch.tv/kraken/streams?channel=' + user + '&limit=20&callback=?' inside getTwitch
@IllusionElements You're not ever creating a new URL, jsut calling the same one over and over again
paulage
@paulage
Aug 30 2015 03:07
Anyone else stuck on the Bonfire Falsey Bouncer? I can pass the first two steps but not the thrid
Rex Schrader
@SaintPeter
Aug 30 2015 03:09
@paulage The trick to Falsey Bouncer is that there is no trick. You can directly evaluate each element in the array with an if statement or via filter. You can basically just do:
if(element) {
  // Save that element
} else {
  // Don't save it
}
Luis Felipe López G.
@luishendrix92
Aug 30 2015 03:09
wiki js falsey
CamperBot
@camperbot
Aug 30 2015 03:09
no wiki entry for: js falsey
:pencil: click here to create one now!after creating your page type update to reload it here
Luis Felipe López G.
@luishendrix92
Aug 30 2015 03:09
wiki falsey
CamperBot
@camperbot
Aug 30 2015 03:09

:point_right: falsey [wiki]

Something which evaluates to FALSE. There are only five falsey values in JavaScript:
undefined, null, NaN, 0, "" (empty string), and false of course.

:pencil: read more about falsey on the FCC Wiki

paulage
@paulage
Aug 30 2015 03:10
first time chatting here - how do I paste code?
Rex Schrader
@SaintPeter
Aug 30 2015 03:10
@luishendrix92 @paulage It's all fine and dandy to know which values are considered false, but it's ultimately irrelevent to you - you don't have to directly test them (with === or anything), just test the element and javascript figures it out for you.
wiki format
CamperBot
@camperbot
Aug 30 2015 03:11

: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

paulage
@paulage
Aug 30 2015 03:12

'''
function bouncer(arr) {
// Don't show a false ID to this bouncer.

var newArray = [];

var x = new Boolean(false);
for(var i = 0; i < arr.length; i++){

if (arr[i] != false){
  newArray.push(arr[i]);
}

}

return newArray;
}
'''

CamperBot
@camperbot
Aug 30 2015 03:12
:bulb: to format code use backticks! ``` more info
paulage
@paulage
Aug 30 2015 03:12
doh!
Luis Felipe López G.
@luishendrix92
Aug 30 2015 03:12
I thought the falsey wiki article had more than that, I'll have to modify it a bit.
Rex Schrader
@SaintPeter
Aug 30 2015 03:12
@paulage try
if (arr[i]){
paulage
@paulage
Aug 30 2015 03:13
My last test returns null because the array is empty, it looks like the test wants an empty array instead of null.
Rex Schrader
@SaintPeter
Aug 30 2015 03:17
@paulage Did you try if(arr[i])? I just tested it and it passes all tests.
paulage
@paulage
Aug 30 2015 03:17
Thanks @SaintPeter , that did the trick.
CamperBot
@camperbot
Aug 30 2015 03:17
paulage sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 421 | @saintpeter | http://www.freecodecamp.com/saintpeter
Luis Felipe López G.
@luishendrix92
Aug 30 2015 03:17
I don't see why it returns null since you are returning newArray as an empty array and that's correct
Rex Schrader
@SaintPeter
Aug 30 2015 03:17
@paulage It might have worked with !== false, but I'm not certain
IllusionElements
@IllusionElements
Aug 30 2015 03:18
Why does this https://api.twitch.tv/kraken/streams/' + user+"&callback=foo keep returning error 404
Rex Schrader
@SaintPeter
Aug 30 2015 03:18
Nope, no joy.
@IllusionElements Try manually entering the URL into the browser. Is it 'streams' or 'stream'?
paulage
@paulage
Aug 30 2015 03:18
If I use if (arr[i] != false) then it returns null, not an empty string. Not sure why that is but it fails the 3rd test.
using if (arr[i]){ works in it's place though.
Rex Schrader
@SaintPeter
Aug 30 2015 03:19
@paulage As far as I know, the only way to pass is to use the element like I demo above. IT's a stinky sneaky bonfire.
IllusionElements
@IllusionElements
Aug 30 2015 03:19
@SaintPeter its streams but it keeps returning {"error":"Not Found","status":404,"message":"Channel 'freecodecamp&callback=foo' does not exist"}
Matt Everson
@matteverson
Aug 30 2015 03:20
@IllusionElements params are separated by a ?
from the url
https://api.twitch.tv/kraken/streams/' + user+"?callback=foo
paulage
@paulage
Aug 30 2015 03:20
Looks like it! Thanks @SaintPeter, I'm glad I'm not totally insane. It was a pretty sneaky bonfire.
CamperBot
@camperbot
Aug 30 2015 03:20
paulage sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: paulage already gave saintpeter points
Rex Schrader
@SaintPeter
Aug 30 2015 03:21
@paulage Don't count on me for your sanity checks ;)
IllusionElements
@IllusionElements
Aug 30 2015 03:28
@matteverson that's wierd when I did it earlier & worked fine
Donavin Northrup
@dnorthrupva
Aug 30 2015 03:37

Anyone have any input on my ‘Resume’ button not working? http://codepen.io/dnorthrupva/pen/YyKEEV
(Currently the timer will go into negative when loading, this is a temp bug I caused trying to switch functions. Click “Start” then click “Pause”. You’ll see the interval get cleared, but when ‘Resume’ is pressed, the function doesn’t resume the timer. (And hitting Pause again seems to do nothing).

Any fresh-eye-input?

RoyEun
@RoyEun
Aug 30 2015 03:37

Can anyone explain why my code is only returning "h"?

function reverseString(str) {
var splitString = [];
for (var i = 0; i <= str.length; i ++) {
return str.charAt(i);
splitString.push(str.charAt(i));
}

reverseString('hello');

*one more bracket at the bottom

function reverseString(str) {
var splitString = [];
for (var i = 0; i <= str.length; i ++) {
return str.charAt(i);
splitString.push(str.charAt(i));
}
}

reverseString('hello');

DTing
@dting
Aug 30 2015 03:39
@RoyEun because you return in the first for loop
RoyEun
@RoyEun
Aug 30 2015 03:39
should i just push delete that line then?
should i just delete that line*
DTing
@dting
Aug 30 2015 03:39
when it reaches the return str.charAt(i) the function exits and returns that value
RoyEun
@RoyEun
Aug 30 2015 03:39
and then return splitString at the end?
so anytime I return it exits the function right?
DTing
@dting
Aug 30 2015 03:40
that would work to make an array of characters from the string ya
RoyEun
@RoyEun
Aug 30 2015 03:42
I had actually been looking at that right before I asked this :smile: Thanks a lot though! It looks like I got an array returned, but its still only the first letter of the original string
CamperBot
@camperbot
Aug 30 2015 03:42
if you want to thank someone, put an @ before their name!
RoyEun
@RoyEun
Aug 30 2015 03:42
thanks @dting for the info btw*
CamperBot
@camperbot
Aug 30 2015 03:42
royeun sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 813 | @dting | http://www.freecodecamp.com/dting
RoyEun
@RoyEun
Aug 30 2015 03:44
is it maybe something to do with the fact that I am declaring the variable before the loop?
DTing
@dting
Aug 30 2015 03:45
if you use split you wouldnt use a loop
var a = "hello";
var reversedA = a.split('');
note that strings are immutable so using str.split('') doesn't mutate a. It just returns an array of the split strings.
@dnorthrupva
  var timer = setInterval(function() {
    workTime--;
    showTime(workTime);
    if (workTime <= 0) {
      clearInterval($active);
    }
  }, 1000);
this starts the timer right away
RoyEun
@RoyEun
Aug 30 2015 03:48
lol i made that so much more complicated than it needed to be
@dting thanks again
CamperBot
@camperbot
Aug 30 2015 03:48
royeun sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: royeun already gave dting points
DTing
@dting
Aug 30 2015 03:49
@dnorthrupva also seems like $active is undefined
Donavin Northrup
@dnorthrupva
Aug 30 2015 03:51
@dting Sorry, thanks for the input. The auto starting isn’t my issue, it’s a temp bug while I mess with variables. (The $active is from the original variable name.)
My issue is I can’t figure out how to get my ‘resume’ button to work. I’m making progress because it now changes the HTML of the button back, but the function itself doesn’t happen.
CamperBot
@camperbot
Aug 30 2015 03:51
dnorthrupva sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 814 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 03:53
@dnorthrupva your resume code should basically be this
  var timer = setInterval(function() {
    workTime--;
    showTime(workTime);
    if (workTime <= 0) {
      clearInterval(timer);
    }
  }, 1000);
well not exactly but something like that
setInterval returns an object that lets you cancel the interval.
Donavin Northrup
@dnorthrupva
Aug 30 2015 03:54
@dting Okay, I was getting close to thinking that, it just didn’t seem very DRY to me, since all of that is already defined in the original ‘start’.
DTing
@dting
Aug 30 2015 03:54
the interval starts immediately
create a function that abstracts that code and call it from both functions
Luis Felipe López G.
@luishendrix92
Aug 30 2015 03:59
Guys, I'm reverse-engineering the twitch zipline and I don't understand the use of this:
var cb = '?client_id=5j0r5b7qb7kro03fvka3o8kbq262wwm&callback=?'; what's that callback, why is there such a long client id and what does it mean?
DTing
@dting
Aug 30 2015 04:00
var timer;

function startTimer() {
  return setInterval(function() {
    workTime--;
    showTime(workTime);
    if (workTime == 0) {
      clearInterval(timer);
    }
  }, 1000);
}

function start() {
  // do stuff
  timer = startTimer();
}

function pause() {
  // do stuff
  clearInterval(timer);
}

function resume() {
  // do stuff
  timer = startTimer();
}
Haremantra
@haremantra
Aug 30 2015 04:02
Hi, the lesson asks for the <a> element to be nested within the <p> element, i can't find my error, as the program states the <a> element is not nested within this new <p> element, here is the code:
Rex Schrader
@SaintPeter
Aug 30 2015 04:02
@luishendrix92 A callback is used for JSONP. Normally, JSON data would just be a raw object passed back. Instead, the data is placed as an argument to a callback with a name passed in the url
@luishendrix92 Which is really confusing, right?
Haremantra
@haremantra
Aug 30 2015 04:02
<p>click here for
<a href="http://freecatphoto.com">cat photos</a>
</p>
Mike Moss
@MMux
Aug 30 2015 04:02
@luishendrix92 Do you have your code posted somewhere? I'm working on that zipline too. I'm not sure about the client id, but that callback is there because you're asking for a request format of JSONP.
http://codepen.io/MMux/pen/jbNRbg?editors=001
This is where i'm at: I'm struggling with getting stream info
Luis Felipe López G.
@luishendrix92
Aug 30 2015 04:03
It is, when users post their zipline here I raaarely see such client id thingy
Oh no, I am starting the ziplines so I'm reverse engineering all of them in order to be prepared and start coding right away
Donavin Northrup
@dnorthrupva
Aug 30 2015 04:03
@dting Oh wow NOW I understand what you’re saying. I was overly complicating it. I was wondering if a function inside of a function was going to be problematic.
Rex Schrader
@SaintPeter
Aug 30 2015 04:03
@luishendrix92 Yeah, usually you just append something like ?callback=? and the ID is placed there by $.get or $.getJSON.
Haremantra
@haremantra
Aug 30 2015 04:04
<p>click here for
<a href="http://freecatphoto.com">cat photos</a>
</p>
The a element is identified as not nested within the p element, where could the problem be?
Justin Crawford
@JCrawford1122
Aug 30 2015 04:05
@haremantra You should put ``` on the lines before and after your code
Rex Schrader
@SaintPeter
Aug 30 2015 04:05
wiki format
CamperBot
@camperbot
Aug 30 2015 04:05

: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

Justin Crawford
@JCrawford1122
Aug 30 2015 04:06
@haremantra what Waypoint was that anyway?
Haremantra
@haremantra
Aug 30 2015 04:08
@JCrawford1122 Thank you, are those double quotes before the <p> and after the </p>
CamperBot
@camperbot
Aug 30 2015 04:08
haremantra sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 162 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
Haremantra
@haremantra
Aug 30 2015 04:08
Waypoint: Nest an Anchor Element within a Paragraph
Justin Crawford
@JCrawford1122
Aug 30 2015 04:10
@haremantra can you paste in the entire code instead of the one line?
Haremantra
@haremantra
Aug 30 2015 04:12

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

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

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<a href="http://www.freecatphotoapp.com">cat photos</a>

<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

<p>click here for
<a href=http://freecatphoto.com>cat photos</a>
</p>

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

Justin Crawford
@JCrawford1122
Aug 30 2015 04:13
@haremantra try wrapping the a element right below h2 in a <p>
Donavin Northrup
@dnorthrupva
Aug 30 2015 04:15
@dting Yea, works perfectly once I modifed it a bit. Now to fix the resume button not triggering pause again. Thanks for the help!
CamperBot
@camperbot
Aug 30 2015 04:15
dnorthrupva sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: dnorthrupva already gave dting points
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:15
You forgot double quotes:
<p>click here for
<a href="http://freecatphoto.com">cat photos</a>
</p>
Lux3
@Lux3
Aug 30 2015 04:20
@SojournerOctocat can you tell me why my navbar on top the button wont work when it is small?
I have the same code as the example that works.
as far as I can tell
the upper right button does nothing
or anyone else for that matter
Haremantra
@haremantra
Aug 30 2015 04:22
@SojournerOctocat Thanks, I tried that and it still says the a element is not nested
CamperBot
@camperbot
Aug 30 2015 04:22
haremantra sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sojourneroctocat
Haremantra
@haremantra
Aug 30 2015 04:22
You need an a element that links to "freecatphotoapp.com".
Your a element should have the anchor text of "cat photos"
Create a new p element around your a element.
Your a element should be nested within your new p element.
Your p element should have the text "click here for".
Make sure each of your p elements has a closing tag.
Make sure each of your a elements has a closing tag.
Your a element should be nested within your new p element.===>this is the one that will not get checked, is this a bug possibly
Justin Crawford
@JCrawford1122
Aug 30 2015 04:22
@haremantra there is another a element up higher in the code that you need to wrap
Haremantra
@haremantra
Aug 30 2015 04:26
@JCrawford1122 Worked! I thought they wanted me to retype the entire thing and not wrap the existing a element
@JCrawford1122 Thanks
CamperBot
@camperbot
Aug 30 2015 04:26
haremantra sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:warning: haremantra already gave jcrawford1122 points
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:41
@Lux3 Not sure why.
Lux3
@Lux3
Aug 30 2015 04:41
@SojournerOctocat I have been trying for 3 days to fix it lol
I have another person's codepen and am comparing our code and it looks the same.
At one point it did work correctly then I changed something and hasn't worked since XD
Than kyou for looking at it.
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:45
@Lux3 I notice that the button has a data-target="#myNavbar". Is there supposed to be anything in the JS code for that?
Lux3
@Lux3
Aug 30 2015 04:45
The example I got it from was nothing but HTML
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:45
Because I didn't see anything in your JS code related to that.
it is the example at the bottom of the page.
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:56
@Lux3 Huh. It looks like the example at the bottom of the page simply collapses the menu when the page is smaller. When I make the page smaller, it does not show a button!
Lux3
@Lux3
Aug 30 2015 04:56
That is odd I see a button and can click it.
I may just need to copy paste it and start over with my navbar
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:57
@Lux3 Weird.
Lux3
@Lux3
Aug 30 2015 04:57
@SojournerOctocat agreed lol. Oh well.
Thanks again for helping me out. @SojournerOctocat
CamperBot
@camperbot
Aug 30 2015 04:58
lux3 sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sojourneroctocat
SojournerOctocat
@SojournerOctocat
Aug 30 2015 04:58
@Lux3 I did it again, and this time, it did give me a button. And your code seems to match the example code.
Lux3
@Lux3
Aug 30 2015 04:59
That is why it is so frustrating XD
Tim Bell
@MindfulBell
Aug 30 2015 04:59
Is there a reason why codepen doesn't run a simple alert("Hello World");
Lux3
@Lux3
Aug 30 2015 05:00
@MindfulBell you probably still need to add <head> etc
Tim Bell
@MindfulBell
Aug 30 2015 05:00
no thats not it, it worked on a brand new pen
Lux3
@Lux3
Aug 30 2015 05:00
oh
Tim Bell
@MindfulBell
Aug 30 2015 05:01
Something in my code just kinda stops everything? I dunno
SojournerOctocat
@SojournerOctocat
Aug 30 2015 05:02
@Lux3 I don't know if this matters. In the example code there is: <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> and in your code that link goes to font awesome. Would you need another link to the regular bootstrap?
Lux3
@Lux3
Aug 30 2015 05:07
I figured the code I had for the current bootstrap had the same abilities
hmm I will check but I never removed that
so guess what
you fixed it! :smiley: :thumbsup:
SojournerOctocat
@SojournerOctocat
Aug 30 2015 05:09
Nice!
Lux3
@Lux3
Aug 30 2015 05:10
Why can't I give you brownie points?
@SojournerOctocat thanks
CamperBot
@camperbot
Aug 30 2015 05:10
lux3 sends brownie points to @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sojourneroctocat
Kevin-Cope
@Kevin-Cope
Aug 30 2015 05:13

I am stuck on this: Store the three random numbers in slotOne, slotTwo and slotThree.

Generate the random numbers by using the system we used earlier:

Math.floor(Math.random() * (3 - 1 + 1)) + 1;

Ashraful Islam
@iashraful
Aug 30 2015 05:15
hello!
:)
@Kevin-Cope please show me where you got stuck
Ashraful Islam
@iashraful
Aug 30 2015 05:18
@Kevin-Cope I meant what seems to be the problem
Luis Felipe López G.
@luishendrix92
Aug 30 2015 05:20
each of the slot variables should have a random integer from 1 to 3
Richard-Frost
@Richard-Frost
Aug 30 2015 05:23
Can someone tell me how to apply 2 classes to 1 html element? This is what I'm stuck on. http://freecodecamp.com/challenges/waypoint-add-borders-around-your-elements
Kevin-Cope
@Kevin-Cope
Aug 30 2015 05:23
I can't figure out how to store the random numbers in their slots. I have this part down: Math.floor(Math.random() * (3 - 1 + 1)) + 1;. Now, how will I generate the random integer for each slot?
Matt Everson
@matteverson
Aug 30 2015 05:24
@Richard-Frost class="class1 class2" separate by spaces
Luis Felipe López G.
@luishendrix92
Aug 30 2015 05:26
@Kevin-Cope Assigning that to each variable:
// Declaration:
var mySuperVariable;

// Assignation:
mySuperVariable = "This is its value";

// Declaration AND Assignation:
var iLoveCats = true;

// Re-assignation:
mySuperVariable = "This is a new value that replaces the old one";
iLoveCats = false;
IllusionElements
@IllusionElements
Aug 30 2015 05:28
inside an api call, can you move freely between links without, having to recall that part of the api or is that the only way to "move" within an api?
Richard-Frost
@Richard-Frost
Aug 30 2015 05:28
thank you @matteverson
CamperBot
@camperbot
Aug 30 2015 05:28
richard-frost sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 348 | @matteverson | http://www.freecodecamp.com/matteverson
Will Seymour
@wseymour
Aug 30 2015 05:29
If I may ask, on the first zipline, are they looking for a copy of the web page, or am I making a kind of self-introduction page based on the example?
Ashraful Islam
@iashraful
Aug 30 2015 05:29
@Kevin-Cope here is how I'd store the first and second value to slotOne
var slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
var slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
IllusionElements
@IllusionElements
Aug 30 2015 05:30
@wseymour make your own
Will Seymour
@wseymour
Aug 30 2015 05:30
@IllusionElements Thanks
CamperBot
@camperbot
Aug 30 2015 05:30
wseymour sends brownie points to @illusionelements :sparkles: :thumbsup: :sparkles:
:star: 242 | @illusionelements | http://www.freecodecamp.com/illusionelements
Kevin-Cope
@Kevin-Cope
Aug 30 2015 05:30
@iashraful Thanks
Matt Everson
@matteverson
Aug 30 2015 05:30
@IllusionElements Could you expand on your question?
IllusionElements
@IllusionElements
Aug 30 2015 05:31
This message was deleted

sure: for example this random api

{
name:{....
}
date: ....
"users": http://api.random.org;

after my first $.ajax call that returns this api, can I aquire data from users without having to re-declare another api call

Ashraful Islam
@iashraful
Aug 30 2015 05:35
@IllusionElements do you mean to say that you need to take input from user instead of calling the api again?
IllusionElements
@IllusionElements
Aug 30 2015 05:35
@iashraful yeah instead of redeclaring another function
Matt Everson
@matteverson
Aug 30 2015 05:36
You can, for the same reason this works:
var x = 1;
function test(y) {
 console.log(x);
}
users is still in scope
Ashraful Islam
@iashraful
Aug 30 2015 05:36
@IllusionElements err... what is this redeclaring another function
@IllusionElements do you mean something like this?
var myUser = '';
function callAPI(....) {
/* ... some api ninja stuff ....*/
myUser = data.users[0];
} // end apiCall(...)
.... some more code ....
console.log(myUser);
once you store something on a global scope variable you can access it anywhere
IllusionElements
@IllusionElements
Aug 30 2015 05:45
@iashraful yeah I know that, what i'm saying is assume this is an api, instead of having to call this other link for data in a new function is there another faster way to do so?
/*/*foo{
/*...random API Stuff*/
/*...more Api stuff..*/
"users": api.link.com/users/name // leads to another part of the api
/*end API*/

/*start user API endpoint*/
/*...stuff..*/
/*...end...*/
var myUser = '';
function callAPI(....) {
/* ... some api ninja stuff ....*/
myUser = data.users[0];
function CallAPI2(...){
/*..more api stuff..*/
url: api.link.com/users/name
//end
console.log(myUser);
} // end apiCall(...)
.... some more code ....
Matt Everson
@matteverson
Aug 30 2015 05:45
ooh, you're talking about references within the json returned from an api
IllusionElements
@IllusionElements
Aug 30 2015 05:46
yeah, thats what I mean, right now I find myself doing $.ajax whenever I need another reference in the api, is there a faster way to do so
Ashraful Islam
@iashraful
Aug 30 2015 05:46
@IllusionElements wow! that is one twisted api
@IllusionElements looks like Facebook graph api
Matt Everson
@matteverson
Aug 30 2015 05:47
Generally no, turning those into data (sometimes called populating or hydrating them) requires a separate api call. Sometimes there's a /query endpoint to an API that has additional options that allow the server to do this and then it batches up all the data. Salesforce has this. Azure does not :(
Look for batch or query facilities in the API docs.
It's not standard for REST APIs though.
IllusionElements
@IllusionElements
Aug 30 2015 05:48
so to access the channel link here I'd need another api call then?
{
"_links":
{
"self":"https://api.twitch.tv/kraken/streams/hebo",
"channel":"https://api.twitch.tv/kraken/channels/hebo"
},
"stream":null
}
Matt Everson
@matteverson
Aug 30 2015 05:48
Yes
IllusionElements
@IllusionElements
Aug 30 2015 05:50
Ok I was just wondering because it said Every JSON response includes a _links object which allows you to navigate the API without having to hardcode any of our URLs, so I assumed that there was a quicker way to navigate the api than making another api call
in the twitch docs
Matt Everson
@matteverson
Aug 30 2015 05:51
Well, we don't have to hardcode it, we just take the url they provide in the object we got from the first call and call it ourselves.
As opposed to Azure, where I can get a list of resource groups, but then have to hardcode the url for compute resources, for storage resources, etc. No links.
IllusionElements
@IllusionElements
Aug 30 2015 05:54
ah ok, was hoping for a easy solution like a get command or something but I guess i'll just have to make a new api call
elayaoen
@elayaoen
Aug 30 2015 05:56
can you break down the meaning of this? $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
Cristián Berríos
@crisberrios
Aug 30 2015 05:57
sure
IllusionElements
@IllusionElements
Aug 30 2015 05:57
@elayaoen
$( // jquery selector
$('.slot') //targets the slot class in the html
[0] // first occurance of the slot class
).html('<img src = "' + images[slotOne-1] + '">' // add this html where the variables asked
);
Cristián Berríos
@crisberrios
Aug 30 2015 05:57
first $('.slot') selects all the nodes with the class slot
then [0] selects the 1st one
then the $( ) around wraps the node and selects it as a jquery selector instead of an html node
then the .html method replaces the child html of the node
IllusionElements
@IllusionElements
Aug 30 2015 06:00
@elayaoen basically: You are targeting the selector that targets , the first node of the slot class, replacing the html with the one you passed onto it.
elayaoen
@elayaoen
Aug 30 2015 06:01
whats the -1 after the slotOne?
and double and single quotes? + on beginning and end of images?
IllusionElements
@IllusionElements
Aug 30 2015 06:03
@elayaoen -1 literally means minus 1, and the + is add and the quotes are there to show that they're not js functions/variables
codeguy2015
@codeguy2015
Aug 30 2015 06:21
Hi.. on waypoint 49, it wants Your h1 element should have the class pink-text.
Your h1 element should have the class blue-text.
Your h1 element should be blue.
Mike Bobadilla
@mikebobadilla
Aug 30 2015 06:21
  • are for string concactinations
"+"
codeguy2015
@codeguy2015
Aug 30 2015 06:22
how do you assign two classes to the same h1 element!? you can only have one class element in the h1 tag right?
Mike Bobadilla
@mikebobadilla
Aug 30 2015 06:22
class="classOne classTwo" @codeguy2015
codeguy2015
@codeguy2015
Aug 30 2015 06:23
ahh oh i missed that.. thanks bits!
CamperBot
@camperbot
Aug 30 2015 06:23
if you want to thank someone, put an @ before their name!
codeguy2015
@codeguy2015
Aug 30 2015 06:23
thanks @bitsandbytez
CamperBot
@camperbot
Aug 30 2015 06:23
codeguy2015 sends brownie points to @bitsandbytez :sparkles: :thumbsup: :sparkles:
:star: 236 | @bitsandbytez | http://www.freecodecamp.com/bitsandbytez
Mike Bobadilla
@mikebobadilla
Aug 30 2015 06:23
@codeguy2015 np
Jacob Jamell
@jjamell
Aug 30 2015 06:26
Try to run how-to-npm verify and I get Error: Cannot find module '/home/ubuntu/.config/how-to-npm/registry/npm-workshop/body.json'
Ashraful Islam
@iashraful
Aug 30 2015 06:29
looks like learnyoumongo will be a tough nut to crack, already giving me troubles :D
RoyEun
@RoyEun
Aug 30 2015 06:30

function titleCase(str) {
for (var i = 0; i < str.length; i++) {
if (str.charAt(i) == " ") {
str.charAt(i+1) = str.toUpperCase().charAt(i+1);
}
}
var myArray = str.split(' ')

return myArray;
}

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

Can anyone explain why my 4th line of code would have a left-hand side invalid? Also, is there a better way to write this code? Thanks!

CamperBot
@camperbot
Aug 30 2015 06:30
if you want to thank someone, put an @ before their name!
RoyEun
@RoyEun
Aug 30 2015 06:30
I am trying to capitalize the first letter of each word in the string
Mike Bobadilla
@mikebobadilla
Aug 30 2015 06:31
regex
Ashraful Islam
@iashraful
Aug 30 2015 06:32
@RoyEun you could use regex and str.replace(...)
str.replace will do the lovely looping for you
RoyEun
@RoyEun
Aug 30 2015 06:32
you're right, much easier. Thanks @bitsandbytez and @iashraful. (I'm just starting off as you can tell!)
CamperBot
@camperbot
Aug 30 2015 06:32
royeun sends brownie points to @bitsandbytez and @iashraful :sparkles: :thumbsup: :sparkles:
:star: 285 | @iashraful | http://www.freecodecamp.com/iashraful
:star: 237 | @bitsandbytez | http://www.freecodecamp.com/bitsandbytez
Mike Bobadilla
@mikebobadilla
Aug 30 2015 06:32
@RoyEun thats what its all about
Ashraful Islam
@iashraful
Aug 30 2015 06:33
@RoyEun solve it the way you feel comfortable
bf title case
CamperBot
@camperbot
Aug 30 2015 06:33

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

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

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Ashraful Islam
@iashraful
Aug 30 2015 06:33
bf details
CamperBot
@camperbot
Aug 30 2015 06:33

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");
Return the provided string with the first letter of each word capitalized.
For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Mike Bobadilla
@mikebobadilla
Aug 30 2015 06:33
@RoyEun hint: the second argument in string.replace is a callback
Ashraful Islam
@iashraful
Aug 30 2015 06:34
@RoyEun are all tests using sentences with spaces between words or do they have weird _- | etc?
RoyEun
@RoyEun
Aug 30 2015 06:35
@bitsandbytez will keep that in mind, thanks!
@iashraful all spaces
CamperBot
@camperbot
Aug 30 2015 06:35
royeun sends brownie points to @bitsandbytez and @iashraful :sparkles: :thumbsup: :sparkles:
:warning: royeun already gave bitsandbytez points
:warning: royeun already gave iashraful points
Ashraful Islam
@iashraful
Aug 30 2015 06:35
then try splitting the sentence into array
use foreach and just replace charAt(0) of each array element with their uppercase
think I vaguely remember that I had trouble with charAt() in that one
RoyEun
@RoyEun
Aug 30 2015 06:40
got it! Ill try that, will give you an update after going through it
thanks a lot guys
CamperBot
@camperbot
Aug 30 2015 06:40
if you want to thank someone, put an @ before their name!
Jesse Croxford
@Jcroxford
Aug 30 2015 06:48
can someone help me with bonfire number 15? I don't even know where to begin with it I have been stuck trying to understand it for a solid 30-45 minutes now
CamperBot
@camperbot
Aug 30 2015 06:48
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ashraful Islam
@iashraful
Aug 30 2015 06:50
@AuricSlayer which one is it?
SojournerOctocat
@SojournerOctocat
Aug 30 2015 06:52
bonfire where
CamperBot
@camperbot
Aug 30 2015 06:52

:fire:Bonfire: Where art thou :link:

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

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

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

more info:  bf details | bf links | hint

Jesse Croxford
@Jcroxford
Aug 30 2015 06:53
yes this one sorry not used to that feature yet haha
Ashraful Islam
@iashraful
Aug 30 2015 06:53
@AuricSlayer this one is easy but tricky
Jesse Croxford
@Jcroxford
Aug 30 2015 06:53
I think it should be easy
Jacob Jamell
@jjamell
Aug 30 2015 06:53
I already forgot what I did for that one
Ashraful Islam
@iashraful
Aug 30 2015 06:54
you need to use .hasOwnProperty(...) and then copy that object into your returning object
:)
Jesse Croxford
@Jcroxford
Aug 30 2015 06:54
do you need to use .keys()?
cause that part is confusing me
Ashraful Islam
@iashraful
Aug 30 2015 06:55
for example if( x.hasOwnProperty('name' ) && x.name === 'AurieSlayer') { resultArr.push(x) ; }
:)
@AuricSlayer you need to actually use the keys()[0] to determine which property you'll be looking for :D
@AuricSlayer I won't say anything else, I have this strange habit of giving out a solution and people seems to just copy paste it and don't think about it
SojournerOctocat
@SojournerOctocat
Aug 30 2015 06:57
I didn't use hasOwnProperty. I used filter.
Jesse Croxford
@Jcroxford
Aug 30 2015 06:57
haha yeah I dont want the answer I want to figure it out
Jacob Jamell
@jjamell
Aug 30 2015 06:57
Same here
I did the minimal amount of code to make the test pass. :P
Jesse Croxford
@Jcroxford
Aug 30 2015 06:58
but forgive me if I have a few more questions im just rereading what you've said xD
Ashraful Islam
@iashraful
Aug 30 2015 06:59
no problem :)
DTing
@dting
Aug 30 2015 07:00

@AuricSlayer if you have an object

var a = {"hello": 1, "world": 2}

Then,

Object.keys(a);

returns

["hello", "world"]
Ashraful Islam
@iashraful
Aug 30 2015 07:00
I believe to learn better and later on writing oneliner awesome code, initially we need to write some working code that I can be proud of instead of a patch together that passes the tests only
@dting morning! :D
Jacob Jamell
@jjamell
Aug 30 2015 07:01
I find myself completely ignoring any suggestions in the sidebar on these bonfires because there are always better methods you can use that get the job done in fewer lines and that are easier to read
DTing
@dting
Aug 30 2015 07:01
@iashraful morning
Ashraful Islam
@iashraful
Aug 30 2015 07:01
@jjamell yes, also most of the recommended methods are not applicable for certain bonfires
DTing
@dting
Aug 30 2015 07:01
bf links
DTing
@dting
Aug 30 2015 07:02
hmm all those seem reasonabl for this one
Jesse Croxford
@Jcroxford
Aug 30 2015 07:02
@dting on this exercise though when I tried to console.log(Object.keys(collection)); it returns an array with [0, 1, 2] instead of each item. Can you explain why that happens?
DTing
@dting
Aug 30 2015 07:02
Thats because collection is an array
the keys are "0", "1", "2"
Ashraful Islam
@iashraful
Aug 30 2015 07:03
yes
Rockpile
@rock-pile
Aug 30 2015 07:03
Anyone completed the first ZipLine 'Build a Personal Portfolio'?
Jesse Croxford
@Jcroxford
Aug 30 2015 07:03
oh ok lol
Ashraful Islam
@iashraful
Aug 30 2015 07:03
Object.keys(["hello","world"]), would return [0,1]
DTing
@dting
Aug 30 2015 07:03
the second argument, source is an object
Jacob Jamell
@jjamell
Aug 30 2015 07:04
@camgoodman I skipped that one. I'll finish it near the end of the course instead. :P
DTing
@dting
Aug 30 2015 07:04
@camgoodman i've done that one.
Ashraful Islam
@iashraful
Aug 30 2015 07:04
@camgoodman me too, will put something together once all my basejumps and ziplines are done
Jesse Croxford
@Jcroxford
Aug 30 2015 07:04
so essentially you need to use .hasOwnProperty to search collection for a match. and then use Keys to find the match's loaction and push that into an array?
Ashraful Islam
@iashraful
Aug 30 2015 07:04
@AuricSlayer my head = blown :D
Rockpile
@rock-pile
Aug 30 2015 07:04
@jjamell im trying to find some info on the static backgrounds images that dont scroll with the text but are new for each section, what is that called?
Jesse Croxford
@Jcroxford
Aug 30 2015 07:05
am I on the right track? haha
DTing
@dting
Aug 30 2015 07:05
@camgoodman parallax
Ashraful Islam
@iashraful
Aug 30 2015 07:05
@AuricSlayer yes, you are there
Jesse Croxford
@Jcroxford
Aug 30 2015 07:05
ok awesome I will figure the rest out from here thanks @dting thanks @iashraful for helping me clarify
CamperBot
@camperbot
Aug 30 2015 07:05
auricslayer sends brownie points to @dting and @iashraful :sparkles: :thumbsup: :sparkles:
:star: 286 | @iashraful | http://www.freecodecamp.com/iashraful
:star: 815 | @dting | http://www.freecodecamp.com/dting
Rockpile
@rock-pile
Aug 30 2015 07:06
thanks @dting
CamperBot
@camperbot
Aug 30 2015 07:06
camgoodman sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 816 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 07:06
@AuricSlayer hmm "and then use Keys to find the match's loaction and push that into an array?" this isn't quite right.
Jae
@jaestaar
Aug 30 2015 07:06
So... for javascript what is the difference in knowing when to use console.log() and when to not use it? When is it not used to print?
DTing
@dting
Aug 30 2015 07:07
you want to check each element in the collection array to see if it has all the keys of the source. and for every key the value of the element you are checking is equal to the value for that key in the source object.
Jacob Jamell
@jjamell
Aug 30 2015 07:07
@jaestaar that's entirely up to you. you can use it anywhere you want. abuse it, because it makes debugging your code easier
Ashraful Islam
@iashraful
Aug 30 2015 07:08
@jaestaar there is also console.info('information message'), console.error('error message') etc...
^ these are colorful too :D
Jesse Croxford
@Jcroxford
Aug 30 2015 07:09
ok
Jae
@jaestaar
Aug 30 2015 07:10
@jjamell @iashraful thank you!!!
CamperBot
@camperbot
Aug 30 2015 07:10
jaestaar sends brownie points to @jjamell and @iashraful :sparkles: :thumbsup: :sparkles:
:star: 250 | @jjamell | http://www.freecodecamp.com/jjamell
:star: 287 | @iashraful | http://www.freecodecamp.com/iashraful
Jacob Jamell
@jjamell
Aug 30 2015 07:12
personally, I comment out any console.log() statements once I feel like I don't need them anymore. I don't delete them, because I can just uncomment them if I need them again.
there's also console.assert() which only prints when tests fail
Jae
@jaestaar
Aug 30 2015 07:14
very helpful! Python makes better sense lol. But I'm coming along. Thanks again!
CamperBot
@camperbot
Aug 30 2015 07:14
if you want to thank someone, put an @ before their name!
Jae
@jaestaar
Aug 30 2015 07:14
no @camperbot !!!!
lol. thanks @camperbot
CamperBot
@camperbot
Aug 30 2015 07:15
jaestaar sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 127 | @camperbot | http://www.freecodecamp.com/camperbot
Mike Bobadilla
@mikebobadilla
Aug 30 2015 07:16
is the fibionacci bonfire broken?
my numbers are way bigger than what its expecting
oh nm
I used the value passed in as the number of rounds
duh
naxty
@naxty
Aug 30 2015 07:19
is bonfire where art thou broken?
Mike Bobadilla
@mikebobadilla
Aug 30 2015 07:20
@Nixoxo no
Ashraful Islam
@iashraful
Aug 30 2015 07:24
@Nixoxo is a bonfire acts weird, try refreshing the page, often solved a lot of my woes
naxty
@naxty
Aug 30 2015 07:27
@iashraful thanks for the advice, but it did not helped :D
CamperBot
@camperbot
Aug 30 2015 07:27
nixoxo sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 288 | @iashraful | http://www.freecodecamp.com/iashraful
Mike Bobadilla
@mikebobadilla
Aug 30 2015 07:28
@Nixoxo post code
naxty
@naxty
Aug 30 2015 07:28
The second task is working while the first task is not working. What values are expected in the first task?
DTing
@dting
Aug 30 2015 07:29
bf where
CamperBot
@camperbot
Aug 30 2015 07:29

:fire:Bonfire: Where art thou :link:

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

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

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

more info:  bf details | bf links | hint

Ashraful Islam
@iashraful
Aug 30 2015 07:29
:D this one appears to be quite popular now
naxty
@naxty
Aug 30 2015 07:29
:D
DTing
@dting
Aug 30 2015 07:29
[{ first: 'Tybalt', last: 'Capulet' }]
naxty
@naxty
Aug 30 2015 07:29
@dting thanks :)
CamperBot
@camperbot
Aug 30 2015 07:29
nixoxo sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 817 | @dting | http://www.freecodecamp.com/dting
Bastien Lemaire
@blemaire
Aug 30 2015 07:31
any tips on bonfire: DNA ??
I have the following working but I can't help to think it can be done in a better way...
function pair(str) {
  var pairs = [],
      combos = {
        "C": "G",
        "G": "C",
        "A": "T",
        "T": "A"
      };

  str.split("").forEach(addPair);

  return pairs;

  function addPair(letter) {
    pairs.push([letter, combos[letter]]);
  }
}
Jesse Croxford
@Jcroxford
Aug 30 2015 07:32
I just finished that bonfire!
not yours @blemaire the other one xD
Ashraful Islam
@iashraful
Aug 30 2015 07:32
@blemaire wow!
looks good to me, can't be shorter
in my opinion that is
naxty
@naxty
Aug 30 2015 07:35
hahaha I finished the other bonfire too :D the problem was that I had no idea how I should access the values of the objects
Bastien Lemaire
@blemaire
Aug 30 2015 07:35
@iashraful just feels a little fiddly, (just the pair matching...)
DTing
@dting
Aug 30 2015 07:35
@blemaire
var lookup = Object.create(null);
lookup.A = 'T';
lookup.T = 'A';
lookup.C = 'G';
lookup.G = 'C';
function pair(str) {
 return str.split('').map(function(p) {return [p, lookup[p]];});
}
Bastien Lemaire
@blemaire
Aug 30 2015 07:37
@dting can you expand on the use of Object.create() over the way I did it?
DTing
@dting
Aug 30 2015 07:38
var lookup = {A: 'T', T: 'A', C: 'G', G: 'C'};
function pair(str) {
 return str.split('').map(function(p) {return [p, lookup[p]];});
}
ya.
It's pretty similar but Object.creating an object with null prevents it from inheriting any properties
Bastien Lemaire
@blemaire
Aug 30 2015 07:39
does that mean I would no longer need to do a object.hasOwnProperty("property")?
DTing
@dting
Aug 30 2015 07:40
ya.
Bastien Lemaire
@blemaire
Aug 30 2015 07:41
sweet ! thanks
CamperBot
@camperbot
Aug 30 2015 07:41
if you want to thank someone, put an @ before their name!
Bastien Lemaire
@blemaire
Aug 30 2015 07:41
@dting thanks
CamperBot
@camperbot
Aug 30 2015 07:41
blemaire sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 818 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 07:45
nps
Jesse Croxford
@Jcroxford
Aug 30 2015 07:46
so I am curious, while doing some of these bonfires I have figured out more than way to do what it wants you to do. Is the idea to limit yourself to the concepts it links to?
Seems like it but I just was curious to see what other people thought
DTing
@dting
Aug 30 2015 07:50
definitely don't limit yourself to the links. It's a good idea after you solve something to take a look at other people's answer and try to understand them.
Ashraful Islam
@iashraful
Aug 30 2015 07:50
@AuricSlayer those are some headstarts, you can solve anyway you see fit
Jesse Croxford
@Jcroxford
Aug 30 2015 07:55
ok cool thanks again xD
CamperBot
@camperbot
Aug 30 2015 07:55
if you want to thank someone, put an @ before their name!
Bastien Lemaire
@blemaire
Aug 30 2015 07:57
bonfire: Missing letters
function fearNotLetter(str) {
  for (var i = 1 ; i < str.length; i++ ) {
    if (str.charCodeAt(i-1) + 1 !== str.charCodeAt(i)) {
      return String.fromCharCode(str.charCodeAt(i-1) + 1);
    }
  }
}
CamperBot
@camperbot
Aug 30 2015 07:57
Sorry, can't find a bonfire called missing lettersfunction fearnotletterstr for var i 1 i strlength i if strcharcodeati-1 1 strcharcodeati return stringfromcharcodestrcharcodeati-1 1 . [ Check the map? ]
Mike Bobadilla
@mikebobadilla
Aug 30 2015 07:58
This message was deleted
CamperBot
@camperbot
Aug 30 2015 07:58
Sorry, can't find a bonfire called fearnot. [ Check the map? ]
DTing
@dting
Aug 30 2015 07:58
bf missing
CamperBot
@camperbot
Aug 30 2015 07:58

:fire:Bonfire: Missing letters :link:

function fearNotLetter(str) {
  return str;
}

fearNotLetter('abce');

Find the missing letter in the passed letter range and return it.

more info:  bf details | bf links | hint

DTing
@dting
Aug 30 2015 07:59
@blemaire return String.fromCharCode(str.charCodeAt(i-1) + 1); this isnt correct
oh wait hmm
Bastien Lemaire
@blemaire
Aug 30 2015 07:59
@dting it passed the test...
I start the loop at index 1 (not 0)
just sharing my solution see if there is any different/better/cleaner...
Bastien Lemaire
@blemaire
Aug 30 2015 08:14
bf boo who
CamperBot
@camperbot
Aug 30 2015 08:14

:fire:Bonfire: Boo who :link:

function boo(bool) {
  // What is the new fad diet for ghost developers? The Boolean.
  return bool;
}

boo(null);

Check if a value is classified as a boolean primitive. Return true or false.

more info:  bf details | bf links | hint

Bastien Lemaire
@blemaire
Aug 30 2015 08:14
is it really that simple?
function boo(bool) {
  return typeof bool === "boolean";
}
DTing
@dting
Aug 30 2015 08:15
think so
Bastien Lemaire
@blemaire
Aug 30 2015 08:17
it feels like it should do more checks...
DTing
@dting
Aug 30 2015 08:21
what do you mean?
Bastien Lemaire
@blemaire
Aug 30 2015 08:21
don't know just seems too simple..
Thomas Farla
@TFarla
Aug 30 2015 08:23

@blemaire try the following in your browser's console

console.log(typeof(true));
console.log(typeof(false));
console.log(typeof(null));

that should answer your question c:

Alan Wilson
@nulland
Aug 30 2015 08:24
Could someone please explain how I apply the .smaller-image class to the following image?<img src="https://bit.ly/fcc-relaxing-cat">
Bastien Lemaire
@blemaire
Aug 30 2015 08:25
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">
Alan Wilson
@nulland
Aug 30 2015 08:25
@blemaire Thanks!
CamperBot
@camperbot
Aug 30 2015 08:25
nulland sends brownie points to @blemaire :sparkles: :thumbsup: :sparkles:
:star: 14 | @blemaire | http://www.freecodecamp.com/blemaire
Thomas Farla
@TFarla
Aug 30 2015 08:26
@nulland read more about classes here
Alan Wilson
@nulland
Aug 30 2015 08:26
@TFarla Thank you!
CamperBot
@camperbot
Aug 30 2015 08:26
nulland sends brownie points to @tfarla :sparkles: :thumbsup: :sparkles:
:star: 5 | @tfarla | http://www.freecodecamp.com/tfarla
Bastien Lemaire
@blemaire
Aug 30 2015 08:38
bf sorted
CamperBot
@camperbot
Aug 30 2015 08:38

:fire:Bonfire: Sorted Union :link:

function unite(arr1, arr2, arr3) {
  return arr1;
}

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

Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.

more info:  bf details | bf links | hint

Bastien Lemaire
@blemaire
Aug 30 2015 08:39
function unite(arr1, arr2, arr3) {
  var merged = [].reduce.call(arguments, mergeArray);

  return merged.filter(deDupe);

  function mergeArray(previous, current) {
    return previous.concat(current);
  }

  function deDupe(current, pos) {
    return merged.indexOf(current) === pos;
  }
}
slight improvement:
function unite(arr1, arr2, arr3) {

  return [].reduce.call(arguments, mergeArray).filter(deDupe);

  function mergeArray(previous, current) {
    return previous.concat(current);
  }

  function deDupe(current, pos, arr) {
    return arr.indexOf(current) === pos;
  }
}
DTing
@dting
Aug 30 2015 09:11
function unite() {
  return [].concat.apply([], arguments).filter(function(e,i,a) {
    return a.indexOf(e) === i;
  });
}
should be significantly faster by reducing the number of intermediate arrays objects created by not using reduce -> concat.
DTing
@dting
Aug 30 2015 09:17
function fearNotLetter(str) {
  var i=0, cc=str.charCodeAt(0);
  while(++i < str.length) 
    if (++cc != str.charCodeAt(i)) return String.fromCharCode(cc);
}
half the number of str.charCodeAt's by using a second variable to track expected charcode
Bastien Lemaire
@blemaire
Aug 30 2015 09:19
@dting from 3 down to 2, well done
@dting talking about the number of String.charCodeAt
@dting can't believe I didn't think to you concat directly instead of reduce...
DTing
@dting
Aug 30 2015 09:20
@blemaire its actually like n less
oosp
Bastien Lemaire
@blemaire
Aug 30 2015 09:20
true
DTing
@dting
Aug 30 2015 09:20
so a bit faster ya
Ashraful Islam
@iashraful
Aug 30 2015 09:21
@dting wow! that totally makes sense, but how come I couldn't think of it before?
Bastien Lemaire
@blemaire
Aug 30 2015 09:21
definitely with large arrays !
Ashraful Islam
@iashraful
Aug 30 2015 09:22
@dting do you have some sort of magic? :D
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 09:25
I'm having some difficulty getting the alarm to work on my pomodoro clock/
I'm using the timecircles plugin and I can't figure out how to use the listener.
Sean Campbell
@natac13
Aug 30 2015 09:26
Can anyone help me with understanding how to set up mongodb to run the freecodecamp app locally? I been going through the steps on the README and I am stuck on just after filling out your mandrill info... and just to check I had to sign up for mandrill to be able to fill out these fields?? Then I started to start mongod but it said no /data/db dir so I made that then the permissions were wrong and then I changed, ran the mongod command again and now it is stuck on wiating for connections from port
DTing
@dting
Aug 30 2015 09:31
do you mean mongo is waiting?
Sean Campbell
@natac13
Aug 30 2015 09:31
yep been there for awhile now
is that normal
DTing
@dting
Aug 30 2015 09:31
ya
Ashraful Islam
@iashraful
Aug 30 2015 09:32
that is the server running and listening for incoming connections I believe
Sean Campbell
@natac13
Aug 30 2015 09:33
Right and then the next step it says to create the mongo db?
Ashraful Islam
@iashraful
Aug 30 2015 09:34
create?
DTing
@dting
Aug 30 2015 09:35
open another terminal
Sean Campbell
@natac13
Aug 30 2015 09:38
@dting alrighty That was it then I switched to the freecodecamp db exit.... run node seed/ and then gulp??
IllusionElements
@IllusionElements
Aug 30 2015 09:39
For some reason, my twitch app, is bugging out, the images are all the same for everyone and the description is as well, it can't seem to determine who's online and whos off
DTing
@dting
Aug 30 2015 09:39
@TheHighPriestess which listener?
@natac13 i havent messed with the fcc code in a while but sounds right
Sean Campbell
@natac13
Aug 30 2015 09:41
@dting thanks
CamperBot
@camperbot
Aug 30 2015 09:41
natac13 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 821 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 09:49
@IllusionElements hmm i looked over your code. how come you have for loops that all use the same counter variable
seems like a dangerous game to play
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 09:53
@dting I posted all the information in the HelpZiplines forum
@dting I'm using the timecircles plugin
DTing
@dting
Aug 30 2015 09:56
hmm im not in that room i guess i'll join and check it
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 09:56
@dting I came over here because nobody is over thee
I'm sure it's something easy
Spatz
@Spatzerny
Aug 30 2015 09:57
arr.reduce(callback[, initialValue])
how do you pass initialValue
where do i put it in the syntax of this whole thing
Robert Richey
@0x0936
Aug 30 2015 09:59
right where you have it
arr.reduce(callback, initialValue)
the documentation uses brackets to show it's optional. don't actually use those in your code
Spatz
@Spatzerny
Aug 30 2015 10:00
now when i see it it seems fairly logical :P
thanks @2358
CamperBot
@camperbot
Aug 30 2015 10:01
spatzerny sends brownie points to @2358 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for 2358
Spatz
@Spatzerny
Aug 30 2015 10:01
:F
thanks @0x0936
CamperBot
@camperbot
Aug 30 2015 10:02
spatzerny sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 62 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Aug 30 2015 10:02
:)
DTing
@dting
Aug 30 2015 10:03
@TheHighPriestess hmm what listener are you trying to add
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:04
He has some info on it here:
I'm trying to get the clock to send out an "alarm" when the time is up
Shouldn't be too hard to do...but I'm struggling
DTing
@dting
Aug 30 2015 10:04
also you can link to the js file on github using the rawgit.com url intead of pasting it in. https://rawgit.com/wimbarelds/TimeCircles/master/inc/TimeCircles.js http://codepen.io/dting/pen/zvOgbE
k
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:06
@dting I'm confused about how to add the listener. When I tried it...my clock stopped working
DTing
@dting
Aug 30 2015 10:09
@TheHighPriestess i updated my example
this listener just log the total value
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:10
@dting your example
??
How can I see it?
DTing
@dting
Aug 30 2015 10:10
i linked it above
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:11
oh sorry...i see it now
IllusionElements
@IllusionElements
Aug 30 2015 10:11
Is there a way to check why your if statement is being bypassed?
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 10:11
Need some help
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:12
@dting That's similar to what I was doing...I must have been just slightly off
@dting thank you
CamperBot
@camperbot
Aug 30 2015 10:12
thehighpriestess sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 823 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 10:13
@IllusionElements you can assume it's because the condition inside the if statement evaluated to falsy
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:14
@dting oh...tell me...how did you get that to work without include all the timecircles code?
I don't understand Codepen very well
DTing
@dting
Aug 30 2015 10:14
also you can link to the js file on github using the rawgit.com url intead of pasting it in. https://rawgit.com/wimbarelds/TimeCircles/master/inc/TimeCircles.js
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 10:14
ahhh...
DTing
@dting
Aug 30 2015 10:14
click the sprocket for the js window
Rohit Balasubramanian
@rohitknhs
Aug 30 2015 10:22
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<div class="container-fluid">
  <h2 class="red-text text-center">CatPhotoApp</h2>

  <p>Click here for <a href="#">cat photos</a>.</p>

  <a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>

  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class= "row col-xs-4">
  <button class="btn btn-block btn-primary">Like</button>
  <button class="btn btn-block btn-info">Info</button>
  <button class="btn btn-block btn-danger">Delete</button>
</div>
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>
Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4
DTing
@dting
Aug 30 2015 10:24
you put them all in one div
Rohit Balasubramanian
@rohitknhs
Aug 30 2015 10:24
I have no clue what's wrong with the code
DTing
@dting
Aug 30 2015 10:29
@rohitknhs which waypoint is this?
Rohit Balasubramanian
@rohitknhs
Aug 30 2015 10:30
Waypoint: Use the Bootstrap Grid to Put Elements Side By Side
Johannes Lyytikkä
@Wildarts
Aug 30 2015 10:31
I keep getting the following error in Bonfire: Return Largest Numbers in Arrays: "cannot read property eql of undefined". I can't get it to return anything, not even with return true. Has anybody had a similar problem?
DTing
@dting
Aug 30 2015 10:36
@rohitknhs right now you have <div class= "row col-xs-4">
they want you to have a <div class= "row">
then 3 <div class= "col-xs-4"> each with one of the buttons
nested inside that first element
Rohit Balasubramanian
@rohitknhs
Aug 30 2015 10:38
alright let me try
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 30 2015 10:45
hi campers, please could someone tell me how to tweet a quote in Zipline 3 : Random Quote Machine ?
Betsey Biggs
@betsbillabong
Aug 30 2015 10:47
waypoint random whole
oops, sorry, was hoping that would bring up the wiki via camperbot!
DTing
@dting
Aug 30 2015 10:49
i dont think the waypoints have wiki stuff yet for the bot. @betsbillabong
@Abdelaziz18003 you probably want to use https://dev.twitter.com/web/intents
Betsey Biggs
@betsbillabong
Aug 30 2015 10:49
I'm on Waypoint: Generate Random Whole Numbers with Javascript. Can anyone explain to me why multiplying by ten is helpful? If math.floor converts to a whole number… why not just convert the initial random decimal to a whole number? The initial number has several places past the decimal...
@dting thanks… it does, but it must not yet be connected to the wiki.
CamperBot
@camperbot
Aug 30 2015 10:50
betsbillabong sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 825 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 10:50
find random whole
DTing
@dting
Aug 30 2015 10:51
@betsbillabong math.random returns a number between [0, 1) inclusive exclusive. so if you floor that number it is always 0
Betsey Biggs
@betsbillabong
Aug 30 2015 10:51
Thanks @dting - I guess it is connected but you don't type in waypoint. interesting!
CamperBot
@camperbot
Aug 30 2015 10:51
betsbillabong sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: betsbillabong already gave dting points
Betsey Biggs
@betsbillabong
Aug 30 2015 10:53
@dting ah, that makes sense, thanks. I'm still a bit confused - I think I have the correct code, and it's passing and sending me onto the next one, but what's returned is not a whole number, it's null. No matter how many times I run it.
Math.floor(Math.random()*10);
  return Math.floor();
CamperBot
@camperbot
Aug 30 2015 10:53
betsbillabong sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: betsbillabong already gave dting points
Rohit Balasubramanian
@rohitknhs
Aug 30 2015 10:53
Thanks @dting
shit worked
CamperBot
@camperbot
Aug 30 2015 10:53
rohitknhs sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 826 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 30 2015 10:53
@betsbillabong you need to return the top line
Betsey Biggs
@betsbillabong
Aug 30 2015 10:54
Oh, the whole thing?
Cool, i'll try.
DTing
@dting
Aug 30 2015 10:54
right now you are returning Math.floor(undefined)
Betsey Biggs
@betsbillabong
Aug 30 2015 10:54
Oh, right. If I used val in the first line, I could just return that, right? I know that's not what it's asking for now, just trying to figure out how the grammar works.
DTing
@dting
Aug 30 2015 10:55
you can assign it to a variable using var something = that code then return something ya
Betsey Biggs
@betsbillabong
Aug 30 2015 10:55
And thx, it works now!
CamperBot
@camperbot
Aug 30 2015 10:55
if you want to thank someone, put an @ before their name!
DTing
@dting
Aug 30 2015 10:55
np
Betsey Biggs
@betsbillabong
Aug 30 2015 10:56
yay it works! just about my first javascript that is not completely just typed out according to the instructions:
```
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 30 2015 11:08
thanks @dting
CamperBot
@camperbot
Aug 30 2015 11:08
abdelaziz18003 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 827 | @dting | http://www.freecodecamp.com/dting
chikrix
@Chikrix
Aug 30 2015 11:20
This message was deleted
Please what's wrong with my code function largestOfFour(arr) { arry = arr.map(function(x){ return Math.max.apply(null,x); }) return arry; } This was for the bonfire problem that finds the biggest number in each array of a given array. When I run it, it returns the desired array but if I submit, it tells me "No user tests were run." . What could be wrong?
Bastien Lemaire
@blemaire
Aug 30 2015 11:31
@Chikrix try to refresh the browser
chikrix
@Chikrix
Aug 30 2015 11:32
@blemaire I've done that, the same response
Bastien Lemaire
@blemaire
Aug 30 2015 11:33
copy yourcode in the clipboard and click reset() on the left hand side
Paste your code back in and try again
DTing
@dting
Aug 30 2015 11:33
@Chikrix that bonfire seems bugged
theres an issue posted already for the bug
DTing
@dting
Aug 30 2015 11:39
@Chikrix i'd just skip it and move to the next one. your code looks good except i'd recommend not using a global arry either var arry = arr.map(...) or just return arr.map(...)
chikrix
@Chikrix
Aug 30 2015 11:44
@blemaire I did that and got the same response. Thanks @dting
CamperBot
@camperbot
Aug 30 2015 11:44
chikrix sends brownie points to @blemaire and @dting :sparkles: :thumbsup: :sparkles:
:star: 15 | @blemaire | http://www.freecodecamp.com/blemaire
:star: 830 | @dting | http://www.freecodecamp.com/dting
Bastien Lemaire
@blemaire
Aug 30 2015 11:45
bf html entities
CamperBot
@camperbot
Aug 30 2015 11:45

:fire:Bonfire: Convert HTML Entities :link:

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

convert('Dolce & Gabbana');

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

more info:  bf details | bf links | hint

Bastien Lemaire
@blemaire
Aug 30 2015 11:45
function convert(str) {
  return str.replace(/(&|<|>|"|')/g, htmlEncode); 

  function htmlEncode(match, capture) {
    return "&#" + capture.charCodeAt() + ";";
  }
}
Suggestions to improve?
DTing
@dting
Aug 30 2015 11:50
@blemaire maybe replace the |'s with [] /[&<>"']/g looks good
Spatz
@Spatzerny
Aug 30 2015 12:06
function smallestCommons(arr) {
  var nMin = Math.min(arr[0],arr[1]);
  var nMax = Math.max(arr[0],arr[1]);
  var nArr = [];
  var nSCM = nMax;

  for (var i=nMin;i<=nMax;i++) {
    nArr.push(i);  
  }

  //why are things stopping here?

  for (var i=0;i==='done';i++) {
    console.log('start!');
    if (nSCM%nArr[i]>0) {
      nSCM++;
      i=0;
      console.log('add!');
    }
    if(i>nArr.length) {
      i='done';
      console.log('done!');
    }
  }
  return nSCM;
}

smallestCommons([1,5]);
i can't see the problem
Spatz
@Spatzerny
Aug 30 2015 12:11
help?
Omar
@oab00
Aug 30 2015 12:13
find smallest
CamperBot
@camperbot
Aug 30 2015 12:13

find smallest

:zero: bonfire smallest common multiple

Omar
@oab00
Aug 30 2015 12:13
0
CamperBot
@camperbot
Aug 30 2015 12:13

:fire:Bonfire: Smallest Common Multiple :link:

function smallestCommons(arr) {
  return arr;
}


smallestCommons([1,5]);

Find the smallest number that is evenly divisible by all numbers in the provided range.

more info:  bf details | bf links | hint

Eamonn O'Dwyer
@epodwyer
Aug 30 2015 12:14
bf Reverse A String
CamperBot
@camperbot
Aug 30 2015 12:14

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

Eamonn O'Dwyer
@epodwyer
Aug 30 2015 12:14
bf details
CamperBot
@camperbot
Aug 30 2015 12:14

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');
Reverse the provided string.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Spatz
@Spatzerny
Aug 30 2015 12:14
it just completely skips the second for loop
Omar
@oab00
Aug 30 2015 12:14
@Spatzerny condition must start with true for the for loop to run
Eamonn O'Dwyer
@epodwyer
Aug 30 2015 12:14
bf hint
CamperBot
@camperbot
Aug 30 2015 12:14
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Spatz
@Spatzerny
Aug 30 2015 12:15
oh shhhh....
ye
Omar
@oab00
Aug 30 2015 12:15
lol
Spatzerny @Spatzerny smacks himself in the forhead
Spatz
@Spatzerny
Aug 30 2015 12:17
i think i need a break
:D
  for (var i=0;true;i++) {
    if (nSCM%nArr[i]>0) {
      console.log(nSCM);
      nSCM+=nMax;
      i=0;
    }
    if(i>nArr.length) {
      break;
    }
  }
is there a more elegant way than than that 'true' ?
This message was deleted
Omar
@oab00
Aug 30 2015 12:18
i>nArr.length ?
reverse ^
for (var i=0; i<=nArr.length; i++) {
Spatz
@Spatzerny
Aug 30 2015 12:19
i'm afraid of number ranges
in for loops
Omar
@oab00
Aug 30 2015 12:20
and being always true is much better? xD
Spatz
@Spatzerny
Aug 30 2015 12:20
no, it's not
i wonder why i suddnly went with false conditions in the loop
[edit: because i've tried using strings to end the loop thats why, damn strings]
@oab00 thanks :)
CamperBot
@camperbot
Aug 30 2015 12:21
spatzerny sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 273 | @oab00 | http://www.freecodecamp.com/oab00
Omar
@oab00
Aug 30 2015 12:21
change it to a while loop much simpler :p
Spatz
@Spatzerny
Aug 30 2015 12:23
but i'd have to give it an iterator anyway
Mitzi Withrow
@mitziw
Aug 30 2015 12:39
hi
hey does anyone know what to do about waypoints getting blown away?
Spatz
@Spatzerny
Aug 30 2015 12:41
blown away?
Mitzi Withrow
@mitziw
Aug 30 2015 12:42
@Spatzerny deleted work ive done
Spatz
@Spatzerny
Aug 30 2015 12:46
would imagine there's not much you can do but i might be wrong
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 12:57
Need help with Chunky Monkey
Mitzi Withrow
@mitziw
Aug 30 2015 12:58
@Spatzerny do you know if there is there someone in particular that FCC has monitoring this room?
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 12:59
@mitziw Hey! I'm a Community Builder here
Mitzi Withrow
@mitziw
Aug 30 2015 12:59
@AmmarAliShah you must be a bot then ;-)
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 13:00
@mitziw I prefer Cyborg
:fire:
Mitzi Withrow
@mitziw
Aug 30 2015 13:00
@AmmarAliShah hah my waypoint work has disappeared for the second time.
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 13:01
@mitziw some maintainence was done today. You should file an issue
Mitzi Withrow
@mitziw
Aug 30 2015 13:01
@AmmarAliShah where do i do that?
Mitzi Withrow
@mitziw
Aug 30 2015 13:03
@AmmarAliShah thank you
CamperBot
@camperbot
Aug 30 2015 13:03
mitziw sends brownie points to @ammaralishah :sparkles: :thumbsup: :sparkles:
:star: 124 | @ammaralishah | http://www.freecodecamp.com/ammaralishah
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 13:03
@mitziw :smile:
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:06
helloWorld
myArray.unshift(["Paul"]);
Haremantra
@haremantra
Aug 30 2015 13:06
Hi @aryasaatvik !
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:07
myArray.unshift(["Paul"]); outputs myArray.unshift(["Paul"]);
the challenge wants ["Paul", 23, ["dog", 3]])')
@haremantra help
Haremantra
@haremantra
Aug 30 2015 13:08
Sorry, you are way ahead of me on this course--just wanted to say hi
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:08
thats fine
thanks anyways
CamperBot
@camperbot
Aug 30 2015 13:08
if you want to thank someone, put an @ before their name!
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:09
@camperbot sorry
@camperbot could you help with this @aryasaatvik
myArray.unshift(["Paul"]); outputs myArray.unshift(["Paul"]);
the challenge wants ["Paul", 23, ["dog", 3]])')
Mitzi Withrow
@mitziw
Aug 30 2015 13:11
@aryasaatvik unshift is returning the first element
Katherine Wakefield
@awakekat
Aug 30 2015 13:11
I am stuck on jquery waypoint 130 it says I am not fulfilling Only add one class with each of your three selectors. with this code: $("button.btn#target1").addClass("animated shake btn-primary"); I am at a loss and cofused about what it is saying.
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:11
@mitziw it is returning it with []
Mitzi Withrow
@mitziw
Aug 30 2015 13:12
@aryasaatvik oh which waypoint is it?
mine are all gone anywaay
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:13
@mitziw #23 Basic Javascript
Katherine Wakefield
@awakekat
Aug 30 2015 13:13
oh sorry #6 in jquery
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:13
@mitziw #189
Mitzi Withrow
@mitziw
Aug 30 2015 13:13
@aryasaatvik @awakekat i can look at each brb
Katherine Wakefield
@awakekat
Aug 30 2015 13:14
@mitziw cool
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:14
@awakekat you are supposed to add one class to first two selectors
@awakekat and classes are mentioned for the third one
Katherine Wakefield
@awakekat
Aug 30 2015 13:15
still clueless... (feeling stupid) :worried:
HTML andCSS no problem, jquery my brain shuts off
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:17
@awakekat you are supposed to select each class, element and id seperately
@awakekat $("button").addClass("animated")
$(".btn").addClass("shake")
$("#target1").addClass("animated shake btn-primary")
Katherine Wakefield
@awakekat
Aug 30 2015 13:19
Got it, before you posted, the way you say it - it makes sense - target them seperately
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:19
@awakekat you are welcome
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:21
http://codepen.io/kandimohsin/pen/epYOZe
hey plz help me with this problem
My SM Government and Jennings H4 Tags are not on the same line with IQRA
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:21
@MustafaMohsin whats the problem
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:22
Look at IQRA and Sm and Jeenings
Elizabeth Hatleli
@TheHighPriestess
Aug 30 2015 13:22
Headsup to anyone thinking of using a plugin for the pomodoro clock. Stay away from this plugin:
It does not work properly.
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:22
@aryasaatvik They Are aways from the columns of IQRA
I want to Align my Sm and Jennings text to left , but I cant
Katherine Wakefield
@awakekat
Aug 30 2015 13:24
padding and margin on li
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:24
I have given SM and Jennings a H4 tag
look at my HTML Coding @awakekat
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:25
@MustafaMohsin IQRA University Karachi: is not in the list
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:25
@aryasaatvik YEs
IllusionElements
@IllusionElements
Aug 30 2015 13:25
For loop countdown ?
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:25
@aryasaatvik its in H4 tag and SM and Jennings too
Katherine Wakefield
@awakekat
Aug 30 2015 13:25
yes you have nested ul and li tags - you have to change the default margin of the ul and li
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:26
@awakekat i cant Understand :( would you plz help me out
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:26
@MustafaMohsin if you want it to have same indentation as sm and jenning then it is supposed to be in the list
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:26
no i want to Give their subheading
i dont want to put them in List
Mitzi Withrow
@mitziw
Aug 30 2015 13:26
@aryasaatvik myArray.unshift(["Paul"]); returns the array but it still gives an error msg
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:27
@mitziw ik
Katherine Wakefield
@awakekat
Aug 30 2015 13:27
take them out of the ul nesting
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:27
@awakekat i have not nested in Ul nesting
Katherine Wakefield
@awakekat
Aug 30 2015 13:27
yep I see that now...
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:28
@awakekat plz help :( i want to align the text of SM and Jennings left to
@awakekat All the three names are in a <div class="Qua">
Katherine Wakefield
@awakekat
Aug 30 2015 13:29
h4 {
display: block;
-webkit-margin-before: 1.33em;
-webkit-margin-after: 1.33em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
font-weight: bold;
}
this is what the inspector is telling me
not sure where that is coming from
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:29
@awakekat Not working :(
Katherine Wakefield
@awakekat
Aug 30 2015 13:30
the h4 in the html dies not have .Qay class there
dies = does
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:31
@awakekat i have nested the H4 element in Qua class :( of Div
Mitzi Withrow
@mitziw
Aug 30 2015 13:31
@aryasaatvik this: d[0].toLowerCase is not a function ?
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:32
@MustafaMohsin http://codepen.io/kandimohsin/pen/epYOZe look at it again
Katherine Wakefield
@awakekat
Aug 30 2015 13:32
that is the surrounding object not specific to the exact element you want to change - the h4
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:32

@MustafaMohsin <p> I am a skilled student proefficient in performing duties efficiently and well. Looking for a good upportunity where I can utilize my skills and acquire new diverse knowledge.</p>
<div Class="Qua">
<h2>QUALIFICATION:</h2>
<ul>
<h4>IQRA University Karachi:</h4>
<p>Bacheolor in Computer Science</p>
<ul>
<li>In Progress(2nd Semester)</li>
</ul>
</ul>
<ul>

<h4>SM Government Science College:</h4>
<p>Intermediate(computer science)</p>
<ul>
<li>2013</li>
</ul>

<h4>Jenning's Private School Karachi:</h4>
<p>Matriculation(science)</p>
  <ul>

<li>2011</li>
    </ul>

</div>

Katherine Wakefield
@awakekat
Aug 30 2015 13:33
the h4 is what you want to target and change to line up with the others
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:33
@aryasaatvik what to do ?
@awakekat but there are many other h4 elements they were also get change
@aryasaatvik the text :( :( still not in left :(
Saatvik Arya
@aryasaatvik
Aug 30 2015 13:37
@MustafaMohsin try replacing your list with this
<ul>
<h4>IQRA University Karachi:</h4>
<p>Bacheolor in Computer Science</p>
<ul>
<li>In Progress(2nd Semester)</li>
</ul>
</ul>
<ul>
<h4>SM Government Science College:</h4>
<p>Intermediate(computer science)</p>
<ul>
<li>2013</li>
</ul>
<h4>Jenning's Private School Karachi:</h4>
<p>Matriculation(science)</p>
<ul>

<li>2011</li>
</ul>
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:38
@aryasaatvik do chaning in HTML
@aryasaatvik I have nested the Ul Li H4 into a Div with class .Qua
Katherine Wakefield
@awakekat
Aug 30 2015 13:39
that is so odd... the first ul is causing the problem
I took it out and they seem to act properly
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:39
@awakekat So what should i do :(
Katherine Wakefield
@awakekat
Aug 30 2015 13:40
<div Class="Qua">
<h2>QUALIFICATION:</h2>
<h4>IQRA University Karachi:</h4>
<p>Bacheolor in Computer Science</p>
<li>In Progress(2nd Semester)</li>
take the ul off the first li - see what happens
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:41
@awakekat Nope nothing much done
Vanja Valent
@walent021
Aug 30 2015 13:41
I'm literally too stupid
code looks ok to me but no... won't work
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:42
@awakekat ahh it Works
@awakekat Thank you :) :) Ma'm :) :) @aryasaatvik :) :) (Y)
CamperBot
@camperbot
Aug 30 2015 13:43
mustafamohsin sends brownie points to @awakekat and @aryasaatvik :sparkles: :thumbsup: :sparkles:
:star: 132 | @awakekat | http://www.freecodecamp.com/awakekat
:star: 189 | @aryasaatvik | http://www.freecodecamp.com/aryasaatvik
Mustafa Hussain
@MustafaMohsin
Aug 30 2015 13:43
@awakekat i was so stupid i dint closed the first Ul element :P
Vanja Valent
@walent021
Aug 30 2015 13:45
function titleCase(str) {
  var sentence = str.split(' ')
  for (i = 0; i<sentence.length; i++){
    sentence[i].charAt(0).toUpperCase();

  }
  var joined = sentence.join(' ');
  return joined;
}

titleCase("I'm a little tea pot");
Shouldn't this change the first letter?
James Becker
@james-becker
Aug 30 2015 13:48
Hey need a second pair of eyes to tell me what I'm doing wrong here...
function chunk(arr, size) {
  multiArr = [];
  for ( i = 0; i < arr.length; i += size ); {
    multiArr.push(arr.slice(i, (size + i)));
  }
  console.log(multiArr);
  return multiArr;
}

chunk(['a', 'b', 'c', 'd'], 2);
In JS.bin it gives the correct output, but FCC doesn't pass it
Vanja Valent
@walent021
Aug 30 2015 13:50
@james-becker how do you set up js.bin to show the code output?
James Becker
@james-becker
Aug 30 2015 13:51
@walent021 click on Javascript and Console
@walent021 make sure only those two are highlighted
@walent021 it's great for debugging FCC, I do all of my Bonfires on there
Vanja Valent
@walent021
Aug 30 2015 13:52
@james-becker it shows nothing on the console
James Becker
@james-becker
Aug 30 2015 13:52
@walent021 Yeah, I know. I don't understand why, since i have a console.log
it returns the correct multi-dimensional array in JsBin
Vanja Valent
@walent021
Aug 30 2015 13:53
@james-becker oh yeah i didn't put console log.
James Becker
@james-becker
Aug 30 2015 13:53
@walent021 for titleCase: STRINGS ARE IMMUTABLE ;)
@walent021 you cannot change a character in a string. You have to break the string into pieces and re-concatenate them
Vanja Valent
@walent021
Aug 30 2015 13:54
oh are you kidding me :D
James Becker
@james-becker
Aug 30 2015 13:54
annoying, eh?
:)
Vanja Valent
@walent021
Aug 30 2015 13:55
Why though. i select the character with number in the brackets
James Becker
@james-becker
Aug 30 2015 13:55
you have to reference the first lettter and use substring(1) to reference the rest of each word
arr[i].charAt(0).toUpperCase() + arr[i].substring(1)
Something like that
you can't ever do
```
charAt(x) =
charAt(x)
you can only pull information from charAt, you cannot declare a new value for charAt
@crisberrios Denver brownies all around!
thanks @iashraful
CamperBot
@camperbot
Aug 30 2015 14:00
james-becker sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 289 | @iashraful | http://www.freecodecamp.com/iashraful
Moisés Man
@moigithub
Aug 30 2015 14:03
This message was deleted
wiki globals
CamperBot
@camperbot
Aug 30 2015 14:07
no wiki entry for: globals
:pencil: click here to create one now!after creating your page type update to reload it here
Moisés Man
@moigithub
Aug 30 2015 14:08
wiki bad global
CamperBot
@camperbot
Aug 30 2015 14:08
no wiki entry for: bad global
:pencil: click here to create one now!after creating your page type update to reload it here
Vilva
@albertovilva
Aug 30 2015 14:08
code test code
test
Moisés Man
@moigithub
Aug 30 2015 14:09
wiki global variables
CamperBot
@camperbot
Aug 30 2015 14:09
no wiki entry for: global variables
:pencil: click here to create one now!after creating your page type update to reload it here
Vilva
@albertovilva
Aug 30 2015 14:09
function titleCase(str) {
  str = str.split(" "); 

  for (var i=1; i <str.length;i++){
     for (var j=0;i < str[i].length; j++){
       if (j == 0){
       str[i][j] = str[i][j].toUpperCase();
       }else{
       str[i][j] = str[i][j].toLowerCase();  
       }
     }
  }  

  return str;
}
Can someone help with this? its supposed to capitalize the first letter of each word in a string
and turn to lowercase the rest, but its not working
Bonfire: Title Case a Sentence
CamperBot
@camperbot
Aug 30 2015 14:10

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

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

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Aug 30 2015 14:12
wiki global variables
CamperBot
@camperbot
Aug 30 2015 14:12
no wiki entry for: global variables
:pencil: click here to create one now!after creating your page type update to reload it here
Moisés Man
@moigithub
Aug 30 2015 14:12
update
CamperBot
@camperbot
Aug 30 2015 14:12
updating wiki...
Updating f7f944f..d57a9b4 Fast-forward
Write-and-Run-ES6-Code-in-Browser.md | 6 +++++- global-variables.md | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 global-variables.md
done code: 0
:computer:
Moisés Man
@moigithub
Aug 30 2015 14:13
wiki global variables
CamperBot
@camperbot
Aug 30 2015 14:13

:point_right: global variables [wiki]

you should ALWAYS use var to declare your variables (to make locally) else it will install GLOBALLY

http://www.w3.org/wiki/JavaScript_best_practices#Avoid_globals

http://c2.com/cgi/wiki?GlobalVariablesAreBad
:pencil: read more about global variables on the FCC Wiki

Moisés Man
@moigithub
Aug 30 2015 14:26
@james-becker in case u didnt fixed yet...
the problem is here arr.slice(i, (size + i))
slice extract/copy part of an array.. and have 2 parameters
(startPosition, howManyCharacters)
.... so if u have size=2 and increment+i ...
Antun Badurina
@Namdeus
Aug 30 2015 14:57
I'm doing the Random Quote Generator zipline, but I can't get the JSON with .getJSON because of the No 'Access-Control-Allow-Origin' header is present on the requested resource.. How do I work around it? There is this thing called JSONP, should I look into that?
Abhisek Pattnaik
@abhisekp
Aug 30 2015 14:58
@Namdeus use JSONP but someone else can help you there.
Antun Badurina
@Namdeus
Aug 30 2015 15:02
@abhisekp Will do. On freeCodeCampp homepage I can see that there ought to be JSON APIs and AJAX lessons soon.
Craig McKenna
@craigdmckenna
Aug 30 2015 15:08
@Namdeus I'm not absolutely sure but I think that .getJSON assumes JSONP unless you specify otherwise. I have been researching this and it seems the the method used by .getJSON is blocked by some servers.

There is a lot of conflicting information out there regarding .getJSON
Most explanations I have seen claim that it is just a shorthand version of .ajax.
Others say that it is not and that it is equivalent to a cross server/cross domain script call.

Maybe someone else can help clarify?

Craig McKenna
@craigdmckenna
Aug 30 2015 15:16
i'm beginning to wonder if using JQuery for XMLHttpRequest is pointless. Maybe using native JS is a better choice?
MD Arefin Saad
@arefinsaaad
Aug 30 2015 15:16
hlw ...everyone
Craig McKenna
@craigdmckenna
Aug 30 2015 15:16
Howdy @arefinsaaad
Antun Badurina
@Namdeus
Aug 30 2015 15:18
@CraigMcKenna I tried it on a couple of APIs in codepen.io and none of them seem to work. I'm new to this so maybe it's some kind of logical or syntax error (or some kind of brain fart). I'll try with native approach. Thank you!
CamperBot
@camperbot
Aug 30 2015 15:18
namdeus sends brownie points to @craigmckenna :sparkles: :thumbsup: :sparkles:
:star: 199 | @craigmckenna | http://www.freecodecamp.com/craigmckenna
Craig McKenna
@craigdmckenna
Aug 30 2015 15:19
@Namdeus- Did you try JQuery .ajax?
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 15:19
need help with the bonfire, Chunky Monkey
CamperBot
@camperbot
Aug 30 2015 15:19
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Antun Badurina
@Namdeus
Aug 30 2015 15:22
@CraigMcKenna I'm still reading all the info :)
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:22
bf chunky
CamperBot
@camperbot
Aug 30 2015 15:22

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

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

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:22
@AmmarAliShah :point_up: August 30, 2015 8:52 PM
Robert Richey
@0x0936
Aug 30 2015 15:29
@Namdeus I had similar issues yesterday with random quote generator. JSONP is what will make that work.
Den McHenry
@denmch
Aug 30 2015 15:29
You can chunk that monkey in a similar way with either .slice() or .splice()
Korim Uddin
@Kayzon00
Aug 30 2015 15:32
hey guys, a little stuck on my second lesson here
Vanja Valent
@walent021
Aug 30 2015 15:33
Hey. Bonfire Return largest number of four shows cannot read property of 'eql' undefined
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:33
@walent021 you code pls
explain code form
CamperBot
@camperbot
Aug 30 2015 15:33

: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

Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:33
@walent021 :point_up: August 30, 2015 9:03 PM
Vanja Valent
@walent021
Aug 30 2015 15:34
It shows that with the default code also
JSBin works
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 15:35
bf chunky
CamperBot
@camperbot
Aug 30 2015 15:35

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

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

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:35
@walent021 could you pls show your code for sake of pure happiness to our mind.
Ammar Ali Shah
@AmmarAliShah
Aug 30 2015 15:35
hint
CamperBot
@camperbot
Aug 30 2015 15:35
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Vanja Valent
@walent021
Aug 30 2015 15:35
function largestOfFour(arr) {
  var ls1=0;
  var ls2=0;
  var ls3=0;
  var ls4=0;


  for (i=0; i<4; i++) {

    if (arr[0][i] > ls1) { ls1 = arr[0][i];}
  }

  for (i=0; i<4; i++) {

    if (arr[1][i] > ls2) { ls2 = arr[1][i];}
  }
  for (i=0; i<4; i++) {

    if (arr[2][i] > ls3) { ls3 = arr[2][i];}
  }
  for (i=0; i<4; i++) {

    if (arr[3][i] > ls4) { ls4 = arr[3][i];}
  }
  var final = [ls1,ls2,ls3,ls4];
  return final;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Robert Richey
@0x0936
Aug 30 2015 15:36
@Kayzon00 link to lesson and post your code or the specific issue you're having
@walent021 If I remember correctly, there are other tests that don't necessarily use 4 numbers in each array.
Tim
@timmcallister
Aug 30 2015 15:38
anyone use the openweather api for the weather zipline?
Korim Uddin
@Kayzon00
Aug 30 2015 15:38
Vanja Valent
@walent021
Aug 30 2015 15:39
@0x0936 well then arr[0].length?
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:39
@0x0936 then why does does it say largest of four? :P
bf largest
CamperBot
@camperbot
Aug 30 2015 15:39

: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

Vanja Valent
@walent021
Aug 30 2015 15:40
also @abhisekp any idea?
Robert Richey
@0x0936
Aug 30 2015 15:40
@Kayzon00 for that waypoint, just change it from returning false to returning true
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:40
@0x0936 i think the largestoffour doesn't refer to the four arguments. It refers to the four elems in array.
Robert Richey
@0x0936
Aug 30 2015 15:41
@abhisekp I didn't say it wouldn't use 4 arrays of numbers, I said there may be tests where each array doesn't have 4 numbers in the array
Yan Kozlovskiy
@YanKozlovskiy
Aug 30 2015 15:41
i'm having a problem... the interpreter is saying that string.reverse is not a function
Korim Uddin
@Kayzon00
Aug 30 2015 15:42
0x936. Thanks man, you're a life safer. Just getting used to codecamp's way of teaching from codeacademies :)
CamperBot
@camperbot
Aug 30 2015 15:42
if you want to thank someone, put an @ before their name!
digitalomen
@digitalomen
Aug 30 2015 15:42
it keeps telling me to "myName should be a string that contains at least one character in it" and I have typed my name....
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:42
@0x0936 i'm also getting same thing
Robert Richey
@0x0936
Aug 30 2015 15:42
@walent021 I'm getting the same error. I wonder if there's a server problem at the moment. It's not accepting my correct solution. Cannot read property 'eql' of undefined
Korim Uddin
@Kayzon00
Aug 30 2015 15:42
@camperbot Thanks :)
CamperBot
@camperbot
Aug 30 2015 15:42
kayzon00 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 129 | @camperbot | http://www.freecodecamp.com/camperbot
Moisés Man
@moigithub
Aug 30 2015 15:42
@YanKozlovskiy reverse method its not part of String , but its from Array
Vanja Valent
@walent021
Aug 30 2015 15:42
I know there's a way to simplify and i've tried using for with i and another with j, but i'll have to think harder about that
Yan Kozlovskiy
@YanKozlovskiy
Aug 30 2015 15:43
thanks @moigithub
CamperBot
@camperbot
Aug 30 2015 15:43
yankozlovskiy sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 272 | @moigithub | http://www.freecodecamp.com/moigithub
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:43
@walent021 as @0x0936 says, change your code to account for more than four elements in the inner arrays
Vanja Valent
@walent021
Aug 30 2015 15:44
@abhisekp Just to verify, you're suppoused to take largest number from each array and put them into a new array?
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:44
@walent021 use loops, use length property of array
@walent021 yes
Vanja Valent
@walent021
Aug 30 2015 15:45
@abhisekp @0x0936 Ok thanks, i'll try also hope it gets fixed
CamperBot
@camperbot
Aug 30 2015 15:45
walent021 sends brownie points to @abhisekp and @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 64 | @0x0936 | http://www.freecodecamp.com/0x0936
:star: 345 | @abhisekp | http://www.freecodecamp.com/abhisekp
Patrick McWilliams
@patrickmac110
Aug 30 2015 15:46
can anyone determine why my pane1 and spacer arent staying in place relative to each other?
http://codepen.io/patrcikmac110/pen/xwKXdm
Vanja Valent
@walent021
Aug 30 2015 15:54

@abhisekp ```
function largestOfFour(arr) {
var ls=0;
var biggestArray = [];

for(j=0;j<arr.length; j++){
for (i=0; i<arr[j].length; i++) {

if (arr[j][i] > ls) { ls = arr[j][i];}

}
biggestArray[j] = ls;
}

console.log(biggestArray);
}

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

um
function largestOfFour(arr) {
  var ls=0;
  var biggestArray = [];

for(j=0;j<arr.length; j++){
  for (i=0; i<arr[j].length; i++) {

    if (arr[j][i] > ls) { ls = arr[j][i];}
  }
  biggestArray[j] = ls;
}


  console.log(biggestArray);
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Rajendra kadam
@raju249
Aug 30 2015 15:57
I am having problem completing a challenge on cloud 9 for how-to-npm and challenge is about
Start a project
Please help
Abhisek Pattnaik
@abhisekp
Aug 30 2015 15:57
@walent021 your code is flawed. Check this http://repl.it/BE36
@walent021 fix your code again. It doesn't work correctly if all negative numbers are in the inner array.

@walent021

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

gives output [ 0, 27, 39, 1001 ]
but should give output [ -1, 27, 39, 1001 ]

Vanja Valent
@walent021
Aug 30 2015 16:00
@abhisekp
var ls=Number.NEGATIVE_INFINITY;
That fixes it i think_
Patrick McWilliams
@patrickmac110
Aug 30 2015 16:02
@abhisekp how would I go about optimizing my background images on the two overlapping divs
as you can see to implement the effect with the scrollmagic js I had to go through a few hoops
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:03
@walent021 that can be one way! but try using the Math.max method
Vanja Valent
@walent021
Aug 30 2015 16:04
@abhisekp But basically that's the same thing?
"If no arguments are given, the result is -Infinity."
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:05
@walent021 but i'm suggesting you use functional programming
This message was deleted
CamperBot
@camperbot
Aug 30 2015 16:05
no wiki entry for: fun prog
:pencil: click here to create one now!after creating your page type update to reload it here
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:05
explain functional prog
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:06
@walent021 this is one way to solve it using functional programming paradigm.
function largestOfFour(arr) {
  // You can do this!
  // Yes, I can. :P
  return arr.map(Function.apply.bind(Math.max, null));
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Vanja Valent
@walent021
Aug 30 2015 16:07
@abhisekp oh wow.
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:07
@walent021 don't try to understand it if you can't. Just showing the FP way!
:warning: Don't try that at home. :P
@walent021 but that's not what is expected at this level from you. Just use Math.max method in your own way.
Vanja Valent
@walent021
Aug 30 2015 16:10
@abhisekp I hope i get to that one day. I'm planning on going to programming at uni, but i'm still unsure at this point :)
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:11
@walent021 just stay in FCC
Patrick McWilliams
@patrickmac110
Aug 30 2015 16:18
http://codepen.io/patrcikmac110/pen/xwKXdm
I tried implementing bootsrap on my buttons but it's not expanding to fit the page and it's messing with my name being centered
This message was deleted
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:26
@patrickmac110
Patrick McWilliams
@patrickmac110
Aug 30 2015 16:28
I'm not entirely sure what that means/ or what the point of showing that is
Lux3
@Lux3
Aug 30 2015 16:30
That your images are large and load-time is unreasonably high?
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:31
@patrickmac110 don't focus on the load time bcoz it varies with connection speed.
But focus on the size and the bytes transferred
Patrick McWilliams
@patrickmac110
Aug 30 2015 16:32
I feel that worrying about load times and stuff should be one of the later issues to deal with, I'm trying to just get it looking/working properly and to finish the rest of the page. I only have an animated topbar right now for my page
Abhisek Pattnaik
@abhisekp
Aug 30 2015 16:33
@patrickmac110 that's right but it takes only half min. to optimize the imgs and copy paste the new links. :)
Danny Fritz
@dannyfritz
Aug 30 2015 16:34
It took him 1.8 minutes to load the page. :P
Deep2322
@Deep2322
Aug 30 2015 16:35

@Deep2322
function elipsis(str,num){
if(str.length > num){
var res = str.slice(0,num - 3) + "...";
}
console.log(res);
}

elipsis("The band of brothers episode 6 is yet to start",25);

<p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium tenetur consectetur ipsa quod, cupiditate, debitis quaerat excepturi culpa. Voluptatibus magnam, quibusdam dicta sapiente laboriosam qui.</p>
i want to apply that on p ..how can i do that..?

Ashraful Islam
@iashraful
Aug 30 2015 16:47
uh! am stuck in mongodb
my test run doesn't seem to actually execute my code
Insert Document one
if I try to run it naked, it just throws me a bunch of errors about socket being closed
however, my lovely mongod is actully running
and showing connection open close status
rolanjose7
@rolanjose7
Aug 30 2015 17:00
Guys, i cant decide between Atom and Sublime Text 3...i'm sick of codepen!(and i haven't even done the first waypoint yet)
Justin859
@Justin859
Aug 30 2015 17:05
@rolanjose7 I like atom, its free and you can download custom themes for the ui and the syntax. Im using Adventurous Syntax theme and Seti for the UI theme.
Ashraful Islam
@iashraful
Aug 30 2015 17:05
@rolanjose7 which OS[Win|Lin|Mac]?
Sublime is fast in all OS, Atom severely lags on Windows, brackets is middle of the road
rolanjose7
@rolanjose7
Aug 30 2015 17:13
@Justin859 @iashraful im on ubuntu 14.04
Ashraful Islam
@iashraful
Aug 30 2015 17:16
@rolanjose7 then, Atom is a good choice
atom isn't as stable as I'd like in windows, but linux version seems to be fairly fluid
Justin859
@Justin859
Aug 30 2015 17:17
@rolanjose7 @iashraful same here I guess that's why atom suits me just fine. I moved from windows, I'll admit there was a bit of lag now and then on windows.
rolanjose7
@rolanjose7
Aug 30 2015 17:18
@Justin859 @iashraful so Atom?
Justin859
@Justin859
Aug 30 2015 17:18
@rolanjose7 floats my boat pretty well.
Ashraful Islam
@iashraful
Aug 30 2015 17:19
@rolanjose7 go for it :thumbsup:
rolanjose7
@rolanjose7
Aug 30 2015 17:20
@Justin859 @iashraful ok, thanks guys!
CamperBot
@camperbot
Aug 30 2015 17:20
rolanjose7 sends brownie points to @justin859 and @iashraful :sparkles: :thumbsup: :sparkles:
:star: 181 | @justin859 | http://www.freecodecamp.com/justin859
:star: 290 | @iashraful | http://www.freecodecamp.com/iashraful
Cory Lundgren
@cml0401
Aug 30 2015 17:20
1.345 is not a function
anyone see this error?
var myDecimal = 1.345
nvm, left off the ';'
Valon Haliti
@valonhaliti
Aug 30 2015 17:26
Can someone help me solve this: Bonfire: Return Largest Numbers in Arrays
CamperBot
@camperbot
Aug 30 2015 17:26
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Valon Haliti
@valonhaliti
Aug 30 2015 17:26
:worried:
Ashraful Islam
@iashraful
Aug 30 2015 17:27
bf largest
CamperBot
@camperbot
Aug 30 2015 17:27

: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

Ashraful Islam
@iashraful
Aug 30 2015 17:27
@valonfhaliti where are you stuck?
Valon Haliti
@valonhaliti
Aug 30 2015 17:27
I tried some solutions but they didn't work
Ashraful Islam
@iashraful
Aug 30 2015 17:28
what seems to be the problem specifically?
Valon Haliti
@valonhaliti
Aug 30 2015 17:29
I tried this: function largestOfFour(arr) {
var result = [];
for (var i = 0; i < arr.length; i++) {
result.push(Math.max.apply(Math, arr[i]));
}
return result;
}
Ashraful Islam
@iashraful
Aug 30 2015 17:29
Math.arr?
result.push(Math.max.apply(Math, arr[i]));
your problem is on this line
Math.max.apply(null, some_array)
this is the correct form
Kat
@Mystfreak
Aug 30 2015 17:30
the lesson Waypoint: Use Clockwise Notation to Specify the Margin of an Element for html is not working for me.
is it just me or is there a bug on that section
Ashraful Islam
@iashraful
Aug 30 2015 17:31
no bug when I did it
try again
here is the syntax margin: top right bottom left;
Kat
@Mystfreak
Aug 30 2015 17:31
I am 100% confident i did it right
Valon Haliti
@valonhaliti
Aug 30 2015 17:32
@iashraful what should I write instead of null?
Kat
@Mystfreak
Aug 30 2015 17:32
yes I did that syntax correctly
Ashraful Islam
@iashraful
Aug 30 2015 17:32
please post your code here so I can see if there's some mistake
@valonfhaliti you need to write null as is
Kat
@Mystfreak
Aug 30 2015 17:32
'.green-box {
background-color: green;
margin: 40px 20px 20px 40px;'
Ashraful Islam
@iashraful
Aug 30 2015 17:33
'.green-box {
    background-color: green;
    margin: 40px 20px 20px 40px;'
what did the instruction say?
Kat
@Mystfreak
Aug 30 2015 17:33
yeah how do you get that black box to show up
green box
Ashraful Islam
@iashraful
Aug 30 2015 17:33
I see you have 40px for top, 20px for right, 20px for bottom, 40px for left
Kat
@Mystfreak
Aug 30 2015 17:33
yes
Ashraful Islam
@iashraful
Aug 30 2015 17:33
is that what the instruction wanted?
Kat
@Mystfreak
Aug 30 2015 17:33
yeah
Ashraful Islam
@iashraful
Aug 30 2015 17:34
was there a closing bracket in your code?
.green-box {
    background-color: green;
    margin: 40px 20px 20px 40px;
this doesn't include a closing bracket
Kat
@Mystfreak
Aug 30 2015 17:34
yes
Ashraful Islam
@iashraful
Aug 30 2015 17:34
should be
.green-box {
    background-color: green;
    margin: 40px 20px 20px 40px;
} /* important */
could you please link me to that challenge?
I need to check
Kat
@Mystfreak
Aug 30 2015 17:35
i did that
I am 100% sure it is a bug, I have been looking at it for quite a while noe
*now
from there side
not my side
Michael Krebs
@michael-krebs
Aug 30 2015 17:36
@Mystfreak could you post all of your code
Ashraful Islam
@iashraful
Aug 30 2015 17:36
here is the instruction margin of 40px on its top and left side, but only 20px on its bottom and right side.
Valon Haliti
@valonhaliti
Aug 30 2015 17:37
this works at me
.green-box {
margin: 40px 20px 20px 40px;
}
Ashraful Islam
@iashraful
Aug 30 2015 17:37
so it should work, your class is fine with the instruction
Cory Lundgren
@cml0401
Aug 30 2015 17:37
.green-box {
background-color: green;
margin: 40px 20px 20px 40px;
}
works for me
Kat
@Mystfreak
Aug 30 2015 17:37
i did that code exactly
Ashraful Islam
@iashraful
Aug 30 2015 17:38
works for me too
Kat
@Mystfreak
Aug 30 2015 17:38
why is it not working for me
Ashraful Islam
@iashraful
Aug 30 2015 17:38
@Mystfreak please post your whole code
Kat
@Mystfreak
Aug 30 2015 17:38
maybe firefox browser
Cory Lundgren
@cml0401
Aug 30 2015 17:38
Or, reset the code for that exercise and try again
Kat
@Mystfreak
Aug 30 2015 17:38

.yellow-box {
background-color: yellow;
padding: 20px 40px 20px 40px;
}

.red-box {
background-color:red;
margin: 20px 40px 20px 40px;
}

.green-box {
background-color: green;
margin: 40px 20px 20px 40px;
}

Giacomo
@Jack1618
Aug 30 2015 17:38
Hi guys, can anyone help me? I'm building the random quote machine, and I have issues to make the button get the random text.
This is how I tried, and when the page loads, it shows a random quote, but when I click the button it doesn't do nothing. Any suggests? Thanks!
<div>
  <center><button type = 'button' class = 'btn btn-primary btn-lg title' onclick = 'getARandomQuote(quotes)'>Get the quote!</button></center>
</div>

<div class = 'jumbotron'>
  <center><h2 id = 'quotehere'></h2></center>
</div>



/* --- script --- */

/* --- declaration of an array of quotes --- */


var x = document.getElementById("quotehere"); 
 var quote = getARandomQuote(quotes);

  x.innerHTML = quote[0] + quote[1];


function getARandomQuote(quotes){

  return(quotes[getARandomIndex()]);

  function getARandomIndex(){
  return(Math.floor(Math.random() * (quotes.length - 1)));
  }
}
Kat
@Mystfreak
Aug 30 2015 17:38
I did reset the code
Luis Felipe López G.
@luishendrix92
Aug 30 2015 17:39

Margin/Padding:

TOP - RIGHT - BOTTOM - LEFT (Clockwise)
margin: npx npx npx npx; -> margin: npx;
margin: apx bpx apx bpx; -> margin: apx bpx;
Kat
@Mystfreak
Aug 30 2015 17:39
it must be my browser then
idk
why do you have a dash in between them?
Ashraful Islam
@iashraful
Aug 30 2015 17:40
@Mystfreak works for me
try refreshing your page
Kat
@Mystfreak
Aug 30 2015 17:41
i did
same problem
Ashraful Islam
@iashraful
Aug 30 2015 17:41
I couldn't replicate the problem, using your code
may be something changed ...
Kat
@Mystfreak
Aug 30 2015 17:41
my problem is not the code
but the fact I can press next
can't
Coira Ellison
@Coira
Aug 30 2015 17:42
@Mystfreak does it show any sort of error message?
Luis Felipe López G.
@luishendrix92
Aug 30 2015 17:42
It works better with Chrome, Edge and Opera have a hard time with FCC
Kat
@Mystfreak
Aug 30 2015 17:42
I will try chrome brb
Giacomo
@Jack1618
Aug 30 2015 17:42
FireFox is the Answer.
Ashraful Islam
@iashraful
Aug 30 2015 17:43
@Mystfreak sometimes right-clicking the run/complete button enables it
Kat
@Mystfreak
Aug 30 2015 17:44
same probelme on chrome
*problem
I seriously don't know what is wrong, I am going to just move on then
Ashraful Islam
@iashraful
Aug 30 2015 17:45
@Mystfreak I think you removed some bit of code from the challenge
I mean the seed code
Kat
@Mystfreak
Aug 30 2015 17:46
can you show me all your code
this is my code

<style>
.injected-text {
margin-bottom: -25px;
text-align: center;
}

.box {
border-style: solid;
border-color: black;
border-width: 5px;
text-align: center;
}

.yellow-box {
background-color: yellow;
padding: 20px 40px 20px 40px;
}

.red-box {
background-color:red;
margin: 20px 40px 20px 40px;
}

.green-box {
background-color: green;
}
</style>

<h5 class="injected-text">margin</h5>

<div class="box yellow-box">
<h5 class="box red-box">padding</h5>
<h5 class="box green-box">padding</h5>
</div>

omg
Coira Ellison
@Coira
Aug 30 2015 17:48
there's no margin code in .green-box there
Kat
@Mystfreak
Aug 30 2015 17:48
I am so stupid
I ran the code
and guess what it works now
Ashraful Islam
@iashraful
Aug 30 2015 17:49
yes, after adding the margin, it works
Kat
@Mystfreak
Aug 30 2015 17:49
since when do you need to press the run button in order for it to work
is this a new update
Ashraful Islam
@iashraful
Aug 30 2015 17:50
@Mystfreak this is a new update :)
also the previous tests would have needed the run button, otherwise you would've not passed 'em
Kat
@Mystfreak
Aug 30 2015 17:50
is there no next button
guess what
eventhough I have ticks it is still not passing me
Giacomo
@Jack1618
Aug 30 2015 17:51
guys please I'm really stuck on that :worried:
Coira Ellison
@Coira
Aug 30 2015 17:51
try click run again?
for some reason i have to submit twice to get it to move on
Kat
@Mystfreak
Aug 30 2015 17:52
thank you coira
CamperBot
@camperbot
Aug 30 2015 17:52
if you want to thank someone, put an @ before their name!
Coira Ellison
@Coira
Aug 30 2015 17:52
np, i think it must be a bug
Ashraful Islam
@iashraful
Aug 30 2015 17:52
@Jack1618 where are you stuck?
Kat
@Mystfreak
Aug 30 2015 17:53
don't tell me what to do bot
Giacomo
@Jack1618
Aug 30 2015 17:53
I'm building the random quote machine, and I have issues to make the button get the random text.
This is how I tried, and when the page loads, it shows a random quote, but when I click the button it doesn't do nothing. Any suggests? Thanks!
<div>
  <center><button type = 'button' class = 'btn btn-primary btn-lg title' onclick = 'getARandomQuote(quotes)'>Get the quote!</button></center>
</div>

<div class = 'jumbotron'>
  <center><h2 id = 'quotehere'></h2></center>
</div>



/* --- script --- */

/* --- declaration of an array of quotes --- */


var x = document.getElementById("quotehere"); 
 var quote = getARandomQuote(quotes);

  x.innerHTML = quote[0] + quote[1];


function getARandomQuote(quotes){

  return(quotes[getARandomIndex()]);

  function getARandomIndex(){
  return(Math.floor(Math.random() * (quotes.length - 1)));
  }
}
CamperBot
@camperbot
Aug 30 2015 17:53
if you want to thank someone, put an @ before their name!
Kat
@Mystfreak
Aug 30 2015 17:53
no
Valon Haliti
@valonhaliti
Aug 30 2015 17:54
@iashraful I tried with null
function largestOfFour(arr) {
  var result = [];
  for (var i = 0; i < arr.length; i++) {
    result.push(Math.max.apply(null, arr[i]));
  }
  return result;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
But still doesn't work
Ashraful Islam
@iashraful