These are chat archives for FreeCodeCamp/Help

14th
Oct 2015
Brian K
@BKtheDAD
Oct 14 2015 00:00
@bleesand you need it to return true
js-bone21
@js-bone21
Oct 14 2015 00:10
Heyo
Struggling with Bonfire Palindromes...
I replaced all the special characters (well...periods and commas)
And flipped the string via split/reverse/join.
Can't get the regex correct to ignore case...
Ryan
@rmbarley
Oct 14 2015 00:13
@joshsoucie what if the whole String was one case?
js-bone21
@js-bone21
Oct 14 2015 00:14
Poop, that's kinda what I was trying to do...but I was stuck in the mindset of doing it with regex...and "/gi"
.toLowerCase works too...
So close...
Actually...

The last test:

"palindrome("0_0 (: /-\ :) 0-0") should return true."

Ryan
@rmbarley
Oct 14 2015 00:17
"You'll need to remove punctuation" I think I applied that liberally
Hans van Riet
@hansinla
Oct 14 2015 00:17
@joshsoucie You’ll have to replace more than just periods and commas...
Ryan
@rmbarley
Oct 14 2015 00:18
especially since - and _ are not equivalent in my book
Simon
@simonshum
Oct 14 2015 00:18
anyone having issues with chapter3, exercise 12?
creating custom headers w/ annoying bootstrap
Hans van Riet
@hansinla
Oct 14 2015 00:19
@simonshum What is the problem?
Simon
@simonshum
Oct 14 2015 00:19
@hansinla just wont let me pass
Ryan
@rmbarley
Oct 14 2015 00:19
I just opened it up, and although I already passed it, my code no longer works
Hans van Riet
@hansinla
Oct 14 2015 00:20
@simonshum Can you paste your code?
Simon
@simonshum
Oct 14 2015 00:20
:quote: <div class="row" <div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
:quote:
guess quotes dont work here
Hans van Riet
@hansinla
Oct 14 2015 00:20
@simonshum you’l have to use three single ticks "```"
Marcos
@marcosmohar
Oct 14 2015 00:21
@simonshum by the looks of it, you seem to be missing a '>' after class="row"
Simon
@simonshum
Oct 14 2015 00:21
''' <div class="row" <div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>'''
CamperBot
@camperbot
Oct 14 2015 00:21
:bulb: to format code use backticks! ``` more info
Simon
@simonshum
Oct 14 2015 00:21
<div class="row" <div class="col-xs-8"> <h2 class="text-primary text-center">CatPhotoApp</h2> </div> <div class="col-xs-4"> <a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> </div> </div>
Hans van Riet
@hansinla
Oct 14 2015 00:21
@simonshum Your problem is in your first line
Barna Farkas
@bearbox
Oct 14 2015 00:22
3 ticks before, enter, then paste, then enter, then 3 ticks
Hans van Riet
@hansinla
Oct 14 2015 00:22
wiki format
CamperBot
@camperbot
Oct 14 2015 00:22

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Barna Farkas
@bearbox
Oct 14 2015 00:22
@simonshum First things first close your first <div>
Simon
@simonshum
Oct 14 2015 00:23
ah!
oops haha spelling mistake
thanks guys!
CamperBot
@camperbot
Oct 14 2015 00:23
if you want to thank someone, put an @ before their name!
Simon
@simonshum
Oct 14 2015 00:24
thanks @bearbox @hansinla @camperbot
CamperBot
@camperbot
Oct 14 2015 00:24
simonshum sends brownie points to @bearbox and @hansinla and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 349 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 172 | @bearbox | http://www.freecodecamp.com/bearbox
:star: 528 | @hansinla | http://www.freecodecamp.com/hansinla
js-bone21
@js-bone21
Oct 14 2015 00:27
Ahhh, ok, I thought that weird 0's and underscores were also supposed to be a palindrome...aight got it.
Thanks @rmbarley
CamperBot
@camperbot
Oct 14 2015 00:27
joshsoucie sends brownie points to @rmbarley :sparkles: :thumbsup: :sparkles:
:star: 196 | @rmbarley | http://www.freecodecamp.com/rmbarley
Blee
@bleesand
Oct 14 2015 00:36
@samosale and @bkthegeek thanks!
CamperBot
@camperbot
Oct 14 2015 00:36
bleesand sends brownie points to @samosale and @bkthegeek :sparkles: :thumbsup: :sparkles:
:star: 339 | @samosale | http://www.freecodecamp.com/samosale
:star: 182 | @bkthegeek | http://www.freecodecamp.com/bkthegeek
Garrett Schultz
@garettschultz
Oct 14 2015 00:41
where can i practice javascript? are there any websites out there where you can run code and see the live result?
Ryan
@rmbarley
Oct 14 2015 00:44
@gratschultz2013 besides FreeCodeCamp, there's codecademy.com
and codeschool.com
Garrett Schultz
@garettschultz
Oct 14 2015 00:46
no, im not talking about another code camp. im talking about just a place where i can write my own code and just have fun with it to see if different things work? like a javascript playground
Blee
@bleesand
Oct 14 2015 00:47
@gratschultz2013 fiddle great. you write your code in Javascript, css, html in each window and you see the result in the fourth one. https://jsfiddle.net/
Garrett Schultz
@garettschultz
Oct 14 2015 00:48
i tried that and when i click ""run" nothing happens
Marcos
@marcosmohar
Oct 14 2015 00:48
@gratschultz2013 if you only want to use JS you could try https://repl.it
Garrett Schultz
@garettschultz
Oct 14 2015 00:49
thank you @marcosmohar thats EXACTLY what i was looking for I will be book marking this now.
CamperBot
@camperbot
Oct 14 2015 00:49
gratschultz2013 sends brownie points to @marcosmohar :sparkles: :thumbsup: :sparkles:
:star: 116 | @marcosmohar | http://www.freecodecamp.com/marcosmohar
Blee
@bleesand
Oct 14 2015 00:50
@marcosmohar thank you too. sweet tool!
CamperBot
@camperbot
Oct 14 2015 00:50
bleesand sends brownie points to @marcosmohar :sparkles: :thumbsup: :sparkles:
:star: 118 | @marcosmohar | http://www.freecodecamp.com/marcosmohar
Hélio Guilherme
@HelioGuilherme66
Oct 14 2015 01:01
bf falsy bouncer
CamperBot
@camperbot
Oct 14 2015 01:01
Sorry, can't find a bonfire called falsy bouncer. [ Check the map? ]
Hélio Guilherme
@HelioGuilherme66
Oct 14 2015 01:02
help bonfire-falsy-bouncer
CamperBot
@camperbot
Oct 14 2015 01:02
Sorry, can't find a bonfire called falsy bouncer. [ Check the map? ]
Hélio Guilherme
@HelioGuilherme66
Oct 14 2015 01:04
help bonfire-falsy-bouncer
Damani Turner
@AdamBrashear
Oct 14 2015 01:14
hey guys, im stuck on the beginning waypoint: size your images. I am trying to get the cat image down to 100 pixels, but i cant seem to get the code righ. cna someone take a look and explain what i didn wrong?
<img scr="..." style= .smaller-image { width:100px;}
Mida
@Midaysa
Oct 14 2015 01:17
You write scr it is src
Edper
@edper
Oct 14 2015 01:17
jsfiddle.net and jsbin.com also @gratschultz2013 is a good one.
what have you got so far in falsy-bouncer @HelioGuilherme66 ?
help bf falsy bouncer
CamperBot
@camperbot
Oct 14 2015 01:18
no wiki entry for: bf bouncer
:pencil: click here to create one now!after creating your page type update to reload it here
m-farooqui
@m-farooqui
Oct 14 2015 01:20
hi everyone i am trying to import a font -family into my css document the instructions is gave me a link for google and told me to import it into the document using the link which i did but it says to use the imported font for the heading which i have hard time doing can someone help?
Marcos
@marcosmohar
Oct 14 2015 01:23
@AdamBrashear you are supossed to add <style></style> tags above your code, and inside those tags write .smaller-image {width: 100px}; then you just need to add a
class="smaller-image" inside the <img> tag
ralphdriandu
@ralphdriandu
Oct 14 2015 01:27
"Nest your i element within your button element." how to program this? im stuck? someone help me?
Brian K
@BKtheDAD
Oct 14 2015 01:28
help factorialize a number
CamperBot
@camperbot
Oct 14 2015 01:28

:point_right: bonfire factorialize a number [wiki]

The problem

Return the factorial of the provided integer. If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

Factorials are often represented with the shorthand notation n!

For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f

:pencil: read more about bonfire factorialize a number on the FCC Wiki

rafid059
@rafid059
Oct 14 2015 01:39
Hi there @HelioGuilherme66 ! DId you complete the bonfire: Falsy Bouncer? I am stuck too
Kian Jones
@AtomicWasp22
Oct 14 2015 01:41
Hey, I need help with the Least Common Multiple Bonfire
CamperBot
@camperbot
Oct 14 2015 01:41
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Kian Jones
@AtomicWasp22
Oct 14 2015 01:41
Smallest Common Multiple
bonfire name
CamperBot
@camperbot
Oct 14 2015 01:41
no, type part of the name of the bonfire! eg bonfire roman
Kian Jones
@AtomicWasp22
Oct 14 2015 01:41
bonfire common multiple
CamperBot
@camperbot
Oct 14 2015 01:41

: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

Kian Jones
@AtomicWasp22
Oct 14 2015 01:42
hint
CamperBot
@camperbot
Oct 14 2015 01:42
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Zoe
@BlackADeath
Oct 14 2015 01:43
bf return largest numbers in arrays
CamperBot
@camperbot
Oct 14 2015 01:43

: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

Thomas Manchester
@Eruditious
Oct 14 2015 01:47
hint
CamperBot
@camperbot
Oct 14 2015 01:47
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Blee
@bleesand
Oct 14 2015 01:51
@bkthegeek are you still looking for help with factorial
Korry Williams
@korrywill
Oct 14 2015 02:01
I’m trying to select random numbers from a string and append the random selections to a separate string. Anyone have a idea of a solution?
Henrique Cansela
@henriquetsc
Oct 14 2015 02:06
Hello guys!
Travis
@TravisHi
Oct 14 2015 02:07
hiya @henriquetsc
Henrique Cansela
@henriquetsc
Oct 14 2015 02:08
Hi @TravisHi
Can someone help me with this bonfire? I don't know how to link it here also /shame
CamperBot
@camperbot
Oct 14 2015 02:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Travis
@TravisHi
Oct 14 2015 02:09
just copy paste it between ``` then (shift + enter) paste your code in
shift enter again
close with ``` on its own line
Henrique Cansela
@henriquetsc
Oct 14 2015 02:10
Thanks @TravisHi. I am trying to capitalize my text, but i can't put it on a Title case ç.ç
CamperBot
@camperbot
Oct 14 2015 02:10
henriquetsc sends brownie points to @travishi :sparkles: :thumbsup: :sparkles:
:star: 222 | @travishi | http://www.freecodecamp.com/travishi
Henrique Cansela
@henriquetsc
Oct 14 2015 02:11
I even tried something different of what i am supposed to do with charAt
Travis
@TravisHi
Oct 14 2015 02:11
Ah, I haven't worked that one out yet :/
where's @SaintPeter when you need him
SaintPeter @SaintPeter appears in a puff of smoke
Rex Schrader
@SaintPeter
Oct 14 2015 02:12
WHO DARES SUMMON ME?
@TravisHi 'sup?
Travis
@TravisHi
Oct 14 2015 02:12
:O
bows
Henrique Cansela
@henriquetsc
Oct 14 2015 02:13
function titleCase(str) {
  return str.toLowerCase().replace(/\b\w/g, function(m) { return m.toUpperCase(); });
}
Hi @SaintPeter hahah
:bow:
Rex Schrader
@SaintPeter
Oct 14 2015 02:13
@henriquetsc That looks pretty slick - does it work?
Henrique Cansela
@henriquetsc
Oct 14 2015 02:13
Actually yes, but not completely...
Rex Schrader
@SaintPeter
Oct 14 2015 02:14
@henriquetsc Which test case does it fail?
Henrique Cansela
@henriquetsc
Oct 14 2015 02:14
But i found this regEx on my research, but it not works completely, when i have I'm for example
I'm a little tea pot
@SaintPeter i get I'M a..
But i really want to know how can i use charAt in this case...
Travis
@TravisHi
Oct 14 2015 02:15
what if you put ' in the regex?
Rex Schrader
@SaintPeter
Oct 14 2015 02:15
@henriquetsc Yeah, \b matches non word characters.
Henrique Cansela
@henriquetsc
Oct 14 2015 02:16
@SaintPeter yes
Rex Schrader
@SaintPeter
Oct 14 2015 02:16
@henriquetsc I'm not 100% sure if there is a way around that. I'd play around on http://regex101.com and see if I could come up with something. There might be a way to match \b but not puctuation.
Henrique Cansela
@henriquetsc
Oct 14 2015 02:16
@TravisHi i could do that, but if i think outside the test-cases, i would have to add a treatament for everything =/
DJ
@qualitymanifest
Oct 14 2015 02:16
@SaintPeter ha i'm doing that right now
Travis
@TravisHi
Oct 14 2015 02:17
I see @henriquetsc
(I'm just guessing)
Henrique Cansela
@henriquetsc
Oct 14 2015 02:17
I am working on this for a week..
Rex Schrader
@SaintPeter
Oct 14 2015 02:17
@henriquetsc Ok, here is the definition for \b: (^\w|\w$|\W\w|\w\W)
Henrique Cansela
@henriquetsc
Oct 14 2015 02:17
@TravisHi actually is a good idea, thanks ^^
CamperBot
@camperbot
Oct 14 2015 02:17
henriquetsc sends brownie points to @travishi :sparkles: :thumbsup: :sparkles:
:warning: henriquetsc already gave travishi points
Travis
@TravisHi
Oct 14 2015 02:17
educated guessing
haha, I just wana see if I was right
Rex Schrader
@SaintPeter
Oct 14 2015 02:18
@henriquetsc Maybe there is a way to modify that and find something that matches a but more specifically
Travis
@TravisHi
Oct 14 2015 02:18
I'm assuming the regex does something funky with the '
DJ
@qualitymanifest
Oct 14 2015 02:18
too bad you can't use negative lookbehind in javascript regex
Rex Schrader
@SaintPeter
Oct 14 2015 02:18
Well, it's the \W\w that is matchthing the '
Henrique Cansela
@henriquetsc
Oct 14 2015 02:20
@TravisHi it probably does
@SaintPeter yes, i will try to find some escape
Brian K
@BKtheDAD
Oct 14 2015 02:26
@bleesand I got it, but maybe you can help clarify
function factorialize(num) {
  var factor = 1;
  for(var i = 1; i <= num; i++) {
    factor = factor * i;
  }
  return factor;
}

factorialize(5);
why do i have to declare factor = 1 at the begining of the function?
Brian K
@BKtheDAD
Oct 14 2015 02:34
because if i'm understanding it right it starts of as if you factorialize 5 then it should = 120, but as I see it "11=1" then "12=2" then "23=6" then "34=12" and then "4*5=20" I know that's incorrect, but can someone explain it to me.
"11=1" then "12=2" then "23=6" then "34=12" and then "4*5=20"
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:37
@bkthegeek 12345 12 = 2 3 = 6 4 = 24 5 =120
DJ
@qualitymanifest
Oct 14 2015 02:37
@bkthegeek 11=1, 12=2, 23=6, 64=24, 245=120
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:37
the astric is not working...
Brian K
@BKtheDAD
Oct 14 2015 02:37
yeah it wasn't for me either
DJ
@qualitymanifest
Oct 14 2015 02:37
asteriscs in here surrounding something make them italic
its just part of the markup
Brian K
@BKtheDAD
Oct 14 2015 02:37
haha okay
now i get it
i was doing my arithmatic wrong
DJ
@qualitymanifest
Oct 14 2015 02:38
hey it's good you're trying to really understand it
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:38
1x2x3x4x5 = 120 the x's should work
1x2 = 2 x3 = 6 x4 = 24 x 5 =120
Brian K
@BKtheDAD
Oct 14 2015 02:39
1 x1 = 1, 1x2 = 2, 2x3=6,6x4=24,24x5=120
thank you @qualitymanifest @TheDukeOfAwesome
CamperBot
@camperbot
Oct 14 2015 02:39
bkthegeek sends brownie points to @qualitymanifest and @thedukeofawesome :sparkles: :thumbsup: :sparkles:
:star: 271 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 224 | @thedukeofawesome | http://www.freecodecamp.com/thedukeofawesome
Brian K
@BKtheDAD
Oct 14 2015 02:39
I was thinking that the factor would follow the i
but now I got it
!
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:42
Great!
rafid059
@rafid059
Oct 14 2015 02:42
This message was deleted
Damani Turner
@AdamBrashear
Oct 14 2015 02:44
Hey everyone. Im trying to change the href attribute to the # symbol, but when i replace it and run the test, I cant complete the challenge. Am i doing something worng?
Herman Fassett
@HermanFassett
Oct 14 2015 02:44
Hey @AdamBrashear please share your code
rafid059
@rafid059
Oct 14 2015 02:45
need help. previously there were test cases on the left pane of the page. Now it only shows "chai is not defined. Program execution failure". I'm doing Bonfire: Falsy Bouncer
CamperBot
@camperbot
Oct 14 2015 02:45
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Damani Turner
@AdamBrashear
Oct 14 2015 02:45
<p> click here for <a#="..."> cat photos</a> </p>
Herman Fassett
@HermanFassett
Oct 14 2015 02:46
Ok @AdamBrashear your # should be inside an href attribute
Damani Turner
@AdamBrashear
Oct 14 2015 02:46
so it should be href=#="..."?
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:46
@AdamBrashear <a href="#">Link Text</a>
Herman Fassett
@HermanFassett
Oct 14 2015 02:46
For instance <a href="attribute stuff">. The href must be there to specify the attribute type and the # must go inside the quotes
Damani Turner
@AdamBrashear
Oct 14 2015 02:46
ohhhhh
I understand now. Thanks guuy"s!
CamperBot
@camperbot
Oct 14 2015 02:47
if you want to thank someone, put an @ before their name!
Damani Turner
@AdamBrashear
Oct 14 2015 02:47
thank you @TheDukeOfAwesome @HermanFassett
CamperBot
@camperbot
Oct 14 2015 02:47
adambrashear sends brownie points to @thedukeofawesome and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 225 | @thedukeofawesome | http://www.freecodecamp.com/thedukeofawesome
:star: 361 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Brian K
@BKtheDAD
Oct 14 2015 02:51
help palindrome
CamperBot
@camperbot
Oct 14 2015 02:51

:point_right: bonfire check for palindromes [wiki]

Explanation:

You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

:pencil: read more about bonfire check for palindromes on the FCC Wiki

Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:53
@bkthegeek That one was a pain for me
Herman Fassett
@HermanFassett
Oct 14 2015 02:53
That one's kinda fun though
fun e nuf
Brian K
@BKtheDAD
Oct 14 2015 02:53
haha, @HermanFassett
Herman Fassett
@HermanFassett
Oct 14 2015 02:54
:P
Brian K
@BKtheDAD
Oct 14 2015 02:54
i'll let you guys know when i need help
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:54
it was all fun until
palindrome("0_0 (: /-\\ :) 0-0")
Travis
@TravisHi
Oct 14 2015 02:54
lol
Brian K
@BKtheDAD
Oct 14 2015 02:54
here's what I have so far, let me know if I'm on the right track
function palindrome(str) {
  // Good luck!
  var array = str;
  array = array.split("").reverse().join("")
    if str = array {
      return true
    }
    else {
      return false
    }
}



palindrome("eye");
Herman Fassett
@HermanFassett
Oct 14 2015 02:54
Well you need to deal with the punctuation removal
But otherwise it looks pretty great
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:55
And also lower case
Herman Fassett
@HermanFassett
Oct 14 2015 02:55
^ yes and that
Brian K
@BKtheDAD
Oct 14 2015 02:55
k
Herman Fassett
@HermanFassett
Oct 14 2015 02:55
Also your if statement is wrong syntax
And you could just remove the if else and replace with
return str === array;
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:56
mine looked like this
lcnsstr = lcnsstr.toLowerCase();
var array2 = lcnsstr.split('');
array2 = array2.reverse();

  str2 = array2.join('');
  if (lcnsstr === str2){
  return true} else {return false};
But I also have like a dozen replaces above to remove all punctuation
Herman Fassett
@HermanFassett
Oct 14 2015 02:57
All it takes is one regex replace
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:57
I am not a master at regex yet so there are lots of single lines in my code.
rafid059
@rafid059
Oct 14 2015 02:58
Hi guys. Need help. I'm working on Bonfire: Falsy bouncer but the page is not downloading the libraries jquery, bootstrap, angular, ui-bootstrap, moment.js, d3.js and chai.js. I looked up the dev console and it shows error code 403 for these files. Because of this I'm not able to submit the code and continue. Help please?
Herman Fassett
@HermanFassett
Oct 14 2015 02:58
:/ I'm not a master at regex, but it's incredibly useful for something like this
And using something like https://regex101.com/ helps a lot
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 02:58
@rafid059 try saving your code out to note pad and refreshing hte page.
Brian K
@BKtheDAD
Oct 14 2015 02:59
=== means they have to be the same...correct?
Herman Fassett
@HermanFassett
Oct 14 2015 02:59
The same type yes
rafid059
@rafid059
Oct 14 2015 02:59
I refreshed the page, disabled the extensions like Privacy Badger and still nothing
bruglesco
@bruglesco
Oct 14 2015 03:00
same type and same value
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 03:00
@rafid059 this may sound stupid, make sure javascript is enabled. If you flipped browsers that may be the isssue. if not that, let me know
@rafid059 If it is not that then reboot PC/Router. might be a DNS issue.
Hans van Riet
@hansinla
Oct 14 2015 03:03
@rafid059 loads fine here.
Brian K
@BKtheDAD
Oct 14 2015 03:11
function palindrome(str) {
  str = str.toLowerCase();
  var string = str;
  array = string.split("").reverse().join("")
    if (array === str) {
      return true} else {return false};
}

palindrome("eye");
where am I going wrong
do I need to split up my code?
Herman Fassett
@HermanFassett
Oct 14 2015 03:11
You still need to remove punctuation
str = str.replace(/regex/, "");
Brian K
@BKtheDAD
Oct 14 2015 03:15
@HermanFassett can you explain regex to me or do you have a good article about it
i keep trying to understand it, but everything i find just dives into the use/context
Greg Duncan
@GregatGit
Oct 14 2015 03:15
how do put code snippets in like @bkthegeek has above?
bruglesco
@bruglesco
Oct 14 2015 03:15
wiki format
CamperBot
@camperbot
Oct 14 2015 03:15

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Hans van Riet
@hansinla
Oct 14 2015 03:15
wiki format
CamperBot
@camperbot
Oct 14 2015 03:15

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Herman Fassett
@HermanFassett
Oct 14 2015 03:16
Brian K
@BKtheDAD
Oct 14 2015 03:16
@HermanFassett thanks
CamperBot
@camperbot
Oct 14 2015 03:16
bkthegeek sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 364 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
rafid059
@rafid059
Oct 14 2015 03:18
@TheDukeOfAwesome "The owner of this website (cdnjs.cloudflare.com) has banned your IP address (xxx.xxx.xxx.xxx)."
@TheDukeOfAwesome Using vpn to change my ip address and it works fine now :)
Herman Fassett
@HermanFassett
Oct 14 2015 03:20
:P
Or change ip if not static... VPN can be a pain
Zoe
@BlackADeath
Oct 14 2015 03:21
VPN's are a pain yet Onion is worse.
Herman Fassett
@HermanFassett
Oct 14 2015 03:22
xD idk
Carl J. Kashnier
@CarlJKashnier
Oct 14 2015 03:29
No problems
vere perrot
@perrot
Oct 14 2015 03:30

Hi friends,
I am get stuck in unit "Waypoint: Get Set for Basejumps" for a several days.
I paste command "rm -rf * && echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack" and follow the checkbox 11.
Then got a message:

Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ No .bowerrc file in home directory
✖ Node.js version

Your Node.js version is outdated.
✔ No .yo-rc.json file in home directory
✖ npm version

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm

✔ NODE_PATH matches the npm root

Found potential issues on your machine :(

Then I update node.js by the command "npm install -g n". Get another message in the terminal.

npm ERR! EEXIST, open '/home/ubuntu/.npm/5c733ef3-ntu-npm-lodash-2-4-2-package-tgz.lock'
File exists: /home/ubuntu/.npm/5c733ef3-ntu-npm-lodash-2-4-2-package-tgz.lock
Move it away, and try again. 

npm ERR! System Linux 3.14.13-c9
npm ERR! command "/home/ubuntu/.nvm/v0.10.35/bin/node" "/home/ubuntu/.nvm/v0.10.35/bin/npm" "install" "-g" "yo" "grunt" "grunt-cli" "generator-angular-fullstack"
npm ERR! cwd /home/ubuntu/workspace
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! path /home/ubuntu/.npm/5c733ef3-ntu-npm-lodash-2-4-2-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0

Have any idea?

Greg Duncan
@GregatGit
Oct 14 2015 03:30
function destroyer(arr) {
  // Remove all the values
  var target = arguments[0];

  var len = arguments.length;
  var toPurge = [];
  for (var i = 1; i < len; i++){
    toPurge.push(arguments[i]);
  }
  var toReturn = target.filter(mustRemove);

  function mustRemove(value) {
  return value !== toPurge[1] && value !== toPurge[0];
  }
  return toReturn;
}
Hans van Riet
@hansinla
Oct 14 2015 03:31
@perrot Many people have enncountered this problem. Pretty soon now, we will be using ClementineJS and the modified lesson will come online shortly.
Greg Duncan
@GregatGit
Oct 14 2015 03:31
I can only do this by hard coding the purge values - how would I go about using multiple values
vere perrot
@perrot
Oct 14 2015 03:32
@hansinla Thank you for your information. I got it.
CamperBot
@camperbot
Oct 14 2015 03:32
perrot sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 529 | @hansinla | http://www.freecodecamp.com/hansinla
Greg Duncan
@GregatGit
Oct 14 2015 03:33
As long as there are 1 or 2 values to purge it works
Hans van Riet
@hansinla
Oct 14 2015 03:33
@Ithinkthatisme Load the other arguments and use them to delete those values from your target.
Brian K
@BKtheDAD
Oct 14 2015 03:38
function palindrome(str) {
  str = str.toLowerCase().replace(/\W+/g,"");
  var string = str;
  array = string.split("").reverse().join("")
    if (str === array) {
      return true} else {return false};
}

palindrome("race car");
I can get all but the last one to work using this
palindrome("0_0 (: /-\ :) 0-0")
palindrome("0_0 (: /-\\ :) 0-0")
Brian Barrow
@briancbarrow
Oct 14 2015 03:39
For some reason, my buttons aren't working on my portfolio zipline. Here is the code for one of the buttons. When I click on them, it takes me nowhere.
<a href="https://www.linkedin.com/in/barrowbrian" class="btn btn-default 
btn-lg black-words social-btn">
            <i class="fa fa-linkedin fa-fw"></i> LinkedIn
          </a>
Ian Barker
@IanBarkerDev
Oct 14 2015 03:40
@bkthegeek \w = [a-zA-Z0-9_]
Greg Duncan
@GregatGit
Oct 14 2015 03:44
@bkthegeek make the return array and then str to see the difference
Hans van Riet
@hansinla
Oct 14 2015 03:47
@briancbarrow if you’re on codepen, you need to include target=“_blank” in your <a> tag.
Brian K
@BKtheDAD
Oct 14 2015 03:51
here's my code
function palindrome(str) {
  str = str.toLowerCase().replace(/[\W_]/g,"");//replace uses regex: check regex101.com
  var string = str;
  array = string.split("").reverse().join("")
  if (str === array) {
      return true} else {return false};
}

palindrome("0_0 (: /-\\ :) 0-0");
the only thing I don't understand is with regex what the "[]" do and what the "_" does
Herman Fassett
@HermanFassett
Oct 14 2015 03:53
_ is needed since it's counted as alphanumeric do to its common use in variable names or similar
[ ] just say each of these instead of this whole expression
Brian K
@BKtheDAD
Oct 14 2015 03:53
so it looks for the underscore specifically
Herman Fassett
@HermanFassett
Oct 14 2015 03:53
So you could also do /\W|_/g where | means or
Yeah, underscore literal
Brian Barrow
@briancbarrow
Oct 14 2015 03:53
thanks @hansinla . It worked
CamperBot
@camperbot
Oct 14 2015 03:53
briancbarrow sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 530 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Oct 14 2015 03:54
@briancbarrow it’s due to sandboxing in codepen.
Brian K
@BKtheDAD
Oct 14 2015 03:54
and then as W looks for any non word character
Herman Fassett
@HermanFassett
Oct 14 2015 03:54
Yeah
Brian Barrow
@briancbarrow
Oct 14 2015 03:54
@hansinla okay. I was going to go research it. So in a normal site I wouldn't have to include it? Would it hurt to include it anyways?
Brian K
@BKtheDAD
Oct 14 2015 03:55
awesome, thanks again @HermanFassett
CamperBot
@camperbot
Oct 14 2015 03:55
bkthegeek sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: bkthegeek already gave hermanfassett points
Herman Fassett
@HermanFassett
Oct 14 2015 03:55
Yeah
Brian K
@BKtheDAD
Oct 14 2015 03:55
ahh i've given you too many points already, sorry
Herman Fassett
@HermanFassett
Oct 14 2015 03:56
:laughing: no problem
Michael Kebe
@michaelkebe
Oct 14 2015 04:07
@ArielLeslie thanks
CamperBot
@camperbot
Oct 14 2015 04:07
michaelkebe sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 501 | @arielleslie | http://www.freecodecamp.com/arielleslie
Jesse
@jctm30
Oct 14 2015 04:08
hi can anyone help with my site http://codepen.io/jctm30/full/GpvKZx/
was wondering why my 3 thumbnail images aren't the same size
Travis
@TravisHi
Oct 14 2015 04:13
you end your body tag several times?
Brian Barrow
@briancbarrow
Oct 14 2015 04:16
@jctm30 did @TravisHi answer your question? When I look at it they are all the same size.
Ian Barker
@IanBarkerDev
Oct 14 2015 04:16
Your entire page is one body. Divide things up into several divs instead.
bruglesco
@bruglesco
Oct 14 2015 04:17
no I did in another chat window - however he really does have multiple body tags
should prolly fix that
Jason
@Jauble
Oct 14 2015 04:27
Anyone know how I can get my break length and session length divs lined up? They're a mess right now lol http://codepen.io/auble220/pen/avyZZE
Thomas Manchester
@Eruditious
Oct 14 2015 04:29
see why they're doing that with developer console
Jason
@Jauble
Oct 14 2015 04:31
I'm not sure that's really gonna help me. I'm still learning the dev tools
Hans van Riet
@hansinla
Oct 14 2015 04:32
@briancbarrow No you wouldn’t use it. It’s specifically to circumvent sandboxing.
Jason
@Jauble
Oct 14 2015 04:32
I had them lined up so so without the divs, but I really want to know how to make them work with the divs.
h4r1m4u
@h4r1m4u
Oct 14 2015 04:50
@Jauble add these rules into your CSS:
#brkSesLen {
  width: 240px;
  height: 200px;
}
#sesLen {
  float: left;
}
overall, i would encourage you to have a closer look at the bootstrap grid system. if you use some columns in your html markup, it'll make positioning of elements on your page much easier
Herman Fassett
@HermanFassett
Oct 14 2015 04:52
@Jauble what @h4r1m4u is where you want to go somewhat. Though I think classes are better
Jason
@Jauble
Oct 14 2015 04:53
@h4r1m4u Thanks I'll try that. So I should make it 2 columns?
CamperBot
@camperbot
Oct 14 2015 04:53
jauble sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 217 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 14 2015 04:53
issue is he doesn't really have classes in his HTML markup. the above works for his existing code.
Jason
@Jauble
Oct 14 2015 04:53
@HermanFassett Thanks
CamperBot
@camperbot
Oct 14 2015 04:53
jauble sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 366 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
h4r1m4u
@h4r1m4u
Oct 14 2015 04:55
@Jauble yes. you could make the session and break containers the bootstrap columns. you can then offset them, so that they're in the middle of the page
here's the general idea:
<div class="row">
  <div class="col-md-2 col-md-offset-4"></div>
 <div class="col-md-2"></div>
</div>
Pasi Mellin
@dim-pasi
Oct 14 2015 04:56
Is that weather app example working? http://codepen.io/AdventureBear/full/yNBJRj
i only got those white boxes..
h4r1m4u
@h4r1m4u
Oct 14 2015 04:57
@dim-pasi yeah, it's not working
Pasi Mellin
@dim-pasi
Oct 14 2015 04:57
@h4r1m4u ok, any idea what they should contain?
h4r1m4u
@h4r1m4u
Oct 14 2015 04:58
@dim-pasi the api the app uses recently changed their terms and conditions. now they require you to always use an API key when making calls to their service and the sample app doesn't use it
they used to show the weather icon, describe the weather (sunny, rain, etc.) and show wind speed
oh, also temperature. i forgot about that
Pasi Mellin
@dim-pasi
Oct 14 2015 05:01
@h4r1m4u thanks
CamperBot
@camperbot
Oct 14 2015 05:01
dim-pasi sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 218 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Jason
@Jauble
Oct 14 2015 05:04
@h4r1m4u When I do that it lines them up on the left. I thought they were supposed to add up to 12? Is there a way to get rid of the extra space between them here? Also, is there a way to remove the space between the numbers and the buttons? Thanks http://codepen.io/auble220/pen/avyZZE
CamperBot
@camperbot
Oct 14 2015 05:04
jauble sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 14 2015 05:05
@Jauble you set them to col-md-6. that means that you have two columns, each of them taking 50% of the screen width
you need them narrower, e.g. col-md-2 or 3, something like that. and then offsetting the first column, so that they're in the middle
check the sample code i posted above
Jason
@Jauble
Oct 14 2015 05:06
@h4r1m4u I tried that, but they lined up on the left side of the page
h4r1m4u
@h4r1m4u
Oct 14 2015 05:07
did you use the offset?
Jason
@Jauble
Oct 14 2015 05:07
ya col-md-offset-4
h4r1m4u
@h4r1m4u
Oct 14 2015 05:07
as for the gap between numbers and buttons, change the margin on .plusMinus
you currently have it set to margin: 50px 0 0 0; change it to something like 15px 0 0 0;
Jason
@Jauble
Oct 14 2015 05:08
@h4r1m4u Oh that's why, didn't think about that
h4r1m4u
@h4r1m4u
Oct 14 2015 05:10
the offsetting didn't work because your custom CSS rules on the .brkLen class override the bootstrap rules
put the offset back and remove margin:auto from .brkLen
Jason
@Jauble
Oct 14 2015 05:10
@h4r1m4u Gotcha
@h4r1m4u Thanks. It's looking much better
CamperBot
@camperbot
Oct 14 2015 05:12
jauble sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 14 2015 05:13
@Jauble you're welcome. a tip: if you don't use your browser's development tools, you definitely should look into it. it makes troubleshooting the page code much easier as you can immediately see which css rules influence which elements
Hans van Riet
@hansinla
Oct 14 2015 05:14
@h4r1m4u Thanks for the heads up, my app stopped working without me knowing it. Changed the API call thanks to your comments.
CamperBot
@camperbot
Oct 14 2015 05:14
hansinla sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 219 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 14 2015 05:14
@hansinla nice!
they literally changed it like 2 or 3 days ago. mine stopped working too :)
Jason
@Jauble
Oct 14 2015 05:16
@h4r1m4u Ya, I just started a mini course the other day. Gotta finish that an see what else I can find on dev tools
h4r1m4u
@h4r1m4u
Oct 14 2015 05:17
@Jauble great. it'll save you ton of work and uncertainty why something isn't working the way you want it to. i can't imagine developing without the dev tools
Michael Kebe
@michaelkebe
Oct 14 2015 05:21
bonfire Finders Keepers
CamperBot
@camperbot
Oct 14 2015 05:21

:fire:Bonfire: Finders Keepers :link:

function find(arr, func) {
  var num = 0;
  return num;
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });

Create a function that looks through an array (first argument) and returns the first element in the array that passes a truth test (second argument).

more info:  bf details | bf links | hint

Jason
@Jauble
Oct 14 2015 05:22
@h4r1m4u I just remembered (with your help) how you can click on and off different css rules to see their effect. My buttons weren't lining up and I just solved the problem in like 2 seconds lol. Gotta finish that tutorial and keep practicing. I'm sure there's a lot more that I don't know about
Michael Kebe
@michaelkebe
Oct 14 2015 05:23
It mentions Array.some(). But it only return true, if the callback returns true, not the element itself. There is a Array.find(), but it is ES6...
h4r1m4u
@h4r1m4u
Oct 14 2015 05:24
@Jauble way to go, great job! yeah, learning more is why we're taking these courses :clap:
Michael Kebe
@michaelkebe
Oct 14 2015 05:24
To find the element I have to iterate the array anyway...
Jason
@Jauble
Oct 14 2015 05:31
@h4r1m4u Exactly. It's pretty awesome too when you learn something and soon after you get to put it to use.
Michael Kebe
@michaelkebe
Oct 14 2015 05:36
FreeCodeCamp/FreeCodeCamp#1350
Sapthagiri
@sapthagr2
Oct 14 2015 06:07

var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;

function myFunction(){
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.
if (flip === 1) {
return heads;
} else {
return tails;
}

// Only change code above this line.
}

error "heads is not defined"
Michael Kebe
@michaelkebe
Oct 14 2015 06:10
wiki format
CamperBot
@camperbot
Oct 14 2015 06:10

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Michael Kebe
@michaelkebe
Oct 14 2015 06:11
@sapthagr2 Please format your posted code
h4r1m4u
@h4r1m4u
Oct 14 2015 06:12
@sapthagr2 you need to wrap heads and tails in quotes, like so: "heads", "tails". without the quotes they're considered variables and you get the not defined error
with the quotes they're strings
Sapthagiri
@sapthagr2
Oct 14 2015 06:14
@h4r1m4u Thanks
CamperBot
@camperbot
Oct 14 2015 06:14
sapthagr2 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 220 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Sapthagiri
@sapthagr2
Oct 14 2015 06:14
@michaelkebe hereafter I'll use formatted code
Solehjon
@Solehjon
Oct 14 2015 06:15
"lastNameLength should be equal to eight."
guys what i should to do
help me
Sapthagiri
@sapthagr2
Oct 14 2015 06:16
@Solehjon you have to use .lenght property --->lastName.length
Solehjon
@Solehjon
Oct 14 2015 06:17
@sapthagr2 Thanks
CamperBot
@camperbot
Oct 14 2015 06:17
solehjon sends brownie points to @sapthagr2 :sparkles: :thumbsup: :sparkles:
:star: 160 | @sapthagr2 | http://www.freecodecamp.com/sapthagr2
Avishay
@avishayshushan
Oct 14 2015 06:29
@azaleas when will the each function will start? also in this method i'm actually create several event listeners .
is it possible to gave all numbers an html 'onclick' that will execute the same function?
Sergiy Babiy
@Acidsky
Oct 14 2015 06:31
Why map of education sometimes changing? And why you stopped using code.academy.
Michael Kebe
@michaelkebe
Oct 14 2015 06:32
bonfire Steamroller
CamperBot
@camperbot
Oct 14 2015 06:32

:fire:Bonfire: Steamroller :link:

function steamroller(arr) {
  // I'm a steamroller, baby
  return arr;
}

steamroller([1, [2], [3, [[4]]]]);

Flatten a nested array. You must account for varying levels of nesting.

more info:  bf details | bf links | hint

Michael Kebe
@michaelkebe
Oct 14 2015 06:32
function steamroller(arr) {
  return arr.reduce(function(accu, e) {
    return accu.concat(Array.isArray(e) ? steamroller(e) : [e]);
  }, []);
}
Any comments?
Ian Barker
@IanBarkerDev
Oct 14 2015 06:33
@avishayshushan Are your "onclicks" written into the html?
Solehjon
@Solehjon
Oct 14 2015 06:34

Bracket notation is a way to get a character at a specific index within a string.

Computers don't start counting at 1 like humans do. They start at 0.

For example, the character at index 0 in the word "Charles" is "C". So if var firstName = "Charles", you can get the value of the first letter of the string by using firstName[0].

Use bracket notation to find the first character in the firstLetterOfLastName variable.

Try looking at the firstLetterOfFirstName variable declaration if you get stuck.

what i should do?
The first letter of firstLetterOfLastName should be a "L".
Avishay
@avishayshushan
Oct 14 2015 06:34
@Malical it will be if i know it's ok
like this <div 'onclick'=function>
Ian Barker
@IanBarkerDev
Oct 14 2015 06:35
You know any jQuery?
Avishay
@avishayshushan
Oct 14 2015 06:35
not sure about the syntax but i will get to it
Ian Barker
@IanBarkerDev
Oct 14 2015 06:35
@Solehjon So if you have an array say: a = [1,2,3]; a[0] = 1.
Avishay
@avishayshushan
Oct 14 2015 06:36
i learn it on the map of fcc but i rarely use jQuery @Malical
Ian Barker
@IanBarkerDev
Oct 14 2015 06:37
@avishayshushan jQuery is your frieeeeeend. It's a little awkward at first but saves you a ton of time.
Avishay
@avishayshushan
Oct 14 2015 06:37
which jQuery will fit my case?
Ian Barker
@IanBarkerDev
Oct 14 2015 06:38
So you have a bunch of numbers?
And you want to have an action be performed when you click them?
Avishay
@avishayshushan
Oct 14 2015 06:40
yes, the action will be the same(taking the number somewhere)
Solehjon
@Solehjon
Oct 14 2015 06:41
@Malical can you explain more
Ian Barker
@IanBarkerDev
Oct 14 2015 06:41
@Solehjon Which question number is it?
Solehjon
@Solehjon
Oct 14 2015 06:42
@Malical Use Bracket Notation to Find the First Character in a String'
Ian Barker
@IanBarkerDev
Oct 14 2015 06:43
@Solehjon So strings are literally arrays of characters.
Foo => ['F', 'o', 'o']
Solehjon
@Solehjon
Oct 14 2015 06:43

@Malical var firstLetterOfFirstName = "";
var firstLetterOfLastName = "";

var firstName = "Ada";

firstLetterOfFirstName = firstName0;

var lastName = "Lovelace";

firstLetterOfLastName = lastName;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(v){return v;})(firstLetterOfLastName);

@Malical this is my code how can i change
Ian Barker
@IanBarkerDev
Oct 14 2015 06:44
So Ada => ['A', 'd', 'a']
The places in the array are [0, 1, 2]
So if you take the 0th element of that array you get A.
Which is why firstLetterOfFirstName = firstName[0];
var lastName = "Lovelace" is another array of letters.
Huỳnh Tấn
@Shenseye
Oct 14 2015 06:46
String and array are diffence type
David Bouwkamp
@DavidBouw
Oct 14 2015 06:47
It is wrong to coerce a str into a String obj type because str is seen by the js engine as a primitive. You should change the str to an array (which is a mutable obj, something that is different from a primitive) before changing str's contents
Huỳnh Tấn
@Shenseye
Oct 14 2015 06:47
"123" == [1,2,3] because == will call .toString()
Solehjon
@Solehjon
Oct 14 2015 06:48
Guys I can't grab your brains
Ian Barker
@IanBarkerDev
Oct 14 2015 06:48
You two help him then.
Solehjon
@Solehjon
Oct 14 2015 06:49

var firstLetterOfFirstName = "LL";
var firstLetterOfLastName = "";

var firstName = "Ada";

firstLetterOfFirstName = firstName['L','L'];

var lastName = "Lovelace";

firstLetterOfLastName = lastName;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(v){return v;})(firstLetterOfLastName);

here is my code how i should change that
Michael Kebe
@michaelkebe
Oct 14 2015 06:49
function binaryAgent(str) {
  return str.split(" ").map(binaryCharString2Char).join("");
}

function binaryCharString2Char(s) {
  var reversed = s.split("").reverse();
  var charCode = reversed.reduce(function(accu, b, exponent) {
    return accu + Math.pow(2, exponent) * b;
  }, 0);
  return String.fromCharCode(charCode);
}
Please give me some comments on my solution of binary agents.
David Bouwkamp
@DavidBouw
Oct 14 2015 06:50
= " ... something..."; is a string. You should change it to an Array object with the .split("") string method
Then you can call each letter up by the corresponding array index
Solehjon
@Solehjon
Oct 14 2015 06:51

var firstLetterOfFirstName = "LL";
var firstLetterOfLastName = "";

var firstName = "Ada";

firstLetterOfFirstName = firstName['L','L'];

var lastName = "Lovelace";

firstLetterOfLastName = lastName;

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(v){return v;})(firstLetterOfLastName);
here is my code how i should change that

Michael Kebe
@michaelkebe
Oct 14 2015 06:52
@Solehjon Please format your code
wiki format
CamperBot
@camperbot
Oct 14 2015 06:52

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Huỳnh Tấn
@Shenseye
Oct 14 2015 06:52
firstLetterOfFirstName = firstName['L','L'];
What are you doing here
David Bouwkamp
@DavidBouw
Oct 14 2015 06:53
I actually don't know. what does it do? Why 'L', when you're pointing to the word Ada @Solehjon
Ian Barker
@IanBarkerDev
Oct 14 2015 07:00
@Solehjon You still there?
Dean Whittaker
@deanhtid
Oct 14 2015 07:02
Can anyone help me with Waypoint: Make Object Properties Private.
i just dont get it
Paras Arora
@parasaro92
Oct 14 2015 07:02
I'n stuck, my jquery is not working..
Huỳnh Tấn
@Shenseye
Oct 14 2015 07:02
array = [1,2,3]
array[1,2] == array[2] \\true
array[0,1,2] == array[2] \\ true
LOL I think i don't know JS. Just test that i thought it won't run lol.
VeeShostak
@VeeShostak
Oct 14 2015 07:06

@deanhtid We can create private properties and private methods, which aren't accessible from outside the object.

To do this, we omit the word this from the property or method declaration.

In the previous waypoint you added a this. to make it public... now to make it private

Dean Whittaker
@deanhtid
Oct 14 2015 07:07
so im guessing i need to omit the .this fro the code, but i dont see myBike.speed and myBike.addUnit in the code
ah never mind, i think ive sussed it
Ian Barker
@IanBarkerDev
Oct 14 2015 07:08
@parasaro92 What's your jQuery?
Dean Whittaker
@deanhtid
Oct 14 2015 07:09
actually no i havent =/
thanks @VeeShostak
CamperBot
@camperbot
Oct 14 2015 07:10
deanhtid sends brownie points to @veeshostak :sparkles: :thumbsup: :sparkles:
:star: 192 | @veeshostak | http://www.freecodecamp.com/veeshostak
Ian Barker
@IanBarkerDev
Oct 14 2015 07:10
@deanhtid You get it?
Dean Whittaker
@deanhtid
Oct 14 2015 07:11
yep got it now, thanks
CamperBot
@camperbot
Oct 14 2015 07:11
if you want to thank someone, put an @ before their name!
Ian Barker
@IanBarkerDev
Oct 14 2015 07:13
Thanks @camperbot
CamperBot
@camperbot
Oct 14 2015 07:13
malical sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 351 | @camperbot | http://www.freecodecamp.com/camperbot
Dean Whittaker
@deanhtid
Oct 14 2015 07:13
Must admit im finding the javescript stuff hard to grasp
Paras Arora
@parasaro92
Oct 14 2015 07:13
@Malical my jquery map is working but server is not responding
Dean Whittaker
@deanhtid
Oct 14 2015 07:13
javaScript
Do you guys take notes?
VeeShostak
@VeeShostak
Oct 14 2015 07:16
The waypoints can be confusing, they do not explain much, and instead give you a basic overview . Hence, once you do your first 3 bonfires you'll be good, you will be able to understand all of the code
Dean Whittaker
@deanhtid
Oct 14 2015 07:17
Im glad you have said that as i cant get my head round it at all.
Ian Barker
@IanBarkerDev
Oct 14 2015 07:18
@deanhtid What languages are you more used to? I found JS to just flow really nicely.
Dean Whittaker
@deanhtid
Oct 14 2015 07:18
do you take notes @VeeShostak ? my note taking is taking a lot of time and wondering if i should just go through the sections trying to absorb as much of the information as possible
Ian Barker
@IanBarkerDev
Oct 14 2015 07:19
@parasaro92 What's your code?
Dean Whittaker
@deanhtid
Oct 14 2015 07:19
@Malical im quite new to all this, the HTML and CSS stuff seemed ok, but the JS im struggling
VeeShostak
@VeeShostak
Oct 14 2015 07:21
I used to think in the same way, wanting to take accurate notes. But as you go deeper, you will realize it is tedious and unnecessary for the intial things.
Ian Barker
@IanBarkerDev
Oct 14 2015 07:21
Ah. Okay. JS is a good language to start with.
You don't have to memorize things. You can always google a function to see how it works. (Or a problem to see if there is a function :) )
VeeShostak
@VeeShostak
Oct 14 2015 07:23

There is too much information, later you will also be using a reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript

Basically the more you encompass yourself with code (the more coding you do) the better you will become

Paras Arora
@parasaro92
Oct 14 2015 07:23
@Malical In Jquery section question 1...
Dean Whittaker
@deanhtid
Oct 14 2015 07:23
So i suppose ill stop taking notes as all the information is out there anyways. Yes?
Ian Barker
@IanBarkerDev
Oct 14 2015 07:24
If it helps you learn go for it. But yeah, there are limitless facts out there. You can't write them all down.
@parasaro92 The learn how document ready works?
Paras Arora
@parasaro92
Oct 14 2015 07:26
@Malical that why i'm server is not responding...its stuck even for sections i've completed
Ian Barker
@IanBarkerDev
Oct 14 2015 07:26
Oh. You just mean it won't load? Go back to your map and scroll down to the next question. I've had that happen a bunch.
Dean Whittaker
@deanhtid
Oct 14 2015 07:29
stuck again now. Waypoint: Make Instances of Objects with a Constructor Function,just doesnt make any sense to me
Alex
@Sevohan
Oct 14 2015 07:44
I'm stuck at the same point @deanhtid if your still on it do you want to try to work through it together?
Aleksander Gębicki
@Takumar
Oct 14 2015 07:52
@deanhtid, @Sevohan what are your problems with that waypoint?
Alex
@Sevohan
Oct 14 2015 07:56
@Takumar I've tried everything I can think of to create the engines property and give it value but I'm still getting an X next to "The property engines of myCar should be a number."
Aleksander Gębicki
@Takumar
Oct 14 2015 08:00
@Sevohan please show your code, where do you tried to create this property. Did you remember to put it after the comment?
Alex
@Sevohan
Oct 14 2015 08:00
@Takumar I just had a flash of inspiration and was able to figure it out. Thank you for your help. @deanhtid If you are still having trouble with it tomorrow let me know and we can work through it.
CamperBot
@camperbot
Oct 14 2015 08:00
sevohan sends brownie points to @takumar and @deanhtid :sparkles: :thumbsup: :sparkles:
:star: 455 | @takumar | http://www.freecodecamp.com/takumar
:star: 171 | @deanhtid | http://www.freecodecamp.com/deanhtid
Aleksander Gębicki
@Takumar
Oct 14 2015 08:00
In line six you create object myCar using constructor.
I only wanted to add that you add property to your newly created object, but I see you managed to do it yourself. Good job.
Alex
@Sevohan
Oct 14 2015 08:02
Yes the second I explained my difficulty I had a new idea. Thanks!
CamperBot
@camperbot
Oct 14 2015 08:02
if you want to thank someone, put an @ before their name!
Avishay
@avishayshushan
Oct 14 2015 08:09
can anyone explain why i'm getting this error on the console?
Cannot read property 'push' of undefined
to get this error you need to click one of the digits [0-9]
http://codepen.io/avishayshushan/pen/WQjPRV/?editors=101
Jayeson
@Jayeson
Oct 14 2015 08:17
element's text color to blue: <h2 style="color: blue">CatPhotoApp</h2>. guys how this code works?
Avishay
@avishayshushan
Oct 14 2015 08:20
style basically gives you the ability to change the style properties of an element
in your case change the color of h2 to blue
you can also do it via css
Jayeson
@Jayeson
Oct 14 2015 08:24
@avishayshushan im writing it but te result is not blue.......im getting an error
Avishay
@avishayshushan
Oct 14 2015 08:26
can you put the rest of your code here?
or a link?
Avishay
@avishayshushan
Oct 14 2015 08:27
the catphotoapp text is blue
the point of this waypoint is to change it to red
this is why you getting an error
@Jayeson
Jayeson
@Jayeson
Oct 14 2015 08:29
@avishayshushan i know but the screen is not showing any colour
h4r1m4u
@h4r1m4u
Oct 14 2015 08:30
@avishayshushan as to your question - there's a problem with the 2nd line of your JS (mul.addEventListener("click", MyMul);). if you uncomment it, the getNum() function will work properly and store the values in the array
i'm not sure why exactly the 2nd line is spazzing out - probably a syntax error or something
Avishay
@avishayshushan
Oct 14 2015 08:31
@h4r1m4u Tnx
CamperBot
@camperbot
Oct 14 2015 08:31
avishayshushan sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 221 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Jayeson
@Jayeson
Oct 14 2015 08:32
@avishayshushan thanks man for help now got it......my error is that i write it without a space...
CamperBot
@camperbot
Oct 14 2015 08:32
jayeson sends brownie points to @avishayshushan :sparkles: :thumbsup: :sparkles:
:star: 299 | @avishayshushan | http://www.freecodecamp.com/avishayshushan
Avishay
@avishayshushan
Oct 14 2015 08:34
@Jayeson i hate when this happens :smile:
Jayeson
@Jayeson
Oct 14 2015 08:40
i belong to pakistan.....i wont speak english very well
ronald
@ronstarcool
Oct 14 2015 08:42
any meteor fans here? i like to make a little group on it, bout 5-7 people, making little practise stuff together
thomas-duval
@thomas-duval
Oct 14 2015 08:48
This message was deleted

Hey guys, I'm practicing recursion in JS on CodeAcademy (after completing the bonfire) and I'm stuck.
The goal of this function is to return a stack of power like this :

Power(base, exponent) = Power(3,3) = [3, 9, 27].

Here is the code :

// Create an empty array called "stack"
stack = []
// Here is our recursive function
function power(base, exponent) {
  // Base case 
  if ( exponent === 0 ) {
    return 1;
  }
  // Recursive case
  else {
    stack[exponent-1] = base * power(base, exponent - 1);
    return stack;
  }
}
// Test function
power(3, 3)

But the result is

[3,9,null]

The thing is that when I return stack[exponent-1] (or stack2), I get 27 ...
What did I do wrong ?

Jose E. Pimentel
@jedpimentel
Oct 14 2015 09:07
@thomasduval I think I have it
ronald
@ronstarcool
Oct 14 2015 09:09
plz share..
im looking at it too now
Jose E. Pimentel
@jedpimentel
Oct 14 2015 09:11
so, the function makes a call stack, with each passing values to the next. the first it returns the number 1, then [1x3], which is [3], then [3,[3]x3], which is [3,9], then it breaks down when it tries to calc [3, 9, [3, 9] x 3], since [3, 9] x 3 is NaN
the function is returning an array, it can calculate stack[1] fine since JS treats single element numeric arrays as a number [3] x 3 = 9, but there is a point where it tries to multiply a two element array by 3, which is what causes stack[2] to be NaN
thomas-duval
@thomas-duval
Oct 14 2015 09:15
This message was deleted
ronald
@ronstarcool
Oct 14 2015 09:15
coersion right?
thomas-duval
@thomas-duval
Oct 14 2015 09:16

That would explain why

power(3,4) gives [3,9,null,null]

I'm going to look into that, thanks @jedpimentel

CamperBot
@camperbot
Oct 14 2015 09:16
thomasduval sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 361 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Jose E. Pimentel
@jedpimentel
Oct 14 2015 09:19
@ronstarcool from what I understand the first two where coerced into numbers
that was actually some pretty cool code to look into... just a bit harder and it would have gone over my head
ronald
@ronstarcool
Oct 14 2015 09:20
i was already logging my ass off..
thanks for finding the answer for us
CamperBot
@camperbot
Oct 14 2015 09:20
if you want to thank someone, put an @ before their name!
ronald
@ronstarcool
Oct 14 2015 09:21
thank @jedpimentel
CamperBot
@camperbot
Oct 14 2015 09:21
ronstarcool sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 362 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Jose E. Pimentel
@jedpimentel
Oct 14 2015 09:22
no thanks are necessary, learning to debug is a perk in itself :)
CamperBot
@camperbot
Oct 14 2015 09:22
if you want to thank someone, put an @ before their name!
ronald
@ronstarcool
Oct 14 2015 09:22
np, i got a full bag of brownie points right here next to my shair
John Joseph Dela Cruz
@tubbyteph18
Oct 14 2015 09:26
Hello World
CamperBot
@camperbot
Oct 14 2015 09:26

welcome to FreeCodeCamp @tubbyteph18!

Mettcon
@Mettcon
Oct 14 2015 09:34
i know its not from codecamp but what is wrong here
// Use console.log to print out the length of the variable myCountry.
console.log(var myCountry = "Germany" );

// Use console.log to print out the first three letters of myCountry.
console.log(myCountry.substring(0,2));
Jose E. Pimentel
@jedpimentel
Oct 14 2015 09:41
@Mettcon I think they want you to use the str.length method (it returns the number of characters (length) in the string
Mettcon
@Mettcon
Oct 14 2015 09:42
i know .length but how and why i should implement it there?
Jose E. Pimentel
@jedpimentel
Oct 14 2015 09:45
myCountry.length returns the length of that variable
Mettcon
@Mettcon
Oct 14 2015 09:49
seems not
Karolis
@Luomint
Oct 14 2015 09:53
bf multiple
CamperBot
@camperbot
Oct 14 2015 09:53

: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

Karolis
@Luomint
Oct 14 2015 09:53
hint
CamperBot
@camperbot
Oct 14 2015 09:53
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Tobi
@theber
Oct 14 2015 09:57
hi guys, I can't figure out a problem on the Camper News Zipline. I tried to use Angular and everything works when I save the result from the API call in a local variable manually.
Now I want to use $.getJSON to get the data, but it doesn't work... Here's my code:
(function() {
  var app = angular.module('newsFeed', []);

  app.controller('NewsController', function() {
    var jqxhr = $.getJSON("http://www.freecodecamp.com/news/hot").done(function(data) {
      this.feed = data;
      for (i in this.feed) {
        if (this.feed[i].image === "") {
          this.feed[i].image = this.feed[i].author.picture;
        }
      }
    });
  });
})();
mattrees
@mattcreativehatchet
Oct 14 2015 11:05
I know i probably sound stupid - but hey, we all start somewhere:
could you help me with how to add css styling to a div element?
h4r1m4u
@h4r1m4u
Oct 14 2015 11:06
@mattcreativehatchet did you go through the basic waypoints? they show multiple ways to achieve that, slowly building on top of each other
mattrees
@mattcreativehatchet
Oct 14 2015 11:07
I'm doing the tutorials now and its asking me to add style into div, here is what i have done: <div>
<style>
.gray-background { background-color: gray; }
</style>
<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>
</div>
where is the error? And for future how do i do a screen grab of the code?
h4r1m4u
@h4r1m4u
Oct 14 2015 11:09
you've created the CSS rule for a class called .gray-background. now you need to apply the class to one of the HTML elements, like so <div class="gray-background">
mattrees
@mattcreativehatchet
Oct 14 2015 11:10
ah brilliant thank you @h4r1m4u
CamperBot
@camperbot
Oct 14 2015 11:10
:star: 222 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
mattcreativehatchet sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
h4r1m4u
@h4r1m4u
Oct 14 2015 11:10
you're welcome
Jason
@Jauble
Oct 14 2015 11:16
Hey @h4r1m4u. When I clearInterval() after running setInterval on my pomodoro timer, it just pauses it. So if I start it again, it starts where it left off. Do you know how I would reset the setInterval?
h4r1m4u
@h4r1m4u
Oct 14 2015 11:18
@Jauble i don't think you should reset the setInterval. that's just a function that runs periodically until you clear it. what you should reset is the pomodoro time, so that when you click start again, it starts from the beginning
in other words, looking at your code, you would reset the d Date object.
does that make sense?
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:21
I'm working on the pomodoro timer too and I'm getting a really weird error
h4r1m4u
@h4r1m4u
Oct 14 2015 11:22
what's the issue @JordanShackelford ?
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:22
click the start button and you'll see
h4r1m4u
@h4r1m4u
Oct 14 2015 11:23
hahaha, ok, i see it :)
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:24
seems like it's updating the screen twice per second but it should only be running once
h4r1m4u
@h4r1m4u
Oct 14 2015 11:25
i'm looking at your code to try to find out where it's coming from

i think there's problem with the way you calculate the timeLeft. in this line

timeLeft = (time * 60000) - timeSinceStarting - timeLeft;

why do you subtract the timeLeft?

Edper
@edper
Oct 14 2015 11:28
@Luomint in my case I have to create a loop within a loop. The link to mathisfun website provides a lot of hint on the logic of how it should work. Read through until the bottom part and you can get some idea there.
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:29
@h4r1m4u that's probably where the problem is
h4r1m4u
@h4r1m4u
Oct 14 2015 11:30
yeah. your timeLeft actually drops below 0 on every other second, which is why you're seeing it on the clock display
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:30
It's so if you press the pause button then click start again it will remember where you left off
h4r1m4u
@h4r1m4u
Oct 14 2015 11:31
you'll probably have to find some other way to track that
if you change the line to timeLeft = (time * 60000) - timeSinceStarting;, the countdown works properly
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:31
yeah but when you click stop then start again it resets back to the default time
h4r1m4u
@h4r1m4u
Oct 14 2015 11:33

yes. as i mentioned, you'll have to find another way to track that. you have this inside the setInterval function:

var timeSinceStarting = Date.now() - timeStarted;

that means that every time the setInterval function is launched, the timeSinceStarting variable will reset

you may want to make it a global variable and reset it only when you press the Reset button
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:34
I have an idea
Jason
@Jauble
Oct 14 2015 11:35

@h4r1m4u I figured it out. I had:

    d.setSeconds(01);
    d.setMinutes(25);

instead of:

  sec = 01;
  min = 25;

Thanks

CamperBot
@camperbot
Oct 14 2015 11:35
jauble sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 223 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 14 2015 11:35
@Jauble great :clap:
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:37
it's so much more complicated than I expected to make a simple stopwatch
h4r1m4u
@h4r1m4u
Oct 14 2015 11:38
yeah. i'm actually surprised they put it in the basic ziplines. compared with all the other basic ziplines, the pomodoro is exponentially more complicated
i've been programming for quite some time and it took me a while to put it together too
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:39
javascript?
h4r1m4u
@h4r1m4u
Oct 14 2015 11:40
HTML, CSS, PHP, Python. some JavaScript. going through FCC to get better at it
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:40
I got into programming when I was 12 but I never stuck with anything long enough to get good at it. I'm ashamed
h4r1m4u
@h4r1m4u
Oct 14 2015 11:40
don't be. perhaps now's the time
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:41
I could've been a prodigy. My best friend is 22 and already makes $120k a year because he's not as lazy as me lol
h4r1m4u
@h4r1m4u
Oct 14 2015 11:42
it's never too late, man.
don't compare yourself with others, compare yourself with yourself yesterday
that's all that matters
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:42
:D
I become much more productive when I have a lot of caffeine so I started drinking lots of coffee
h4r1m4u
@h4r1m4u
Oct 14 2015 11:43
lol
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:44
it's kind of a stereotype that programmers drink lots of energy drinks but I never knew it helped so much
h4r1m4u
@h4r1m4u
Oct 14 2015 11:46
i never needed that. sufficient sleep and working out works wonders
Jordan Shackelford
@JordanShackelford
Oct 14 2015 11:48
I sleep more than enough
Chaitra S
@chaitinfin
Oct 14 2015 11:49
hint seek and destroy
CamperBot
@camperbot
Oct 14 2015 11:49
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Edper
@edper
Oct 14 2015 11:58
@codehait you can convert the arguments of a function into an array and then use filter to filter out from the first array those that does not match on the arguments that turned into array awhile ago.
Richard Vankoningsveld
@richyvk
Oct 14 2015 12:09
help where do i belong
CamperBot
@camperbot
Oct 14 2015 12:09

:point_right: bonfire where do i belong [wiki]

Explanation:

This can be a tricky problem to understand. You need to find where in the array a number should be inserted by order, and return the index where it should go.

:pencil: read more about bonfire where do i belong on the FCC Wiki

Abdul Rafay Khan
@khanrafay
Oct 14 2015 12:09
Need help in a code.
Edper
@edper
Oct 14 2015 12:09
@khanrafay what are you working on?
Abdul Rafay Khan
@khanrafay
Oct 14 2015 12:10
in javascript they ask about .length code which i am doing but it still shows lastname should be equal to 8
'''''
CamperBot
@camperbot
Oct 14 2015 12:10
:bulb: to format code use backticks! ``` more info
Edper
@edper
Oct 14 2015 12:10
Show your code.
Backticks @khanrafay is the key/character besides number 1 key in the keyboard.
Abdul Rafay Khan
@khanrafay
Oct 14 2015 12:13
http://freecodecamp.com/challenges/waypoint-check-the-length-property-of-a-string-variable#?solution=var%20firstNameLength%20%3D%200%3B%0Avar%20lastNameLength%20%3D%200%3B%0Avar%20firstName%20%3D%20%22Ada%22%3B%0A%0AfirstNameLength%20%3D%20firstName.length%3B%0A%0Avar%20lastName%20%3D%20%22Lovelace%22%3B%0A%0A%2F%2F%20Only%20change%20code%20below%20this%20line.%0A%0AlastNameLength%20%3D%20lastName%3B%0A%20lastName.length%3D8%3B%0A%0A%0A%0A%2F%2F%20Only%20change%20code%20above%20this%20line.%0A%2F%2F%20We%20use%20this%20function%20to%20show%20you%20the%20value%20of%20your%20variable%20in%20your%20output%20box.%0A%2F%2F%20You'll%20learn%20about%20functions%20soon.%0Aif(typeof(lastNameLength)%20!%3D%3D%20%22undefined%22)%7B(function()%7Breturn%20lastNameLength%3B%7D)()%3B%7D%0A
Abdul Rafay Khan
@khanrafay
Oct 14 2015 12:19
@edper ?
Aleksander Gębicki
@Takumar
Oct 14 2015 12:19
@khanrafay you have to paste your code in more readable form.
Edper
@edper
Oct 14 2015 12:20
after the lastName variable you add the length property.
lastName.length @khanrafay
Andrew
@anjanjanj
Oct 14 2015 12:34
How do you accept any value in a MongoDB query? I want to query like { authorName: someVar || <anyValue> } because someVar won't always be initialised. Is there something to use in place of <anyValue> that will just return everything?
Richard Vankoningsveld
@richyvk
Oct 14 2015 12:37
help
CamperBot
@camperbot
Oct 14 2015 12:37

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Richard Vankoningsveld
@richyvk
Oct 14 2015 12:37
help Sum All Numbers in a Range
CamperBot
@camperbot
Oct 14 2015 12:37

