These are chat archives for FreeCodeCamp/Help

31st
Aug 2015
Matt Everson
@matteverson
Aug 31 2015 00:04
@YanKozlovskiy Check out the examples here: http://www.regexr.com/
MatiKid
@MatiKid
Aug 31 2015 00:06
I’m doing the Quotes Zipline
but I can’t get the twitter button to share the quote
How did you go about it?
Tim
@timmcallister
Aug 31 2015 00:07
@MatiKid does it not open a new window/tab?
what exactly is failing?
Note that CodePen.io overrides the Window.open() function, so if you want to open windows using jquery, you will need to target invisible anchor elements like this one: <a target='_blank'>.
MatiKid
@MatiKid
Aug 31 2015 00:09
@timmcallister the button works fine
But I can’t find a way to change the text to the quote
Tim
@timmcallister
Aug 31 2015 00:09
are you using the twitter js widget?
MatiKid
@MatiKid
Aug 31 2015 00:09
yes
and I’m trying to change the data_text of the button with jQuery
Tim
@timmcallister
Aug 31 2015 00:10
if you're using the widget, it's going to be difficult to dynamically change the content
MatiKid
@MatiKid
Aug 31 2015 00:10
I see
So, I should be using just the link?
(I was trying to cahnge t he data_text)
since it's contained in an ifram
iframe
Steven Parker
@Philosophist
Aug 31 2015 00:11
  var n = 96.74;
  n = n - 60;
  console.log(n);
How might I get this to give me the actual value for n for javascript? I think in C this is a float vs int class issue
Tim
@timmcallister
Aug 31 2015 00:12
it might be easier to use a web intent https://dev.twitter.com/web/intents
that's what I did
I had the same problem
Steven Parker
@Philosophist
Aug 31 2015 00:13
36.739999999999995 is the number I get, but it should be 36.74
MatiKid
@MatiKid
Aug 31 2015 00:14
@timmcallister where you changing the url with JS to insert the quote?
Tim
@timmcallister
Aug 31 2015 00:17
yep
MatiKid
@MatiKid
Aug 31 2015 00:17
@timmcallister thanks
I’ll try it that way
CamperBot
@camperbot
Aug 31 2015 00:17
matikid sends brownie points to @timmcallister :sparkles: :thumbsup: :sparkles:
:star: 188 | @timmcallister | http://www.freecodecamp.com/timmcallister
Tim
@timmcallister
Aug 31 2015 00:17
np
Matt Everson
@matteverson
Aug 31 2015 00:18
@Philosophist Usually you use Math.round()
To truly solve the problem if you're handling something sensitive like money, you could scale the value by multiplying and dividing later so there are no floats in calculations.
Steven Parker
@Philosophist
Aug 31 2015 00:24
@matteverson Thanks. I guess I'll do that. I was told earlier to use .toFixed(2) instead of that, which I thought would just make it cleaner.
CamperBot
@camperbot
Aug 31 2015 00:24
philosophist sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 350 | @matteverson | http://www.freecodecamp.com/matteverson
Matt Everson
@matteverson
Aug 31 2015 00:26

@Philosophist that should work too, as would

function strip(number) {
    return (parseFloat(number.toPrecision(12)));
}

Lots of ways.

AMF1979
@AMF1979
Aug 31 2015 00:29
Hey everyone, I'm wondering how to go about getting assistance on a challenge. It's my first time posting on here. My name's Andrew
Justin Crawford
@JCrawford1122
Aug 31 2015 00:29
@AMF1979 Which challenge?
AMF1979
@AMF1979
Aug 31 2015 00:29
Waypoint: Use a CSS Class to Style an Element
The challenge wants me to "Create a CSS class called red-text and apply it to your h2 element."
This message was deleted

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

<h2>CatPhotoApp</h2>

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

Jose M Viloria
@josevill
Aug 31 2015 00:31
help formatting
CamperBot
@camperbot
Aug 31 2015 00:31

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Jose M Viloria
@josevill
Aug 31 2015 00:31
@AMF1979 Read that ^ so you can share your code in a good and proper looking way :)
Welcome!
Justin Crawford
@JCrawford1122
Aug 31 2015 00:32
@AMF1979 you forgot to add the .red-text class to the <h2> element
BabyKosh
@badbabykosh
Aug 31 2015 00:32
trying to feed this var before = "jumped" into a regex...
  var newstr = str.replace(/+before+/,after);
how to make work?
AMF1979
@AMF1979
Aug 31 2015 00:34

@JCrawford1122 ```

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

<h2 .red-text>CatPhotoApp</h2>

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

Justin Crawford
@JCrawford1122
Aug 31 2015 00:34
@AMF1979 like <h2 class = 'red-text'>CatPhotoApp</h2>
BabyKosh
@badbabykosh
Aug 31 2015 00:37
bf bonfire search and replace
CamperBot
@camperbot
Aug 31 2015 00:37

:fire:Bonfire: Search and Replace :link:

function replace(str, before, after) {
 return str;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");

Perform a search and replace on the sentence using the arguments provided and return the new sentence.

more info:  bf details | bf links | hint

BabyKosh
@badbabykosh
Aug 31 2015 00:37
hint
CamperBot
@camperbot
Aug 31 2015 00:37
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Justin Crawford
@JCrawford1122
Aug 31 2015 00:38
@AMF1979 and the ``` before and after your code must be on their own lines for it to work
BabyKosh
@badbabykosh
Aug 31 2015 00:38
omg no help for the next bonfire
CamperBot
@camperbot
Aug 31 2015 00:38
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
BabyKosh
@badbabykosh
Aug 31 2015 00:38
2-3
Manuel Niederl
@ManuelNiederl
Aug 31 2015 00:38
Hey everyone!
AMF1979
@AMF1979
Aug 31 2015 00:38
<style>
  h2 {
    color: red;
  }
</style>

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

<p>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>
Jose M Viloria
@josevill
Aug 31 2015 00:39
@ManuelNiederl Hey :) Welcome
Manuel Niederl
@ManuelNiederl
Aug 31 2015 00:39
I think I found a bug in the Where do I belong bonfire. As far as I can see my code does what's asked of me.
AMF1979
@AMF1979
Aug 31 2015 00:39
@JCrawford1122 Thanks for the help. Is this accurate?
CamperBot
@camperbot
Aug 31 2015 00:39
amf1979 sends brownie points to @jcrawford1122 :sparkles: :thumbsup: :sparkles:
:star: 165 | @jcrawford1122 | http://www.freecodecamp.com/jcrawford1122
Jose M Viloria
@josevill
Aug 31 2015 00:39
@ManuelNiederl Try refreshing the page. Sometimes is gets a lil buggy
Manuel Niederl
@ManuelNiederl
Aug 31 2015 00:40
Cool, thanks. I'll try.
CamperBot
@camperbot
Aug 31 2015 00:40
if you want to thank someone, put an @ before their name!
Cory Lundgren
@cml0401
Aug 31 2015 00:40
@AMF1979 in your style block the h2 element should be replaced with .red-text. you are applying a class to an element without creating it in your CSS style block.
BabyKosh
@badbabykosh
Aug 31 2015 00:40
HELP with bonfire: search and replace
CamperBot
@camperbot
Aug 31 2015 00:40
no wiki entry for: with bonfire search and replace
:pencil: click here to create one now!after creating your page type update to reload it here
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:41
bonfire replace
CamperBot
@camperbot
Aug 31 2015 00:41

:fire:Bonfire: Search and Replace :link:

function replace(str, before, after) {
 return str;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");

Perform a search and replace on the sentence using the arguments provided and return the new sentence.

more info:  bf details | bf links | hint

Justin Crawford
@JCrawford1122
Aug 31 2015 00:41
@AMF looks good. You could also add the red-text class to the style if you wanted like
<style>
h2, .red-text {
color: red;
}
BabyKosh
@badbabykosh
Aug 31 2015 00:42
@SojournerOctocat there is no help for that bonfire
CamperBot
@camperbot
Aug 31 2015 00:42
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:42
@badbabykosh There is no help for which bonfire?
CamperBot
@camperbot
Aug 31 2015 00:42
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:42
Search and replace?
bf details
CamperBot
@camperbot
Aug 31 2015 00:42

:fire:Bonfire: Search and Replace :link:

function replace(str, before, after) {
 return str;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
Perform a search and replace on the sentence using the arguments provided and return the new sentence.
First argument is the sentence to perform the search and replace on.
Second argument is the word that you will be replacing (before).
Third argument is what you will be replacing the second argument with (after).
NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word 'Book' with the word 'dog', it should be replaced as 'Dog'
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
BabyKosh
@badbabykosh
Aug 31 2015 00:43
@SojournerOctocat are you a human?
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:43
@badbabykosh Yes.
AMF1979
@AMF1979
Aug 31 2015 00:44
@JCrawford1122 @cml0401 Great, I've applied those changes. The CSS part is a bit confusing to me. Thanks for the assistance
CamperBot
@camperbot
Aug 31 2015 00:44
amf1979 sends brownie points to @jcrawford1122 and @cml0401 :sparkles: :thumbsup: :sparkles:
:warning: amf1979 already gave jcrawford1122 points
:star: 165 | @cml0401 | http://www.freecodecamp.com/cml0401
BabyKosh
@badbabykosh
Aug 31 2015 00:44
@SojournerOctocat ok ...there is no hint information past the surface ....which is the same info in the actual bonfire
@SojournerOctocat i.e. "bf search and replace" ultimatly gives you nothing
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:45
@badbabykosh Oh. I see. Well, post what you have so far, and maybe we can help.
Justin Crawford
@JCrawford1122
Aug 31 2015 00:45
@AMF1979 Like everything, it takes practice
Cory Lundgren
@cml0401
Aug 31 2015 00:45
@AMF1979 Just remember you have elements which are the tags that already exist in your html page. you can directly style those.
classes must be created in your style block and then the class='class name' must be added to your html element's opening tag.
BabyKosh
@badbabykosh
Aug 31 2015 00:45
@SojournerOctocat ok...
function replace(str, before, after) {
  var re = "/" + before + "/gi";
  console.log(re);
  var newstr = str.replace(re,after);
  console.log(newstr);
// return newstr;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
@SojournerOctocat var re will not work...I'm going nuts trying to understand why not
Yazed Jamal
@muyaszed
Aug 31 2015 00:47
Hi guys, Im doing bonfire-falsey-bouncer right now, I have manage to solve it but im a liitle bit confuse with Boolean vs new Boolean
AMF1979
@AMF1979
Aug 31 2015 00:51
@cml0401 I got the next challenge right away so hopefully I'm on the right track. I appreciate the assistance
periagoge
@periagoge
Aug 31 2015 00:51

Hi guys, I'm working on Bonfire: Check for Palindromes, and I am not sure why my code is not working, anybody understand what I am doing wrong?:

function palindrome(str) {
var reverseStr = str.split("").reverse().join("");
if(str === reverseStr {
return true;
}
else return false;
};

palindrome("eye");

BabyKosh
@badbabykosh
Aug 31 2015 00:52
@SojournerOctocat any suggestions?
AMF1979
@AMF1979
Aug 31 2015 00:52
@JCrawford1122 Absolutely. I have vague memories of HTML from years ago but never advanced further in CSS
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:52
@badbabykosh Playing with it now, but I'm having the same problem you are.
Cory Lundgren
@cml0401
Aug 31 2015 00:52
@periagoge You need to strip spaces and punctuation
@periagoge do some searching on regular expressions that cna achieve that
Justin Crawford
@JCrawford1122
Aug 31 2015 00:53
bf Where do I belong
CamperBot
@camperbot
Aug 31 2015 00:53

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

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

where([40, 60], 50);

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

more info:  bf details | bf links | hint

DJ
@qualitymanifest
Aug 31 2015 00:53
@periagoge and also make verything lower case
periagoge
@periagoge
Aug 31 2015 00:53
Thanks cml0401 I'll look more into that!
CamperBot
@camperbot
Aug 31 2015 00:53
if you want to thank someone, put an @ before their name!
Justin Crawford
@JCrawford1122
Aug 31 2015 00:53
bf details
CamperBot
@camperbot
Aug 31 2015 00:53

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

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

where([40, 60], 50);
Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).
For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (0th index), but less than 2 (1st index).
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
periagoge
@periagoge
Aug 31 2015 00:53
@qualitymanifest Thanks!
CamperBot
@camperbot
Aug 31 2015 00:53
periagoge sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 174 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Justin Crawford
@JCrawford1122
Aug 31 2015 00:54
hint
CamperBot
@camperbot
Aug 31 2015 00:54
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
DJ
@qualitymanifest
Aug 31 2015 00:54
@periagoge no problem. other than that you're on the right track
periagoge
@periagoge
Aug 31 2015 00:54
@cml0401 Thanks!
CamperBot
@camperbot
Aug 31 2015 00:54
periagoge sends brownie points to @cml0401 :sparkles: :thumbsup: :sparkles:
:star: 166 | @cml0401 | http://www.freecodecamp.com/cml0401
SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:55
bf search
CamperBot
@camperbot
Aug 31 2015 00:55

:fire:Bonfire: Search and Replace :link:

function replace(str, before, after) {
 return str;
}

replace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");

Perform a search and replace on the sentence using the arguments provided and return the new sentence.

more info:  bf details | bf links | hint

SojournerOctocat
@SojournerOctocat
Aug 31 2015 00:55
bf links
Hans van Riet
@hansinla
Aug 31 2015 00:55
@badbabykosh Forget the reggae, this should do it: var newstr = str.replace(before,after); then return newstr;
BabyKosh
@badbabykosh
Aug 31 2015 01:00
@hansinla hmm......ah see...MDN says pattern can be string OR Regex @SojournerOctocat
SojournerOctocat
@SojournerOctocat
Aug 31 2015 01:00
Yes! I didn't realize that.
Thanks hansinla!
CamperBot
@camperbot
Aug 31 2015 01:00
if you want to thank someone, put an @ before their name!
SojournerOctocat
@SojournerOctocat
Aug 31 2015 01:01
Thanks @hansinla !
CamperBot
@camperbot
Aug 31 2015 01:01
sojourneroctocat sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 328 | @hansinla | http://www.freecodecamp.com/hansinla
BabyKosh
@badbabykosh
Aug 31 2015 01:02
thank you @SojournerOctocat
CamperBot
@camperbot
Aug 31 2015 01:02
badbabykosh sends brownie points to @hansinla and @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sojourneroctocat
:star: 329 | @hansinla | http://www.freecodecamp.com/hansinla
Cory Lundgren
@cml0401
Aug 31 2015 01:03
Such a great community here by the way. I really like how helpful everyone is so far.
My navbar buttons are floating underneath the navbar. Can anyone help me get them inside?
henry fritz
@henryamster
Aug 31 2015 01:11
start with getting rid of the position:fixed !important
SojournerOctocat
@SojournerOctocat
Aug 31 2015 01:12
@JordanShackelford Can't see the code with the link you're giving.
henry fritz
@henryamster
Aug 31 2015 01:12
in your nav's css @JordanShackelford
Steven Parker
@Philosophist
Aug 31 2015 01:12
@matteverson Thanks again. I finally managed to get it done.
CamperBot
@camperbot
Aug 31 2015 01:12
philosophist sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:warning: philosophist already gave matteverson points
Matt Everson
@matteverson
Aug 31 2015 01:13
You're welcome!
henry fritz
@henryamster
Aug 31 2015 01:14
@JordanShackelford I'd also suggest enabling the viewport meta tag in html settings on codepen and using vh and vw for your heights & widths instead of %, as they don't mingle so well with different device sizes.
Jordan Shackelford
@JordanShackelford
Aug 31 2015 01:15
When I make the navbar shorter the buttons don't move up with it
and when i set position:fixed on the navbar it won't work unless I add !important. How can I fix that?
henry fritz
@henryamster
Aug 31 2015 01:18
@JordanShackelford You don't really need to fix it with css. you're using bootstrap so you can use 'navbar-fixed-top' as a class on your nav tag and this should fix it
Jordan Shackelford
@JordanShackelford
Aug 31 2015 01:21
@henryamster awesome thanks
CamperBot
@camperbot
Aug 31 2015 01:21
jordanshackelford sends brownie points to @henryamster :sparkles: :thumbsup: :sparkles:
:star: 207 | @henryamster | http://www.freecodecamp.com/henryamster
P Joshi
@papajo
Aug 31 2015 01:31
hey guys, anyone having this issue with any of the bonfires? Cannot read property 'eql' of undefined...
Reggie
@Reggie01
Aug 31 2015 01:32
@MatiKid you can change the text dynamically if you use an iframe instead of an a tag <a></a>. I had to use the promises methods with jquery ajax. So instead of success, error, complete methods I used done, fail and always methods.
Another alternative is to dynamically create the button in your ajax. I think you will have to remove the current button from the dom before inserting a new one if you go that route. Optional links to read https://twittercommunity.com/t/insert-dynamic-content-into-data-text-attribute/19598/4 describes the problem. The four ways to make a button including Iframe example https://dev.twitter.com/web/tweet-button/parameters.
TL;DR just read this http://marcus-christie.blogspot.com/2011/07/how-to-dynamically-change-tweet-buttons.html
henry fritz
@henryamster
Aug 31 2015 01:33
http://codepen.io/henryamster/full/MagZRp/ for the life of me I cannot get the directional weathericons to appear in my "#wind" div. What I'd like to use is on line 24 of my js but I can't get the dummy hard-coded one on line 22 to show up either. The top icon is from the same icon collection so I'm assuming I'm screwing up something with jQuery? any ideas?
Zach
@zachgis529
Aug 31 2015 01:34
@periagoge you need to make sure all the letters in the phrases are lowercase, and that all symbols have been removed before you split reverse join. Hopefully that helps!
roguelettuce
@roguelettuce
Aug 31 2015 01:36
@papajo I am having the same problem with 'Bonfire: Return Largest Numbers in Arrays' - I feel like this error message would make more sense if I had any prior knowledge of the Chai.js tests, but although they're mentioned here, they haven't been explained in any of the prior stuff I've done...
Zach
@zachgis529
Aug 31 2015 01:37
This message was deleted
Justin Crawford
@JCrawford1122
Aug 31 2015 01:41
Does everyone use the free CodePen accounts or are you guys buying plans?
Spatz
@Spatzerny
Aug 31 2015 01:41
@henryamster getJSON url is not working in my case
@JCrawford1122 I don't have a reason to buy it :P
@henryamster http://api.openweathermap.org/data/2.5/weather?q=' + city + ',' + region
Jae
@jaestaar
Aug 31 2015 01:44
Besides Eloquent Javascript is there any other really great beginner books that break the theory of Javascript down?
henry fritz
@henryamster
Aug 31 2015 01:49
@Spatzerny It seems to work for me, I'm getting back data (albeit somewhat incorrect.) is it populating any of the divs with data or just breaking after getLocation()?
Spatz
@Spatzerny
Aug 31 2015 01:49
nope
i assume that my location doesn't return the region via the ip api
Ben Hart
@Benjmhart
Aug 31 2015 01:52
hey folks
Spatz
@Spatzerny
Aug 31 2015 01:52
hey
henry fritz
@henryamster
Aug 31 2015 01:53
ah, I see. I'll have to do a check to see that there's a region and maybe replace with country if one isn't found. Woulda defaulted to that but there are so many repeat city names in the US. thanks @Spatzerny
CamperBot
@camperbot
Aug 31 2015 01:53
henryamster sends brownie points to @spatzerny :sparkles: :thumbsup: :sparkles:
:star: 298 | @spatzerny | http://www.freecodecamp.com/spatzerny
Spatz
@Spatzerny
Aug 31 2015 01:53
you can go by longtitude and latitude
as a fallback from region and city
Ben Hart
@Benjmhart
Aug 31 2015 01:54
roguelettuce - that's the problem I'm bumping into
henry fritz
@henryamster
Aug 31 2015 01:55
I originally started with lat & lon and now I'm beating myself up over not sticking with it :/
Ben Hart
@Benjmhart
Aug 31 2015 01:56
at least I know I'm not a total idiot - I tried replacing the big array with a simple one and it told me that largestOfFour wasn't a function...
Tamir Omara
@teomara
Aug 31 2015 01:56
@jaestaar I'd recommend (You Don't Know JS - Up & Going) book. I find it to be very detailed
Jae
@jaestaar
Aug 31 2015 02:03
@teomara Thank you so much! I'm going back over everything I can get my hands on to really understand this stuff. I'm coming from a scientific background and if I don't understand the why of it I need to go back and break down everything so i can get it. I like to make life harder i guess. lol. Funny enough, Python was so much easier to understand for me.
CamperBot
@camperbot
Aug 31 2015 02:03
jaestaar sends brownie points to @teomara :sparkles: :thumbsup: :sparkles:
:star: 92 | @teomara | http://www.freecodecamp.com/teomara
Tamir Omara
@teomara
Aug 31 2015 02:05
@jaestaar python IS easier that is true. You might wanna have a look at CodeAcademy's JS course. Its quick but can get you up and running in short time.
Hans van Riet
@hansinla
Aug 31 2015 02:05
@SojournerOctocat You’re welcome. You’ll still have to deal with recurring strings and Uppercase, so the solution will be way more involved tha this.
Jae
@jaestaar
Aug 31 2015 02:06
@teomara thank you! I'll be checking it out. :D
CamperBot
@camperbot
Aug 31 2015 02:06
jaestaar sends brownie points to @teomara :sparkles: :thumbsup: :sparkles:
:warning: jaestaar already gave teomara points
henry fritz
@henryamster
Aug 31 2015 02:21
@Spatzerny http://codepen.io/henryamster/pen/yYLNKp this look any better on your end?
P Joshi
@papajo
Aug 31 2015 02:27
@roguelettuce hey thanks for the confirmation, actually i dont think its the code issue, i think could be a bug or something weird going on on the FCC server. not sure cos this challenge had been marked successful just yesterday, i was only revisiting it today but when i clicked submit, suddenly get this error
CamperBot
@camperbot
Aug 31 2015 02:27
papajo sends brownie points to @roguelettuce :sparkles: :thumbsup: :sparkles:
:star: 162 | @roguelettuce | http://www.freecodecamp.com/roguelettuce
roguelettuce
@roguelettuce
Aug 31 2015 02:30
@papajo (and @Benjmhart) Thanks! Yeah, it looks to my novice eye like there's a bug in the 'success conditions' (or whatever the technical name is) that have been written into the task, maybe a typo that's causing it to look for the wrong variable? I've tried all sorts of things to work out what's wrong, and it seems like the error isn't in my code, which seems to be the experience you guys are having too...
CamperBot
@camperbot
Aug 31 2015 02:30
roguelettuce sends brownie points to @papajo and @benjmhart :sparkles: :thumbsup: :sparkles:
:star: 193 | @papajo | http://www.freecodecamp.com/papajo
:star: 165 | @benjmhart | http://www.freecodecamp.com/benjmhart
P Joshi
@papajo
Aug 31 2015 02:32
@roguelettuce nah im sure its nothing to do with your code, something's up with FCC, maybe there's some maintenance going on?
267296
@267296
Aug 31 2015 02:32
@henryamster You in Augusta?
nvm…I just realized your codepen probably pulls my ip and figures out my location
henry fritz
@henryamster
Aug 31 2015 02:35
@267296 haha, yup
267296
@267296
Aug 31 2015 02:35
yeah I’m looking at your code now…I am just getting used to using CodePen….
for a little bit I was excited thinking there might actually be someone else on FCC from augusta….bummer :)
henry fritz
@henryamster
Aug 31 2015 02:38
you should check to see if there's a local FCC group on facebook near you- in lexington, kentucky (middle of nowhere) there's like 20 people in the group. pretty surprising imo
267296
@267296
Aug 31 2015 02:39
Yeah I’ve already checked. The closest one is like two hours away in Atlanta….I am a member of it but I just can’t ever get to the meetings
mwandama
@mwandama
Aug 31 2015 02:43
Add a second image with the src of http://bit.ly/fcc-running-cats. How do i add two images
henry fritz
@henryamster
Aug 31 2015 02:45
@mwandama <img src="http://bit.ly/fcc-running-cats">
deaninous
@deaninous
Aug 31 2015 02:46
anyone knows what I am doing wrong?
function truncate(str, num) {
  // Clear out that junk in your trunk
  if (str.length > num){
  return str.slice(0,num )+"...";
}
   }

truncate('A-tisket a-tasket A green and yellow basket', 11);
bf truncate
CamperBot
@camperbot
Aug 31 2015 02:47

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

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

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

Danny Fritz
@dannyfritz
Aug 31 2015 02:47
@deaninous '...' takes up 3 characters.
SojournerOctocat
@SojournerOctocat
Aug 31 2015 02:48
@deaninous Remember that the has to be added as part of the number of characters.
deaninous
@deaninous
Aug 31 2015 02:49
i think that is the part where I am in trouble @SojournerOctocat @dannyfritz
Danny Fritz
@dannyfritz
Aug 31 2015 02:49
music
CamperBot
@camperbot
Aug 31 2015 02:49
deaninous
@deaninous
Aug 31 2015 02:49
I tried num+ 3
Gordon Davidescu
@gordondavidescu
Aug 31 2015 02:49
I keep getting "cannot read property 'eql' of undefined :(
I'm in return largest number of arrays
I've tried a few approaches, too
Moisés Man
@moigithub
Aug 31 2015 02:50
that one is bugged.. they already working on it.. u can skip it.. and/or paste ur code here if u want some1 else take a look
SojournerOctocat
@SojournerOctocat
Aug 31 2015 02:51
@deaninous You want num - 3.
Hans van Riet
@hansinla
Aug 31 2015 02:51
@deaninous Shouldn’t that be num-3 ? And always test for edge cases. What if the string.length == num?
Gordon Davidescu
@gordondavidescu
Aug 31 2015 02:51
oh, thank you
CamperBot
@camperbot
Aug 31 2015 02:51
if you want to thank someone, put an @ before their name!
Gordon Davidescu
@gordondavidescu
Aug 31 2015 02:52
thank you @moigithub
CamperBot
@camperbot
Aug 31 2015 02:52
gordondavidescu sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 280 | @moigithub | http://www.freecodecamp.com/moigithub
deaninous
@deaninous
Aug 31 2015 02:52
thank you @hansinla @SojournerOctocat
CamperBot
@camperbot
Aug 31 2015 02:52
deaninous sends brownie points to @hansinla and @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 331 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 260 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
deaninous
@deaninous
Aug 31 2015 02:52
I think these will do it
Maryam Ahmed
@mseager
Aug 31 2015 02:53
Hi Guys, I'm going crazy with Bonfire: Title Case A Letter. I feel like my code is too complicated....but it only returns two letters and won't iterate through the whole array. Can anyone help me? Here's my code:
function titleCase(str) {
var arrayOfStrings = str.split(" "); //["I'm", "a", "little", "tea", "pot"]

  var arrayLength = arrayOfStrings.length;
  var substr;
  var newWord;
  var newString ="";
  var otherLetters ="";
  var firstLetter;
  var expression = /\S+/gi; //any character NOT a space


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

    substr = arrayOfStrings[i]; //"Im", "a", "little", "tea", "pot"

    if (substr.match(expression)) { //If not a space


      firstLetter = substr.charAt(0);
      firstLetter = firstLetter.toUpperCase();

      if (substr.length>1){ //This word has more than one letter, change the remaining to lowercase

        for (i=1; i<substr.length; i++){
         otherLetters = otherLetters + substr.charAt(i).toLowerCase(); //Change all other characters in word to lower case       

       } //end for loop

        newWord = firstLetter + otherLetters; //build the new word with first letter upper case and the remaining lower case
      }    

        else { //One letter word

          newWord = firstLetter;
        }


      newString = newString + newWord + " ";  //Rebuild the new sentence, one word at a time

    } //end if

  } //end for loop


 return newString; // return new sentence with Title Case
} // end function