:point_right: bonfire sum all numbers in a range [wiki]

Problem Explanation:

  • You need to create a program that will take an array of two numbers who are not necessarily in order, and then add not just those numbers but any numbers in between. For example, [3,1] will be the same as 1+2+3 and not just 3+1
:pencil: read more about bonfire sum all numbers in a range on the FCC Wiki
h4r1m4u
@h4r1m4u
Oct 14 2015 12:58
@anjanjanj i believe you just use 'true' or '1' to include the field in the query. 'false' or '0' to exclude the field
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:03
Hello I have a problem with this
$($('.slot')[0]).html('<img src = "' + imagenes[slotOne-1] + '">');
$($('.slot')1).html('<img src = "' + imagenes[slotTwo -2] + '">');
$($('.slot')[2]).html('<img src = "' + imagenes[slotThree -3] +'">');
h4r1m4u
@h4r1m4u
Oct 14 2015 13:04
what's the issue @JorgeCuevas ?
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:06
the exercise tell me that I need to use this code three time but I used that and the task is uncompleted yet
h4r1m4u
@h4r1m4u
Oct 14 2015 13:06
which waypoint is it?
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:07
it is 40, I'm new programming in JavaScritp
In Basic JavaScript
h4r1m4u
@h4r1m4u
Oct 14 2015 13:10
you're on the right track, but check your spelling. you've two issues:
a) your 2nd (incorrect) line is slightly different from the other ones? can you spot the difference?
b) doublecheck the name of the array that holds the images
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:12
Okey , Let me see
h4r1m4u
@h4r1m4u
Oct 14 2015 13:14
@JorgeCuevas cool. let me know if you need more hints
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:16
I already fixed it and I'm in the same situation
h4r1m4u
@h4r1m4u
Oct 14 2015 13:16
post your code
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:29
This message was deleted

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

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