titleCase("Im a little tea pot");
Danny Fritz
@dannyfritz
Aug 31 2015 02:55
@mseager you are reusing i in each for loop. so they are clashing because of that. the only scope in javascript is a function. So, your for loops are sharing a scope.
Maryam Ahmed
@mseager
Aug 31 2015 02:56
@dannyfritz ah! let me try changing it to a j
@dannyfritz great that's progress! Now it's returning "Im A Lmittle Tmittleea Pmittleeaot "
Danny Fritz
@dannyfritz
Aug 31 2015 02:59
heh, that sounds a lot better than just 2 letters. :P
looks like the m in Im is getting dragged through each word
Hans van Riet
@hansinla
Aug 31 2015 02:59
@mseager You don’t want to strip the apostrophe (‘) out. Ultimately you can do this in three lines of code, so you’re right that you’re complicating things a bit.
Moisés Man
@moigithub
Aug 31 2015 03:00
on top u splitting ur phrase on space ,
var arrayOfStrings = str.split(" "); //["I'm", "a", "little", "tea", "pot"]
means after that,, u should/will never find an space
if (substr.match(expression)) { //If not a space
Maryam Ahmed
@mseager
Aug 31 2015 03:02
thanks @dannyfritz yes definitely! I'm iterating through it with fresh eyes now
CamperBot
@camperbot
Aug 31 2015 03:02
mseager sends brownie points to @dannyfritz :sparkles: :thumbsup: :sparkles:
:star: 106 | @dannyfritz | http://www.freecodecamp.com/dannyfritz
Moisés Man
@moigithub
Aug 31 2015 03:03
toLowerCase() function affects a string.. u no need to loop on each character to transform a string case u can just
otherLetters = substr.slice(1).toLowerCase();
slice function extract part of a string.. u can also use other similar functions like substr or substring
@mseager
Maryam Ahmed
@mseager
Aug 31 2015 03:03
@hansinla yes you know us women can tend to complicate things :) I know there must be some functions I can leverage out there to make this a more elegant solution. I took the Apostrophe out to make it easier to debug
@moigithub yes you're right, I got rid of the regex, it was the i in the for loop that was causing the issue which I mistook for a space issue
thanks @moigithub ....I knew there must've been a better way than going through every character, the slice function!
CamperBot
@camperbot
Aug 31 2015 03:04
mseager sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 281 | @moigithub | http://www.freecodecamp.com/moigithub
Josh
@joshcxa
Aug 31 2015 03:05
'''
CamperBot
@camperbot
Aug 31 2015 03:05
:bulb: to format code use backticks! ``` more info
Josh
@joshcxa
Aug 31 2015 03:06
function largestOfFour(arr) {
  // You can do this!
  var newArr = [];
  var largest = 0;

  for (i = 0; i < arr.length; i++) {
    for (j = 0; j < arr[i].length; j++) {
      if (largest < arr[i][j]) {
        largest = arr[i][j];
      }
    } 
    newArr.push(largest);
  }
  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Hi Guys
I tested this in jsfiddle, I seem to get the correct result
but in the challenge it all i get is >cannot read property 'eql' of undefined
Moisés Man
@moigithub
Aug 31 2015 03:07
@joshcxa that Bonfire is bugged, u can skip that for now
Josh
@joshcxa
Aug 31 2015 03:08
ooooh thank! @moigithub
CamperBot
@camperbot
Aug 31 2015 03:08
joshcxa sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 282 | @moigithub | http://www.freecodecamp.com/moigithub
Moisés Man
@moigithub
Aug 31 2015 03:08
@joshcxa a small problem in ur code is
var largest = 0;
should relocate
else when u check the "next" largest num it will carry the previous largest value
Josh
@joshcxa
Aug 31 2015 03:09
Oh good point @moigithub
Moisés Man
@moigithub
Aug 31 2015 03:09
u can do a quick test with
largestOfFour([[1000, 1001, 857, 1],[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39]]);
P Joshi
@papajo
Aug 31 2015 03:09
@moigithub @joshcxa even if the code is right, it will not pass due to some issue with fcc right now, hope someone is looking into it, ciao later GN folks
Hans van Riet
@hansinla
Aug 31 2015 03:09
@moigithub Also, take the first value in the array as your init largest value, that way negative values don’t break your code. What if you want to find the largest of [-25, -11, -1, -3] ?
Josh
@joshcxa
Aug 31 2015 03:12
@moigithub , tested and you were right. Relocated the largest var and all good now.
@hansinla , also a good point. Doesn't work with negatives :(
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:16
hi every one
Hans van Riet
@hansinla
Aug 31 2015 03:16
@joshcxa just initialize var largest = arr[i][0]; and you’ll be good.
Josh
@joshcxa
Aug 31 2015 03:18
thanks @hansinla
CamperBot
@camperbot
Aug 31 2015 03:18
joshcxa sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 332 | @hansinla | http://www.freecodecamp.com/hansinla
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:18
I 've just solved the No Repeats Please problem on my own editor, using a recursive algorithm. The problem is that when I try to run it on freecode camp it gets stuck. What can I do? @/all
Katherine Wakefield
@awakekat
Aug 31 2015 03:20
I am stuck on jquery 13 - this doesn't work $("#left-well").parent().css("background-color", "red");
Mihalis Phenos
@gitmihalis
Aug 31 2015 03:22
function largestOfFour(arr) {
    var largest = 0;
    var newArr = [];
    for(var x = 0; x < arr.length; x++) {    
        for( var y = 0; y < arr[x].length; y++){
            if(arr[x][y] > largest) {
                largest = arr[x][y];
            }
        } newArr.push(largest);
    } return newArr;
}
largestOfFour([[1,2,3,4],[1,2,3,4],[1,2,2,2],[3,4,5,6]]);
this has got to be right, but im not getting a pass: throwing this error: cannot read property 'eql' of undefined!
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:23
@awakekat You got to set the color of #target1 parent's to red, not #left-well parent's
Mihalis Phenos
@gitmihalis
Aug 31 2015 03:23
RETURN LARGEST NUMBER IN ARRAys
Hans van Riet
@hansinla
Aug 31 2015 03:23
@absalnC The recursion may take too much time in the FCC environment. Any way you can optimize or test for edge cases and immediately return without going to recursion?
Mihalis Phenos
@gitmihalis
Aug 31 2015 03:23
:worried:
Reggie
@Reggie01
Aug 31 2015 03:25
@gitmihalis someone earlier mentioned that bonfire is bugged.
Hans van Riet
@hansinla
Aug 31 2015 03:25
@gitmihalis You want to init var largest inside your first for loop. Setting it to 0 doesn’t work if the array contains all negative numbers.
Lux3
@Lux3
Aug 31 2015 03:26
@awakekat you are targetting the parent of left-well but you need ot target the parent of one of the buttons
the left-well is the parent
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:28
@hansinla I dont know. Do you know of any efficient algorithm?
Hans van Riet
@hansinla
Aug 31 2015 03:30
@absalnC I did this to avoid unnecessary recursion:
function quicktest(str){
  for (var i = 0; i < str.length - 1; i++) {
    if (str[i] != str[i+1]) return false;
  }
  return true;
}
@hansinla And then test for this as:
  if (quicktest(str)) return 0;
Danny Fritz
@dannyfritz
Aug 31 2015 03:31
a shortcircuit to avoid an intensive algorithm
Mihalis Phenos
@gitmihalis
Aug 31 2015 03:31
ahh geez thanks @Reggie01 , i've been so upset over trying to figure it out, i've confined my meekrat to his chamber!
CamperBot
@camperbot
Aug 31 2015 03:31
gitmihalis sends brownie points to @reggie01 :sparkles: :thumbsup: :sparkles:
:star: 169 | @reggie01 | http://www.freecodecamp.com/reggie01
Danny Fritz
@dannyfritz
Aug 31 2015 03:31
sometimes it is easy to disprove something and hard to prove it.
Matthew Iles
@miles613
Aug 31 2015 03:34
can any one help with the java script slot machine
how do I assign the Math.floor(Math.random() * (3 - 1 + 1)) + 1; to var SlotOne
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:37
@hansinla Anyway I still have this strings to be tested: abcdefa abfdefa
Matthew Iles
@miles613
Aug 31 2015 03:38
nvm
Hans van Riet
@hansinla
Aug 31 2015 03:41
@absalnC Without seeing your code it’s hard to give you any advise, what is the runtime on your local editor?
Dmaa
@Dmaa
Aug 31 2015 03:46
blob
Does anyone know what I'm missing when I get this error?
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:46
It takes a while. Like 15 secs @hansinla
SojournerOctocat
@SojournerOctocat
Aug 31 2015 03:47
@Dmaa Which waypoint are you working on?
Dmaa
@Dmaa
Aug 31 2015 03:47
@SojournerOctocat Bonfire: Diff Two Arrays in Intermediate algorithms
Danny Fritz
@dannyfritz
Aug 31 2015 03:47
@Dmaa it says the array you return is empty when it should be filled with 3 items
Hans van Riet
@hansinla
Aug 31 2015 03:47
@absalnC That sounds right, I get a 16secs runtime. But I did this before the porting of FCC.
SojournerOctocat
@SojournerOctocat
Aug 31 2015 03:48
@Dmaa Paste your code.
help format
CamperBot
@camperbot
Aug 31 2015 03:48

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Dmaa
@Dmaa
Aug 31 2015 03:51
function diff(arr1, arr2) {
  var newArr = [];
  for(var i = 0; i < arr1.length; i++) {
    if( i < arr2.length && arr2.indexOf(arr1[i]) == -1) {
      newArr.push(arr1[i]);
    }
  }
  for(var i = 0; i < arr2.length; i++) {
    if( i < arr1.length && arr1.indexOf(arr2[i]) == -1){
      newArr.push(arr2[i]);
    }
  }
  return newArr;
}

diff(['snuffleupagus', 'cookie monster', 'elmo'], ['snuffleupagus', 'cookie monster', 'elmo']);
Absalon Castañon Avila
@absalnC
Aug 31 2015 03:53
Any way, I made shortcuts for those strings too and use my code fot the others :D Thanks for your help @hansinla
CamperBot
@camperbot
Aug 31 2015 03:53
absalnc sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 333 | @hansinla | http://www.freecodecamp.com/hansinla
Dmaa
@Dmaa
Aug 31 2015 03:55
oh never mind. I was reading the assert statement incorrectly and so was testing the wrong part. Whoops.
SojournerOctocat
@SojournerOctocat
Aug 31 2015 03:58
@Dmaa That's weird. It looks like your code works. I don't know why it's throwing an error.
Maryam Ahmed
@mseager
Aug 31 2015 03:59
@moigithub because you pointed me to the slice function, I was able to significantly reduce my code for the "Bonfire: Title Case A Sentence"!
function titleCase(str) {

  var arrayOfStrings = str.split(" "); //["I'm", "a", "little", "tea", "pot"]

  var arrayLength = arrayOfStrings.length;
  var newString ="";
  var substr ="";

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

    substr = arrayOfStrings[i]; //"I'm", "a", "little", "tea", "pot"

    newString += substr.slice(0,1).toUpperCase() + substr.slice(1,substr.length).toLowerCase() + " ";

     } //end for loop


 return newString;
} // end function

titleCase("I'm a little tea pot");
SojournerOctocat
@SojournerOctocat
Aug 31 2015 03:59
The only thing I might change is using var i = 0 in both for loops.
@Dmaa But I doubt that is what's causing the error.
Maryam Ahmed
@mseager
Aug 31 2015 04:00
Unfortunately I'm getting an extra space at the end, anyone know what I'm doing wrong? I'm getting "I'm A Little Tea Pot [space]" instead of "I'm A Little Tea Pot"
Lux3
@Lux3
Aug 31 2015 04:00
yes
Danny Fritz
@dannyfritz
Aug 31 2015 04:00
@mseager ).toLowerCase() + " ";
Lux3
@Lux3
Aug 31 2015 04:00
^
get rid of that + " "
Maryam Ahmed
@mseager
Aug 31 2015 04:01
@dannyfritz without the + " " at the end, I get "I'mALittleTeaPot"
Lux3
@Lux3
Aug 31 2015 04:01
hmm
Danny Fritz
@dannyfritz
Aug 31 2015 04:02
@mseager you can either detect when it is the end and not append a space, or add the words to an array and join later with spaces.
Lux3
@Lux3
Aug 31 2015 04:03
@mseager my code is very different so I have no suggestion.
Maryam Ahmed
@mseager
Aug 31 2015 04:05
@dannyfritz thanks let me try adding the words to an array and then joining......@hansinla said I should be able to do it in 3 lines of code so I was trying to be a minimalist :)
CamperBot
@camperbot
Aug 31 2015 04:05
mseager sends brownie points to @dannyfritz :sparkles: :thumbsup: :sparkles:
:star: 107 | @dannyfritz | http://www.freecodecamp.com/dannyfritz
Maryam Ahmed
@mseager
Aug 31 2015 04:06
@Lux3 no worries, appreciate the help
@dannyfritz the join worked! :)
Danny Fritz
@dannyfritz
Aug 31 2015 04:08
@mseager woot!
Maryam Ahmed
@mseager
Aug 31 2015 04:08
WOOHOOOOOO! That only took me 6 hours LOL
Danny Fritz
@dannyfritz
Aug 31 2015 04:08
:thumbsup:
Maryam Ahmed
@mseager
Aug 31 2015 04:10
Thank you so so much!
CamperBot
@camperbot
Aug 31 2015 04:10
if you want to thank someone, put an @ before their name!
Maryam Ahmed
@mseager
Aug 31 2015 04:12
I read earlier that the Bonfire: Return Largest Numbers in Arrays is buggy, does anyone know if FCC is aware? If not I'll send them an email
Jennifer Pazos
@jmb521
Aug 31 2015 04:15
bf details
CamperBot
@camperbot
Aug 31 2015 04:15

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Tim P
@xTimpi
Aug 31 2015 04:19

Hey guys, working on the Wikipedia Viewer zipline, and I just can’t get the request to work, my angular code looks a little something like this:

  var requestData = {
    url: 'http://en.wikipedia.org/w/api.php',
    method: 'GET',
    params: {action: 'query', list: 'search', srsearch: 'Albert Einstein', format: 'json'},
    headers: {
        'Content-type': 'application/json',
        'Accept': 'application/json'
    }
  };

  var succ = function(data) {
    console.log(data);
  };

  var fail = function(data) {
    console.log(data);
  };

  $http(requestData).then(succ, fail);

Can anyone help me with this?

justindobbs
@justindobbs
Aug 31 2015 04:20
i recently finished the wikipedia so I can surely help
Tim P
@xTimpi
Aug 31 2015 04:23
@justindobbs can you spot any obvious mistakes in this? :D
justindobbs
@justindobbs
Aug 31 2015 04:24
what library are you using for the request?
Lux3
@Lux3
Aug 31 2015 04:24
What do you guys think of my portfolio so far?
Tim P
@xTimpi
Aug 31 2015 04:25
@justindobbs thats a standard angular.js request
Tim P
@xTimpi
Aug 31 2015 04:25
@Lux3 +1 for cat ipsum
Lux3
@Lux3
Aug 31 2015 04:25
lol
justindobbs
@justindobbs
Aug 31 2015 04:25
@xTimpi you should add ?callback =? to the url
Lux3
@Lux3
Aug 31 2015 04:25
I have to do the projects before I can include them.
Tim P
@xTimpi
Aug 31 2015 04:27
@justindobbs damn I forget that every time lol, but it didn’t make it work this time
justindobbs
@justindobbs
Aug 31 2015 04:28
what's the error look like?
Tim P
@xTimpi
Aug 31 2015 04:28
@justindobbs its just a weird object that I can’t decypher, let me try to post it here somehow
justindobbs
@justindobbs
Aug 31 2015 04:28
also it should be https rather than http
Tim P
@xTimpi
Aug 31 2015 04:28
I think the easiest way for you to see it is look at the console yourself: http://codepen.io/xtimpi/full/LpYpPP/
@Lux3 are you aware that your menubar doesn’t go away once it was opened? :D
Lux3
@Lux3
Aug 31 2015 04:30
@xTimpi yes it used to but something happened. It is still a work in progress.
justindobbs
@justindobbs
Aug 31 2015 04:30
maybe my wifi is slow but this doesn't open
Lux3
@Lux3
Aug 31 2015 04:30
Any idea why that is?
justindobbs
@justindobbs
Aug 31 2015 04:31
ah, yes, the console confirms it should be https @xTimpi
Tim P
@xTimpi
Aug 31 2015 04:32
@justindobbs now it says that the request is not allowed due to access control allow origin
justindobbs
@justindobbs
Aug 31 2015 04:33
this is the url you are using?
https://en.wikipedia.org/w/api.php?callback=?
Tim P
@xTimpi
Aug 31 2015 04:34
yup
justindobbs
@justindobbs
Aug 31 2015 04:34
what library are you using for request?
Tim P
@xTimpi
Aug 31 2015 04:35
angularjs
justindobbs
@justindobbs
Aug 31 2015 04:36
i don't know angular but these are the jquery headers i'm using
Lux3
@Lux3
Aug 31 2015 04:36
Going to bed.
justindobbs
@justindobbs
Aug 31 2015 04:38
action: 'query',
titles: str,
generator: randomized,
prop: 'extracts',
rvprop: 'content',
format: 'json'
you can also look at my code if you want http://codepen.io/thebigpumpkin/pen/pJMYyG?editors=001
Danny Fritz
@dannyfritz
Aug 31 2015 04:41
woo bernie
Tim P
@xTimpi
Aug 31 2015 04:41
@justindobbs thats allright, I still want to try and make it work with angular!
justindobbs
@justindobbs
Aug 31 2015 04:41
feeling the bern dannyfritz?
Danny Fritz
@dannyfritz
Aug 31 2015 04:42
yeah
i went to his rally here in denver
Rafael Neubauer
@Scyles
Aug 31 2015 04:48

Hi, I'm getting an error for Bonfire: Return Largest Numbers in Arrays. My code is as follows

function largestOfFour(arr) {
  // You can do this!
  return arr.map(function(value){
    return value.reduce(function(highest,v){
      if(highest<=v){
        highest = v;
      }
      return highest;
    },0)
  });
}

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

It works on other compilers but within the FCC bonfire it won't run and I get an error "Cannot read property 'eql' of undefined"
Anyone know what is going on?

Maryam Ahmed
@mseager
Aug 31 2015 04:51
@Scyles this Bonfire is buggy, it's not working for a lot of people
@Scyles I saved my code in notepad and moved on to the next one until FCC fixes the issue
Rafael Neubauer
@Scyles
Aug 31 2015 04:53
@mseager Thanks, I guess I'll just move on and come back to that later
CamperBot
@camperbot
Aug 31 2015 04:53
scyles sends brownie points to @mseager :sparkles: :thumbsup: :sparkles:
:star: 167 | @mseager | http://www.freecodecamp.com/mseager
Hans van Riet
@hansinla
Aug 31 2015 04:54
@xTimpi Do you have $http listed in your dependencies?
Maryam Ahmed
@mseager
Aug 31 2015 04:54
@Scyles good luck!
Alex
@nasdarovye
Aug 31 2015 04:55
hey guys, I am incredibly new at this, but there is the lesson with html where I'm supposed to paste in a call for the "Lobster" font, and no matter where I paste the call into it doesn't activate so I can't make the h2 font-family Lobster. any suggestions?
Tim P
@xTimpi
Aug 31 2015 04:55
@hansinla yeah sure, otherwise I wouldn’t even be able to make request, but I got it to work, I used jsonp
  $http.jsonp("https://en.wikipedia.org/w/api.php?callback=JSON_CALLBACK&action=query&list=search&format=json&srsearch=Einstein&titles=Main%20Page").then(succ, fail);
Hans van Riet
@hansinla
Aug 31 2015 04:56
@xTimpi Great!
DTing
@dting
Aug 31 2015 04:58
@nasdarovye what's your code look like?
Alex
@nasdarovye
Aug 31 2015 05:00
code 1.png
hope that goes through
DTing
@dting
Aug 31 2015 05:03
@nasdarovye remove the . before h2 in the style tag
Alex
@nasdarovye
Aug 31 2015 05:03
I would assume that doing that for the p in the style tag is good too?
wow.
Maryam Ahmed
@mseager
Aug 31 2015 05:04
@dting good eye!
Alex
@nasdarovye
Aug 31 2015 05:04
so doing that for a class is fine but for an overall type of element just the name of the element is what needs to be on there?
Maryam Ahmed
@mseager
Aug 31 2015 05:04
@nasdarovye yep.... dots are for custom classes
Alex
@nasdarovye
Aug 31 2015 05:04
righteous. thanks!
CamperBot
@camperbot
Aug 31 2015 05:04
if you want to thank someone, put an @ before their name!
Alex
@nasdarovye
Aug 31 2015 05:05
@dting thank you
@dting @mseager how do I send a brownie point?
Maryam Ahmed
@mseager
Aug 31 2015 05:07

@nasdarovye for pasting code, you don't have to take a screencapture. You can just type

three grave accents then your code, then 3 more grave accents

"```"

<your code here>
"```"

@nasdarovye you just say the word 'thanks' then @thescreenname
CamperBot
@camperbot
Aug 31 2015 05:08
mseager sends brownie points to @nasdarovye and @thescreenname :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for thescreenname
:star: 16 | @nasdarovye | http://www.freecodecamp.com/nasdarovye
Alex
@nasdarovye
Aug 31 2015 05:08
thanks @mseager @dting
CamperBot
@camperbot
Aug 31 2015 05:08
nasdarovye sends brownie points to @mseager and @dting :sparkles: :thumbsup: :sparkles:
:star: 169 | @mseager | http://www.freecodecamp.com/mseager
:star: 852 | @dting | http://www.freecodecamp.com/dting
Maryam Ahmed
@mseager
Aug 31 2015 05:09
@nasdarovye you'll be a pro in no time :)
Alex
@nasdarovye
Aug 31 2015 05:09
@mseager :-) this is pretty awesome.
Maryam Ahmed
@mseager
Aug 31 2015 05:09
@nasdarovye I know right? And very addictive
Alex
@nasdarovye
Aug 31 2015 05:10
@mseager There are far worse ways to spend time
Maryam Ahmed
@mseager
Aug 31 2015 05:10
@nasdarovye I spent my weekend putting out bonfires :)
Alex
@nasdarovye
Aug 31 2015 05:10
@mseager but now I have to hit the bed. Much appreciated, ya'all.
Maryam Ahmed
@mseager
Aug 31 2015 05:10
@nasdarovye good night
Jake Bryant
@jbryant8706
Aug 31 2015 05:12
You may have a good night!
Take care
Alex
@nasdarovye
Aug 31 2015 05:13
:-)
Derek Duncan
@derek-duncan
Aug 31 2015 05:15
Maryam Ahmed
@mseager
Aug 31 2015 05:19
@derek-duncan yes it's buggy, I saved mine in notepad and moved on until FCC fixes the issue
Derek Duncan
@derek-duncan
Aug 31 2015 05:20
:thumbsup: ah I'll do the same. thanks!
CamperBot
@camperbot
Aug 31 2015 05:20
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Aug 31 2015 05:22
@derek-duncan but you can post the soln. here. We're human compilers. :P
DTing
@dting
Aug 31 2015 05:22
@derek-duncan FreeCodeCamp/FreeCodeCamp#2874
Derek Duncan
@derek-duncan
Aug 31 2015 05:26
@abhisekp This is mine that may or may not work :wink:
function largestOfFour(arr) {

  var largest = [];
  for (var x = 0; x < arr.length; ++x) {
    var sub = arr[x];
    largest.push(Math.max.apply(Math, sub));
  }
  return Math.max.apply(Math, largest);
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Abhisek Pattnaik
@abhisekp
Aug 31 2015 05:27
@Scyles plz update your code. Doesn't work for negative values in inner arrays. http://repl.it/BE8k
@derek-duncan it doesn't work. Read the instructions again and try to do it again. http://repl.it/BE8l
@derek-duncan you need to output an array with four max. elems in each inner array passed.
Derek Duncan
@derek-duncan
Aug 31 2015 05:29
Oh, that's right. How's this?
function largestOfFour(arr) {

  var largest = [];
  for (var x = 0; x < arr.length; ++x) {
    var sub = arr[x];
    largest.push(Math.max.apply(Math, sub));
  }
  return largest;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Abhisek Pattnaik
@abhisekp
Aug 31 2015 05:30
@derek-duncan first try to do it in simple way. Then use the apply. Moreover, apply is not taught till that bf
Derek Duncan
@derek-duncan
Aug 31 2015 05:31
@abhisekp So you'd suggest using simple for loops?
Abhisek Pattnaik
@abhisekp
Aug 31 2015 05:32
@derek-duncan ok. that looks great :+1:
yes. first do it using simple for loops. And then after that go for adv. tech.
Derek Duncan
@derek-duncan
Aug 31 2015 05:33
@abhisekp Gotcha. Thanks for the help!
CamperBot
@camperbot
Aug 31 2015 05:33
derek-duncan sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 352 | @abhisekp | http://www.freecodecamp.com/abhisekp
Rafael Neubauer
@Scyles
Aug 31 2015 05:39
@abhisekp Thanks, it's fixed. The Bonfire is still broken so I couldn't see all the test cases
CamperBot
@camperbot
Aug 31 2015 05:39
scyles sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 353 | @abhisekp | http://www.freecodecamp.com/abhisekp
Prashanth
@dgprashanth
Aug 31 2015 05:49
Guys, need some help with using API's. I will post my code, but nothing happens when i run it
SourceAura
@SourceAura
Aug 31 2015 05:49
can anyone help me wrap my mind around the core concepts of loops…i feel like my lack of understanding there is affecting my application of functions.
Prashanth
@dgprashanth
Aug 31 2015 05:51
<body>
     <nav class="navbar navbar navbar-fixed-top" >
        <div class="container">
             <div class="navbar-header">
                <a>Quote Machine</a>
            </div>
        </div>
        </div>
     </nav>

     <div class="container">
        <div class="row">
            <div class="col-lg-12 text-center">
              <div class="container2">
                <p class="lead" id="response">Click the button below to get a quote!</p><br><br>
                <a class="btn" id="quoteJSON">Generate New Quote!</a></div>
            </div>
        </div>
     </div>
 </body>
$('#quoteJSON').click(function() {
  $.getJSON("http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?")
    .done(update)

});

function update(response) {
  $('#log').prepend('<pre>' + $('#response').html() + '</pre>');
  $('#response').html(JSON.stringify(response));
}
DTing
@dting
Aug 31 2015 05:53
@dgprashanth is this in codepen?
Prashanth
@dgprashanth
Aug 31 2015 05:53
Yeah
SHall I send you the codepen link?
DTing
@dting
Aug 31 2015 05:53
link the pen
digitalomen
@digitalomen
Aug 31 2015 05:53
hey camphelp, im at waypoint 132, trying to Manipulate Arrays With pop. can somone advise me
DTing
@dting
Aug 31 2015 05:53
@dgprashanth works for me
Prashanth
@dgprashanth
Aug 31 2015 05:54
@dting Oh :(
DTing
@dting
Aug 31 2015 05:55
Screen Shot 2015-08-30 at 10.54.54 PM.png
@digitalomen what's your code look like now?
help formatting
CamperBot
@camperbot
Aug 31 2015 05:55

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Prashanth
@dgprashanth
Aug 31 2015 05:55
@dting How come it's not working on my comp.. Is there anywhere in particular i should be looking at?
digitalomen
@digitalomen
Aug 31 2015 05:56
var myArray = ["John", 23, ["cat", 2]];
var .pop("cat", 2);
DTing
@dting
Aug 31 2015 05:56
try refreshing your browser or trying another browser @dgprashanth also that api wont work with https
digitalomen
@digitalomen
Aug 31 2015 05:57
im trying to pop() a value off of the end of the array.
DTing
@dting
Aug 31 2015 05:57
you call .pop on the array out want to remove the last element from
digitalomen
@digitalomen
Aug 31 2015 05:57
so i add the .pop to the original array?
DTing
@dting
Aug 31 2015 05:57
var arr = [1,2,3];
var removed = arr.pop();
console.log(removed);
// 3
console.log(arr);
// [1,2]
Prashanth
@dgprashanth
Aug 31 2015 05:57
@dting Thank you! I had an addon called https everywhere running.. Once I disabled it and ran it, it worked fine :)
CamperBot
@camperbot
Aug 31 2015 05:57
dgprashanth sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 853 | @dting | http://www.freecodecamp.com/dting
digitalomen
@digitalomen
Aug 31 2015 05:58
@dting thank you
DTing
@dting
Aug 31 2015 05:58
nps
digitalomen
@digitalomen
Aug 31 2015 05:59
one more thing to the camphelp, these past two days i noticed that even after i finish a waypoint, it doesn't take me to next screen, when i revisit the map it shows the waypoint as not completed. I have to log-off and back on for it to appear as completed.
DTing
@dting
Aug 31 2015 05:59
@digitalomen not sure about that one. sorry
Maryam Ahmed
@mseager
Aug 31 2015 06:00
@digitalomen pop implies popping only the last element from an array, so you don't have to specify a position. Just calling pop() will do the trick
@digitalomen did you try clicking the run code green button
digitalomen
@digitalomen
Aug 31 2015 06:02
var myArray = ["John", 23, ["cat", 2]];
var .removed = myArray.pop;
DTing
@dting
Aug 31 2015 06:02
you need to remove that . before removed and call the pop function using ()
Maryam Ahmed
@mseager
Aug 31 2015 06:03
@digitalomen yes what @dting said, remove the period before 'removed'
digitalomen
@digitalomen
Aug 31 2015 06:04
ok got it
var myArray = ["John", 23, ["cat", 2]];
var removed = myArray.pop();
Maryam Ahmed
@mseager
Aug 31 2015 06:04
@digitalomen perfect
Jacob Jordan
@jjordan88
Aug 31 2015 06:07
Knock knock, guys.... anyone up besides me? Got a quick question.
Code passes, but technical difficulties are stopping it from running... so maybe one of you guys can help me.
So I can go to sleep! (It's 2.10 am)
digitalomen
@digitalomen
Aug 31 2015 06:14
sorry guys, there is still this issue where it says myArray should only have the first two values left(["cat"], 2) http://www.freecodecamp.com/challenges/waypoint-manipulate-arrays-with-pop
ill read the link someone sent me and see if it helps
DTing
@dting
Aug 31 2015 06:14
what's your code look like now?
digitalomen
@digitalomen
Aug 31 2015 06:17
this is what I typed,,,var myArray = ["John", 23, ["cat", 2]];
var removed = myArray.pop();
and its tellimg me "myArray should only have the first two values left(["cat"], 2)"
but those are the last 2 values so idk
DTing
@dting
Aug 31 2015 06:18
does the code in the box look like?
//var numbers = [1,2,3];
//console.log(numbers); // logs [1,2,3]
//var removed = numbers.pop();
//console.log(numbers); // logs [1,2]
//console.log(removed); // logs 3

var myArray = ["John", 23, ["cat", 2]];
// Only change code below this line.

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

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);
digitalomen
@digitalomen
Aug 31 2015 06:21
yes
hallelujuah it worked.
thank you so much
CamperBot
@camperbot
Aug 31 2015 06:22
if you want to thank someone, put an @ before their name!
Emil Aasa
@emilaasa
Aug 31 2015 06:43
bf DNA Pairing
CamperBot
@camperbot
Aug 31 2015 06:43

:fire:Bonfire: DNA Pairing :link:

function pair(str) {
 return str;
}

pair("GCG");

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

more info:  bf details | bf links | hint

Emil Aasa
@emilaasa
Aug 31 2015 06:43
Anyone got any neat solutions on how to get a string into a 2d array?
I need to transform ’GCG’ into [[G], [C], [G]]
DTing
@dting
Aug 31 2015 06:47
@emilaasa cant think of anything special i used something like
'hello'.split('').map(function(l) {return [l]});
Emil Aasa
@emilaasa
Aug 31 2015 06:48
Okay, .map is a blind spot of mine, I’ll read the docs on that one
thanks @dting
CamperBot
@camperbot
Aug 31 2015 06:49
emilaasa sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 855 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 31 2015 06:49
np
Emil Aasa
@emilaasa
Aug 31 2015 06:51
When I’m reading the first paragraphs on MDN my face looks like someone who just got hit in the head with a sledgehammer
usually clears up a bit when I get to the examples tho
DTing
@dting
Aug 31 2015 06:52
hah
Emil Aasa
@emilaasa
Aug 31 2015 06:53
Feels like reading documentation is a whole skillset that you need to develop.. :>
DTing
@dting
Aug 31 2015 06:53
ya definitely
Luis Felipe López G.
@luishendrix92
Aug 31 2015 06:54
wiki js map
CamperBot
@camperbot
Aug 31 2015 06:54

:point_right: js map [wiki]

The method map of the Array prototype allows you to grab a hold of each element inside an array and apply a function to them. After map finishes iterating through the array, it will return a new array with the results of applying the function to the aforementioned elements.

The syntax is as follows:

myAwesomeArray.map(myAwesomeFunction)

Since map doesn't mutate the original array, it should be used as a value, stored inside a variable, passed in as a returned value inside a function (the most common case) and many other things.
Let's learn a little bit of what this powerful function can do! Say we have an array of names and we want to create a new array with these names but UPPERCASED.

var names = ["Leia", "Anakin", "Luke", "Obi Wan Kenobi"];
var uppercaseNames = names.map(function(name) {
  return name.toUpperCase();
};

Now if we console.log(uppercaseNames) we will get this:

Array(4) -> ["LEIA", "ANAKIN", "LUKE", "OBI WAN KENOBI"]

But how does it work? Let's dive more into it.

:pencil: read more about js map on the FCC Wiki

Santhosh Devaraj
@santhoshdevaraj
Aug 31 2015 06:54
@emilaasa MDN threw me off a little bit at the beginning..but nw i’m so in love with it..
Luis Felipe López G.
@luishendrix92
Aug 31 2015 06:54
You can never go wrong with Star Wars references
Mbos95
@Mbos95
Aug 31 2015 06:56
How can I remove punctuation and spaces in strings ?
DTing
@dting
Aug 31 2015 06:56
@Mbos95 you can use string.replace with a regex
Mbos95
@Mbos95
Aug 31 2015 06:56
Oh yea, thank you! :)
CamperBot
@camperbot
Aug 31 2015 06:56
if you want to thank someone, put an @ before their name!
Mbos95
@Mbos95
Aug 31 2015 06:56
thank you @dting
CamperBot
@camperbot
Aug 31 2015 06:56
mbos95 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 856 | @dting | http://www.freecodecamp.com/dting
Mbos95
@Mbos95
Aug 31 2015 06:57
thanks @camperbot for reminding me
CamperBot
@camperbot
Aug 31 2015 06:57
mbos95 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 133 | @camperbot | http://www.freecodecamp.com/camperbot
Emil Aasa
@emilaasa
Aug 31 2015 06:57
@santhoshdevaraj yeah I think its very nice! :)
Okay so trying to figure out Array.map(function()).. it will just call my function on each item in the array right?
DTing
@dting
Aug 31 2015 07:00
ya and the return values are return as an array as a result
Emil Aasa
@emilaasa
Aug 31 2015 07:01
Okay so In this case I return a separate array for each value
DTing
@dting
Aug 31 2015 07:02
ya
Emil Aasa
@emilaasa
Aug 31 2015 07:03
hmm I think I dont understand how to reference the current value in the array
like if I used a for loop I woud reference it as arr[i]
DTing
@dting
Aug 31 2015 07:03
the callback for the filter function calls the function with the arguments (element, index, array)
so if you have
['a','b','c'].filter(function(v,i,a) {
  console.log('value', v);
  console.log('index', i);
  console.log('array', a);
  return v;
});
you would see:
value a
index 0
array ['a', 'b', 'c']
value b
index 1
array ['a', 'b', 'c']
value c
index 2
array ['a', 'b', 'c']
the return value would be:
['a', 'b', 'c']
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:07

@emilaasa Just imagine your function inside map/filter/forEach grabs a hold of 3 things for each of the values in the arrray:
1- The current value
2- The index of the current value
3- The array that invoked the method

In reality, you will execute the function arr.length times and each of those functions will be independent.

DTing
@dting
Aug 31 2015 07:07
but if you dont need the other arguments you'd just make a function that doesnt have those named parameters
[1,2,3,4].filter(function(number) {
  return number > 2; 
});
then the result would be
[3, 4]
Emil Aasa
@emilaasa
Aug 31 2015 07:08
hmmkayy
Mbos95
@Mbos95
Aug 31 2015 07:09
Hmm.. the regexp patterns you can select confuse me! I need to remove punctuation and spaces.. Are those /s and /w ?
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:11
@Mbos95 \s and \w are "white-space characters" and "alphanumeric characters (a-zA-Z0-9_)" respectively
Uppercasing those letters will cause to NOT match them.
You can understand white-space characters as the spacebar, new-line and others that appear invisible.
Aleksandar B.
@aleksandar-b
Aug 31 2015 07:12
Anyone knows how to find wired background like on this site? https://egghead.io/
Emil Aasa
@emilaasa
Aug 31 2015 07:12
thanks @luishendrix92 and @dting
CamperBot
@camperbot
Aug 31 2015 07:12
emilaasa sends brownie points to @luishendrix92 and @dting :sparkles: :thumbsup: :sparkles:
:warning: emilaasa already gave dting points
:star: 323 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Mbos95
@Mbos95
Aug 31 2015 07:12
Yea.. sorry english confuses me sometimes xD second language and all.. if they throw too many fancy words at me at once, I get all overwhelmed :D
Emil Aasa
@emilaasa
Aug 31 2015 07:12
your combined efforts have fixed my brain
DTing
@dting
Aug 31 2015 07:12
@Mbos95 \W is non word characters or [^A-Za-z0-9_]
Emil Aasa
@emilaasa
Aug 31 2015 07:12
:>
Mbos95
@Mbos95
Aug 31 2015 07:12
@luishendrix92 Oke, whitespaces are invisible thingies you can type or which show up
@dting Yea, that is what I don't get. Those are non words but then they proceed to filter on A-Z a-z and 0-9
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:13

From W3C:

A whitespace character can be:

A space character
A tab character
A carriage return character
A new line character
A vertical tab character
A form feed character

Emil Aasa
@emilaasa
Aug 31 2015 07:13
I think atleast!
function pair(str) {
  var arr = str.split('');
  console.log(arr);
  var twoD = arr.map(function(value) {
    return [value];
  });
  console.log(twoD);
 return str;
}

pair("GCG");
thats what I have so far, it seems to return a 2D array now
Mbos95
@Mbos95
Aug 31 2015 07:13
@luishendrix92 Yea.. that kinda overwhelmes me xD So I thank you for your kind explanation. I get now what it all means.
CamperBot
@camperbot
Aug 31 2015 07:13
mbos95 sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 324 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
DTing
@dting
Aug 31 2015 07:14
@emilaasa nice
Emil Aasa
@emilaasa
Aug 31 2015 07:15
nice help ! like the perfect amount for me
DTing
@dting
Aug 31 2015 07:15
@samosale you can try modifying this css to get it the way you like http://lea.verou.me/css3patterns/#blueprint-grid
Emil Aasa
@emilaasa
Aug 31 2015 07:16
Yours and Luis’ was the perfect combination! :)
Mbos95
@Mbos95
Aug 31 2015 07:16
hmm oke. I kinda get it now! Thank you guys xD
CamperBot
@camperbot
Aug 31 2015 07:16
if you want to thank someone, put an @ before their name!
Omar
@oab00
Aug 31 2015 07:16
@Mbos95 no problem :)
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:17
Speaking of Lea Verou, her youtube video (and web tool) about regex using javascript is just one of the best things around to learn RegExp
I also like the CodeSchool course
Aleksandar B.
@aleksandar-b
Aug 31 2015 07:17
@dting tnx
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:17
I just wish there was more information about capturing groups and new RegExp()
Mbos95
@Mbos95
Aug 31 2015 07:18
@oab00 Oaaab
@luishendrix92 Hmm should check that out! Will do so after work
Omar
@oab00
Aug 31 2015 07:19
@Mbos95 :trollface:
CamperBot
@camperbot
Aug 31 2015 07:19
:trollface: troll problems? notify admins here
Omar
@oab00
Aug 31 2015 07:19
This message was deleted
CamperBot
@camperbot
Aug 31 2015 07:19
@oab00 said: echo :trollface:
Mbos95
@Mbos95
Aug 31 2015 07:20
One more time camperbot and I will notify the admins
you troll
CamperBot
@camperbot
Aug 31 2015 07:20
:trollface: troll problems? notify admins here
Ashraful Islam
@iashraful
Aug 31 2015 07:20
hello!
@dting morning!
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:21
holler
CamperBot
@camperbot
Aug 31 2015 07:21
holler back!
DTing
@dting
Aug 31 2015 07:21
bedtime!
Ashraful Islam
@iashraful
Aug 31 2015 07:21
@luishendrix92 holler!
CamperBot
@camperbot
Aug 31 2015 07:21
holler back!
Aleksandar B.
@aleksandar-b
Aug 31 2015 07:22
@luishendrix92 link?
Mbos95
@Mbos95
Aug 31 2015 07:22
AH yeaaay! I managed to do the palindrome bonfire!!
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:22
@samosale Link to...?
Ashraful Islam
@iashraful
Aug 31 2015 07:22
@Mbos95 time to celebrate!
Mbos95
@Mbos95
Aug 31 2015 07:22
Do you guys have an remarks on my code? way to improve (there will be.. I am sure)
function palindrome(str) {
  str = str.replace(/\s+/g, '');
  str = str.replace(/\W+/g, '');
  str = str.toLowerCase();
var strReverse = str.split('').reverse().join(''); 
  if(str === strReverse){
    return true;

  }else{
    return false;
  }
}



palindrome("not a palindrome");
Aleksandar B.
@aleksandar-b
Aug 31 2015 07:23
@luishendrix92 Lea Verou youtube regex video
Mbos95
@Mbos95
Aug 31 2015 07:23
@iashraful throws around partyhats and annoying floppy whistles you use at birthday parties but always end up in someones eye
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:23
Ashraful Islam
@iashraful
Aug 31 2015 07:25
bf palindrome
CamperBot
@camperbot
Aug 31 2015 07:25

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

Emil Aasa
@emilaasa
Aug 31 2015 07:25
hmm I think i burnt like 10% battery in a few minutes with some infinite loops :D
Ashraful Islam
@iashraful
Aug 31 2015 07:26
holy hell! Nitrous says free tier is not possible for my country, need to pay 'em
:(
Ewe Lin Loo
@elloo
Aug 31 2015 07:26
topic ifelse
wiki ifelse
CamperBot
@camperbot
Aug 31 2015 07:26
no wiki entry for: ifelse
:pencil: click here to create one now!after creating your page type update to reload it here
Emil Aasa
@emilaasa
Aug 31 2015 07:27
wiki else if
CamperBot
@camperbot
Aug 31 2015 07:27
no wiki entry for: else if
:pencil: click here to create one now!after creating your page type update to reload it here
Ashraful Islam
@iashraful
Aug 31 2015 07:28
@Mbos95 here is a lovely refactored version
function palindrome(str) {
  str = str.replace(/[\s+|\W+]/g, '').toLowerCase();
  var strReverse = str.split('').reverse().join(''); 
  return (str === strReverse);
}

palindrome("not a palindrome");
DTing
@dting
Aug 31 2015 07:29
@iashraful @Mbos95
you dont need to remove spaces /\W/g already does that
Ashraful Islam
@iashraful
Aug 31 2015 07:29
I think there are -_, and the likes
DTing
@dting
Aug 31 2015 07:30
str = str.replace(/\W|_/g, '').toLowerCase();
Ewe Lin Loo
@elloo
Aug 31 2015 07:30

@emilaasa Hehe thanks... I'm trying to get this to work but having problems

```function myFunction(){
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
// Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

// Only change code below this line.

if (flip === 0) {
return "heads";
}
else {
return "tails";
}

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

CamperBot
@camperbot
Aug 31 2015 07:30
elloo sends brownie points to @emilaasa :sparkles: :thumbsup: :sparkles:
:star: 271 | @emilaasa | http://www.freecodecamp.com/emilaasa
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:30
@Mbos95 Ok let's give some feedback:
1- str = str.replace(/\s+/g, ''); and str = str.replace(/\W+/g, '');
1.1 - There's no need to use + when you only look for 1 element in the RegExp as long as you have the g (global) flag.
1.2 - There's also NO NEED to replace whitespace characters if you are already using a "anything that IS NOT an alphanumeric character" (this already does the function of removing strange characters including whitespace).
1.3 - You can match one or more characters using bracket notation: /[aeiou\d]/g (this will remove lowercase vowels and any digit) and if you put ^ before everything inside the brackets, you will tell the regexpt to match anything that is NOT vowels and digits.
2- You can chain functions like str.replace().toLowerCase() and store it inside a variable to latter apply more methods.
3- You don't need an if statement if you evaluate an expression that returns either true or false, you can just return whatever the evaluation expression returns using: return (str === strReverse), careful with the parenthesis, what's inside the () will return a Boolean.
Ashraful Islam
@iashraful
Aug 31 2015 07:30
oh! yo are like totally awesome
Mbos95
@Mbos95
Aug 31 2015 07:30
@iashraful Thank you! It is interesting to see :D eventually I can make it more efficient. now I just go for havint it work xD
CamperBot
@camperbot
Aug 31 2015 07:30
mbos95 sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 304 | @iashraful | http://www.freecodecamp.com/iashraful
Mbos95
@Mbos95
Aug 31 2015 07:32
@luishendrix92 Thank you. You do an amazing job helping people :) I really appeciate all the help around here. I'll try to code more efficient in the future.. sometimes will throw my code back in here to get some feed back :)
Spencer
@ThamKinJuhn
Aug 31 2015 07:33

Hello guys, I've got a question about the Bonfire: Title Case a Sentence.

My code gives me the "Invalid left-hand side in assessment" error, but it really looks like it should work (to me at least). Can anyone tell me what I've done wrong? Thanks for your time.

function titleCase(str) {
  str = str.split(/\s/g);
  for (i = 0; i < str.length-1; i++) {
    str[i].charAt(0) = str[i].charAt(0).toUpperCase();
  }
  str = str.join(' ');
  return  str;
}
DTing
@dting
Aug 31 2015 07:33
@elloo you are missing a closing }
Spencer
@ThamKinJuhn
Aug 31 2015 07:33
oh seriously?!
wait where?
DTing
@dting
Aug 31 2015 07:34
that was for @elloo
Spencer
@ThamKinJuhn
Aug 31 2015 07:34
lol just saw. my bad
DTing
@dting
Aug 31 2015 07:34
you cant mutate a string
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:34
wiki js immutable
CamperBot
@camperbot
Aug 31 2015 07:34

:point_right: js immutable [wiki]

Immutable means unchangeable i.e. you can't change.

Javascript has lots of immutable types e.g. string primitive type. Try this in your console.

s = "red";
console.log(s[1]); //→ "e"
s[1] = "x";
console.log(s) //→ "red"

the s didn't change! WAT!

:pencil: read more about js immutable on the FCC Wiki

DTing
@dting
Aug 31 2015 07:34
you need to replace the string in str[i] with the correct string
Spencer
@ThamKinJuhn
Aug 31 2015 07:35
@dting @luishendrix92 Okay thanks for the link and help!
CamperBot
@camperbot
Aug 31 2015 07:35
thamkinjuhn sends brownie points to @dting and @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 325 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
:star: 857 | @dting | http://www.freecodecamp.com/dting
Ewe Lin Loo
@elloo
Aug 31 2015 07:36
@dting Ohh, I see! Thanks! I realised I deleted it when I reset the code
Emil Aasa
@emilaasa
Aug 31 2015 07:36
@dting @luishendrix92 WEEE I finished it and learned a lot, thanks guys :)
CamperBot
@camperbot
Aug 31 2015 07:36
emilaasa sends brownie points to @dting and @luishendrix92 :sparkles: :thumbsup: :sparkles:
:warning: emilaasa already gave dting points
:warning: emilaasa already gave luishendrix92 points
Ashraful Islam
@iashraful
Aug 31 2015 07:36
@dting is there something like java's Stringbuilder for JS?
making new strings sounds like memory issue to me
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:37
You could create a function that emulates it, a new one or as an extension of the String.prototype
I'm really ignorant about Java and the C family (for now, that might over the course of these weeks) so I haven't heard of StringBuilder.
Ashraful Islam
@iashraful
Aug 31 2015 07:41
:( I sometimes feel godlike being able to modify prototypes
Alan Wilson
@nulland
Aug 31 2015 07:41
Hello all. Could someone please help me with the following line of JS code? <img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image" class="thick-green-border"> The picture is smaller but there isn't a border around it. What am I doing wrong? Also, how do I copy the code window instead of just the text? Thanks!
Emil Aasa
@emilaasa
Aug 31 2015 07:42
make it class=“first-style second-style”
instead of class=“first-style” class=“second-style”
If you press the little M in the bottom right corner of the text input window in gitter you can access the Markdown help, that will show you how to do all the formatting of code etc
Ashraful Islam
@iashraful
Aug 31 2015 07:45
@emilaasa good explanation :clap:
Alan Wilson
@nulland
Aug 31 2015 07:45
@emilaasa I agree! Thank you!
CamperBot
@camperbot
Aug 31 2015 07:45
nulland sends brownie points to @emilaasa :sparkles: :thumbsup: :sparkles:
:star: 273 | @emilaasa | http://www.freecodecamp.com/emilaasa
Luis Felipe López G.
@luishendrix92
Aug 31 2015 07:45
Or CTR+SHIFT+M
I really wanted this chat's markdown to support tables, they look great.
DTing
@dting
Aug 31 2015 07:46
@iashraful theres no string builder class but most modern browsers optimize string concatenations.
Ashraful Islam
@iashraful
Aug 31 2015 07:47
@dting oh! thanks for the tip :D
CamperBot
@camperbot
Aug 31 2015 07:47
iashraful sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 858 | @dting | http://www.freecodecamp.com/dting
Emil Aasa
@emilaasa
Aug 31 2015 07:49
@luishendrix92 its open source :)
Just get busy!
xD
Ashraful Islam
@iashraful
Aug 31 2015 08:05
:D
Luis Felipe López G.
@luishendrix92
Aug 31 2015 08:05
Ok I'm out, lots of stuff to do and Uni week err
Ashraful Islam
@iashraful
Aug 31 2015 08:08
@luishendrix92 later
Justin Boden
@justinboden
Aug 31 2015 08:20

Hi all. I'm on the second jQuery Waypoint and I can't figure out how to get the correct syntax to add a string to the document ready function.

I'm currently trying to put '$("button").addClass("animated bounce")' into it but it isn't working for me. This is my best guess at what I'm meant to have showing:

$(document).ready(function($"button").addClass("animated bounce"))

Am I mising something obvious?

Ashraful Islam
@iashraful
Aug 31 2015 08:22
@justinboden this might work
$('button').addClass('animated').addClass('bounce');
wp
Emil Aasa
@emilaasa
Aug 31 2015 08:22
you need the parenthesis after $
the code you pasted has $”button” instead of $(“button”)
Ashraful Islam
@iashraful
Aug 31 2015 08:22
yes, also what emilaasa says unless you were typing it here instead of copy paste :)
@emilaasa see his first claim I'm currently trying to put '$("button").addClass("animated bounce")'
Emil Aasa
@emilaasa
Aug 31 2015 08:24
ah
Ashraful Islam
@iashraful
Aug 31 2015 08:26
@justinboden can you please paste your original code here?
Emil Aasa
@emilaasa
Aug 31 2015 08:26
@justinboden you need to change the document ready function as well
Justin Boden
@justinboden
Aug 31 2015 08:26

Thanks for the help, emilaasa and iashraful. I'm still getting an 'unexpected token' error. I've tried this:

$(document).ready(function($('button').addClass('animated').addClass('bounce'))

and this:

$(document).ready(function($('button').addClass('animated').addClass('bounce');

and neither works.

CamperBot
@camperbot
Aug 31 2015 08:26
if you want to thank someone, put an @ before their name!
Emil Aasa
@emilaasa
Aug 31 2015 08:26
$(document).ready(function() {
thekingwai
@thekingwai
Aug 31 2015 08:26

I am working on Bonfire: Sorted Union exercise but I am not quite sure how the solution work. May somebody be so kind to teach me?

function unite(arr1, arr2, arr3) {
  var tmp = [];
  for (var i=0; i<arguments.length; i++) { 
    tmp.push(arguments[i]);
  }

  var flattened = tmp.reduce(function(a, b) {
                    return a.concat(b);
                  });

  return flattened.filter(onlyUnique);
}
function onlyUnique(value, index, self ) { 
  return self.indexOf(value) === index;
}

Regarding the onlyUnique function, is it a function in javascript library under filter? Otherwise, how does the compiler know the argument type? For example, if I put the argument in onlyUnique(value,self,index), it cannot run successfully. Many thanks for your reading and help in advance.

CamperBot
@camperbot
Aug 31 2015 08:26
if you want to thank someone, put an @ before their name!
Ashraful Islam
@iashraful
Aug 31 2015 08:26
we could scrutinize it for errors
Emil Aasa
@emilaasa
Aug 31 2015 08:27
$(document).ready(function() {

});
Ashraful Islam
@iashraful
Aug 31 2015 08:27
@justinboden paste your's like @thekingwai did
Prashanth
@dgprashanth
Aug 31 2015 08:27
Guys, I'm on Zipline quote machine, and I would like to know how to output the response i'm getting in a neat manner
Justin Boden
@justinboden
Aug 31 2015 08:27
This message was deleted
CamperBot
@camperbot
Aug 31 2015 08:27
:bulb: to format code use backticks! ``` more info
Justin Boden
@justinboden
Aug 31 2015 08:27
This message was deleted
Ashraful Islam
@iashraful
Aug 31 2015 08:27
<script>
$(document).ready(function($('button').addClass('animated').addClass('bounce'); {
});
</script>
oh got it
Prashanth
@dgprashanth
Aug 31 2015 08:28
As in, which documentation should I be using? I'm using a JSON get request. Anyone can point me to the right documentation for this?
Ashraful Islam
@iashraful
Aug 31 2015 08:28
@emilaasa he is putting it as argument of the function rather than inside function
Justin Boden
@justinboden
Aug 31 2015 08:28
<script>
  $(document).ready(function($('button').addClass('animated').addClass('bounce'); {

  });
</script>
Alan Wilson
@nulland
Aug 31 2015 08:28
This message was deleted
CamperBot
@camperbot
Aug 31 2015 08:28
:bulb: to format code use backticks! ``` more info
Alan Wilson
@nulland
Aug 31 2015 08:28
This message was deleted
Emil Aasa
@emilaasa
Aug 31 2015 08:28
$(document).ready(function() {
  $(‘button’).addClass(‘animated’); // etc etc
});
Ashraful Islam
@iashraful
Aug 31 2015 08:29
@justinboden it should be like this
$(document).ready(function() {
   $('button').addClass('animated').addClass('bounce'); 

  });
Emil Aasa
@emilaasa
Aug 31 2015 08:29
right now you are missing a closing parenthesis and bracket notation after function(
Justin Boden
@justinboden
Aug 31 2015 08:29
OK, great. Thanks a lot!
CamperBot
@camperbot
Aug 31 2015 08:29
if you want to thank someone, put an @ before their name!
Emil Aasa
@emilaasa
Aug 31 2015 08:29
This message was deleted
Ashraful Islam
@iashraful
Aug 31 2015 08:31
@dgprashanth what do you mean by neat manner?
I think it would be helpful for people to realize that .ready() is just a function like any other, but the way we format it may be confusing for beginners.
techcoder008
@techcoder008
Aug 31 2015 08:33
learning html stuck on the part where i need to import lobster font from the link
http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css
Alan Wilson
@nulland
Aug 31 2015 08:33
This message was deleted
techcoder008
@techcoder008
Aug 31 2015 08:33
getting error not found
Emil Aasa
@emilaasa
Aug 31 2015 08:33
@nbh yep!
This message was deleted
whops
Alan Wilson
@nulland
Aug 31 2015 08:34
I'm trying to create a dead link in lesson 23 of the camp map. If I'm understanding correctly, I'm supposed to replace this <p>Click here for <a href="http://www.freecatphotoapp.com">cat photos</a>.</p> with this <p>Click here for <a #="http://www.freecatphotoapp.com">cat photos</a>.</p>. However, it doesn't appear to be working. I did this in the W3 Tryit Editor and it worked. Could someone help please?
the dash should replace the link
not the href
Ashraful Islam
@iashraful
Aug 31 2015 08:34
@techcoder008 should be like <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lobster" type="text/css>
@nulland no, it should be <a href="#">cat photos</a>.</p>
Alan Wilson
@nulland
Aug 31 2015 08:36
@nbh and @iashraful Got it. Thanks for the help!
CamperBot
@camperbot
Aug 31 2015 08:36
nulland sends brownie points to @nbh and @iashraful :sparkles: :thumbsup: :sparkles:
:star: 305 | @iashraful | http://www.freecodecamp.com/iashraful
:star: 144 | @nbh | http://www.freecodecamp.com/nbh
Marc bernardoni
@mbernardoni
Aug 31 2015 08:41
Hello, In "Waypoint: Make Images Mobile Responsive" section, they ask me to "Add a second image with the src of http://bit.ly/fcc-running-cats". So I copy my first img code and change it by:
<a href="#">
<img class="smaller-image thick-green-border img-responsive" src="http://bit.ly/fcc-running-cats">
</a>
but that doesn't valid the section. I try w/o <a> and w/o class wiyhout success
Ashraful Islam
@iashraful
Aug 31 2015 08:42
@Morifen did they ask you to add only image or another image as link
you should remove that <a href="#"> </a>
Marc bernardoni
@mbernardoni
Aug 31 2015 08:43

First, Add a new image below the existing one. Set it's src attribute to http://bit.ly/fcc-running-cats.

It would be great if this image could be exactly the width of our phone's screen.

Ashraful Islam
@iashraful
Aug 31 2015 08:43
you only need <img class="smaller-image thick-green-border img-responsive" src="http://bit.ly/fcc-running-cats">
the class should be class="img-responsive", I don't think that smaller-image and thick-green-border is needed as well
Marc bernardoni
@mbernardoni
Aug 31 2015 08:44
@iashraful badly, that doesn't valid the stage :(
Ashraful Islam
@iashraful
Aug 31 2015 08:45
let me see your whole code
put your code in like this
wiki format
CamperBot
@camperbot
Aug 31 2015 08:45

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Marc bernardoni
@mbernardoni
Aug 31 2015 08:46
This message was deleted
CamperBot
@camperbot
Aug 31 2015 08:46
:bulb: to format code use backticks! ``` more info
anknits
@anknits
Aug 31 2015 08:48
wrt Bonfire: Diff Two Arrays. I can do it various ways like we do in other languages. But I don't understand how to use the features/ functions provided to solve the problem.
Marc bernardoni
@mbernardoni
Aug 31 2015 08:48
<div class="container-fluid">
  <h2 class="red-text">CatPhotoApp</h2>

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

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

  <img class="img-responsive" src="http://bit.ly/fcc-running-cats">


  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
    <label><input type="checkbox" name="personality"> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Crazy</label>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</div>
sorry :(
my fault is on line 10
Aleksandr Sidorov
@AleksandrSidorov
Aug 31 2015 08:52
@anknits I am on Diff Two Arrays too. Done it, but I'm think I repeat myself in code.
Prashanth
@dgprashanth
Aug 31 2015 08:55
@iashraful I mean, I want to be able to individually extract each element of the response.. So then I would be able to apply classes and make them look presentable. Right now it's all like {"quoteText":"I destroy my enemies when I make them my friends. ","quoteAuthor":"Abraham Lincoln","senderName":"","senderLink":"","quoteLink":"http://forismatic.com/en/3795a38c76/"}
Marc bernardoni
@mbernardoni
Aug 31 2015 08:57
wtf ... the new image must be upper the another one ... not below !!!
[...]
<p>Click here for <a href="#">cat photos</a>.</p>

<img class="img-responsive" src="http://bit.ly/fcc-running-cats">
<a href="#"><img class="smaller-image thick-green-border" src="http://bit.ly/fcc-relaxing-cat"></a>
thx for your help @iashraful
CamperBot
@camperbot
Aug 31 2015 08:58
morifen sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 306 | @iashraful | http://www.freecodecamp.com/iashraful
Ashraful Islam
@iashraful
Aug 31 2015 08:59
@Morifen I wasn't helping, I am just back from lunch, what's going on?
Marc bernardoni
@mbernardoni
Aug 31 2015 08:59
the image must be upper and not below the other one !!!!
Ashraful Islam
@iashraful
Aug 31 2015 09:00
@dgprashanth you can't beautify a json data, you need to inject part's of those into appropriate html elements like p, div, h1 etc
Marc bernardoni
@mbernardoni
Aug 31 2015 09:00
@iashraful there is a bug in the instruction's text
Ashraful Islam
@iashraful
Aug 31 2015 09:01
@Morifen please report any bug you find, will help everyone :D
Prashanth
@dgprashanth
Aug 31 2015 09:03
@iashraful Yes! I want to be able to do that. I think i must be looking at getJSON() to find out how.
Ashraful Islam
@iashraful
Aug 31 2015 09:05
@dgprashanth I lost you, are you saying you need some way to retrieve data via json or are you saying you have the json data, you need to inject it into html :( ?
Prashanth
@dgprashanth
Aug 31 2015 09:07
Yeah! I have the data show up in it's raw form basically. With quotes, and brackets and stuff
I just wanted to know how to access each individual part of it. Like Quote will be response[quotename] and perhaps author will be response[quoteauthor] and hence i can apply appropriate classes to them finally before being displayed
igor_bv
@burtovoj-iv
Aug 31 2015 09:08
I get answer in console, but can't pass bonfire Return Largest Numbers in Arrays. Where i wrong:
'''
CamperBot
@camperbot
Aug 31 2015 09:08
:bulb: to format code use backticks! ``` more info
igor_bv
@burtovoj-iv
Aug 31 2015 09:09

'''
function largestOfFour(arr) {
var arrLargestNumbers=[];
for(var i=0; i<arr.length; i++){
var maxArrNumber=0;
for (var q=0; q<arr[i].length; q++){
if(maxArrNumber<arr[i][q]){
maxArrNumber=arr[i][q];
}
}
arrLargestNumbers.push(maxArrNumber);

}
console.log(arrLargestNumbers);
return arrLargestNumbers;
}
'''

CamperBot
@camperbot
Aug 31 2015 09:09
:bulb: to format code use backticks! ``` more info
Ashraful Islam
@iashraful
Aug 31 2015 09:10
function largestOfFour(arr) {
var arrLargestNumbers=[];
for(var i=0; i<arr.length; i++){
var maxArrNumber=0;
for (var q=0; q<arr[i].length; q++){
if(maxArrNumber<arr[i][q]){
maxArrNumber=arr[i][q];
}
}
arrLargestNumbers.push(maxArrNumber);
}
console.log(arrLargestNumbers);
return arrLargestNumbers;
}
igor_bv
@burtovoj-iv
Aug 31 2015 09:10
sorry for formatting
Ashraful Islam
@iashraful
Aug 31 2015 09:11
looks good to me
bf largest
CamperBot
@camperbot
Aug 31 2015 09:11

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

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

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

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

more info:  bf details | bf links | hint

Ashraful Islam
@iashraful
Aug 31 2015 09:12
@burtovoj-iv no no, you need to remove that console.log
also it's borken!
igor_bv
@burtovoj-iv
Aug 31 2015 09:13
its only for checking result, even after removing - don't pass
Ashraful Islam
@iashraful
Aug 31 2015 09:13
@burtovoj-iv that challenge is broken
your code is fine
skip it
if you see Cannot read property 'eql' of undefined then it's broken
you can skip it for now until it's fixed
igor_bv
@burtovoj-iv
Aug 31 2015 09:16
@iashraful thanks, that's it. Is there any broken challenges should i know ?
CamperBot
@camperbot
Aug 31 2015 09:16
if you want to thank someone, put an @ before their name!
Ashraful Islam
@iashraful
Aug 31 2015 09:18
@burtovoj-iv if you see this error Cannot read property 'eql' of undefined it's broken
I believe only largestoffour is broken at the moment
igor_bv
@burtovoj-iv
Aug 31 2015 09:21
@iashraful i get this message on chrome-based browser. In firefox: largestOfFour(...).should is undefined - for the same code
Ashraful Islam
@iashraful
Aug 31 2015 09:22
may be, bug reports are filed already :D
@burtovoj-iv you better move-on to next challenge
Ankit Panwar
@coderNoob
Aug 31 2015 09:22