// Only change code below this line.

$($('.slot')0).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')1).html('<img src = "' + images[slotTwo-2] + '">');
$($('.slot')2).html('<img src = "' + images[slotThree-3] + '">');

h4r1m4u
@h4r1m4u
Oct 14 2015 13:33
a minor mistake in your code: when you use the $('.slot') selector and there are several elements of the .slot class, the selector will return an array. when you want to change a value of an element in array myArray, you would refer to it as myArray[0], myArray1, myArray[2], etc.
can you see where you made the mistake in your code? if not, compare it to the example they give you in the sidebar: $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:36
Yeas I did it in that way , however the issue continue , I did it like in the example , that why I don't know why is the real problem
h4r1m4u
@h4r1m4u
Oct 14 2015 13:37
there's a difference between your code and the example
look carefully
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:40
$($('.slot')[2]).html('<img src = "' + images[slotThree-3] + '">')
This is what I did
three time
Changing the Array's position
h4r1m4u
@h4r1m4u
Oct 14 2015 13:43
can you post all three lines?
Mamadou Badiane
@diango
Oct 14 2015 13:43
i need help for Waypoint: Sift through Text with Regular Expressions
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:43
//$($('.slot') [ 0 ] ).html('<img src = "' + images[slotOne-1] + '">');
//$($('.slot') [ 1 ] ).html('<img src = "' + images[slotTwo-2] + '">');
//$($('.slot') [2] ).html('<img src = "' + images[slotThree-3] + '">');
Jason Wood
@catapixel
Oct 14 2015 13:45
@diango what is your question?
Herman Fassett
@HermanFassett
Oct 14 2015 13:45
@diango ok, what's your problem
:P
h4r1m4u
@h4r1m4u
Oct 14 2015 13:45
@JorgeCuevas why do you subtract 1, then 2, then 3 (from slotOne, slotTwo, and slotThree)? do you understand what the subtraction does and why it's there?
Mamadou Badiane
@diango
Oct 14 2015 13:47