Bonfire: Title Case a Sentence

'function titleCase(str) {
var r = str.split(' ');
var s = [];
for(var i=0; i<r.length; i++){
s[i] = r[i].charAt(0).toUpperCase() + r[i].substring(1).toLowerCase();
}
return s;
}

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

CamperBot
@camperbot
Aug 31 2015 09:22
Sorry, can't find a bonfire called title case a sentencefunction titlecasestr var r strsplit var s forvar i0 irlength i si richarat0touppercase risubstring1tolowercase return stitlecaseim a little tea pot. [ Check the map? ]
Ankit Panwar
@coderNoob
Aug 31 2015 09:23
The output is incorrect. I can't understand why.
Ashraful Islam
@iashraful
Aug 31 2015 09:23
function titleCase(str) {
    var r = str.split(' ');
    var s = [];
    for(var i=0; i<r.length; i++){
        s[i] = r[i].charAt(0).toUpperCase() + r[i].substring(1).toLowerCase();
    }
    return s;
}
titleCase("I'm a little tea pot");
@coderNoob you forgot to join
return s.join(' ')
Ankit Panwar
@coderNoob
Aug 31 2015 09:25
@iashraful Thanks a lot ! It worked.
P.S. - How did you get the code in the black box? I tried but it didn't work.
CamperBot
@camperbot
Aug 31 2015 09:25
codernoob sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 307 | @iashraful | http://www.freecodecamp.com/iashraful
Ashraful Islam
@iashraful
Aug 31 2015 09:25
help format
CamperBot
@camperbot
Aug 31 2015 09:25

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Ashraful Islam
@iashraful
Aug 31 2015 09:25
^ like this
backtick is the button right above your [Tab] button
left of [ 1 ]
Cid
@cidalen888
Aug 31 2015 09:27
Hi Guys, can you help me out with Chunky Monkey. :)
Ozy Design & Software
@OzySky
Aug 31 2015 09:34
@cidalen888 yeah
Cid
@cidalen888
Aug 31 2015 09:35
Hi @ozydesign :)
Ozy Design & Software
@OzySky
Aug 31 2015 09:38
@cidalen888 what have you done so far?
Cid
@cidalen888
Aug 31 2015 09:39
i'll message you my code
Prashanth
@dgprashanth
Aug 31 2015 09:43
@iashraful I found what I was looking for ! :smile:
Aleksandar B.
@aleksandar-b
Aug 31 2015 09:49
I need help on arguments optional
I have copied some code, but don't know what particular code is doing:
function add() {

    var checkNum = function (num) {
        if (typeof num !== 'number'){
            return undefined;
        }else
            return num;
    };

    if (arguments.length > 1) {
        var a = checkNum(arguments[0]);
        var b = checkNum(arguments[1]);
        if (a === undefined || b === undefined) {
            return undefined;
        } else {return a + b;}
    } else {
        var c = arguments[0];
        if(checkNum(c)){
            return function(arg2) {
                if (c === undefined || checkNum(arg2) === undefined) {
                    return undefined;
                }else {
                    return c + arg2;
                }
            };
        }
    }
}
add(2,3);
what is arg2?
Costas Chaitas
@CostasChaitas
Aug 31 2015 09:58
hello everyone
i am tring to solve the pomodoro clock zipline
thats what i have done so far
http://codepen.io/rasakos/pen/XmWXpj
i have problem with the functionality of the countdown
can anybody helps me>
Ayo
@ayondot
Aug 31 2015 09:59
@samosale arg2 is the parameter that accepts the value inputted to the function checkNum( ) that was retuned if only one argument was passed toadd( )
Cid
@cidalen888
Aug 31 2015 10:09
thank you so much for the help @ozydesign :)
CamperBot
@camperbot
Aug 31 2015 10:09
cidalen888 sends brownie points to @ozydesign :sparkles: :thumbsup: :sparkles:
:star: 171 | @ozydesign | http://www.freecodecamp.com/ozydesign
Aleksandar B.
@aleksandar-b
Aug 31 2015 10:15
@ayondot i don't think you are right...I think that is a parameter in global function...
Ozy Design & Software
@OzySky
Aug 31 2015 10:17
@samosale need help?
Aleksandar B.
@aleksandar-b
Aug 31 2015 10:17
@ozydesign yes, ofcourse
Abdelaziz Mokhnache
@Abdelaziz18003
Aug 31 2015 10:18
where to start with Bonfire: Roman Numeral Converter ?
Ozy Design & Software
@OzySky
Aug 31 2015 10:19
@samosale with Arguments Optional, right?
Aleksandar B.
@aleksandar-b
Aug 31 2015 10:19
@ozydesign yes
@ozydesign do you want on coderpad?
Ozy Design & Software
@OzySky
Aug 31 2015 10:20
yeah
@samosale
Aleksandar B.
@aleksandar-b
Aug 31 2015 10:20
@ozydesign the code is correct, though
Abhisek Pattnaik
@abhisekp
Aug 31 2015 10:32
@dting I wonder why camper didn't reply to this :point_up: August 31, 2015 11:28 AM
@emilaasa try http://devdocs.io in ref. to your problem mentioned in :point_up: August 31, 2015 12:21 PM
Betsey Biggs
@betsbillabong
Aug 31 2015 10:33
wiki sift through text
CamperBot
@camperbot
Aug 31 2015 10:33

:point_right: waypoint sift through text with regular expressions [wiki]

Sift through Text with Regular Expressions

Regular expressions are used to find certain words or patterns inside of strings.

Regular expressions are usually surrounded by / symbols.

For example, if we wanted to find the number of times the word the occurred in the string The dog chased the cat, we could use the following regular expression: /the+/gi

Let's break this down a bit:

the is the pattern we want to match.

  • + means we want to find one or more occurrences of this pattern.
  • g means that we want to search the entire string for this pattern.
  • i means that we want to ignore the case (uppercase or lowercase) when searching for the pattern.

:pencil: read more about waypoint sift through text with regular expressions on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Aug 31 2015 10:33
@betsbillabong the example and the instructions are not correct in :point_up: August 31, 2015 4:03 PM
This message was deleted
Betsey Biggs
@betsbillabong
Aug 31 2015 10:35
@abhisekp thank you! whoa.
CamperBot
@camperbot
Aug 31 2015 10:35
betsbillabong sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 354 | @abhisekp | http://www.freecodecamp.com/abhisekp
Betsey Biggs
@betsbillabong
Aug 31 2015 10:36
@abhisekp can you explain what's wrong with it? I passed the waypoint but want to learn it the right way!
Betsey Biggs
@betsbillabong
Aug 31 2015 10:43
If anyone is here, I'm wondering why var expression = /\S/gi; is necessary to count the inverse of spaces, rather than var expression = /\S/g;. Spaces don't have case. ???
wiki slot machine
CamperBot
@camperbot
Aug 31 2015 10:45