In fact var test = (function() {
var testString = "Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it.";
var expressionToGetSoftware = /software/gi;
// Only change code below this line.
return regularexpression = /and/gi;
var expression = /./gi;

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

Jason Wood
@catapixel
Oct 14 2015 13:48
@diango You added this line return regularexpression = /and/gi; they just want you to modify their line var expression = /./gi;
delete your line and modify theirs and your code will pass
Hans van Riet
@hansinla
Oct 14 2015 13:48
@diango When you return in a function, nothing after that will be executed.
Jason Wood
@catapixel
Oct 14 2015 13:50
@diango the change is just to what is between the forward slashes "/" by the way. Nothing else
Mamadou Badiane
@diango
Oct 14 2015 13:50
i want to write var regularexpression= /and/gi but it doesn't match
Jason Wood
@catapixel
Oct 14 2015 13:51
That is because their code expects their variable var expression. Your variable is never called
Jorge Cuevas Quezada
@jcuevas012
Oct 14 2015 13:52
@h4r1m4u Thanks , I understand now , I was confused with the Array's position
CamperBot
@camperbot
Oct 14 2015 13:52
jorgecuevas sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 224 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Mamadou Badiane
@diango
Oct 14 2015 13:52
@catapixel i am very disturb for this waypoint
h4r1m4u
@h4r1m4u
Oct 14 2015 13:52
@JorgeCuevas :) my pleasure :clap:
Jason Wood
@catapixel
Oct 14 2015 13:53

@diango This the code they provide you:

var test = (function() {
  var testString = "Ada Lovelace and Charles Babbage designed the first computer and the software that would have run on it.";
  var expressionToGetSoftware = /software/gi;
  // Only change code below this line.

  var expression = /./gi;  // You are only changing this line

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

They only want you to change the part after var expression = to solve the waypoint. Make no other changes. You wrote your regular expression correctly. It is just in the wrong place.

Mamadou Badiane
@diango
Oct 14 2015 13:56
@catapixel great i must improve my english
Jason Wood
@catapixel
Oct 14 2015 13:56
@diango it works now?
Mamadou Badiane
@diango
Oct 14 2015 13:57
Oh yeah @catapixel
Jason Wood
@catapixel
Oct 14 2015 13:57
:+1:
Rodrigo Castro
@castrors
Oct 14 2015 14:00
hello there, which characters i should consider valid? palindrome("0_0 (: /-\ :) 0-0").Observation, it must return true.
that smile face is ":" ")"
Jason Wood
@catapixel
Oct 14 2015 14:08
@castrors I'm correcting this to all word characters from a-z, A-Z, 0-9, excluding the _ (underscore) character.
All others (including the underscore) need to be stripped out before you check whether or not you have a palindrome
Terry Mafura
@maffsojah
Oct 14 2015 14:11
Hello
Jason Wood
@catapixel
Oct 14 2015 14:13
@maffsojah hello to you
Mohammed Zaher
@moh-zaher
Oct 14 2015 14:13
hey
awesome
Terry Mafura
@maffsojah
Oct 14 2015 14:17
Im good thanks @catapixel . I'm having some trouble with bonfire 2. Is there some source i skipped on reading?
CamperBot
@camperbot
Oct 14 2015 14:17
maffsojah sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 455 | @catapixel | http://www.freecodecamp.com/catapixel
Alec Rizor
@alecrizor
Oct 14 2015 14:18
Hey all, I'm on the waypoint of making instances of objects with a constructor function under object oriented and functional programming and having some trouble knowing what to write. Can anyone help me out?
Terry Mafura
@maffsojah
Oct 14 2015 14:18
hey @moh-zaher , howzit
dht0my
@dht0my
Oct 14 2015 14:18
Hello, how do I pair with someone for bonfire :)?
Ariel
@ArielLeslie
Oct 14 2015 14:24
@dht0my You gotta find someone who wants to pair on the same bonfire. Try the LetsPair room
Terry Mafura
@maffsojah
Oct 14 2015 14:25
Hi @alecrizor . As commented on the editor, add the "engines " property to "myCar" and make it a number. i.e the number of engines on the car. You can follow the same thing done on the "this.wheels" but instead of "this" use "myCar" and engines
Ariel
@ArielLeslie
Oct 14 2015 14:25
(you might have to keep looking for a pair for a while. Not all campers want to pair and those that do might not be in the same place as you) @dht0my
i need help
Alec Rizor
@alecrizor
Oct 14 2015 14:26
@maffsojah Thank You! Was just confused on the format ;)
CamperBot
@camperbot
Oct 14 2015 14:26
alecrizor sends brownie points to @maffsojah :sparkles: :thumbsup: :sparkles:
:star: 189 | @maffsojah | http://www.freecodecamp.com/maffsojah
Chris Wilson
@blockbeard
Oct 14 2015 14:29
Anyone know why
'''
var array = str.split(" ");
var arrayLength = array.length;
'''
is giving me "cannot read property "length" of undefined". I guess I aren't defining the array properly somehow but I'm banging my head against the wall with this.
Coira Ellison
@Coira
Oct 14 2015 14:39
@Rageaholic that should work. post more code?
durairajaa
@durairajaa
Oct 14 2015 14:39
hello how can i get started with "zipline: Build a Personal Portfolio Webpage" some one help me pls
Chris Wilson
@blockbeard
Oct 14 2015 14:39
'''
CamperBot
@camperbot
Oct 14 2015 14:39
:bulb: to format code use backticks! ``` more info
Chris Wilson
@blockbeard
Oct 14 2015 14:40
var str
function findLongestWord(str) {

  var array = str.split(" ");
  var arrayLength = array.length;
  var i = 0
  var currentWord = " "
  var currentWordLength = 0
  var longestWord = 0
  var arrayLength = array.length;
  for (i; i<=arrayLength; i++){
    currentWord = array.pop();
    currentWordLength = currentWord.length;
    if (currentWord.length > longestWord){
    longestWord = currentWord.length;
  }

}
  return longestWord;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
Is my full solution, trying to get the length of the longest word in the array.
CamperBot
@camperbot
Oct 14 2015 14:40
:bulb: to format code use backticks! ``` more info
Chris Wilson
@blockbeard
Oct 14 2015 14:41
thanks @camperbot
CamperBot
@camperbot
Oct 14 2015 14:41
rageaholic sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 352 | @camperbot | http://www.freecodecamp.com/camperbot
Coira Ellison
@Coira
Oct 14 2015 14:41
@Rageaholic try removing the var str at the top?
durairajaa
@durairajaa
Oct 14 2015 14:41
coira could you guide me " zipline: Build a Personal Portfolio Webpage"
i have no idea
Chris Wilson
@blockbeard
Oct 14 2015 14:42
@Coira Same result , I think I only put it in to make sure everything was defined.
durairajaa
@durairajaa
Oct 14 2015 14:44
any one ready for pair programming?
Chris Wilson
@blockbeard
Oct 14 2015 14:44
@durairajaa What's your problem with it? IIRC it suggests a template to start with so you don';t have to go from scratch.
Coira Ellison
@Coira
Oct 14 2015 14:45
@Rageaholic for (i; i<=arrayLength; i++){ change <= to <
durairajaa
@durairajaa
Oct 14 2015 14:46
@Rageaholic really can i use template
@Rageaholic but i thought it would be lame
Coira Ellison
@Coira
Oct 14 2015 14:47
@durairajaa this is the template that's linked in the zipline http://codepen.io/FreeCodeCamp/pen/mJNqQj/
Chris Wilson
@blockbeard
Oct 14 2015 14:47
@Coira Thanks, that works fine now. Though I have no idea why. Well I guess I was using <= wrong, but IDK why that would throw me an error in something that seems unrelaed.
CamperBot
@camperbot
Oct 14 2015 14:47
rageaholic sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 275 | @coira | http://www.freecodecamp.com/coira
durairajaa
@durairajaa
Oct 14 2015 14:48
thanks @Rageaholic @Coira
CamperBot
@camperbot
Oct 14 2015 14:48
durairajaa sends brownie points to @rageaholic and @coira :sparkles: :thumbsup: :sparkles:
:star: 276 | @coira | http://www.freecodecamp.com/coira
:star: 180 | @rageaholic | http://www.freecodecamp.com/rageaholic
durairajaa
@durairajaa
Oct 14 2015 14:48
how to find a pair for me
Coira Ellison
@Coira
Oct 14 2015 14:48
@Rageaholic if you have an array [0, 1, 2, 3], it's length is 4, but to access the last element you would use array[3] because indexing starts from 0
@Rageaholic with this for (i; i<=arrayLength; i++) your i goes from 0 to 4, and will throw an error, because array[4] doesn't exist
but with this for (i; i<arrayLength; i++) i will go from 0 to 3 (i.e less than arrayLength)
make sense?
Chris Wilson
@blockbeard
Oct 14 2015 14:50
@Coira Aaaahhhh, I just assumed all counting would start at 0 so the count for [0,1,2,3] would be 3. So I was getting an error because I was trying to look at element 5, when there are only 4.
Coira Ellison
@Coira
Oct 14 2015 14:51
yep!
Rodrigo Castro
@castrors
Oct 14 2015 14:51
@catapixel thanks!
CamperBot
@camperbot
Oct 14 2015 14:51
castrors sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 456 | @catapixel | http://www.freecodecamp.com/catapixel
Coira Ellison
@Coira
Oct 14 2015 14:52
@durairajaa try here? https://gitter.im/FreeCodeCamp/LetsPair not sure how active it is though
Chris Wilson
@blockbeard
Oct 14 2015 14:53
@Coira Thanks so much, I have been banging my head on that for about 3 days, everything seemed so simple but it just wasn't working....I just hope I can do the next one!
CamperBot
@camperbot
Oct 14 2015 14:53
rageaholic sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:warning: rageaholic already gave coira points
Coira Ellison
@Coira
Oct 14 2015 14:54
it's so much fun when you've been stuck on something for ages and all you needed to do was change one little thing! :p
Dave Davids
@Falsedave
Oct 14 2015 14:58
can anyone see whats wrong with this line
<script> $(document).ready(function() {})</script>
Ariel
@ArielLeslie
Oct 14 2015 14:59
@Coira 90% of coding, I swear
Coira Ellison
@Coira
Oct 14 2015 14:59
:)
Ariel
@ArielLeslie
Oct 14 2015 14:59
@Falsedave missing semicolon
Dave Davids
@Falsedave
Oct 14 2015 15:00
@ArielLeslie ahh got it
thankyou
Brian K
@BKtheDAD
Oct 14 2015 15:02
help title case
CamperBot
@camperbot
Oct 14 2015 15:02

:point_right: bonfire title case a sentence [wiki]

Explanation:

We have to return a sentence with camel case. This means that the first letter will always be in uppercase and the rest lowercase.

:pencil: read more about bonfire title case a sentence on the FCC Wiki

calypte
@sarah-l
Oct 14 2015 15:04
help seek and destroy
CamperBot
@camperbot
Oct 14 2015 15:04

:point_right: bonfire seek and destroy [wiki]

Explanation:

This problem is a bit tricky because you have to familiarize yourself with Arguments, as you will have to work with two or more but on the script you only see two. Many people hardcode this program for three arguments. You will remove any number from the first argument that is the same as any other other arguments.

:pencil: read more about bonfire seek and destroy on the FCC Wiki

Fernando
@fersousa
Oct 14 2015 15:07
Hi, I'm in "Waypoint: Nest an Anchor Element within a Paragraph"
And placed this line: "<P class="red-text">View more <a href="http://www.freecatphotoapp.com">cat photos</a></P>"
But it shows a message error: "Your p element should have the text "View more " (with a space after it)."
Can someone help me?
dht0my
@dht0my
Oct 14 2015 15:13
hello I am at the Bonfire: Reverse a String.
function reverseString(str) {
  return str;
}

reverseString("hello");

var reverseString = "hello";

var reverseString = reverseString;
reverseString = reverseString.split('');

reverseString = reverseString.reverse();

reverseString = reverseString.join("");




(function() {return reverseString;})();
this is my code, can anybody help me :)
thx
CamperBot
@camperbot
Oct 14 2015 15:13
if you want to thank someone, put an @ before their name!
dht0my
@dht0my
Oct 14 2015 15:14
reverseString("hello") should become "olleh".
h4r1m4u
@h4r1m4u
Oct 14 2015 15:15
@fersousa that should work. it works for me at least
Ariel
@ArielLeslie
Oct 14 2015 15:15
explain format
CamperBot
@camperbot
Oct 14 2015 15:15

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Ariel
@ArielLeslie
Oct 14 2015 15:15
@dht0my :point_up_2:
dht0my
@dht0my
Oct 14 2015 15:16
thanks @ArielLeslie
CamperBot
@camperbot
Oct 14 2015 15:16
dht0my sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 503 | @arielleslie | http://www.freecodecamp.com/arielleslie
Fernando
@fersousa
Oct 14 2015 15:17
@h4r1m4u Yes, It should. But didn't :-(
h4r1m4u
@h4r1m4u
Oct 14 2015 15:18
@fersousa can you post all your code? everything that you have in the code pane?
Coira Ellison
@Coira
Oct 14 2015 15:18
@h4r1m4u @fersousa doesn't work for me either, and I can't see why
Fernando
@fersousa
Oct 14 2015 15:19

@h4r1m4u <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 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>

<P class="red-text">View more <a href="http://www.freecatphotoapp.com">cat photos</a></P>

Ariel
@ArielLeslie
Oct 14 2015 15:19
@h4r1m4u @fersousa If it's in a codepen, just post the link to the pen
h4r1m4u
@h4r1m4u
Oct 14 2015 15:20
@fersousa ok, i know what the issue is
@fersousa you put the code at the end which is technically correct. but they want you to wrap the existing <a> in the <p> tag
the <a> on the 5th line from the bottom
@fersousa a sidenote, the convention is to use small letters in the HTML tags. so <p>, not <P>. it'll work with caps too, but it's not common
dht0my
@dht0my
Oct 14 2015 15:25
Can someone help me with Bonfire: Reverse a String?
function reverseString(str) {
  return str;
}

reverseString("hello");

var reverseString = "hello";

var array = reverseString;
array = reverseString.split('');

array = array.reverse();
array = array.join("");




(function() {return array;})();
Fernando
@fersousa
Oct 14 2015 15:27
@h4r1m4u It worked! Just placed de <p> tag with <a> tag near the picture. Thank you?
CamperBot
@camperbot
Oct 14 2015 15:27
fersousa sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 225 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 14 2015 15:28
@fersousa :) you're welcome
Fernando
@fersousa
Oct 14 2015 15:28
@ArielLeslie What is codepen?
Ariel
@ArielLeslie
Oct 14 2015 15:28
@fersousa You'll get there with your first zipline. No need to worry about it yet. ;)
h4r1m4u
@h4r1m4u
Oct 14 2015 15:28
@fersousa http://codepen.io. once you get to your ziplines
h4r1m4u
@h4r1m4u
Oct 14 2015 15:28
snap :)
Fernando
@fersousa
Oct 14 2015 15:30
@ArielLeslie thanks
CamperBot
@camperbot
Oct 14 2015 15:30
fersousa sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 504 | @arielleslie | http://www.freecodecamp.com/arielleslie
mchouse
@housewar
Oct 14 2015 15:32
@dht0my all the bonfires have the same basic format: a function, followed by a function call. The challenge is always to edit the function so that the function call returns the right value. The edits you made are all outside the function, after the function call.
@dht0my this might also be a useful link.
Ian
@IanR0
Oct 14 2015 15:35
@dht0my you are almost there. You need to put the code into the function. So when the function is run with the input "Hello" it takes that string and then reverses it. The order you have is correct. You need to split the string then reverse it then rejoin it.
Lyzzeth Parody Álvarez
@lizparody
Oct 14 2015 15:36
hello, somebody can help me with basic javascript "Waypoint: Use Conditional Logic with If and Else Statements"
h4r1m4u
@h4r1m4u
Oct 14 2015 15:37
what do you need @lizparody ?
Lyzzeth Parody Álvarez
@lizparody
Oct 14 2015 15:37
@h4r1m4u Thanks for replying... I'm doing this
if (flip === 0){
return head;
} else {
return tail;
}
CamperBot
@camperbot
Oct 14 2015 15:37
lizparody sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 226 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Lyzzeth Parody Álvarez
@lizparody
Oct 14 2015 15:37
but it doesn't work
h4r1m4u
@h4r1m4u
Oct 14 2015 15:39
@lizparody are you getting 'not defined' error?
Lyzzeth Parody Álvarez
@lizparody
Oct 14 2015 15:40
@h4r1m4u I'm getting a Program Execution Failure
Coira Ellison
@Coira
Oct 14 2015 15:40
@lizparody i think they need to be strings
tva10
@tva10
Oct 14 2015 15:40
@lizparody You need to return string Text value there
  // Only change code below this line.
if (flip === 0){
return 'heads';
} else {
return 'tails';
}
Lyzzeth Parody Álvarez
@lizparody
Oct 14 2015 15:40
:O thanks!!!
CamperBot
@camperbot
Oct 14 2015 15:40
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 14 2015 15:40
as they said :)
Lyzzeth Parody Álvarez
@lizparody
Oct 14 2015 15:40
@tva10 @Coira thanks
CamperBot
@camperbot
Oct 14 2015 15:40
lizparody sends brownie points to @tva10 and @coira :sparkles: :thumbsup: :sparkles:
:star: 277 | @coira | http://www.freecodecamp.com/coira
:star: 313 | @tva10 | http://www.freecodecamp.com/tva10
h4r1m4u
@h4r1m4u
Oct 14 2015 15:40
if you don't wrap heads and tails in quotes, they're considered variables
tva10
@tva10
Oct 14 2015 15:40
@lizparody in your code you try to access head and tail variable
))
Ajay Singh
@Sammi-93
Oct 14 2015 16:12
hi guys i need help with a javascript code

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

arr=arr.join(' ');
return arr;

}
titleCase("sHoRt AnD sTouT", "");

this is the code i wrote to title case a sentence...can anyone tell me where am i goin wrong?
Ariel
@ArielLeslie
Oct 14 2015 16:16
help format
CamperBot
@camperbot
Oct 14 2015 16:16

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Ariel
@ArielLeslie
Oct 14 2015 16:16
@Sammi-93 :point_up_2:
MANOJ MURALI
@manojmurli
Oct 14 2015 16:21
Hi i'm doing Waypoint: Bring your JavaScript Slot Machine to Life
but i'm not able to exactly understand what needs to be done
Ariel
@ArielLeslie
Oct 14 2015 16:22
@manojmurli what part confuses you?
Bob Moree
@bmoree
Oct 14 2015 16:22
Hi, where should I go for questions about the non-profit aplication form?
MANOJ MURALI
@manojmurli
Oct 14 2015 16:23
    // Only change code below this line.
    selector $(".slot");
    $($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);

    // Only change code above this line.
unable to complete this waypoint
Bob Moree
@bmoree
Oct 14 2015 16:26
@ArielLeslie I see, but it's more like I'm still about 500hrs away from starting our open source e-learning platform, so I thought maybe FCC can help us out...
Problem is, we're not a registered non-profit or official in any way. It's just me helping two linguistics researchers on their project..
Ariel
@ArielLeslie
Oct 14 2015 16:27
@bmoree Ah. You represent a nonprofit. I thought you were a camper who wanted to work with a nonprofit.
Bob Moree
@bmoree
Oct 14 2015 16:28
@ArielLeslie well, I'm both
I'm the (not so) technical guy of the non-profit ;-)
Ariel
@ArielLeslie
Oct 14 2015 16:29
@bmoree -- @CodeNonprofit Is the person to talk to.
Bob Moree
@bmoree
Oct 14 2015 16:30
@ArielLeslie Thanks a bunch! (should I PM, or just use the main chatroom?)
CamperBot
@camperbot
Oct 14 2015 16:30
bmoree sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 506 | @arielleslie | http://www.freecodecamp.com/arielleslie
Ariel
@ArielLeslie
Oct 14 2015 16:33
This message was deleted
Bettina Schaden
@bSchaden
Oct 14 2015 16:34
help bonfires
CamperBot
@camperbot
Oct 14 2015 16:34

:point_right: what the style guide for bonfires is [wiki]

Writing Bonfire challenges is a great way to exercise your own problem solving and testing abilities. Follow this process closely to maximize the chances of us accepting your bonfire.

  • Fork the Free Code Camp repository and open seed_data/bonfires.json to become familiar with the format of our bonfires.
  • Regardless of your bonfire's difficulty, put it as the last bonfire in the JSON file. Change one of the numbers in the ID to ensure that your bonfire has a unique ID.
  • In the terminal, run node seed_data/seed.js. Run gulp. You should be able to navigate to your new bonfire in the challenge map. Whenever you make a change to bonfire.json, you'll need to reseed in order to see these changes in the browser.
  • Solve your own Bonfire. Confirm that your tests work as expected and that your instructions are sufficiently clear.
  • Submit a pull request to Free Code Camp's Staging branch and in the pull request body, link to a gist that has your algorithmic solution.

Here is a description of each of the Bonfires' fields.

  • Name - The name of your challenge. It's OK for this to be humorous but it must be brief and relevant to the task.
  • Difficulty - Attempt to rate difficulty compared against existing bonfire challenges. A good proxy for the difficulty of a bonfire is how long it takes you to solve it. For every 15 minutes it takes, increase the difficulty. For example, a one-hour bonfire should probably be a 4.
  • Description- Separate paragraphs with a line break. Only the first paragraph is visible prior to a user before they click the the 'More information' button. All necessary information must be included in the first paragraph. Write this first paragraph as succinctly as possible. Subsequent paragraphs should offer hints or details if needed. If your subject matter warrants deeper understanding, you may link to Wikipedia.
  • Challenge Seed - This is where you set up what will be in the editor when the camper starts the bonfire.
  • Tests - These tests are what bring your challenge to life. Without them, we cannot confirm the accuracy of a user's submitted answer. Choose your tests wisely. Bonfire tests are written using the Chai.js assertion library. Please use the should and expect syntax for end user readability. As an example of what not do to, many of the original Bonfire challenges are written with assert syntax and many of the test cases are difficult to read. If your bonfire question has a lot of edge cases, you will need to write many tests for full coverage. If you find yourself writing more tests than you desire, you may consider simplifying the requirements of your bonfire challenge. For difficulty level 1 through 3, you will generally only need 2 to 4 tests.
  • MDNlinks- Take a look at seed_data/bonfireMDNlinks.js. If any of these concepts are relevant to your bonfire, be sure to include them. If you know of an MDN article that isn't linked here, you can add it to the bonfireMDNlinks.js file before adding it to your bonfire.
    :pencil: read more about what the style guide for bonfires is on the FCC Wiki
Ariel
@ArielLeslie
Oct 14 2015 16:34
@bmoree If you hover over his screenname you'll see his email address
Bob Moree
@bmoree
Oct 14 2015 16:34
Thanks again :-)
CamperBot
@camperbot
Oct 14 2015 16:34
if you want to thank someone, put an @ before their name!
Bettina Schaden
@bSchaden
Oct 14 2015 16:34
not what I wanted. Where is the bonfire help room?
Ariel
@ArielLeslie
Oct 14 2015 16:36
wiki rooms
CamperBot
@camperbot
Oct 14 2015 16:36

:point_right: help rooms [wiki]

There are official help rooms for each major section of FCC content:

Chat Room Description
Help get help with our Waypoint challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpZiplines get help with our Zipline challenges from your fellow campers
HelpBasejumps get help with our Basejump challenges from your fellow campers
NonprofitProjects get help with your Nonprofit Projects from your fellow campers
CodeReview get constructive criticism and advice on finished code from your fellow campers
YouCanDoThis learning to code is hard - share your feelings and get moral support here

Choose the right room for your question!
:pencil: read more about help rooms on the FCC Wiki

Ariel
@ArielLeslie
Oct 14 2015 16:36
@bschaden :point_up_2:
bmancina13
@bmancina13
Oct 14 2015 16:38

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

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


</style>

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

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

Ariel
@ArielLeslie
Oct 14 2015 16:39
help format
CamperBot
@camperbot
Oct 14 2015 16:39

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Ariel
@ArielLeslie
Oct 14 2015 16:39
@bmancina13 :point_up_2:
Mistereo
@Mistereo
Oct 14 2015 16:43
hi all :)
Bettina Schaden
@bSchaden
Oct 14 2015 16:46
In bonfire Reverse a String I have to turn the string into an array. Is that the .split part? I had to look at answer to even know what's being asked, but I'm trying my best to understand each part.
Jayeson
@Jayeson
Oct 14 2015 16:46
how to be lobster
Mistereo
@Mistereo
Oct 14 2015 16:48
@bschaden yes, you can turn string into an array of characters by passing an empty string as argument to .split:
'abc'.split(''); // gives ['a', 'b','c']
Bettina Schaden
@bSchaden
Oct 14 2015 16:49
Is the empty argument the ('')?
@Mistereo
Mistereo
@Mistereo
Oct 14 2015 16:51
@bschaden the empty string is ''
Jayeson
@Jayeson
Oct 14 2015 16:52
(Apply the font-family of Lobster to your h2 element). how i do it
Bettina Schaden
@bSchaden
Oct 14 2015 16:56
@Mistereo Argument is what goes between the parenthesis, correct?
Mistereo
@Mistereo
Oct 14 2015 17:06
@bschaden yes, arguments, there are can be more than one :)
Bettina Schaden
@bSchaden
Oct 14 2015 17:09
thanks @Mistereo I know these are basic questions, but it helps me understand everything.
CamperBot
@camperbot
Oct 14 2015 17:09
bschaden sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 308 | @mistereo | http://www.freecodecamp.com/mistereo
Becky
@martinbeks
Oct 14 2015 17:09

Javascript is going to be the death of me. I always manage to get half the exercise correct, and then am at a loss as to where to go next.
Here is my code:
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop(["cat", 2]); <--I'VE ONLY CHANGED THIS LINE, THE REST WAS ALREADY THERE

var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]

**Now it's saying that "removed" should only contain ["cat", 2]
I honestly have no idea what that means, or what I'm supposed to do. The instructions in this JavaScript lesson aren't helpful.

Ariel
@ArielLeslie
Oct 14 2015 17:12
help format
CamperBot
@camperbot
Oct 14 2015 17:12

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

``` ⇦ Type 3 backticks and 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

Ariel
@ArielLeslie
Oct 14 2015 17:12
@martinbeks :point_up_2:
Becky
@martinbeks
Oct 14 2015 17:15
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop(["cat", 2]);
var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]
Jake Woods
@djakewoods
Oct 14 2015 17:15
@manojmurli Me too!
Becky
@martinbeks
Oct 14 2015 17:15

Did not know that. That's good info to have for the future. Now, any answers to the question?

var removed = myArray.pop(["cat", 2]);

Is all I've changed.

Matt Yamamoto
@MattYamamoto
Oct 14 2015 17:15
@martinbeks first, the .pop() method doesn't take any parameters/arguments... you just call it on an array array.pop() and it removes the last element in the arry, and returns that.
so you don't need anything in the parens
second, you are assigning a value to removed twice... so in the end removed is the same as myArray
Becky
@martinbeks
Oct 14 2015 17:17
Brilliant. Thanks, @MattYamamoto ! Thank you!
CamperBot
@camperbot
Oct 14 2015 17:17
martinbeks sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 367 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Mistereo
@Mistereo
Oct 14 2015 17:18
var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.
var removed = myArray.pop(["cat", 2]); // removed now ["cat", 2], myArray now ["John", 23]
var removed = myArray; // removed now equals myArray and equals ["John", 23]
Jake Woods
@djakewoods
Oct 14 2015 17:18
Good evening all! I am really struggling with the "Bring your slot machine to life" waypoint, I'm fairly sure I have nailed the first part but have absolutely no idea where to go from there...
Mistereo
@Mistereo
Oct 14 2015 17:19
@djakewoods show you code, and provide a link to this waypoint :)
Brian K
@BKtheDAD
Oct 14 2015 17:21
help largest array
CamperBot
@camperbot
Oct 14 2015 17:21
no wiki entry for: largest array
:pencil: click here to create one now!after creating your page type update to reload it here
Jake Woods
@djakewoods
Oct 14 2015 17:21
@Mistereo sorry! my code is as follows:
$($(".slot"){0}).html(slotOne);
$($(".slot"){1}).html(slotTwo);
$($(".slot"){2}).html(slotThree);
Brian K
@BKtheDAD
Oct 14 2015 17:21
help return largest numbers in array
CamperBot
@camperbot
Oct 14 2015 17:21

:point_right: bonfire return largest numbers in arrays [wiki]

Explanation:

You will get an array that contains sub arrays of numbers and you need to return an array with the largest number from each of the sub arrays.

:pencil: read more about bonfire return largest numbers in arrays on the FCC Wiki

Brian K
@BKtheDAD
Oct 14 2015 17:22
can someone help with the largest numbers in array
i honestly have no idea where to start with this
and please don’t give me the answer
Ariel
@ArielLeslie
Oct 14 2015 17:23
@djakewoods You are using curly braces for an index :)
Mistereo
@Mistereo
Oct 14 2015 17:23
@djakewoods at least $(".slot"){0} should be $(".slot")[0].
Marcos
@marcosmohar
Oct 14 2015 17:23
@djakewoods you are using curly braces
Bettina Schaden
@bSchaden
Oct 14 2015 17:24
help factorialize a number
CamperBot
@camperbot
Oct 14 2015 17:24

:point_right: bonfire factorialize a number [wiki]

The problem

Return the factorial of the provided integer. If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

Factorials are often represented with the shorthand notation n!

For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f

:pencil: read more about bonfire factorialize a number on the FCC Wiki

Mistereo
@Mistereo
Oct 14 2015 17:25
@bkthegeek do you have any code?
Brian K
@BKtheDAD
Oct 14 2015 17:27
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]]);
that’s the base code
i read through the hints and i feel like I have no idea what it’s saying
i understand I have to do a for loop
would it be something along the lines of (i = 0; i = max; i++)
Mistereo
@Mistereo
Oct 14 2015 17:28
@bkthegeek ok, try to write a function that for given simple array returns a maximum element from it.
Bill
@kirah1314
Oct 14 2015 17:29
@bkthegeek the bonfire is asking you to return an array with the biggest numbers in each of the given array arr
Mistereo
@Mistereo
Oct 14 2015 17:29
@bkthegeek lets say function findMax(arr) {} so that: findMax([23,45,4,1000]) returns 1000
Bill
@kirah1314
Oct 14 2015 17:29
@bkthegeek for example out of [4, 5, 1, 3] the biggest number is 5
Brian K
@BKtheDAD
Oct 14 2015 17:30
@kirah1314 i unerstand that I need to find the largest in each array
I’m just unsure as to where to start
Mistereo
@Mistereo
Oct 14 2015 17:30
@bkthegeek can you write a function for one array?
Brian K
@BKtheDAD
Oct 14 2015 17:30
so i would write that function within the function @Mistereo
Mistereo
@Mistereo
Oct 14 2015 17:31
it's better to write it outside.
Bill
@kirah1314
Oct 14 2015 17:31
^ that's usually how I go about it too. Write codes to find the biggest number in 1 array first and then expand it
Mistereo
@Mistereo
Oct 14 2015 17:32
@bkthegeek I can help you at floobits if you want :)
Brian K
@BKtheDAD
Oct 14 2015 17:33
@Mistereo what’s floobits?
VeeShostak
@VeeShostak
Oct 14 2015 17:36
@Mistereo That is awesome, thanks for sharing
CamperBot
@camperbot
Oct 14 2015 17:36
veeshostak sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 309 | @mistereo | http://www.freecodecamp.com/mistereo
Jake Woods
@djakewoods
Oct 14 2015 17:42
@ArielLeslie @Mistereo @marcosmohar Ahh! Stupid mistake, thanks for the help guys! Cheers!
CamperBot
@camperbot
Oct 14 2015 17:42
djakewoods sends brownie points to @arielleslie and @mistereo and @marcosmohar :sparkles: :thumbsup: :sparkles:
:star: 509 | @arielleslie | http://www.freecodecamp.com/arielleslie
:star: 176 | @marcosmohar | http://www.freecodecamp.com/marcosmohar
:star: 310 | @mistereo | http://www.freecodecamp.com/mistereo
Jose Martinez
@movingonup08
Oct 14 2015 17:49
I am on lesson 53 and I am having trouble inheriting the background color to my h1 header
Joseph Botros
@josephwasily
Oct 14 2015 17:55
what is the difference between a callback function and promise ?
Andrew
@anjanjanj
Oct 14 2015 18:01
@josephwasily Here are some explanations on Quora better than I can do :smile: https://www.quora.com/Whats-the-difference-between-a-promise-and-a-callback-in-Javascript
Ariel
@ArielLeslie
Oct 14 2015 18:03
@movingonup08 what problem, specifically, are you having?
AdrianneGeyer
@AdrianneGeyer
Oct 14 2015 18:08
This message was deleted
Jay Stretter
@Afrodisiac
Oct 14 2015 18:08
@movingonup08 Please paste your code here, so that we may help you.
AdrianneGeyer
@AdrianneGeyer
Oct 14 2015 18:11
bonfire $CHUNKYMONKEY
CamperBot
@camperbot
Oct 14 2015 18:11
Sorry, can't find a bonfire called chunkymonkey. [ Check the map? ]
AdrianneGeyer
@AdrianneGeyer
Oct 14 2015 18:12
bonfire $Chunk
CamperBot
@camperbot
Oct 14 2015 18:12

: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

AdrianneGeyer
@AdrianneGeyer
Oct 14 2015 18:14
This message was deleted
This is my code: var emptyArray = []
var sliceArray = arr.splice(0, size);
while(arr.length)
{
emptyArray.push(sliceArray);
emptyArray.push(arr);
return emptyArray;
}
Moisés Man
@moigithub
Oct 14 2015 18:16
return exit the function immediatelly,, so ur while loop will only loop once
splice.. should be inside ur loop
AdrianneGeyer
@AdrianneGeyer
Oct 14 2015 18:18
This message was deleted
Elizabeth Hatleli
@TheHighPriestess
Oct 14 2015 18:28
I'm working on the Stylize Stories on Camper News zipline and I'm getting back "undefined" for the headline. Does anyone know why?

function camperNews(){
  $.ajax({
    url: "http://www.freecodecamp.com/news/hot",
    data: {
      format: "jsonp"
    },
     success: function(data) {
       $(".test").html("headline: " + data.headline);
     }//end success
  });//end ajax
}//end camperNews

camperNews();
Brian K
@BKtheDAD
Oct 14 2015 18:28
tons of thanks to @Mistereo for helping me through the largest array bonfire
CamperBot
@camperbot
Oct 14 2015 18:28
bkthegeek sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 311 | @mistereo | http://www.freecodecamp.com/mistereo
Blee
@bleesand
Oct 14 2015 18:29
having issues with Bonfire Palindromes. Not sure why not passing? Would really appreciate ur thoughts.
Hans van Riet
@hansinla
Oct 14 2015 18:29
@TheHighPriestess It’s an array, so try data[0].headline
Elizabeth Hatleli
@TheHighPriestess
Oct 14 2015 18:30
@hansinla thanks. that worked :)
CamperBot
@camperbot
Oct 14 2015 18:30
thehighpriestess sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 531 | @hansinla | http://www.freecodecamp.com/hansinla
Blee
@bleesand
Oct 14 2015 18:30
blob
having issues with Bonfire Palindromes. Not sure why not passing? Would really appreciate ur thoughts.
Herman Fassett
@HermanFassett
Oct 14 2015 18:34
@bleesand you're missing a closing curly bracket for your function
Rex Schrader
@SaintPeter
Oct 14 2015 18:34
@bleesand Also, /\s\W/ won't do what you expect. That matches a space FOLLOWED by a non-word character.
@bleesand You need a character class around it. Try it at http://regex101.com
Herman Fassett
@HermanFassett
Oct 14 2015 18:35
@bleesand \s shouldn't be necessary since \W takes care of that, and _ will need to be accounted for
Blee
@bleesand
Oct 14 2015 18:38
Thought we need to remove punctuation and spaces. so \s identifies spaces and \W any punctuation. is that correct?
Herman Fassett
@HermanFassett
Oct 14 2015 18:38
\W also indentifies spaces
But it doesn't identify literal underscore _
Blee
@bleesand
Oct 14 2015 18:39
@HermanFassett does \W also take care of spaces?
Herman Fassett
@HermanFassett
Oct 14 2015 18:39
Yes @bleesand
Rex Schrader
@SaintPeter
Oct 14 2015 18:42
@bleesand \W is a shortcut for /[^a-zA-Z0-9_]/
@bleesand Which basically means "Anything that is not a letter, number, or underscore"
Blee
@bleesand
Oct 14 2015 18:44
Thank you @HermanFassett
CamperBot
@camperbot
Oct 14 2015 18:44
bleesand sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 367 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
noobstar
@namsir
Oct 14 2015 18:47
anyone available?
i think i broke FCC
Rafael J. Rodriguez
@Rafase282
Oct 14 2015 18:50
what's wrong?
Alex
@wishe
Oct 14 2015 18:51
How come this does not work?
Blee
@bleesand
Oct 14 2015 18:51
Thanks @SaintPeter
CamperBot
@camperbot
Oct 14 2015 18:51
bleesand sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1022 | @saintpeter | http://www.freecodecamp.com/saintpeter
noobstar
@namsir
Oct 14 2015 18:51
i've tested my script it works fine.
when i submit it ....fcc just freezes
Alex
@wishe
Oct 14 2015 18:52
function where(collection, source) {
  var arr = [];

  for (var i = 0; i < collection.length; i++) {
      if(collection[i][Object.keys(source)[0]] === source[Object.keys(source)[0]]) {
          arr.push(collection[i]);
      }
  }
  return arr;
}
where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Do i need to loop the source to account for more arguments then only 0?
noobstar
@namsir
Oct 14 2015 18:52
i was using recursion.
Blee
@bleesand
Oct 14 2015 18:53
So now check Palindromes passes to the last option. not sure how to handle the character between o-o and o_o?
noobstar
@namsir
Oct 14 2015 18:53
even if i exit out of my chrome and went back it...it still freezes lol
Mistereo
@Mistereo
Oct 14 2015 18:53
@bleesand show your current code.
Rex Schrader
@SaintPeter
Oct 14 2015 18:54
@namsir You'll need to clear the local storage - let me find that article
find local storage
Rex Schrader
@SaintPeter
Oct 14 2015 18:55
1
wiki how to clear
CamperBot
@camperbot
Oct 14 2015 18:55

:point_right: how to clear specific values from your browser's local storage [wiki]

Removing specific values from your browser's local storage will solve many problems related to the browser crashing or freezing on FreeCodeCamp.

This solves, as example, a common problem with browser hanging out in a challenge's page after saving a response with an infinite loop.

When this happens, you must delete the value in localStorage storing that response.

In Firefox:

  • On freecodecamp.com, open your web console with
    • Ctrl + Shift + K
  • From there, using directly the console:
    • Type console.log(localStorage); and hit Enter.
    • Click in Storage link.
      Print the localStorage Object from web console and show the Storage
    • The Storage panel will appear at right.
    • Filter the results to find the bonfire, zipline or waypoint causing the problem.
    • When located, mouse over it and click the x at right.
      Click the x for deleting the value entry.
    • Once removed, check if the problem was solved. Refresh or close and open the browser if necessary.

Note: This can also be done with the Storage Inspector, but seems like Firefox hangs out when there are so many values.
:pencil: read more about how to clear specific values from your browsers local storage on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 14 2015 18:55
@namsir :point_up: October 14, 2015 11:55 AM
Alex
@wishe
Oct 14 2015 18:55
wow
Rex Schrader
@SaintPeter
Oct 14 2015 18:55
@wishe So, um, yeah, that's why recursion is hard :D
Alex
@wishe
Oct 14 2015 18:56
huh?
@SaintPeter i dont follow, did you read my question?
Mistereo
@Mistereo
Oct 14 2015 18:58
@wishe it was for @namsir I guess :)
Rex Schrader
@SaintPeter
Oct 14 2015 18:58
@wishe erm - gimme a sec - helping someoe in another channel
Alex
@wishe
Oct 14 2015 18:59
Ah it was for @namsir
noobstar
@namsir
Oct 14 2015 18:59
i couldn't find the X in console
Rex Schrader
@SaintPeter
Oct 14 2015 18:59
@wishe You need to keep in mind that there may be more than one key in source
Alex
@wishe
Oct 14 2015 19:00
@SaintPeter I tried to add a loop that looped source inside of the other loop and then use j instead of 0
but it gave me nothing
Also i was wondering, is it possible to use Object.keys with dot notation instead of []?
Blee
@bleesand
Oct 14 2015 19:03
blob
Not sure what to do with the last one?
Rex Schrader
@SaintPeter
Oct 14 2015 19:03
@wishe Yes, exactly. You need to grab Object.keys(source) and use that to loop through
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:03
Hey @SaintPeter , I discussed the Mutations bonfire with you yesterday.
noobstar
@namsir
Oct 14 2015 19:03
@SaintPeter i got it reset. Now want to explain to me why it freezes?
Rex Schrader
@SaintPeter
Oct 14 2015 19:03
@TheyCallMeSnarfy Yup - make any progress?
@namsir PRoably because you don't have an exit condititon that is met
noobstar
@namsir
Oct 14 2015 19:03
function steamroller(arr) {
  // I'm a steamroller, baby
  var newArr=[];

  function deeper(a){
      if(Array.isArray(a)){
          for(i=0; i < a.length;i++){
              deeper(a[i]);
          }
      }else{
          newArr.push(a);
      }
  }

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

  return newArr;
}

steamroller([1, [2], [3, [[4]]]]);
Rex Schrader
@SaintPeter
Oct 14 2015 19:04
@namsir The so called "Base Case"
noobstar
@namsir
Oct 14 2015 19:04
@SaintPeter it works on repl.it
Rex Schrader
@SaintPeter
Oct 14 2015 19:04
@namsir You need to return from your deeper function, I think.
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:04
@SaintPeter Sort of. I had people recommended several different approaches to the problem, which I think may be confusing me further.
Rex Schrader
@SaintPeter
Oct 14 2015 19:04
@TheyCallMeSnarfy haha
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:05
Mind if I show you where I'm at now?
Rex Schrader
@SaintPeter
Oct 14 2015 19:05
@namsir Humm - that mostly looks like it ought to work. Why not just make steamroller itself the recursive call?
@TheyCallMeSnarfy Lay it on me bro
noobstar
@namsir
Oct 14 2015 19:06
@SaintPeter yeah it didn't freeze on my other tabs.
Alex
@wishe
Oct 14 2015 19:06
@SaintPeter Ok, thanks i will try some more ideas.!
CamperBot
@camperbot
Oct 14 2015 19:06
wishe sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1024 | @saintpeter | http://www.freecodecamp.com/saintpeter
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:06
function mutation(arr) {
    var split0 = arr[0].split("");
    var split1 = arr[1].split("");
    for (i = 0; i < split0.length; i++)
      if (split0.indexOf(split1[i]) != -1)
          return true;
      if (split0.indexOf(split1[i]) === -1)
          return false;
}
What's confusing me is that my false condition still isn't working, for what seems like would be the simplest cases
mutation(["hello", "hey"]) should return false.
mutation(["hello", "neo"]) should return false.
DJ
@qualitymanifest
Oct 14 2015 19:07
This message was deleted
Rex Schrader
@SaintPeter
Oct 14 2015 19:07
@TheyCallMeSnarfy ok, step 1: Add some curly braces to your for loop.
@TheyCallMeSnarfy the underlying the problem is this: You cannot return true until you are done looping.
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:08
I have added else if before, but what's funny is that it causes the code to fail other cases
But that's another issue, I'm guessing
Mistereo
@Mistereo
Oct 14 2015 19:09
@bleesand you should remove underscores too.
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:09
So, would I need to write a condition outside of the loop to return true once it's finished?
I see the logic of what you're saying, the difficulty is just translating it to code I can be confident in
Rex Schrader
@SaintPeter
Oct 14 2015 19:10
@TheyCallMeSnarfy Correct. Because if there is no match it will automatically exit via the false. Only if you have gone through the entire loop can you say it is true.
Mateo Pool
@IAmMyself
Oct 14 2015 19:10
Can someone help me think through Bonfire: Roman Numeral Converter
CamperBot
@camperbot
Oct 14 2015 19:10
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
noobstar
@namsir
Oct 14 2015 19:11
@SaintPeter forEach works
searched on github
Rex Schrader
@SaintPeter
Oct 14 2015 19:12
@namsir You got it working?
@IAmMyself Sure
noobstar
@namsir
Oct 14 2015 19:13
@SaintPeter sort of.....using forEach instead of for loop
odd and weird but passed.
Rex Schrader
@SaintPeter
Oct 14 2015 19:13
@namsir Passed is passed :D
noobstar
@namsir
Oct 14 2015 19:13
lol
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:14
function mutation(arr) {
    var split0 = arr[0].split("");
    var split1 = arr[1].split("");
    for (i = 0; i < split0.length; i++) {
      if (split0.indexOf(split1[i]) === -1)
          return false;
    }
    if (split0.indexOf(split1) > -1)
      return true;
}
@SaintPeter What do you think?
Did I miss the point?
Mateo Pool
@IAmMyself
Oct 14 2015 19:14
@SaintPeter I can't see how one might go about solving it
Rex Schrader
@SaintPeter
Oct 14 2015 19:14
@TheyCallMeSnarfy That the last if statement is not needed. Does it work?
@IAmMyself gimme one moment and I'll lay it out for you
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:15
No, it doesn't
Rex Schrader
@SaintPeter
Oct 14 2015 19:15
@TheyCallMeSnarfy remove the second if statement and just leave the return true
@TheyCallMeSnarfy This is "backwards": if (split0.indexOf(split1[i]) === -1)
@TheyCallMeSnarfy You need to search split1 for split0[i] because you're looping through split0
@IAmMyself ok, do you know how to manually convert a number to roman numerals?
Mateo Pool
@IAmMyself
Oct 14 2015 19:17
yes
Rex Schrader
@SaintPeter
Oct 14 2015 19:17
@IAmMyself Can you describe the process, in general?
Mistereo
@Mistereo
Oct 14 2015 19:17
@SaintPeter looks like it's not true.
Rex Schrader
@SaintPeter
Oct 14 2015 19:17
@IAmMyself Like, if you have the number 2014, how do you manually convert that?
@Mistereo No context, no idea what you're talking about
Mistereo
@Mistereo
Oct 14 2015 19:18
you should check that all characters from arr[1] presented in arr[0] not opposite.
@SaintPeter "You need to search split1 for split0[i] because you're looping through split0"
Rex Schrader
@SaintPeter
Oct 14 2015 19:18
@Mistereo Ah, in that case his loop is using the wrong item
Mistereo
@Mistereo
Oct 14 2015 19:18
yep.
Mateo Pool
@IAmMyself
Oct 14 2015 19:19
2000 = MM, 10 = X, 4 = IV @SaintPeter
TheyCallMeSnarfy
@TheyCallMeSnarfy
Oct 14 2015 19:19
function mutation(arr) {
    var split0 = arr[0].split("");
    var split1 = arr[1].split("");
    for (i = 0; i < split0.length; i++) {
      if (split1.indexOf(split0[i]) === -1)
          return false;
    }
      return true;
}
@SaintPeter Is that what you meant by leaving return true?
I'm not sure if I understand that
Rex Schrader
@SaintPeter
Oct 14 2015 19:19
@TheyCallMeSnarfy
function mutation(arr) {
    var split0 = arr[0].split("");
    var split1 = arr[1].split("");
    for (i = 0; i < split0.length; i++) {  // Need to loop through split1
      if (split0.indexOf(split1[i]) === -1)
          return false;
    }
    if (split0.indexOf(split1) > -1)  // Delete this line
      return true;  // Keeep this
}
@TheyCallMeSnarfy Think about the conditions:
1) If any letter is in split0 but not in split1, you're done. Return false.
2) Only if EVERY letter matches (and you're done checking) can you return true
@IAmMyself ok, so you may have noticed yourself doing math. 2000 / 1000 = 2, means two M's, then you have 14 left. 14 / 10 = 1, one X, 4/4 = 1, one "IV"
Mateo Pool
@IAmMyself
Oct 14 2015 19:22