:point_right: waypoint add your javascript slot machine slots [wiki]

Add your JavaScript Slot Machine Slots

For this part we should notify if they same number is returned three times or return null otherwise.

if(slotOne !== slotTwo || slotTwo !== slotThree){
      return (null);
    }

If slot one and to are different, or slot two and three are not the same, then return null.

:pencil: read more about waypoint add your javascript slot machine slots on the FCC Wiki

Bram Decuypere
@BramDecuypere
Aug 31 2015 10:46
Zipline: Show the Local Weather Anyone wants to pair up for this?
Rabin Shrestha
@jyapujuju
Aug 31 2015 10:59
This message was deleted
:worried:
chunky mon :key: help
Raji Reddy
@RajiReddy-A
Aug 31 2015 11:06
I working on pomodoro clock,stuck with adding sound.How to add alarm?
Raji Reddy
@RajiReddy-A
Aug 31 2015 11:28
@awesomeaniruddh Should we upload .mp3 file or can we link to a url?
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:28
I'm pretty sure linking to a URL is possible
Raji Reddy
@RajiReddy-A
Aug 31 2015 11:29
@awesomeaniruddh Can you suggest me a site to upload a sound clip and to link the url
There seem to be a few alarm sounds on that website
Raji Reddy
@RajiReddy-A
Aug 31 2015 11:30
@awesomeaniruddh Thank you!
CamperBot
@camperbot
Aug 31 2015 11:30
rajireddy-a sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 314 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Mbos95
@Mbos95
Aug 31 2015 11:34
Hey guys. Can somebody give me some advice on how to let every item in the array return it's length or somehow sort it ? I am kinda stuck -.-
function findLongestWord(str) {
  var re = /\s/;
  array = str.split(re) 
 return array;
}

findLongestWord('The quick brown fox jumped over the lazy dog');
Costas Chaitas
@CostasChaitas
Aug 31 2015 11:35
anyone can help me a bit with the functionality of the http://codepen.io/rasakos/pen/XmWXpj/
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:36

@Mbos95

array

is you array?

Mbos95
@Mbos95
Aug 31 2015 11:36
yes it is
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:37
you can do this:
var arrLength = array.map(function(arrItem) {
    return arrItem.length;
});
Mbos95
@Mbos95
Aug 31 2015 11:37
I split the string findLongestWord into the array. It'll return every word in the array
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:37
arrLength is an array that will contain the length of all the items in the first array in the same order
first array = array
Mbos95
@Mbos95
Aug 31 2015 11:38
ooh.. that is nice to know
now looking at the array.map
didn't know that one yet :) Thank you!
CamperBot
@camperbot
Aug 31 2015 11:39
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:39
You will learn it soon
Mbos95
@Mbos95
Aug 31 2015 11:39
thank you @awesomeaniruddh
CamperBot
@camperbot
Aug 31 2015 11:39
mbos95 sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 315 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:39
You know how to iterate through arrays?
Using a for loop?
Mbos95
@Mbos95
Aug 31 2015 11:40
I think so
```
for(i = 0; i < array.length; i++){
 something here
}
something here will be... array[i] ? I am not sure
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:41
Yes
John Carl James Nebab
@navip0t
Aug 31 2015 11:42

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

something wrong in this? task is: The second element in each of your well elements should bounce.

Aniruddh Agarwal
@anrddh
Aug 31 2015 11:42
The .map() function does something similar
@navip0t What's the issue?
@Mbos95 But it hides all the for loop stuff for you
It's called abstraction
But don't worry about it now
Mbos95
@Mbos95
Aug 31 2015 11:43
I worry about everything :D
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:43
You'll likely find it quite overwhelming
:)
John Carl James Nebab
@navip0t
Aug 31 2015 11:43
@awesomeaniruddh can't make it work
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:43
You will learn that function and similar ones soon
Raji Reddy
@RajiReddy-A
Aug 31 2015 11:43
@awesomeaniruddh How did you enable sound in pomodoro.I'm unable to link via url.
Mbos95
@Mbos95
Aug 31 2015 11:43
I do, but hey.. that is my coding experience so far! overwhelming xD
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:43
It certainly is quite overwhelming if you're a beginner
But keep working and you will eventually have that 'aha' moment when everything makes perfect sense
@navip0t I'll look into it
Mbos95
@Mbos95
Aug 31 2015 11:45
@awesomeaniruddh I am sure there will be that moment :) with the earlier stuff which I didn't get in the beginning I had that moment and now I think 'Why didn't i get that?! it makes perfect sense!'
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:45
These 'aha' moments are certainly one of the most rewarding experiences as a programmer :)
John Carl James Nebab
@navip0t
Aug 31 2015 11:47
nevermind @awesomeaniruddh solve it! :D
Rabin Shrestha
@jyapujuju
Aug 31 2015 11:48
chunky
Costas Chaitas
@CostasChaitas
Aug 31 2015 11:49
i have a problem with my pomodor clock zipline
when i press reset and after play it doesnt work
any advices
and also when the clock goes to 0:00 it doesnt change to the break coundown
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:50
I suggest you have a play function that starts the clock
Wait, let me take a sneak peek at your code
You're not resetting your minutes and seconds
Ankit Panwar
@coderNoob
Aug 31 2015 11:53

Bonfire: Confirm the Ending
```function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
if((str.charAt(str.length-1))===target)
return true;
else
return false;
}

end('Bastian', 'n');```

I don't understand. It wants us to compare the last letter in one the test cases and the last word as well in one the test cases.

CamperBot
@camperbot
Aug 31 2015 11:53
Sorry, can't find a bonfire called confirm the ending . [ Check the map? ]
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:53
bonfire confirm the ending
CamperBot
@camperbot
Aug 31 2015 11:53

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

Aniruddh Agarwal
@anrddh
Aug 31 2015 11:53
there you go :)
Rabin Shrestha
@jyapujuju
Aug 31 2015 11:56
function chunk(arr, size) {
  var first;
  for(i=0;i<arr.length;i=i+size){
    first.push(arr.split(i,i+size));
  }
  return first;
 //return second;
}
chunk(['a', 'b', 'c', 'd'], 2);
chunky monkey help
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:56
bonfire chunky monke
CamperBot
@camperbot
Aug 31 2015 11:56

: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

Aniruddh Agarwal
@anrddh
Aug 31 2015 11:57
var first = []
Change var first; to that ^
Ievgenii Litvinov
@belinef
Aug 31 2015 11:57

hi,all
Bonfire: Return Largest Numbers in Arrays

i do not understand why my code doesn't work in camp console. everything is good in another one

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

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

Aniruddh Agarwal
@anrddh
Aug 31 2015 11:58
Also, you can't split arrays
@belinef Please format your code
Wrap it in '```'
Without the single quotes
bonfire largest numbers in arrays
CamperBot
@camperbot
Aug 31 2015 11:58

: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

Ankit Panwar
@coderNoob
Aug 31 2015 11:58
@awesomeaniruddh Can you help me with Bonfire: Confirm the Ending. The example test case wants to compare the last letter and the one of the test cases wants us to compare the last word. How is that going to work?
CamperBot
@camperbot
Aug 31 2015 11:58
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Aniruddh Agarwal
@anrddh
Aug 31 2015 11:58
bonfire confirm the ending
CamperBot
@camperbot
Aug 31 2015 11:58

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

Aniruddh Agarwal
@anrddh
Aug 31 2015 11:59
Let me take a look at the cases @coderNoob
If it's a sentence, then you will need to check for a word
If it's a word, then you will need to check the last character of the word
Ievgenii Litvinov
@belinef
Aug 31 2015 12:02

like that?
'''function largestOfFour(arr) {
var mimo = [];
for(var i=0;i<arr.length;i++){ mimo.push(0); for (var j=0;j<arr[i].length;j++){ if (arr[i][j]>mimo[i]){
mimo[i]=arr[i][j];
}
}
}
return mimo;
}

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

CamperBot
@camperbot
Aug 31 2015 12:02
:bulb: to format code use backticks! ``` more info
Ievgenii Litvinov
@belinef
Aug 31 2015 12:03
function largestOfFour(arr) { var mimo = []; for(var i=0;i<arr.length;i++){ mimo.push(0); for (var j=0;j<arr[i].length;j++){ if (arr[i][j]>mimo[i]){ mimo[i]=arr[i][j]; } } } return mimo; } largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
anknits
@anknits
Aug 31 2015 12:03
i am facing a problem with bonfire: pig latin. Can someone tell me what is wrong with my code?

function translate(str) {
var count = 0;
var arr = str.split('');
if (arr[0] =='a' || arr[0] =='e' || arr[0] =='i' || arr[0] =='o' || arr[0] =='u'){
arr.push('w');
arr.push('a');
arr.push('y');
str = arr.join('');
}
else{
for (var i=0; i<str.length; i++){
if (arr[i] !='a' || arr[i] !='e' || arr[i] !='i' || arr[i] !='o' || arr[i] !='u'){
arr.push(arr[i]);
count++;
}
else break;
}
//arr.push(arr[0]);
arr.push('a');
arr.push('y');
str = arr.join('');
str = str.substr(count);
}
return str;
}

translate("consonant");

Costas Chaitas
@CostasChaitas
Aug 31 2015 12:04
@awesomeaniruddh o yes you are right:)
@awesomeaniruddh fixed!something last!!do you know why when the clock goes to 0:00 doesnt change to the break countdown?
Aniruddh Agarwal
@anrddh
Aug 31 2015 12:06
@belinef ``` not ''''
CamperBot
@camperbot
Aug 31 2015 12:06
:bulb: to format code use backticks! ``` more info
Aniruddh Agarwal
@anrddh
Aug 31 2015 12:06
Everyone please use those backticks to format code
Click on the more info link.
@rasakos I didn't implement that functionality into my own pomodoro clock (lazy bum, I am :P) so I'm not sure what you would need to do to make that work
Ievgenii Litvinov
@belinef
Aug 31 2015 12:07

@awesomeaniruddh i've alredy understand with that )thanks

```function largestOfFour(arr) {
var mimo = [];
for(var i=0;i<arr.length;i++){ mimo.push(0); for (var j=0;j<arr[i].length;j++){ if (arr[i][j]>mimo[i]){
mimo[i]=arr[i][j];
}
}
}
return mimo;
}

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

problem with this, it should work but doesn't

CamperBot
@camperbot
Aug 31 2015 12:07
belinef sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 316 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Ankit Panwar
@coderNoob
Aug 31 2015 12:08

@awesomeaniruddh I'm able to compare the last letter but not the last word of the sentence and I'm stuck.

``` function end(str, target) {
// "Never give up and good luck will find you."
// -- Falcor
if((str.charAt(str.length-1))===target)
return true;
else
return false;
}

end('Bastian', 'n'); ```

Aniruddh Agarwal
@anrddh
Aug 31 2015 12:08
But I guess you would just need another timer similar to your click itself @rasakos
Guys the ``` must be on their own line
@coderNoob First of all, you need to determine whether the input is a sentence or a word
For that you can check for spaces in the input
tinako97
@tinako97
Aug 31 2015 12:09
@belinef To format code in gitter try hitting shift-enter after your 3 backquotes (I do it again at the bottom, too, shift-enter then 3 back-quotes).
Ievgenii Litvinov
@belinef
Aug 31 2015 12:09
function largestOfFour(arr) {
   var mimo = [];
  for(var i=0;i<arr.length;i++){
      mimo.push(0);
    for (var j=0;j<arr[i].length;j++){
      if (arr[i][j]>mimo[i]){
       mimo[i]=arr[i][j];
      }
    }
  }
  return mimo;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Aniruddh Agarwal
@anrddh
Aug 31 2015 12:09
That's better
What was your issue again?
I'm sorry for insisting on this, but it makes the code so much more readable
Ievgenii Litvinov
@belinef
Aug 31 2015 12:10
it goes error "cannot read property 'eql' of undefined. in camp console.
but code works in another one
Aniruddh Agarwal
@anrddh
Aug 31 2015 12:10
That's not an issue with your code
It's an issue with FCC itself that has been popping up quite often
In fact in that specific bonfire it seems
There is already an issue for that on GitHub, and people have submitted pull requests to fix it
It should be fixed soon :)
Ievgenii Litvinov
@belinef
Aug 31 2015 12:12
thank you)
CamperBot
@camperbot
Aug 31 2015 12:12
if you want to thank someone, put an @ before their name!
Ievgenii Litvinov
@belinef
Aug 31 2015 12:12
@awesomeaniruddh thank you)
CamperBot
@camperbot
Aug 31 2015 12:12
belinef sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:warning: belinef already gave awesomeaniruddh points
Tamir Omara
@teomara
Aug 31 2015 12:14
@fnky has the best avatar :clap:
Costas Chaitas
@CostasChaitas
Aug 31 2015 12:18
anybody knows why my pomodoro locks doesnt change to the break countdown when it goes to 0:00?
http://codepen.io/rasakos/pen/XmWXpj/
Mbos95
@Mbos95
Aug 31 2015 12:21
bonfire find the longest word in a string
CamperBot
@camperbot
Aug 31 2015 12:21

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

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

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

Mbos95
@Mbos95
Aug 31 2015 12:21
bf hint
CamperBot
@camperbot
Aug 31 2015 12:21
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Costas Chaitas
@CostasChaitas
Aug 31 2015 12:30
@Mbos95 split the str and make a loop to test which word is the bigger
Mbos95
@Mbos95
Aug 31 2015 12:32
function findLongestWord(str) {
  var re = /\s/;
  array = str.split(re) 
  for(i = 0; i < array.length; i++) {
    return array[i].length

  }
}

findLongestWord('The quick brown fox jumped over the lazy dog');
I have this so far
Dhruv Dogra
@dhruv3
Aug 31 2015 12:32
This message was deleted
Mbos95
@Mbos95
Aug 31 2015 12:35
how to check the length of all? now it just returns 3.. from the "the" in the array
Aniruddh Agarwal
@anrddh
Aug 31 2015 12:36
Don't return inside the for loop
return terminated the execution of the function
Mbos95
@Mbos95
Aug 31 2015 12:36
oh yea... I forgot about that
Aniruddh Agarwal
@anrddh
Aug 31 2015 12:36
:)
Mbos95
@Mbos95
Aug 31 2015 12:37
So.. what now ? ```
function findLongestWord(str) {
  var re = /\s/;
  array = str.split(re) 
  for(i = 0; i < array.length; i++) {

  }
}

findLongestWord('The quick brown fox jumped over the lazy dog');
Matija01
@Matija01
Aug 31 2015 12:55
Greetings campers! I could use some help with a bonfire if someone can spare the time
CamperBot
@camperbot
Aug 31 2015 12:55
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Matija01
@Matija01
Aug 31 2015 12:57
will do camper bot xD
Peter
@ObaPeter
Aug 31 2015 13:06
any help with Bonfire: Return Largest Numbers in Arrays
CamperBot
@camperbot
Aug 31 2015 13:06
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
anknits
@anknits
Aug 31 2015 13:09
function translate(str) {
  var count = 0;
  var arr = str.split('');
  if (arr[0] =='a' || arr[0] =='e' || arr[0] =='i' || arr[0] =='o' || arr[0] =='u'){
    arr.push('way');
    str = arr.join('');
  }
  else{
    for (var i=0; i<str.length; i++){
      if (arr[i] !='a' || arr[i] !='e' || arr[i] !='i' || arr[i] !='o' || arr[i] !='u'){
        var b = arr[i];
        arr.push(b);
        count++;
    }
      else {break;}
    }
    arr.push('ay');
    str = arr.join('');
    str = str.substr(count);
  }
 return str;
}
translate("consonant");
what is the problem? Why is this code not working on bonfire: pig latin
Ashraful Islam
@iashraful
Aug 31 2015 13:11
iglatingay
:D
ops, iglatingpay
Bastien Lemaire
@blemaire
Aug 31 2015 13:17
@anknits it's a little complicated what you're doing..
anknits
@anknits
Aug 31 2015 13:18
first i see for vowel. if found, i add way at end and remove the first voxel
if it is one or more consonants, i add them to the back of the array and them remove those many from the front.
Bastien Lemaire
@blemaire
Aug 31 2015 13:21
your best bet here is to create a reusable function which checks for consonant...
function isConsonant(letter) {
  return ["a", "e", "i", "o", "u", "y"].indexOf(letter.toLowerCase()) === -1;
}
or event better:
function isConsonant(letter) {
  return "aeiouy".split("").indexOf(letter.toLowerCase()) === -1;
}
Ozy Design & Software
@OzySky
Aug 31 2015 13:23
or even better : regex :wink:
y isn't a vowel by the way
Mbos95
@Mbos95
Aug 31 2015 13:23
function findLongestWord(str) {
  var re = /\s/;
  array = str.split(re) 
  for(i = 0; i < array.length; i++) {
    var arraynum =[]
     arraynum.push(array[i].length);

  }
}
findLongestWord('The quick brown fox jumped over the lazy dog');
Ozy Design & Software
@OzySky
Aug 31 2015 13:23
@Mbos95 yeah?
it's both, lol
Mbos95
@Mbos95
Aug 31 2015 13:24
Hey.. Anyone can help me with this one ? :) I would like to get my arraynum filled with a number.
This number should be the length of every string in the array
I am stuck..
Bastien Lemaire
@blemaire
Aug 31 2015 13:25
@Mbos95 you should be able to use array.reduce for that
Ozy Design & Software
@OzySky
Aug 31 2015 13:25
@blemaire in pig latin I meant
Bastien Lemaire
@blemaire
Aug 31 2015 13:25
oh is it?
shawnparrotte
@shawnparrotte
Aug 31 2015 13:25

Hey, I'm on the find longest length bonfire.... why doesn't this find that really long one? function findLongestWord(str) {

var strArray = str.split(' ');
var strPush = [];

for (i = 0; i < strArray.length; i++){
strPush.push(strArray[i].length)
}

if (strArray.length > 1){
return strPush.sort().pop()
} else {
return str.length
}
}

ooops
how do you even format this??
elhagin
@elhagin
Aug 31 2015 13:27
explain code format
CamperBot
@camperbot
Aug 31 2015 13:27

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

shawnparrotte
@shawnparrotte
Aug 31 2015 13:28
let's see if this worked... why can't this find the 19 letter word??
function findLongestWord(str) {

  var strArray = str.split(' ');
  var strPush = [];

  for (i = 0; i < strArray.length; i++){
      strPush.push(strArray[i].length)
  }

  if (strArray.length > 1){
  return strPush.sort().pop()
  } else {
  return str.length  
  } 
}
Ozy Design & Software
@OzySky
Aug 31 2015 13:29
@Mbos95 isn't that would you did?
shawnparrotte
@shawnparrotte
Aug 31 2015 13:29
awesome, it worked. Thank @elhagin.
CamperBot
@camperbot
Aug 31 2015 13:29
shawnparrotte sends brownie points to @elhagin :sparkles: :thumbsup: :sparkles:
:star: 190 | @elhagin | http://www.freecodecamp.com/elhagin
Mbos95
@Mbos95
Aug 31 2015 13:30
@ozydesign Some would say that.. FFC doesn't :D
Ozy Design & Software
@OzySky
Aug 31 2015 13:30
@Mbos95 you need to return it
Mbos95
@Mbos95
Aug 31 2015 13:30
@ozydesign If that is the case, How can I determine which one the strings had the largest value ?
Ozy Design & Software
@OzySky
Aug 31 2015 13:31
@Mbos95 would be easier to loop through the words array, then if length is more then max, assign max to it then return max
anknits
@anknits
Aug 31 2015 13:32
@blemaire that works, thanks. But what is wrong with my solution? Logically it should do what it is supposed to. wrt: pig latin
CamperBot
@camperbot
Aug 31 2015 13:32
anknits sends brownie points to @blemaire :sparkles: :thumbsup: :sparkles:
:star: 16 | @blemaire | http://www.freecodecamp.com/blemaire
Mbos95
@Mbos95
Aug 31 2015 13:33
@ozydesign What do you mean with max? I need to find the longest words in many different strings ( different as these ) and I need to eventually return the number of letters which are in the longest string
Bastien Lemaire
@blemaire
Aug 31 2015 13:35
@anknits can you send the new version across?
anknits
@anknits
Aug 31 2015 13:36
@blemaire here
Ozy Design & Software
@OzySky
Aug 31 2015 13:36
@Mbos95 you start with max = 0, then loop through each word and if the length of the word is more then max - assign max to that number; then after the loop finishes return max :smile:
anknits
@anknits
Aug 31 2015 13:37
function isVowel(c) { 
  return ['a', 'e', 'i', 'o', 'u'].indexOf(c.toLowerCase()) !== -1 
}

function translate(str) { 
  var count = 0; 
  var arr = str.split(''); 
  if (isVowel(arr[0])) { 
    arr.push('way'); 
    return arr.join(''); 
  } 
  else { 
    for (var i = 0; i < arr.length; i++) { 
      if (isVowel(arr[i])) { 
        arr.push('ay'); 
        return arr.join('').substr(count); 
      }
      else { 
        arr.push(arr[i]); count++; 
      }
    } return arr.join('').substr(count); 
  } 
}
translate("consonant");
Mbos95
@Mbos95
Aug 31 2015 13:39
@ozydesign Iĺl try it but I don't get the logic. Every word will be bigger as max if it starts at 0
JeremyWBean
@JeremyWBean
Aug 31 2015 13:39
Can anyone give a hint for getting started on bonfire no repeats please?
Mbos95
@Mbos95
Aug 31 2015 13:39
oh wait.. I think i get it..
Ozy Design & Software
@OzySky
Aug 31 2015 13:41
@JeremyWBean I saw someone implement it using a recursive reduce then filter :clap: but that went way above my head
I did using a implementation of Heap's permutation algorithm (the idea is not mine though)
JeremyWBean
@JeremyWBean
Aug 31 2015 13:43
@ozydesign Thanks a lot. I'll look into Heap.
CamperBot
@camperbot
Aug 31 2015 13:43
jeremywbean sends brownie points to @ozydesign :sparkles: :thumbsup: :sparkles:
:star: 172 | @ozydesign | http://www.freecodecamp.com/ozydesign
Bastien Lemaire
@blemaire
Aug 31 2015 13:43
@ozydesign I can have a go if you want to see it again..
Ozy Design & Software
@OzySky
Aug 31 2015 13:44
@blemaire cool!
Bastien Lemaire
@blemaire
Aug 31 2015 13:44
which bf is it again?
Ozy Design & Software
@OzySky
Aug 31 2015 13:44
one before last
shawnparrotte
@shawnparrotte
Aug 31 2015 13:48
I'm so lost... why won't this work?? Finding the 19 letter word??
function findLongestWord(str) {

  var strArray = str.split(' ');
  var strPush = [];

  for (i = 0; i < strArray.length; i++){
      strPush.push(strArray[i].length);    
  }

  if (strArray.length > 1){
    return strPush.sort().pop() 
  } else {
    return str.length
  } 
}
Bastien Lemaire
@blemaire
Aug 31 2015 13:50
@ozydesign
function findLongestWord(str) {
  return str.split(" ").reduce(function (previous, current, index) {
    return current.length > previous.length ? current : previous;
  }).length;
}
you can remove index from the function inside the reduce()