These are chat archives for FreeCodeCamp/Help

1st
Sep 2015
Kat
@Mystfreak
Sep 01 2015 00:00
@emiliovillanueva are you stuck at the moment
?
Rex Schrader
@SaintPeter
Sep 01 2015 00:00
@Mystfreak Well, you're never really "done" learning a programming language. Assuming you're good with the programming part - the algorithms and such, you'll be passable in 6 months. But you're always going to be learning. Javascript continues to evolve as a language and there are new features coming out frequently. And the problems you solve may be similar, but there is always some new challenge. For myself, I learn languages as I find a need for them. Programming is programming, just the syntax changes.
Kat
@Mystfreak
Sep 01 2015 00:00
@SaintPeter and there are so many new features to catch up with
@SaintPeter Would I be able to get a job if I were to finish free code camp without a degree
I just feel like studying computer science for four years is a waste of my time
Rex Schrader
@SaintPeter
Sep 01 2015 00:03
@Mystfreak If you do the non-profit projects, then almost certainly. At least, that's what Qunicy and team say. I know a bunch of folks have gotten jobs before finishing the non-profits, but I think they had prior experience coming in.
Wesly Jason
@wesly-jason
Sep 01 2015 00:03
@duckdown007 yes I am always on here
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:03
yes, i am stuck @Mystfreak
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:03
@SaintPeter I'm kinda worried about me not being 18
Rex Schrader
@SaintPeter
Sep 01 2015 00:03
@Mystfreak For Web dev, yeah, it probably is. For data analysis or more complex stuff, the 4 year degree (and even a Masters) can be really valuable.
Wesly Jason
@wesly-jason
Sep 01 2015 00:03
@duckdown007 Are you learning Java right now?
Kat
@Mystfreak
Sep 01 2015 00:04
@SaintPeter is everyone guaranteed a non-profit project?
@SaintPeter web dev is the same thing as front end development or no?
Rex Schrader
@SaintPeter
Sep 01 2015 00:04
@Mystfreak I assume so. In truth, not many have completed all of the curriculum. I think it's maybe on the order of 100-200 people so far. When I started a few months ago it was only about 50.
@Mystfreak Sorry, yes, pretty much the same thing. It's always going to be helpful to understand the backend stuff, even if you don't plan to work on backend.
Kat
@Mystfreak
Sep 01 2015 00:05
@SaintPeter maybe they lack motivation after a couple of days, I know I did
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:05
If I buck up, then I could finish my last basejump before the end of the week, and be ready for the non profits, but I'm really worried that I won't get a job even after that because I'm 16
Rex Schrader
@SaintPeter
Sep 01 2015 00:06
@awesomeaniruddh To that I cannot say. I think if you have a strong portfolio and can demonstrate that you know your stuff, they may not care.
@Mystfreak Tell me about it. I kinda stalled out on my first Basejump and I'm only just now getting back into it. It was HARD, for sure, even with my background. I finally got over the hump and I'm kicking ass now.
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:07
The first basejump is definitely the hardest
Kat
@Mystfreak
Sep 01 2015 00:07
@awesomeaniruddh isn't that age discrimination, I think you should get your knowledge across instead of your age
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:07
I'm also worried about potential legal issues??
lmorris2004
@lmorris2004
Sep 01 2015 00:07
Where Art Thou Bonfire - I can pass the 1st 2 assertions but not the last 2 - any advice?
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:07
@imo
Rex Schrader
@SaintPeter
Sep 01 2015 00:08
Well, I'm off - TTYL
Kat
@Mystfreak
Sep 01 2015 00:08
I heard it will be hard to get programming jobs when your old, is that true?
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:08
@lmorris2004 your code?
Kat
@Mystfreak
Sep 01 2015 00:08
people go into manager positions
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:09
´´´hey´´´
lmorris2004
@lmorris2004
Sep 01 2015 00:09
'''
CamperBot
@camperbot
Sep 01 2015 00:09
:bulb: to format code use backticks! ``` more info
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:10
hey
Kat
@Mystfreak
Sep 01 2015 00:10
inline code
Justin Crawford
@JCrawford1122
Sep 01 2015 00:10
@Mystfreak I have heard that but I believe the skills are the most important
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:10
```hey´´´
fuckkkkkk
lmorris2004
@lmorris2004
Sep 01 2015 00:10
```
duckdown007
@duckdown007
Sep 01 2015 00:10
yes @neglakay33 i am doing PRG420 which is Java Programming
lmorris2004
@lmorris2004
Sep 01 2015 00:10
function where(collection, source) { var arr = []; for (var prop in source) { for (var i = 0; i < collection.length; i++) { if (collection[i].hasOwnProperty(prop)) { if(source[prop] === collection[i][prop]) { arr.push(collection[i]); } } } } return arr; }
Kat
@Mystfreak
Sep 01 2015 00:10
@JCrawford1122 yeah, maybe elderly can't keep up with the younger generation
but they can if they try to
Justin Crawford
@JCrawford1122
Sep 01 2015 00:11
@Mystfreak Im 32 so I'll find out soon enough
DJ
@qualitymanifest
Sep 01 2015 00:11
```function where(collection, source) {
  var arr = [];
  for (var prop in source) {
      for (var i = 0; i < collection.length; i++) {
          if (collection[i].hasOwnProperty(prop)) {
              if(source[prop] === collection[i][prop]) {
                arr.push(collection[i]);
              }
          }
      }
   }
  return arr;
}
```
Kat
@Mystfreak
Sep 01 2015 00:11
@JCrawford1122 you would have to wait 20 years to find out
DJ
@qualitymanifest
Sep 01 2015 00:12
@lmorris2004 you need to do backticks on their own lines above and below your code
Kat
@Mystfreak
Sep 01 2015 00:12
men age slow compared to us women
lmorris2004
@lmorris2004
Sep 01 2015 00:12
function where(collection, source) {
  var arr = [];
  for (var prop in source) {
      for (var i = 0; i < collection.length; i++) {
          if (collection[i].hasOwnProperty(prop)) {
              if(source[prop] === collection[i][prop]) {
                arr.push(collection[i]);
              }
          }
      }
   }
  return arr;
}
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:12
hey

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

}

// 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();})();
```

im sorry guys im new to this
Justin Crawford
@JCrawford1122
Sep 01 2015 00:13
@emiliovillanueva the ``` need to be on their own lines
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:13
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.


}

// 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();})();
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:13
```
new line = code here
```
Okay, you got it :P
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:14
ok yeah, this is the code I need help on
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:14
What's the issue?
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:14
thanks for bearing with me
CamperBot
@camperbot
Sep 01 2015 00:14
if you want to thank someone, put an @ before their name!
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:14
@mystfreak can you point me in the general direction of where to start?
Kat
@Mystfreak
Sep 01 2015 00:14
you do not have the if else statement
lmorris2004
@lmorris2004
Sep 01 2015 00:15
My code won't pass this test: assert.deepEqual(where([{ 'a': 5 }, { 'a': 5 }, { 'a': 5, 'b': 10 }], { 'a': 5, 'b': 10 }), [{ 'a': 5, 'b': 10 }], 'should return a single object in array');should return a single object in array: expected [ Array(4) ] to deeply equal [ { a: 5, b: 10 } ]
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:15
You need to check whether the number being returned is 0 or 1
If it is 0, then return tails
Kat
@Mystfreak
Sep 01 2015 00:15
if() {
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:15
If 1, then return heads
Kat
@Mystfreak
Sep 01 2015 00:15
if(flip === 0) {
}
else {
}
Isaac Calvo
@Icalvo1
Sep 01 2015 00:16

```function bouncer(arr) {
falsey_val = [];
for(var i = 0; i < arr.length; i++){
if(arr[i] === false || arr[i] === null || arr[i] === 0 || arr[i] === "" || arr[i] === undefined || arr[i] === NaN){
falsey_idx = arr.indexOf(arr[i]); //use falsey_idx arr to store values of falsey vals found.
falsey_val.push(falsey_idx); //push indices into separate array
//* //use arr.filter(falsey_val[0]) * in loop to remove false values from original array
return falsey_val; //console.log(falsey_val);
}else{
console.log('else is working');
}

//return arr;
}
}
bouncer([7, 'ate', '', false, 9]);
```
when I replace "return falsey_val" w/ "console.log(falsey_val)" falsey_val has both target values but return only gives the first value anyone know why?

Aniruddh Agarwal
@anrddh
Sep 01 2015 00:16
if(flip === 0) {
   return "tails";
} else {

  return "heads";
}
^
Kat
@Mystfreak
Sep 01 2015 00:16
@awesomeaniruddh other way around
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:16
Oh, sorry
Kat
@Mystfreak
Sep 01 2015 00:17
```if(flip === 0) { return "tails"; } else {
return "heads"; }
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:17
if(flip === 0) {
     return "heads";
} else {
     return "tails";
}
Kat
@Mystfreak
Sep 01 2015 00:17
yeah
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:18
@awesomeaniruddh @Mystfreak Ok so the var is put within the parentheses?
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:18
Yep
Kat
@Mystfreak
Sep 01 2015 00:18
what var?
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:19
@Mystfreak the variable
Kat
@Mystfreak
Sep 01 2015 00:19
oh yeah the var is inside the function
and the if-else statement should be in the function too
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:20
@awesomeaniruddh ok so the function at the top is like a random number generator, it will either generate 1 or 0. And anytime you run the code, it will generate 1 or 0 giving you heads or tails? I'm trying to understand the intuition behind this haha
Kat
@Mystfreak
Sep 01 2015 00:21
yes
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:21
Yes
Kat
@Mystfreak
Sep 01 2015 00:21
@emiliovillanueva the if-else statement enables the numbers to return heads or tails depending on the condition
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:21
The if statement takes an expression in the parenthesis that must evaluate to either true or false
emiliovillanueva
@emiliovillanueva
Sep 01 2015 00:24
@Mystfreak @awesomeaniruddh thanks a bunch guys. really appreciate the kindness and help
CamperBot
@camperbot
Sep 01 2015 00:24
emiliovillanueva sends brownie points to @mystfreak and @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 229 | @mystfreak | http://www.freecodecamp.com/mystfreak
:star: 323 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Kat
@Mystfreak
Sep 01 2015 00:26
@emiliovillanueva your welcome, goodluck with your learning journey :smile:
Aniruddh Agarwal
@anrddh
Sep 01 2015 00:26
yep!
lmorris2004
@lmorris2004
Sep 01 2015 00:28
Any advice on how to pass the last test on Where Art thou?
Bill
@kirah1314
Sep 01 2015 00:31
@lmorris2004 what do you have so far?
DJ
@qualitymanifest
Sep 01 2015 00:31
@lmorris2004 i am majorly struggling on where art thou currently so i can't really help. i took a look at your result though and it looks like, for whatever reason, you are returning all four parts of collection for that
Moisés Man
@moigithub
Sep 01 2015 00:31
bf where
CamperBot
@camperbot
Sep 01 2015 00:31

:fire:Bonfire: Where art thou :link:

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

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

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

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Sep 01 2015 00:32
bf details
CamperBot
@camperbot
Sep 01 2015 00:32

:fire:Bonfire: Where art thou :link:

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

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
lmorris2004
@lmorris2004
Sep 01 2015 00:32
function where(collection, source) {
  var arr = [];
  for (var prop in source) {
      for (var i = 0; i < collection.length; i++) {
          if (collection[i].hasOwnProperty(prop)) {
              if(source[prop] === collection[i][prop]) {
                arr.push(collection[i]);
              }
          }
      }
   }
  return arr;
}
DTing
@dting
Sep 01 2015 00:33
@lmorris2004 the test cases dont cover it but that would push the collection object into the array for each key that matches
Isaac Calvo
@Icalvo1
Sep 01 2015 00:33
is there a way to add camperbot to a private room so I don't spam up the fcc ones testing it?
DJ
@qualitymanifest
Sep 01 2015 00:34
two days i've been spending on where art thou and i don't even really know where to start. generally i get multiple bonfires done in a day
@Icalvo1 try PMing it?
lmorris2004
@lmorris2004
Sep 01 2015 00:35
I've tried several different ways and it always passes the first 2 tests and fails the 2nd 2 tests
duckdown007
@duckdown007
Sep 01 2015 00:35
could anyone here offer me some help with this Java writing
DTing
@dting
Sep 01 2015 00:37
function where(collection, source) {
  var arr = [];
  for (var prop in source) {
      for (var i = 0; i < collection.length; i++) { 
          if (collection[i].hasOwnProperty(prop)) {
              if(source[prop] === collection[i][prop]) {
                arr.push(collection[i]); // this happens every time a property matches
              }
          }
      }
   }
  return arr;
}
Isaac Calvo
@Icalvo1
Sep 01 2015 00:40
@qualitymanifest found it in the camperbot github repo https://gitter.im/camperbot/testing
DTing
@dting
Sep 01 2015 00:40
you could switch the for loops
the imperative way to check that all properties match would be:
var results = [];
for (var i = 0; i < collection.length; i++) {
  var element = collection[i];
  var validMatch = true;
  for (var prop in source) {
    // if not a match set ValidMatch to false and break
  }
  if (validMatch) // push element to results
}
return results;
lmorris2004
@lmorris2004
Sep 01 2015 00:41
Thanks @dting - I'll try that approach
CamperBot
@camperbot
Sep 01 2015 00:41
lmorris2004 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 879 | @dting | http://www.freecodecamp.com/dting
Wesley Viana
@wviana
Sep 01 2015 00:51

Hi there. Someone could help me with this ?

Make the second child in each of your well elements bounce.
I'm doing the follow $(".well:nth-child(2)").addClass("animated bounce");
But I'm getting a > The second element in each of your well elements should bounce.

DTing
@dting
Sep 01 2015 00:53
@wviana you can put a space between .well and :nth-child
Wesley Viana
@wviana
Sep 01 2015 00:55
@dting Thanks. Is it the right way or this lesson is buggy ? I've found this issue reported into FreeCodeCamp FreeCodeCamp/FreeCodeCamp#2005
CamperBot
@camperbot
Sep 01 2015 00:55
wviana sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 881 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 01 2015 00:57
it's not buggy
thats how it works
you could also use $(".target:nth-child(2)")
no space
the explaination isn't really clear.
Wesley Viana
@wviana
Sep 01 2015 00:59
@dting so .target isan't a css class
What does .target means in this context ?
oh,
I just got it.
thank you @dting ;)
CamperBot
@camperbot
Sep 01 2015 01:01
wviana sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: wviana already gave dting points
DTing
@dting
Sep 01 2015 01:08
nice sorry looked away for a bit
Rob Simpson
@pertrai1
Sep 01 2015 01:16
Having issues with factorial. Right now I am using str === str.split('').reverse().join('') but the rest is failing for toLowerCase() and replace !
Hans van Riet
@hansinla
Sep 01 2015 01:17
@pertrai1 Which Bonfire?
Katrina Ezis
@katrinaezis
Sep 01 2015 01:18
This message was deleted
Do I need to create another var to set the ! to be replaced and then replace that var? Hope that makes sense
Hans van Riet
@hansinla
Sep 01 2015 01:20
@pertrai1 It’s probably better to paste your code here.
Justin Crawford
@JCrawford1122
Sep 01 2015 01:20
@pertrai1 you need to remove spaces and punctuation also
Rob Simpson
@pertrai1
Sep 01 2015 01:21
Ok, one moment
Katrina Ezis
@katrinaezis
Sep 01 2015 01:21
function where(collection, source) {
  var arr = [];
  for (var i = 0; i < collection.length; i++) {
    var element = collection[i];
    for (var prop in source) {
      if (source[prop] !== collection[i][prop]) {
        break;
      } else {
        arr.push(collection[i]);
      }
    }
  }
  // What's in a name?
  return arr;
}
Hey guys I'm having the hardest time with Bonfire: Where art thou. It keeps failing the last two tests. Any tips? Thanks :smile:
CamperBot
@camperbot
Sep 01 2015 01:21
if you want to thank someone, put an @ before their name!
Rob Simpson
@pertrai1
Sep 01 2015 01:22
function palindrome(str) {
// Good luck!
return str === str.split('').reverse().join('').toLowerCase().replace(!, '');
}
what are the messages that come in that say pair program?
Justin Crawford
@JCrawford1122
Sep 01 2015 01:23
@pertrai1 Don't forget about removing spaces and punctuation
Rob Simpson
@pertrai1
Sep 01 2015 01:24
Can someone pair program with me? I don't know how to pair program but that would help me a great deal
Hans van Riet
@hansinla
Sep 01 2015 01:25
@pertrai1 Yes, remove spaces and punctuation not just the exclamation mark. Regex is probably the way to go.
Rob Simpson
@pertrai1
Sep 01 2015 01:25
Let me look up how to do that type of Regex
Hans van Riet
@hansinla
Sep 01 2015 01:28
@pertrai1 Keep in mind that you need to do that on str as well, now you’re comparing a str without the lowercase and replacements to a reversed string with those modifications.
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 01:30

i've been stuck here on this problem for two days now :(

i was wondering if someone out there could be kind enough to explain me the solution to the palindrome problem

here's my code:


function palindrome(str) {
  // Good luck!
    word1 = str;
    word2 = str;

    word1 = word1.split('').reverse().join('');

    console.log(word1);

    if (word1 === word2) {
        return true;
    } else {
        return false;
    }
}
Katrina Ezis
@katrinaezis
Sep 01 2015 01:33
@YanKozlovskiy I think you're missing the regex expression to get rid of all spaces and punctuation
I used this one
  str = str.toLowerCase();
  str = str.replace(/[,.\s]+/g, "");
Rob Simpson
@pertrai1
Sep 01 2015 01:33
isnt this comparing with lowerCase and replace? I added this regex with no luck: return str === str.split('').reverse().join('').toLowerCase().replace(/\s+(\W)/g, '');
Hans van Riet
@hansinla
Sep 01 2015 01:33
@YanKozlovskiy Read a few messages above yours. You’re having the same issues as @pertrai1 . You should convert str to lowercase, remove punctuation and spaces. Then test that new string against the reversed new string. In theory you should only have to test for half the length of the string, but on short strings, performance won’t matter.
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 01:33
@katrinaezis how did you figure out the regular expression?
Rob Simpson
@pertrai1
Sep 01 2015 01:34
@hansinla Ah let me give that a shot
Hans van Riet
@hansinla
Sep 01 2015 01:34
@pertrai1
replace(/[^a-z]/g, "”);
@pertrai1 You’re really close.
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 01:38
this is what palindrome('EyE cart 8 had... cared :P'); returns
pundefinedundefinedderacundefinedundefinedundefinedundefineddahundefinedundefinedundefinedtracundefinedeye
Katrina Ezis
@katrinaezis
Sep 01 2015 01:39
@YanKozlovskiy [ ] says anything in that range so any white space character, period, or comma. + means one or more. and /g means global so it causes the replace call to replace all matches, not just the first one.
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 01:40
could you please tell me where you learned all this?
Katrina Ezis
@katrinaezis
Sep 01 2015 01:41
@YanKozlovskiy well they taught us a bit of it and you can find a lot of regex and regular expression practice by googling it
Hans van Riet
@hansinla
Sep 01 2015 01:41
@YanKozlovskiy pseudo code:
  1. turn str into lowercase
  2. remove the special characters
  3. compare this string str with str-reversed
  4. if equal return true, else return false
chicachicamji
@chicachicamji
Sep 01 2015 01:45
hey guys I'm not totally done with the chunky monkey challenge but was wondering if you could troubleshoot what is wrong with my logic based on the code so far
function chunk(arr, size) {
  // Break it up.
  var x = [];
  if(arr.length % size === 0) {
    for(var y = 0; y < arr.length; y += arr.length / size) {
      x.push(arr.splice(y, y + arr.length / size))
    }
    return x;
  }
}

chunk(['a', 'b', 'c', 'd'], 2);
Joseph Miller
@joemillervi
Sep 01 2015 01:47
what was the chunky problem?
DTing
@dting
Sep 01 2015 01:47
@chicachicamji splice mutates the array
since you are iterating and splicing your counter variable gets messed up
you can use slice instead
Joseph Miller
@joemillervi
Sep 01 2015 01:48
Anyone want to talk about the roman numeral problem?
Rob Simpson
@pertrai1
Sep 01 2015 01:48
I have my mind twisted on Palidrome. Need to switch gears for now and get back to that. Not making any progress
DTing
@dting
Sep 01 2015 01:49
also size is how many elements per subarray. y + arr.length / size should jsut by y+size
chicachicamji
@chicachicamji
Sep 01 2015 01:49
oops I thought I wrote slice @dting thanks, but the code still only seems to be working for the given call
CamperBot
@camperbot
Sep 01 2015 01:49
chicachicamji sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 882 | @dting | http://www.freecodecamp.com/dting
chicachicamji
@chicachicamji
Sep 01 2015 01:50
@dting do I need to add an else for when the arr.length % size !== 0?
DTing
@dting
Sep 01 2015 01:50
@chicachicamji you only have a condition that runs if arr.length is divisible by size
chicachicamji
@chicachicamji
Sep 01 2015 01:50
yup thats what i thought thanks
CamperBot
@camperbot
Sep 01 2015 01:50
if you want to thank someone, put an @ before their name!
DTing
@dting
Sep 01 2015 01:50
    for(var y = 0; y < arr.length; y += arr.length / size) { // this should be increasing by size
      x.push(arr.splice(y, y + arr.length / size)) // this should be slicing from y to y+size
    }
Feners4
@Feners4
Sep 01 2015 01:52
can i get some help styling my autocomplete in http://codepen.io/Feners4/pen/ZGZORX
i dont want that drop down to be so close together to the search bar..
Matt Anderson
@MDAWebDev
Sep 01 2015 01:55
hey guys, I'm stuck on part 3 of the Git challenge. It says to open up a text editor and create a file. How am I supposed to do that in Cloud9? http://jlord.us/git-it/challenges/commit_to_it.html
Joseph Miller
@joemillervi
Sep 01 2015 01:55
touch example.txt
Matt Anderson
@MDAWebDev
Sep 01 2015 01:56
touch opens files in bash, but I'm supposed to actually create a new file with a a text editor.
DTing
@dting
Sep 01 2015 01:56
you can just click new file and double click it opens up an enditor tab
Matt Anderson
@MDAWebDev
Sep 01 2015 01:56
right?
DTing
@dting
Sep 01 2015 01:56
there is a directory panel on the left with the files if you just open from there an editor will open up
or use vi
Joseph Miller
@joemillervi
Sep 01 2015 01:57
use vi
Matt Anderson
@MDAWebDev
Sep 01 2015 01:58
Ah, I think I see how to create a new file now.
Joseph Miller
@joemillervi
Sep 01 2015 01:58
:w example.txt
Matt Anderson
@MDAWebDev
Sep 01 2015 01:58
does it automatically save or so I have to that manually?
Joseph Miller
@joemillervi
Sep 01 2015 01:58
from vi?
Matt Anderson
@MDAWebDev
Sep 01 2015 01:58
from the directory panel in Cloud9.
in the upper left-hand corner
Joseph Miller
@joemillervi
Sep 01 2015 02:00
i havent used Cloud9 sry
DTing
@dting
Sep 01 2015 02:00
no idea, probably just save the file?
Joseph Miller
@joemillervi
Sep 01 2015 02:01
Has anybody done the roman numeral problem? Im stuck for numbers like 9 (where I comes before X)
Matt Anderson
@MDAWebDev
Sep 01 2015 02:02
oh I see now, there's a "save as" option in the menu like a regular PC.
DTing
@dting
Sep 01 2015 02:02
@jobo440 what's your code look like now?
Matt Anderson
@MDAWebDev
Sep 01 2015 02:02
All changes saved.
Rex Schrader
@SaintPeter
Sep 01 2015 02:02
@jobo440 It depends on what your strategy is. I did searches for 4, 9, 40, 90, 400, and 900
Joseph Miller
@joemillervi
Sep 01 2015 02:03
I dont have code just thinking atm
Matt Anderson
@MDAWebDev
Sep 01 2015 02:03
Cloud9 is harder to use than Git.
intially anyway.
DTing
@dting
Sep 01 2015 02:04
@MDAWebDev ya i didnt use it
Joseph Miller
@joemillervi
Sep 01 2015 02:04
@SaintPeter so you had it construct normally except for those numbers?
Rex Schrader
@SaintPeter
Sep 01 2015 02:05
@jobo440 Well, I had entries for each of the cardinal numbers as well. I'm just saying that I used those in addition.
@jobo440 Happy to take a look at your code if you share here :D
Joseph Miller
@joemillervi
Sep 01 2015 02:06
@SaintPeter Ok let me write something :)
DTing
@dting
Sep 01 2015 02:07
@MDAWebDev it's slow too
Rex Schrader
@SaintPeter
Sep 01 2015 02:08
I am not a big fan of Cloud9 for the Basejumps. I ended up making my own dev environemnt on Win10. It didn't take that long to do.
@jobo440 Oh, haha, missed your other comment :D
Isaac Calvo
@Icalvo1
Sep 01 2015 02:10
function destroyer(arr) {
  arr_array = arguments[0];
  arr_arg1 = arguments[1];
  arr_arg2 = arguments[2];
  arr_arg3 = arguments[3];
  function filtering(n) {
  return(n !== arr_arg1 && n !== arr_arg2 && n !== arr_arg3);
}
  arr = arr_array.filter(filtering)
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
is there a better way to allow the function 'destroyer' to accept multiple arguments? I just added a third to pass the challenge but function would fail if the user inputs > 3 arguments
Rex Schrader
@SaintPeter
Sep 01 2015 02:10
@Icalvo1 Yes, the Arguments object has all of the arguments that are passed in. It's an object, not an array, though, so you need to convert it before you can use it.
wiki arguments
CamperBot
@camperbot
Sep 01 2015 02:10

:point_right: bonfire arguments optional [wiki]

Author

@Rafase282 submitted by Rafase282 | https://github.com/Rafase282

My Original Wiki

Details

  • Difficulty: 2/5

Fill in the object constructor with the methods specified in the tests.

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

For example, add(2, 3) should return 5, and add(2) should return a function that is waiting for an
:pencil: read more about bonfire arguments optional on the FCC Wiki

Rex Schrader
@SaintPeter
Sep 01 2015 02:11
find arguments
CamperBot
@camperbot
Sep 01 2015 02:11

find arguments

:zero: bonfire arguments optional
:one: js arguments

Rex Schrader
@SaintPeter
Sep 01 2015 02:11
wiki js arguments
CamperBot
@camperbot
Sep 01 2015 02:11

:point_right: js arguments [wiki]

The arguments object is an array-like object (meaning that it looks like an array but it's not) that stores all of the arguments that you passed to a function and is proprietary to that function in particular. If you were to pass 3 arguments to a function, say storeNames(), those 3 arguments would be stored inside an object called arguments and it would look like this when we pass the arguments storeNames("Mulder", "Scully", "Alex Krycek") to our function:

  • First, we declare a function and make it return the arguments object.

    function storeNames() { return arguments; }
  • Then, when we execute that function with n arguments, 3 in this case, it will return the object to us and it will look like an array. We can convert it to an array, but more on that later...

    // If we execute the following line in the console:
    storeNames("Mulder", "Scully", "Alex Kryceck");
    // The output will be: ["Mulder", "Scully", "Alex Kryceck"]

If you want to know more about this, such as converting it to an array or the optimization problem that comes with using the slice() method and how to solve it, click on read more (Gitter Chat Only).

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

Rex Schrader
@SaintPeter
Sep 01 2015 02:11
@Icalvo1 Details ^^ ;)
Isaac Calvo
@Icalvo1
Sep 01 2015 02:14
thanks @SaintPeter
CamperBot
@camperbot
Sep 01 2015 02:14
icalvo1 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 442 | @saintpeter | http://www.freecodecamp.com/saintpeter
DTing
@dting
Sep 01 2015 02:14
@Icalvo1 tricky part to that is to realise each function has it's own arguments object
function fn1() {
  console.log(arguments);
  function fn2() {
    console.log(arguments);
  }
  fn2();
} 
fn1(1,2,3);
you would get
[1,2,3]
[]
Joseph Miller
@joemillervi
Sep 01 2015 02:16

function convert(num) {
var tens = Math.floor(num / 10);
var remainder = num % 10;
var fives = Math.floor(remainder / 5);
var ones = remainder % 5;

console.log('tens ' + tens, 'fives ' + fives, 'ones ' + ones)
}

convert(36);

@SaintPeter
Steven Parker
@Philosophist
Sep 01 2015 02:27
@dting @SaintPeter Thanks. It seems that bonfire is more complicated than I thought at first. Gotta wrap my head around this recursive permutation creating function now.
CamperBot
@camperbot
Sep 01 2015 02:27
philosophist sends brownie points to @dting and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 443 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 884 | @dting | http://www.freecodecamp.com/dting
Jesse
@jctm30
Sep 01 2015 02:46
hi guys, can anyone see whats wrong with this?
function largestOfFour(arr) {
  var largest = 0;
  var newArr = [];
  for(i=0; i<arr.length; i++){
    var firstLayer = arr[i];
    for (j=0; j<firstLayer.length; j++) {
      var secondLayer = firstLayer[j];
      if (secondLayer > largest) {
        largest = secondLayer;
      }
    }
    newArr.push(largest);
  }
  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
DTing
@dting
Sep 01 2015 02:47
@jctm30 your largest variable isnt being reset for each outer loop
it will carry over a value from each sub array
also if you have all negative numbers that would give you 0 instead of the largest negative number
This message was deleted
ctcrnitv
@ctcrnitv
Sep 01 2015 02:48
cant get this dropdown to work, any advice?
DTing
@dting
Sep 01 2015 02:48
This message was deleted
@skr5e click the js gear (settings) and include bootstrap
Jesse
@jctm30
Sep 01 2015 02:50
@dting hmmmm so what do i need to do exactly?
ctcrnitv
@ctcrnitv
Sep 01 2015 02:50
I’m really bad at that lol
I think I asked the exact same question a couple of days ago
DTing
@dting
Sep 01 2015 02:50
lol
@jctm30
function largestOfFour(arr) {
  var largest = 0; // move this 
  var newArr = [];
  for(i=0; i<arr.length; i++){ // inside here
    var firstLayer = arr[i];
    for (j=0; j<firstLayer.length; j++) {
      var secondLayer = firstLayer[j];
      if (secondLayer > largest) {
        largest = secondLayer;
      }
    }
    newArr.push(largest);
  }
  return newArr;
}
also if you set it = to the first value instead of 0 it would fix the negative problem
Jesse
@jctm30
Sep 01 2015 02:53
@dting whats the first value ?
DTing
@dting
Sep 01 2015 02:53
first value of the nested array
what you iterate over in the inside loop
zach94
@zzzJH
Sep 01 2015 02:54

Q:Add to your form a pair of radio buttons. Each radio button should be nested within its own label element. They should share a common name attribute. One should have the option of indoor and the other should have the option of outdoor.

<label name="indoor"><input type="radio" name="indoor-outdoor"></label>
<label name="outdoor"><input type="radio" name="indoor-outdoor"></label>

why i have wrong? is not true?

TaralJaiswal
@TaralJaiswal
Sep 01 2015 02:54
Do i have to format the code in that strange cascading manor, can't i just have it go straight down
?
DTing
@dting
Sep 01 2015 02:55
@jctm30 var largest = arr[i][0]; or var largest = firstLayer[0]; if you hve it after you declare and assign firstLayer
Jesse
@jctm30
Sep 01 2015 02:58
@dting oh wow it works. but I don't think i undersatnd it completely.
why are we defining largest inside the loop? and what does arr[i][0] mean?
DTing
@dting
Sep 01 2015 03:01
you define it in the loop because you want it to reset after every sub array
arr[i][0] is the first element of arr[i]
arr[i] is the current sub array you are looking at
Matt Everson
@matteverson
Sep 01 2015 03:02
@TaralJaiswal If you mean indenting lines, it's easier to read the code that way and understand what will be skipped if you run into an if/else block. Javascript doesn't care though, it would run fine without indentation.
Philosoraptor1981
@Philosoraptor1981
Sep 01 2015 03:10

```var flag = 'true';

function translate(str) {
var pigLatin = '';
var consonants = '';
var count = 0;
if(isVowel(str[0])){
pigLatin = str + "way";

}
else{        
    while(flag){
        count++;
        consonants = consonants + str.slice(0,1);
        //console.log(consonants);
        str = str.slice(1,str.length);
        //console.log(str);
        isVowel(str[0]);

    }
    pigLatin = str + consonants + 'ay';
    console.log(pigLatin);
}
return pigLatin;

}

function isVowel(c) {
if(['a', 'e', 'i', 'o', 'u'].indexOf(c) !== -1){
flag = false;
return true;
}
}

translate("consonant");
```

var flag = 'true';

function translate(str) {
    var pigLatin = '';    
    var consonants = '';
    var count = 0;
    if(isVowel(str[0])){
        pigLatin = str + "way";

    }
    else{        
        while(flag){
            count++;
            consonants = consonants + str.slice(0,1);
            //console.log(consonants);
            str = str.slice(1,str.length);
            //console.log(str);
            isVowel(str[0]);

        }
        pigLatin = str + consonants + 'ay';
        console.log(pigLatin);
    }
    return pigLatin;
}



function isVowel(c) {
        if(['a', 'e', 'i', 'o', 'u'].indexOf(c) !== -1){
            flag = false;
            return true;  
        }    
}

translate("consonant");
All my cases return correct, but the bonfire marks it as not complete
DTing
@dting
Sep 01 2015 03:14
@Philosoraptor1981 the top 3 testcases show errors for me with your code
Philosoraptor1981
@Philosoraptor1981
Sep 01 2015 03:14
What errors are you getting?
Because I'm showing a return string that matches the case given.
DTing
@dting
Sep 01 2015 03:15
@Philosoraptor1981 the tests dont run with the same context as the code editor
having your var flag outside the functions and using it in both functions is making the tests fail
function translate(str) {
    var flag = 'true';
    var pigLatin = '';    
    var consonants = '';
    var count = 0;
    function isVowel(c) {
        if(['a', 'e', 'i', 'o', 'u'].indexOf(c) !== -1){
            flag = false;
            return true;  
        }    
    }

    if(isVowel(str[0])){
        pigLatin = str + "way";

    }
    else{        
        while(flag){
            count++;
            consonants = consonants + str.slice(0,1);
            //console.log(consonants);
            str = str.slice(1,str.length);
            //console.log(str);
            isVowel(str[0]);

        }
        pigLatin = str + consonants + 'ay';
        console.log(pigLatin);
    }
    return pigLatin;
}
this is your same code but i moved the function and variable inside the function and your tests pass
Philosoraptor1981
@Philosoraptor1981
Sep 01 2015 03:18
Okay...thank you sir!
CamperBot
@camperbot
Sep 01 2015 03:18
if you want to thank someone, put an @ before their name!
Philosoraptor1981
@Philosoraptor1981
Sep 01 2015 03:18
thank you @dting
CamperBot
@camperbot
Sep 01 2015 03:18
philosoraptor1981 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 891 | @dting | http://www.freecodecamp.com/dting
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:25
thank you @matteverson
CamperBot
@camperbot
Sep 01 2015 03:25
yankozlovskiy sends brownie points to @matteverson :sparkles: :thumbsup: :sparkles:
:star: 357 | @matteverson | http://www.freecodecamp.com/matteverson
jinithin
@jinithin
Sep 01 2015 03:26
can someone help me on a non FCC project
Madmaxneo
@Madmaxneo
Sep 01 2015 03:36
Hey all, I am on the first tutorial and am having an issue with adding a class to an image. Can someone please help?
Jacob Jordan
@jjordan88
Sep 01 2015 03:36
@Madmaxneo : Post your code. Three backticks, then Shift + Enter, then three more backticks.
Rex Schrader
@SaintPeter
Sep 01 2015 03:37
wiki format
CamperBot
@camperbot
Sep 01 2015 03:37

: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

Madmaxneo
@Madmaxneo
Sep 01 2015 03:38
<img class="smaller-image" class="thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
ok the 3 back ticks things didn't work, I obviously did something wrong
Rex Schrader
@SaintPeter
Sep 01 2015 03:39
@Madmaxneo You can add as many classes as you want inside your existing class attribute. Just add a space and the new class:
class="class1 class2 class3"
Jacob Jordan
@jjordan88
Sep 01 2015 03:39
CODE HERE
^^ SP has it exactly.
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:40
can someone please pair up with me really quickly i'm having trouble understandig my code :(
Madmaxneo
@Madmaxneo
Sep 01 2015 03:41
@SaintPeter that is what I am missing. They don't explain that
Rex Schrader
@SaintPeter
Sep 01 2015 03:41
@Madmaxneo Humm, I'll see if I can't clarify the wording on that one.
@Madmaxneo Which waypoint is it specifically?
Joseph Miller
@joemillervi
Sep 01 2015 03:43
Does anyone have a lovely solution to the roman numerals problem?
Here is my mess:
Madmaxneo
@Madmaxneo
Sep 01 2015 03:43
I still can't get code to post correctly
Joseph Miller
@joemillervi
Sep 01 2015 03:43
function convert(num) {
  var tens = Math.floor(num / 10);
  var remainder = num % 10;
  var fives = Math.floor(remainder / 5);
  var ones = remainder % 5;

  console.log('tens ' + tens, 'fives ' + fives, 'ones ' + ones);

  var amounts = [tens,fives,ones];
  var numerals = ["X", "V", "I"];
  var finalStr = '';

  for(i in amounts) {
      for(j = 0; j < amounts[i]; j++) {
          finalStr = finalStr + numerals[i];
      }
  }
  return finalStr;
}

convert(36);
Rex Schrader
@SaintPeter
Sep 01 2015 03:43
@Madmaxneo Do you know where the backtick key is?
Madmaxneo
@Madmaxneo
Sep 01 2015 03:43
yes
``
Rex Schrader
@SaintPeter
Sep 01 2015 03:44
@Madmaxneo 3 backticks, shift-enter for a new line, paste code, shift-enter, three more backticks, ctrl-enter to post
Madmaxneo
@Madmaxneo
Sep 01 2015 03:44
I do three backticks then press shift + enter
then three more backticks then hit enter and noting
Jacob Jordan
@jjordan88
Sep 01 2015 03:45
Click the little keyboard icon.
Then try hitting Enter again.
Rex Schrader
@SaintPeter
Sep 01 2015 03:45
@jobo440 I just PMed you my neatest solution.
@Madmaxneo You need to paste your code between the sets of backticks
Jacob Jordan
@jjordan88
Sep 01 2015 03:46
@YanKozlovskiy I don't have the pairing app installed right now, but maybe I can help talk you through it if I'm far enough along the course. What's up?
Joseph Miller
@joemillervi
Sep 01 2015 03:47
@SaintPeter thanks!
CamperBot
@camperbot
Sep 01 2015 03:47
jobo440 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 445 | @saintpeter | http://www.freecodecamp.com/saintpeter
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:47
it's the palindrome... i'm reading the regex guide on regexr.com but my regular expression isn't working
this is my code:
Rex Schrader
@SaintPeter
Sep 01 2015 03:47
@jobo440 It looks like your code doesn't cover several important cases.
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:48
function palindrome(str) {
  // Good luck!
    word1 = str;
    word2 = str;

    word1 = word1.toLowerCase().replace(/([a-z])\w\D\S+/g).split('').reverse().join('');

    console.log(word1);

    if (word1 === word2) {
        return true;
    } else {
        return false;
    }
}

palindrome('yesyes haha car');
Joseph Miller
@joemillervi
Sep 01 2015 03:48
yah im not sure how to implement the 'subtraction aspect' of roman numerals
Madmaxneo
@Madmaxneo
Sep 01 2015 03:48
<img class="smaller-image" class="thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
DTing
@dting
Sep 01 2015 03:48
@jobo440 my suggestions like @SaintPeter mentioned is make an array of values mapped to roman numeral values
Rex Schrader
@SaintPeter
Sep 01 2015 03:48
@YanKozlovskiy Your Regex is a bit of a mess. Try noodling with it here: http://regex101.com
Madmaxneo
@Madmaxneo
Sep 01 2015 03:49
Why can't they use brackets for code like normal chat rooms ?
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:49
why is it a bit of a mess?
SM
@nogo10
Sep 01 2015 03:49

bootstrap troubles: centering content

<div class="row center-block">
          <div class="col-md-3">....

I've tried putting an offset

<div class="row center-block">
          <div class="col-md-3 col-md-offset-1">.....

but still not perfectly centerd
edit: here's my css for center-block

.center-block {
  float: none;
  margin-right: auto;
  margin-left: auto;
}
DTing
@dting
Sep 01 2015 03:49
then until you cant subtract that value add the roman numberal value to a result string
Jacob Jordan
@jjordan88
Sep 01 2015 03:49
Lol regexes aren't my strong suit... give me a sec.
Madmaxneo
@Madmaxneo
Sep 01 2015 03:51
@SaintPeter I am not sure what you mean by adding as many classes as needed in the example you gave
hello?
Jacob Jordan
@jjordan88
Sep 01 2015 03:53
Well, it looks like you're trying to cram everything into one statement, @YanKozlovskiy .
SM
@nogo10
Sep 01 2015 03:53
@Madmaxneo see my example above: I use a center-block 'helper' class added to my row class so that one <div> has two classes
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:54
is there a better way to do it?
Justin Crawford
@JCrawford1122
Sep 01 2015 03:54
@YanKozlovskiy You could use a smaller reg ex
Madmaxneo
@Madmaxneo
Sep 01 2015 03:54
umm yeah, I am completely new to code and am doing the tutorials... the code needs to be specific for the tutorials
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 03:55
@JCrawford1122 what regex should i use?
Justin Crawford
@JCrawford1122
Sep 01 2015 03:55
@YanKozlovskiy And you also need to include what you want to replace with after the regex
Jacob Jordan
@jjordan88
Sep 01 2015 03:55
You could do str.replace & toLowerCase as one statement (use Word1 for this) and then make Word2 = Word1 reversed and joined.
The way you have it now, you're not even using your Word2 variable. Get it?
Madmaxneo
@Madmaxneo
Sep 01 2015 03:56
If you would like I can post the whole code here
Hans van Riet
@hansinla
Sep 01 2015 03:56
@YanKozlovskiy You compare a string that has taken special characters out and concerted to lowerCase to a string that didn’t get that treatment. You will never find that word1 == word2.
Madmaxneo
@Madmaxneo
Sep 01 2015 03:56
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

  .smaller-image {
    width: 100px;
  }
  .thick-green-border {
    border-color: green; border-width: 10px; border-style: solid; 
  }

</style>

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
in the code I have to add the "thick green border" to the image and I did everything as it suggested. But the thick green border will not show up.
Jacob Jordan
@jjordan88
Sep 01 2015 03:58
@hansinla said it more concisely than I did, but yeah, you need to make Word1 and Word2 have a relationship with each other, @YanKozlovskiy .
Isaac Calvo
@Icalvo1
Sep 01 2015 03:59

http://freecodecamp.com/challenges/bonfire-seek-and-destroy <-- stuck on filtering function

function destroyer(arr) {
  arr_array = arguments[0];
  arr_arg = [];
  for(var i = 1; i < arguments.length; i++){
  arr_arg.push(arguments[i]);
  console.log(arr_arg);  
}
  function filtering(n) {
  return(n !== arr_arg);
}
  arr = arr_array.filter(filtering)
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

console.log() shows the arguments in the array filtering function isn't working as expected though

DTing
@dting
Sep 01 2015 04:04
@Icalvo1 arr_arg is an array
n wont === an array
justindobbs
@justindobbs
Sep 01 2015 04:05
anyone know what's going on with the code school angular exercises. i click 'check my work' and nothing happens
DTing
@dting
Sep 01 2015 04:06
@Icalvo1 you need to check if n is in the arr_arg array. maybe use indexOf
Isaac Calvo
@Icalvo1
Sep 01 2015 04:06
ok ill try it
Jacob Jordan
@jjordan88
Sep 01 2015 04:06
^^indexOf is the way to go!
DTing
@dting
Sep 01 2015 04:07
@Madmaxneo you shouldn't make 2 class atrribute
s
@Madmaxneo
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
one attribute with class names separated by spaces
Madmaxneo
@Madmaxneo
Sep 01 2015 04:08
@dting so there is no separation other than a space?
DTing
@dting
Sep 01 2015 04:08
ya just a space
Madmaxneo
@Madmaxneo
Sep 01 2015 04:08
It would be nice if they explained that
Isaac Calvo
@Icalvo1
Sep 01 2015 04:10
function destroyer(arr) {
  arr_array = arguments[0];
  arr_arg = [];
  for(var i = 1; i < arguments.length; i++){
  arr_arg.push(arguments[i]);
  console.log(arr_arg);  
}
  function filtering(n) {
  return(arr_arg.indexOf(n));
}
  arr = arr_array.filter(filtering)
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
well semi-works now I'm closer. threes still in arr returned though thanks @dting
CamperBot
@camperbot
Sep 01 2015 04:10
icalvo1 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 892 | @dting | http://www.freecodecamp.com/dting
Madmaxneo
@Madmaxneo
Sep 01 2015 04:11
@dting I'd give you some kudos but I don't know how to add them
Rex Schrader
@SaintPeter
Sep 01 2015 04:12
help thanks
CamperBot
@camperbot
Sep 01 2015 04:12
no wiki entry for: thanks
:pencil: click here to create one now!after creating your page type update to reload it here
Madmaxneo
@Madmaxneo
Sep 01 2015 04:12
help kudos
CamperBot
@camperbot
Sep 01 2015 04:12
no wiki entry for: kudos
:pencil: click here to create one now!after creating your page type update to reload it here
Madmaxneo
@Madmaxneo
Sep 01 2015 04:13
help brownie points
CamperBot
@camperbot
Sep 01 2015 04:13

:point_right: brownie points [wiki]

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets
  3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people.

They also add to your Streak.
:pencil: read more about brownie points on the FCC Wiki

Rex Schrader
@SaintPeter
Sep 01 2015 04:13
@Madmaxneo just mention his @name and say than ks
Madmaxneo
@Madmaxneo
Sep 01 2015 04:13
@dting than ks
@dting ks
Isaac Calvo
@Icalvo1
Sep 01 2015 04:13
lol
Rex Schrader
@SaintPeter
Sep 01 2015 04:13
@Madmaxneo sorry, without the space
"thanks"
CamperBot
@camperbot
Sep 01 2015 04:14
if you want to thank someone, put an @ before their name!
Isaac Calvo
@Icalvo1
Sep 01 2015 04:14
no space
Madmaxneo
@Madmaxneo
Sep 01 2015 04:14
@dting
@dting ks
Rex Schrader
@SaintPeter
Sep 01 2015 04:14
Say the word "thanks" and @theirnamehere
CamperBot
@camperbot
Sep 01 2015 04:14
saintpeter sends brownie points to @theirnamehere :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for theirnamehere
Madmaxneo
@Madmaxneo
Sep 01 2015 04:15
@dting
Mike Bobadilla
@mikebobadilla
Sep 01 2015 04:15
@Madmaxneo we get it. please stop
SaintPeter @SaintPeter laughs
Madmaxneo
@Madmaxneo
Sep 01 2015 04:15
They don't make it easy do they
Rex Schrader
@SaintPeter
Sep 01 2015 04:15
Thanks @dting
CamperBot
@camperbot
Sep 01 2015 04:15
saintpeter sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 894 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 01 2015 04:17
lol thanks @SaintPeter @Madmaxneo
CamperBot
@camperbot
Sep 01 2015 04:17
dting sends brownie points to @saintpeter and @madmaxneo :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for madmaxneo
:star: 447 | @saintpeter | http://www.freecodecamp.com/saintpeter
Manuel Alzadiq Romero
@erratadei
Sep 01 2015 04:18
Hello, is there any chatroom for Ziplines? or a page with a list of all the chatrooms?
DTing
@dting
Sep 01 2015 04:20
its at the top of the page
also
Screen Shot 2015-08-31 at 9.20.14 PM.png
wiki official
CamperBot
@camperbot
Sep 01 2015 04:20

:point_right: official free code camp chat rooms [wiki]

The following are our official chat rooms.

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

Chat Room Description
FreeCodeCamp our main chat room - hang out and chat about life and learning to code
Help get help with our Waypoint challenges from your fellow campers
HelpZiplines get help with our Zipline challenges from your fellow campers
HelpBonfires get help with our Bonfire challenges from your fellow campers
HelpBasejumps get help with our Basejump challenges from your fellow campers
NonprofitProjects get help with your Nonprofit Projects from your fellow campers
CodingJobs chat about the process of getting a coding job, such as portfolios, networking, and interviewing
YouCanDoThis learning to code is hard - share your feelings and get moral support here
News chat about stories trending on Camper News
LetsPair find fellow campers to pair program with using Screen Hero
TeamViewer find fellow campers who use Linux and pair program using Team Viewer
PairProgrammingWomen this women-only chat room helps women pair program with other women if they so desire
40PlusDevs campers who are over 40+ years old can chat here if they so desire
LiveCoding chat about streaming webdev and gamedev on Twitch.tv and LiveCoding.tv

:pencil: read more about official free code camp chat rooms on the FCC Wiki

Manuel Alzadiq Romero
@erratadei
Sep 01 2015 04:20
Sorry, thanks, i found it
CamperBot
@camperbot
Sep 01 2015 04:20
if you want to thank someone, put an @ before their name!
Jacob Jordan
@jjordan88
Sep 01 2015 04:24
@Icalvo1 : Your thoughts are headed in the right direction, but look at your filter function and think about what you're trying to do. You've got an original array you're trying to filter, your arr_arg array that holds your unwanted values, and now you have to find these values using indexOf. From there, you can remove them a couple of different ways... I'll leave those to you.
Hey @dting , when are we supposed to (or should we) install screen hero or whatever? I keep hearing so much stuff about pair programming, and you seem to know a ton, so I figured I'd ask you. Also, have some brownie points for the links - thanks, @dting !
CamperBot
@camperbot
Sep 01 2015 04:26
jjordan88 sends brownie points to @dting and @dting :sparkles: :thumbsup: :sparkles:
:star: 895 | @dting | http://www.freecodecamp.com/dting
:star: 895 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 01 2015 04:28
@jjordan88 sorry i didnt do any pair coding haha
there is a room tho
Jacob Jordan
@jjordan88
Sep 01 2015 04:30
That'll work.... I'll check it out closer to the nonprofit stuff. I'm so new now that I probably wouldn't be much help to anyone lol.
Ashraful Islam
@iashraful
Sep 01 2015 04:43
@jjordan88 am revisiting the bonfires
you like to pairup?
:sunglasses:
:( this is embarrassing
DTing
@dting
Sep 01 2015 04:52
hah
Debbie Brown
@astar9
Sep 01 2015 05:04
This message was deleted
Ashraful Islam
@iashraful
Sep 01 2015 05:04
ok, I go do my own stuff then
bruce-c-liu
@bruce-c-liu
Sep 01 2015 05:04
'''
CamperBot
@camperbot
Sep 01 2015 05:04
:bulb: to format code use backticks! ``` more info
Hans van Riet
@hansinla
Sep 01 2015 05:05
@iashraful What do you need help with?
Yan Kozlovskiy
@YanKozlovskiy
Sep 01 2015 05:06
what does a greyed out contact in screenhero mean?
Ashraful Islam
@iashraful
Sep 01 2015 05:06
:( I am waiting for clementinejs to update, so in the mean time I thought I'd redo my bonfires and looked if anyone was doing their bonfires and got stuck
my bonfires are pretty old, early july stuff
the dark days when I had hard time writing anything other than a for loop :D
Debbie Brown
@astar9
Sep 01 2015 05:07
Help! I am also stuck on "Use a CSS Class to Style an Element" Does anyone have an answer or a good place to figure this out?
CamperBot
@camperbot
Sep 01 2015 05:07
no wiki entry for: i am also stuck on use a css class to style an element does anyone have an answer or a good place to figure this out
:pencil: click here to create one now!after creating your page type update to reload it here
Ashraful Islam
@iashraful
Sep 01 2015 05:07
holler
CamperBot
@camperbot
Sep 01 2015 05:07
holler back!
Ashraful Islam
@iashraful
Sep 01 2015 05:07
@dting morning!
DTing
@dting
Sep 01 2015 05:10
yo
you didnt like angular-fullstack?
@astar9 what's your code look like now?
Ashraful Islam
@iashraful
Sep 01 2015 05:14
@dting am getting flooded with errors and memory limit exceeded ... killed too frequently
so I gaveup on angular-fullstack
waiting for clementine :D
DTing
@dting
Sep 01 2015 05:15
oh on c9?
Ashraful Islam
@iashraful
Sep 01 2015 05:15
johnstonbl01 says clementine generator will be ready by today
@dting yep, c9, tried to apply for Nitrous.io free tier, they don't have free tier for my country :D
Peter Benjamin
@petermbenjamin
Sep 01 2015 05:22

Hello all, with regards to Bonfire Finders Keepers, I resolved the problem but I feel it's the intended solution.
My solution:

function find(arr, func) {
  var num = 0,
      numArr = arguments[0];

  for (var i = numArr[0]; i<numArr.length; i++){
    num = numArr[i];
    if (num % 2 === 0) return num;
  }
}

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

However, it seems that I need to use Array.some(). Any ideas how I can make this code more DRY (Don't Repeat Yourself)?

DTing
@dting
Sep 01 2015 05:25
@pmbenjamin i did this:
function find(arr, func) {
  var num;
  arr.some(function(e) {
    if (func(e)) {
      num = e;
      return true;
    }
  });
  return num;
}
Peter Benjamin
@petermbenjamin
Sep 01 2015 05:26
I see. Thank you, @dting
CamperBot
@camperbot
Sep 01 2015 05:26
pmbenjamin sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 902 | @dting | http://www.freecodecamp.com/dting
Luis Felipe López G.
@luishendrix92
Sep 01 2015 05:27
@pmbenjamin I also used .som() but I feel dirty for returning 'undefined', I just think I could improve it.
function find(arr, func) {
  var result;
  if (arr.some(function(number) {result = number; return func(number);}))
    return result;
  else
    return undefined;
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
DTing
@dting
Sep 01 2015 05:27
@pmbenjamin you should consider calling the passed in function rather using num % 2 === 0
Kayrat
@kairatomurbek2
Sep 01 2015 05:28
Hi! I added a user, there is an error 404: We could not find path / vailodf
DTing
@dting
Sep 01 2015 05:28
also your loop starts at the first index
err your index loop starts at the value of the first element in your numArr
@kairatomurbek2 where you seeing that?
function find(arr, func) {
  // var num = 0, 
  //    numArr = arguments[0]; // you can just use arr here instead of arguments[0]

  // for (var i = numArr[0]; i<numArr.length; i++){ // this loop would be inconsistent
  for (var i = 0; i < arr.length; i++) { // you just want to iterate each element of the arr array
    var num = arr[i];
    if (func(num)) return num; // call the function and if it returns true return the value of num;
  }
}
Nila
@star1671
Sep 01 2015 05:38

Hello! :) I'm a bit stuck on "Waypoint: Bring your JavaScript Slot Machine to Life"

Here is my code:

$($(".slot")[0]).html(slotOne);
    $($(".slot")[0]).html(slotTwo);
    $($(".slot")[0]).html(slotThree);

What am I doing wrong?

DTing
@dting
Sep 01 2015 05:40
@star1671 you need to change the index
in the brackets [ ]
to the right numbers
Nila
@star1671
Sep 01 2015 05:41
ohh i see. Thank you! @dting
CamperBot
@camperbot
Sep 01 2015 05:41
star1671 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 903 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@iashraful
Sep 01 2015 05:50
wow!
Emil Aasa
@emilaasa
Sep 01 2015 05:58
first to 1k dting
:P
DTing
@dting
Sep 01 2015 06:11
haha
Peter
@ObaPeter
Sep 01 2015 06:22
This message was deleted
CamperBot
@camperbot
Sep 01 2015 06:22
no wiki entry for: with bf confirm the ending
:pencil: click here to create one now!after creating your page type update to reload it here
Peter
@ObaPeter
Sep 01 2015 06:22
bonfire: Confirm the Ending
CamperBot
@camperbot
Sep 01 2015 06:22

: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

Peter
@ObaPeter
Sep 01 2015 06:23
this is my code so far please whats wrong

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

var subStr=str.substr(-1,1)
if (subStr==target){
return true;
}
else{
return false;
}

}

end('Bastian', 'n');

DTing
@dting
Sep 01 2015 06:24
@ObaPeter substr(-1,1) is just the last character
you need to check that the last n characters match or dont match target, where n = length of target
basically if the end of str is === target
target can be multiple characters
Peter
@ObaPeter
Sep 01 2015 06:27
Oh thanks @dting
CamperBot
@camperbot
Sep 01 2015 06:27
obapeter sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 906 | @dting | http://www.freecodecamp.com/dting
Mbos95
@Mbos95
Sep 01 2015 06:35
bonfire find the longest word in a string
CamperBot
@camperbot
Sep 01 2015 06:35

: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
Sep 01 2015 06:35
bf hint
CamperBot
@camperbot
Sep 01 2015 06:35
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Abdul Rafay Khan
@khanrafay
Sep 01 2015 06:37
Can anyone help me with the anchor text?
i am already using anchortext as catphotos but its still not working.
DTing
@dting
Sep 01 2015 06:38
post the code
Mbos95
@Mbos95
Sep 01 2015 06:38
Hey guys. my code in bonfire: Find the longest word in a string completes all the requirements except one! I am not sure why..
function findLongestWord(string) {
    var str = string.split(" ");
    var longest = 0;
    var word = null;
    for (var i = 0; i < str.length - 1; i++) {
        if (longest < str[i].length) {
            longest = str[i].length;
            word = str[i];
        }
    }
    return word.length;
}


findLongestWord('The quick brown fox jumped over the lazy dog');
Abdul Rafay Khan
@khanrafay
Sep 01 2015 06:39
<p> Here's <a href="http://freecatphotoapp.com">
cat photos </a> </p>
DTing
@dting
Sep 01 2015 06:39
@Mbos95 you aren't reaching the last element of the str array
Abdul Rafay Khan
@khanrafay
Sep 01 2015 06:39
@dting
DTing
@dting
Sep 01 2015 06:40
i < str.length -1 is everything but the last element
@khanrafay you are missing some words
find nest
Mbos95
@Mbos95
Sep 01 2015 06:40
you're right. how stupid xD thanks @dting
CamperBot
@camperbot
Sep 01 2015 06:40
mbos95 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 908 | @dting | http://www.freecodecamp.com/dting
Abdul Rafay Khan
@khanrafay
Sep 01 2015 06:40
@dting Thanks.
DTing
@dting
Sep 01 2015 06:40
@khanrafay it should be " click here for "
CamperBot
@camperbot
Sep 01 2015 06:40
khanrafay sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 909 | @dting | http://www.freecodecamp.com/dting
Abdul Rafay Khan
@khanrafay
Sep 01 2015 06:46
@dting still not working.
<p> click here for <a href="http://freecatphotoapp.com">
"catphotos" </a> </p>
DTing
@dting
Sep 01 2015 06:50
remove the quotes from "catphotos"
<p> click here for <a href="http://www.catphotoapp.com">cat photos</a></p>
Luis Felipe López G.
@luishendrix92
Sep 01 2015 06:52
@khanrafay Catphotos is not an attribute value, it's content (or value) inside a tag.
Carl Huxley
@carlhuxley
Sep 01 2015 07:04
Hi. Can anyone see why I'm getting unwanted shapes on the left and right of the orange social buttons on my portfolio project? I can't see anything wrong with the code in codepen http://codepen.io/CarlHux/pen/GJbwPP . When I inspect the element in chrome I see there are hidden <a> tags. Does anyone know how to solve this? Thanks!
DTing
@dting
Sep 01 2015 07:06
@carlhuxley you have a typo
<a/> in the second link
Carl Huxley
@carlhuxley
Sep 01 2015 07:08
Something simple in the end! I've looked at this a dozen times and couldn't see it, thanks @dting!
CamperBot
@camperbot
Sep 01 2015 07:08
carlhuxley sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
DTing
@dting
Sep 01 2015 07:08
        <ul>
          <li><a href='https://github.com/carlhuxley'target="_blank">Git Hub</a></li>
          <li><a href='https://uk.linkedin.com/pub/carl-huxley/83/486/218'target="_blank">Linkedin<a/></li>
        </ul>
should be:
        <ul>
          <li><a href='https://github.com/carlhuxley'target="_blank">Git Hub</a></li>
          <li><a href='https://uk.linkedin.com/pub/carl-huxley/83/486/218'target="_blank">Linkedin</a></li>
        </ul>
CamperBot
@camperbot
Sep 01 2015 07:08
:star: 911 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 01 2015 07:08
nps
Vulle
@Vulle
Sep 01 2015 07:15
Dont understand the task good enough..... http://freecodecamp.com/challenges/bonfire-check-for-palindromes
Someone who has a good explanation
DTing
@dting
Sep 01 2015 07:16
@Vulle check if the string that is passed into the function is the same forward and backwards when ignoreing spaces, punctuation and case
Vulle
@Vulle
Sep 01 2015 07:21
@dting Im reading the documentation on String.replace() but dont really know how to use it to this task...
DTing
@dting
Sep 01 2015 07:24
@Vulle you can use a regex with string.replace
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions replace all non A-Za-z characters with empty string ''
Vulle
@Vulle
Sep 01 2015 07:33
@dting Thanks for your help Dting! :)
CamperBot
@camperbot
Sep 01 2015 07:33
vulle sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 912 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@iashraful
Sep 01 2015 07:55
@dting any better way to extract the arguments obj elements?
function destroyer(arr) {
  // Remove all the values
  var toRemove = [].slice.call(arguments).slice(1);
  return arr.filter(function(e) {
    return (toRemove.indexOf(e) === -1);
  });
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
I did this for seek-n-destroy, but I feel that there are nicer ways
DTing
@dting
Sep 01 2015 07:55
@iashraful you can put the argument in the call function call
[].slice.call(arguments, 1);
Ashraful Islam
@iashraful
Sep 01 2015 07:56
:worried: nice!
@dting I did this for where art thou
function where(collection, source) {
  var keys = Object.keys(source);
  // What's in a name?
  return collection.filter(function(el){
    return keys.every(function(k){
      return (el.hasOwnProperty(k) && source[k] === el[k]);
    });
  });
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
you were saying something about not having to use .hasOwnProperty()
DTing
@dting
Sep 01 2015 07:58
@iashraful nice looks good
Ashraful Islam
@iashraful
Sep 01 2015 07:59
so I have to use .hasOwnProperty()
d3nn1s29
@d3nn1s29
Sep 01 2015 08:02
pls tel how to degrade font...

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

h2 {
font-family: Lobster;
}

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

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

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

Costas Chaitas
@CostasChaitas
Sep 01 2015 08:04
need help with my pomodoro clock
http://codepen.io/rasakos/pen/WQNxVP?editors=001
anybody knows why my clock starts always from 25 minutes if i change the sessions length
DTing
@dting
Sep 01 2015 08:04
@iashraful i think i was talking about using Object.keys making it so you dont have to use hasOwnProperty for the source keys if iterating them using for...in
Ashraful Islam
@iashraful
Sep 01 2015 08:04
oh
got it
@d3nn1s29 what is font degrade?
Costas Chaitas
@CostasChaitas
Sep 01 2015 08:06
anyone ???
DTing
@dting
Sep 01 2015 08:06
@rasakos inside your timer function you use the sessionseconds sessionminutes variables
you never update those when you change the sessionTime
Costas Chaitas
@CostasChaitas
Sep 01 2015 08:08
@dting the timer function just check the seconds and the minutes of the clock
what do you mean to update them
DTing
@dting
Sep 01 2015 08:09

    function timer(){            
        if(sessionseconds === 0){
          if(sessionminutes === 0){
            clearInterval(countdown);
            breakcountdown=setInterval(breaktimer,1000);
          }else{
            sessionminutes--;
            sessionseconds = 60;
          }
        }else{
          if(sessionseconds < 10){
            $("#time").text(sessionminutes + ":0" + sessionseconds);
          }
          else{
            $("#time").text(sessionminutes + ":" + sessionseconds);
          }
        }
        sessionseconds--;
    }
where are those variables set?
they are are set once at the very top of your code
Costas Chaitas
@CostasChaitas
Sep 01 2015 08:10
yes
ooo you mean to update them on the minus and plus onclick functions
DTing
@dting
Sep 01 2015 08:11
then when you change the value of sessionTime. you dont update those
so the timer starts at whatever you set at the top of the code
not at the current value of sessionTime
Costas Chaitas
@CostasChaitas
Sep 01 2015 08:14
i just put sessionminutes++; and sessionminutes--; on my incSession and my decSession and i think it works
DTing
@dting
Sep 01 2015 08:15
cool
Costas Chaitas
@CostasChaitas
Sep 01 2015 08:17
i have on more problem
when i run the clock ,click pause and change the length the clock start from the old value
same on the reset button
DTing
@dting
Sep 01 2015 08:20
sorry im heading off to bed. gluck with your app.
Costas Chaitas
@CostasChaitas
Sep 01 2015 08:20
thanks @dting for your time
CamperBot
@camperbot
Sep 01 2015 08:20
rasakos sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 913 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@iashraful
Sep 01 2015 08:20
@dting any advices on this one?
function where(arr, num) {
  // Find my place in this sorted array.
  var arr_ = arr.slice().sort();

  for(var i = 0; i < arr.length; i++) {
      if(arr_[i] >= num) return i;
  }

  return arr.length;
}

where([5,1 , 2, 4], 3)
bonfire where do I belong :D
CamperBot
@camperbot
Sep 01 2015 08:20
Sorry, can't find a bonfire called where do i belong d. [ Check the map? ]
Ashraful Islam
@iashraful
Sep 01 2015 08:21
@dting ok, night!
Emil Aasa
@emilaasa
Sep 01 2015 08:21
@iashraful using a compareFunction as outlined in MDN was my strategy
Ashraful Islam
@iashraful
Sep 01 2015 08:21
compareFunction?
wiki js compareFunction
CamperBot
@camperbot
Sep 01 2015 08:22
no wiki entry for: js comparefunction
:pencil: click here to create one now!after creating your page type update to reload it here
softeg
@softeg
Sep 01 2015 08:22
Hello everyone
Ashraful Islam
@iashraful
Sep 01 2015 08:22
@softeg Hello! :D
softeg
@softeg
Sep 01 2015 08:22
PLZ iam looking to ressources to learn more and more boostrap i want to master boostrap
Ashraful Islam
@iashraful
Sep 01 2015 08:23
@emilaasa I'm totally confused
what do you mean by compare function?
Emil Aasa
@emilaasa
Sep 01 2015 08:24
sorry about that! :)
Well the thing is that when you use array.sort() it will use sort of naive sorting criteria
Ashraful Islam
@iashraful
Sep 01 2015 08:24
holy **!
Emil Aasa
@emilaasa
Sep 01 2015 08:24
say you have [1, 2, 20, 10, 3, 32]
Ashraful Islam
@iashraful
Sep 01 2015 08:25
sorry, need a compare function otherwise it'll be like 1,10,2,20 :D
Emil Aasa
@emilaasa
Sep 01 2015 08:25
yeah
so you pass that as an argument of sort
Ashraful Islam
@iashraful
Sep 01 2015 08:25
dang it :D
strangely the bonfire test's passed
:( there should be test cases for [1,20,2,40,3]
Steve Tang
@Thescuba
Sep 01 2015 08:27
Waypoint: Target the Parent of an Element Using jQuery
'''
CamperBot
@camperbot
Sep 01 2015 08:27
:bulb: to format code use backticks! ``` more info
Ashraful Islam
@iashraful
Sep 01 2015 08:27
@Thescuba use this $('child').parent()
Steve Tang
@Thescuba
Sep 01 2015 08:27
$("#left-well").parent().css("background-color", "red")
Ashraful Islam
@iashraful
Sep 01 2015 08:28
:D
Steve Tang
@Thescuba
Sep 01 2015 08:28
@iashraful my background is red but it wont let me pass
jim3
@jim3
Sep 01 2015 08:28
bf Confirm the Ending
CamperBot
@camperbot
Sep 01 2015 08:28

: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

Ashraful Islam
@iashraful
Sep 01 2015 08:29
@Thescuba try bribing the guard :D
show us your full code, may be something is missing :D
Steve Tang
@Thescuba
Sep 01 2015 08:29
@iashraful i tried cookies but he is even blinking
Alex Karasik
@alexkarasik
Sep 01 2015 08:31
can someone help with the factorial problem?
jim3
@jim3
Sep 01 2015 08:37
function end(str, target) {
  if (str.substr(-1) === target) {
    return true;
    }
  else {
    return false;
  }
}
end('Bastian', 'n');
I'm on Confirm the Ending bonfire and I'm getting one error but not sure what it's asking for.
should equal true if target equals end of string: expected false to equal true
Ashraful Islam
@iashraful
Sep 01 2015 08:40
@jim3 you are not supposed to do str.substr(-1)
your code with fail for test `end('bastian','min')
:D
jim3
@jim3
Sep 01 2015 08:42
I figured that was too easy. :smile: Why can't I use str.substr(-1)?
Ashraful Islam
@iashraful
Sep 01 2015 08:43
because for the caseend('bastian','min') will be true, but bastian doesn't end with min
str.substr(-1) will only return one character from the end of string :D
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:44

@iashraful

function destroyer(arr) {
  var toDestroy=Array.prototype.slice.call(arguments,1);
  var result=true;
  return arr.filter(function(element) {
    for(i=0;i<toDestroy.length;i++)
    {
      if(element==toDestroy[i])
        result= false;
    }
    return result;
  });
}
destroyer([1, 2, 3, 1, 2, 3], 2,3);

i can't figure out whats going wrong. this should filter out the elements! but its returning [1] instead of [1,1]

Aniruddh Agarwal
@anrddh
Sep 01 2015 08:45
bonfire destroyer
CamperBot
@camperbot
Sep 01 2015 08:45
Sorry, can't find a bonfire called destroyer. [ Check the map? ]
Ashraful Islam
@iashraful
Sep 01 2015 08:45
@shoumyadas you should return either true or false
returning undefined is not an option :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:45
Which bonfire @shoumyadas ?
Ashraful Islam
@iashraful
Sep 01 2015 08:45
but yours does
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:46
@iashraful why? i am returning result which is initialised to true;
Ashraful Islam
@iashraful
Sep 01 2015 08:46
ops! I see the true up there
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:46
@awesomeaniruddh seek and destroy
Ashraful Islam
@iashraful
Sep 01 2015 08:46
say it found 2 once but you never reset it to true :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:46
bonfire seek and destry
CamperBot
@camperbot
Sep 01 2015 08:46
Sorry, can't find a bonfire called seek and destry. [ Check the map? ]
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:46
bonfire seek and destroy
CamperBot
@camperbot
Sep 01 2015 08:46

: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.

more info:  bf details | bf links | hint

Thomas Farla
@TFarla
Sep 01 2015 08:46
@jim3 You almost got it! Look into the argument you give to substr. Maybe that can be variable ;)
Ashraful Islam
@iashraful
Sep 01 2015 08:46
function destroyer(arr) {
  var toDestroy=Array.prototype.slice.call(arguments,1);
  var result=true;
  return arr.filter(function(element) {
    for(i=0;i<toDestroy.length;i++)
    {
      if(element==toDestroy[i])
        result= false;
    } else { result = true; } // <--- important
    return result;
  });
}
destroyer([1, 2, 3, 1, 2, 3], 2,3);
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:46
Ah, this is quite simple
Why o you have such a complicated solution?
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:47
@iashraful i thought filter ran the function for each element separately?!
d3nn1s29
@d3nn1s29
Sep 01 2015 08:47
CamperBot
@camperbot
Sep 01 2015 08:47
if you want to thank someone, put an @ before their name!
Ashraful Islam
@iashraful
Sep 01 2015 08:47
yes, but you never reset result to true after it being false once
so all elements being false after the first match :D
I mean all elements getting removed
Thomas Farla
@TFarla
Sep 01 2015 08:48
This message was deleted
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:48
hmm ! as the input is 1,2,3,1,2,3 after first 1,2,3 its not considering the rest. right lemme see
Ashraful Islam
@iashraful
Sep 01 2015 08:49
when it catches the 1 [2] 3 1 2 3 , result=false, after that, result remains always false
:D
so all the rest of the elements are getting removed too :D
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:49
thanx @iashraful just had to declare the result var inside the function! my bad.. :P
CamperBot
@camperbot
Sep 01 2015 08:49
shoumyadas sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 324 | @iashraful | http://www.freecodecamp.com/iashraful
Thomas Farla
@TFarla
Sep 01 2015 08:49
This message was deleted
Ashraful Islam
@iashraful
Sep 01 2015 08:49
@shoumyadas I think reseting value is better than redeclaring inside a loop
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:50
@awesomeaniruddh whats your solution?
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:50
Let me hack one right now
It might be an epic fail
:P
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:50
@iashraful array.filter's comp function is called for each variable so if its inside the func it will automatically be reset :smile:
Ashraful Islam
@iashraful
Sep 01 2015 08:51
@shoumyadas you could use every instead of a for loop in there
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:51
atleast thats what i used .. lol !
Ashraful Islam
@iashraful
Sep 01 2015 08:51
:D
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:51
@iashraful i dont even know what every is! i come from java background and we only had while,do-while and for there .. :P
Ashraful Islam
@iashraful
Sep 01 2015 08:52
I'm also repeating my bonfires today :D
lemme show you my seek-n-destroy
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:52
@iashraful what was your solution?
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:52
function destroyer(arr) {
       arr.filter(function(item) {
               for(i = 1; i < arguments.length; i++) {
                      if(arr.indexOf(arguments[i]) !== -1) {
                                  return false;
                       }
                }
                return true;
        });
}
That should work
bonfire seek and destroy
CamperBot
@camperbot
Sep 01 2015 08:52

: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.

more info:  bf details | bf links | hint

Ashraful Islam
@iashraful
Sep 01 2015 08:52
@shoumyadas
//seek n destroy the heck out of arr
function destroyer(arr) {
  // Remove all the values
  var toRemove = [].slice.call(arguments,1);
  return arr.filter(function(e) {
    return (toRemove.indexOf(e) === -1);
  });

}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:53
Okay shit, doesn't work
function destroyer(arr) {
  // Remove all the values
  args = [];
  for(i = 1; i < arguments.length; i++) {
    args.push(arguments[i]);
  }
  for(i = 0; i < args.length; i++) {
    for(x = 0; x < arr.length; x++) {
      if(args[i] === arr[x]) {
        arr.splice(arr.indexOf(args[i]), 1);
      }
    }
  }
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
That works though
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:54
@iashraful thats neat! if element is not present indexof will return -1 no need to check every element separately! quite elegant!
Ashraful Islam
@iashraful
Sep 01 2015 08:54
yes, I try to avoid arrays
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 08:54
@awesomeaniruddh i thought you were aiming to be simpler . right? :smile:
Aniruddh Agarwal
@anrddh
Sep 01 2015 08:55
Lol
I said it might be an epic fail
Didn't read the description properly
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 09:12
@/all why does sorting [2,5,15,10] using sort() return [10,15,2,5] ?! :O
Ashraful Islam
@iashraful
Sep 01 2015 09:13
:D
@shoumyadas need comparison function, as @emilaasa said
Shoumya Kanti Das
@shoumyadas
Sep 01 2015 09:15
@iashraful how does it sort by default then?! i used char array and it worked fine!
Ashraful Islam
@iashraful
Sep 01 2015 09:15
:D
wiki js sort
CamperBot
@camperbot
Sep 01 2015 09:15
no wiki entry for: js sort
:pencil: click here to create one now!after creating your page type update to reload it here
Ashraful Islam
@iashraful
Sep 01 2015 09:15
:(
Costas Chaitas
@CostasChaitas
Sep 01 2015 09:16
have a problem with my pomodoro clockhttp://codepen.io/rasakos/pen/XmWXpj?editors=001
Costas Chaitas
@CostasChaitas
Sep 01 2015 09:16
when the clock fihsh the break and returns back to the sessions it has a problem
anyone can help?
Ashraful Islam
@iashraful
Sep 01 2015 09:27
@shoumyadas here is my solution to Diff Two Arrays
// Diff two arrays
function diff(arr1, arr2) {

  // Same, same; but different.
  return arr1.concat(arr2).filter(function(e,i,a){
    return a.indexOf(e) === a.lastIndexOf(e);
  });

}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 09:39
function titleCase(str) {
    var testCase = str.split(" ");
    for (var i = 0; i < testCase.length; i++) {
      testCase[i] = testCase[i].charAt(0).toUpperCase();
    }
  return testCase.join(' ');
}

titleCase("I'm a little tea pot");
How do I get it to return the whole string
Not just the first letter?
MANOJ MURALI
@manojmurli
Sep 01 2015 09:41

<style>
body {
background-color: black;
}

.green-text {
color: green;
}
.p {
font-family: Monospace;
}

</style>

<h1 class = "green-text p">Hello World</h1>

in the above code 2 points i can't understand -
Give your body element the color property of green.
Give your body element the font-family property of Monospace.
Ashraful Islam
@iashraful
Sep 01 2015 09:42
@AbiTyasTunggal you need following correction
```
function titleCase(str) {
    var testCase = str.split(" ");
    for (var i = 0; i < testCase.length; i++) {
      testCase[i] = testCase[i].charAt(0).toUpperCase() + testCase[i].slice(1); // <--- correction
    }
  return testCase.join(' ');
}

titleCase("I'm a little tea pot");
Aniruddh Agarwal
@anrddh
Sep 01 2015 09:43
@AbiTyasTunggal
function titleCase(str) {
    var testCase = str.split(" ");
    testCase = testCase.map(function(word) {
        var letters = word.split("");
        letters[0] = letters[0].toUpperCase();
        word = letters.join("");
        return word;
    });
  return testCase.join(' ');
}

titleCase("I'm a little tea pot");
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 09:43

Can someone tell me why my audio file isn't playing when the timer is up? Maybe I'm not understanding something about .play() because it seems that it should work:

http://codepen.io/highpriestess/pen/vNYYJg

Costas Chaitas
@CostasChaitas
Sep 01 2015 09:51
anybody knows how can i add a audio sound?
Ashraful Islam
@iashraful
Sep 01 2015 09:56
@rasakos is your audio file present?
your source link is only pointing to an html page, you can't play an html page as sound :D
Ashraful Islam
@iashraful
Sep 01 2015 10:01
you need absolute link the the bell
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:01
@iashraful this is my problem as well
I can't get that absolute link
Ashraful Islam
@iashraful
Sep 01 2015 10:02
@rasakos I find this is the absolute link for the bell_ringing.mp3 <source src="http://picosong.com/cdn/171b86b662b12b5b5409637358ef18f3.mp3" type="audio/mpeg">
but hotlinking is bad habit :(
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:03
@iashraful beat me to it
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:03
@iashraful how else can it be done though if you're doing it via codepen?
Ashraful Islam
@iashraful
Sep 01 2015 10:03
ok, you got me there :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:04
No way but to hotlink
I think
Because Codepen won't allow you to upload assets to their own servers
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:04
```
function largestOfFour(arr) {
  // You can do this!
  var first = arr[0][0];
  var test = arr;
  for (var i = 0; i < test.length; i++) {
    if (test[i][0] >= first) {
      first = test[i][0]; 
    } 
    else if (test[i][1] >= first) {
      first = test[i][1];
    }
    else if (test[i][2] >= first) {
      first = test[i][2];
    }
    else if (test[i][3] >= first) {
      first = test[i][3];
    }
  return first;
  } 
}

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

/* if array item i 0/1/2/3 is bigger than the last array item saved, let new array item be array item i 0/1/2/3 */
How come this doesn’t work?
Ashraful Islam
@iashraful
Sep 01 2015 10:04
@rasakos @TheHighPriestess use the link I gave you, will work now
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:05
@AbiTyasTunggal which bonfire?
Ashraful Islam
@iashraful
Sep 01 2015 10:05
@awesomeaniruddh think its largest of four
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:05
@awesomeaniruddh Bonfire: Return Largest Numbers in Arrays
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:05
bonfire return largest numbers in arrays
CamperBot
@camperbot
Sep 01 2015 10:05

: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

Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:05
Yep @iashraful
Ashraful Islam
@iashraful
Sep 01 2015 10:05
looks totally frightening
:(
Costas Chaitas
@CostasChaitas
Sep 01 2015 10:05
@iashraful so i write this code to the html and write something like $("#alarm").play(); to the js?
Ashraful Islam
@iashraful
Sep 01 2015 10:05
@AbiTyasTunggal your code is way too complex, my head almost blew all over the place
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:06
@iashraful haha It makes sense to me but it doesn’t work :(
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:06
@iashraful it's still not working
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:06
Going from Ruby to JS is confusing sometimes
Ashraful Islam
@iashraful
Sep 01 2015 10:06
@rasakos your code is fine, just correct this in your html only, your js is fine
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:07
It looks like @rasakos and I are trying to do the same thing
Ashraful Islam
@iashraful
Sep 01 2015 10:07
@rasakos <source src="http://picosong.com/cdn/171b86b662b12b5b5409637358ef18f3.mp3" type="audio/mpeg">
@TheHighPriestess their server is a bit slow, wait a bit
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:08
function largestOfFour(arr) {
  // You can do this!
  arr = arr.map(function(subArr) {
    var largest = 0;
    for(var i = 0; i < subArr.length; i++) {
        if(largest < subArr[i]) {
            largest = subArr[i]''
        }
    }
    return largest;
  });
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Try that?
Ashraful Islam
@iashraful
Sep 01 2015 10:08
@TheHighPriestess also why are you using autoplay?
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:08
@AbiTyasTunggal
Costas Chaitas
@CostasChaitas
Sep 01 2015 10:08
@TheHighPriestess yeah thats true
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:08
@iashraful I deleted it
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:08
@awesomeaniruddh thanks mate!
CamperBot
@camperbot
Sep 01 2015 10:08
abityastunggal sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:09
..and the sound still doesn't play when the timer is up
CamperBot
@camperbot
Sep 01 2015 10:09
:star: 324 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Ashraful Islam
@iashraful
Sep 01 2015 10:09
@TheHighPriestess @rasakos it works for me, ringing here :)
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:09
@AbiTyasTunggal Please try to understand why my code works and yours doesn't
Costas Chaitas
@CostasChaitas
Sep 01 2015 10:09
it works for me
@iashraful thanks
CamperBot
@camperbot
Sep 01 2015 10:09
rasakos sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 328 | @iashraful | http://www.freecodecamp.com/iashraful
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:09
That's how you will learn
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:09
@iashraful from my codepen???
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:09
@awesomeaniruddh I will :)
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:09
:)
Ashraful Islam
@iashraful
Sep 01 2015 10:09
@rasakos remove the autoplay part, otherwise the bell will ring when the page loads
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:10
I suggest that do the same bonfire again after like ~2-3 days
@AbiTyasTunggal
So that you don't remember my solution
Martyna
@kasyrm
Sep 01 2015 10:10
Hi everyone! I just got to quote machine and weather app exercises and both of them require getting data from api. Is it explained in any of the exercises on freecodecamp? Did I miss something? I can't find anything online that would explain it from the very beginning.
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:11
@kasyrm A lot of people seem to be having an issue with that
Costas Chaitas
@CostasChaitas
Sep 01 2015 10:11
@iashraful i dont have autoplay friend
Ashraful Islam
@iashraful
Sep 01 2015 10:11
the pen I got, it has <audio autoplay>
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:11
@kasyrm You can do the quote machine without an API....but yeah, the weather app does require an API
Ashraful Islam
@iashraful
Sep 01 2015 10:11
whose pen was it :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:11
@kasyrm you will need to use the $.getJSON function
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:12
Well....my sound is not working from what I have on Codepen
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:12
@TheHighPriestess What happened?
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:12
@awesomeaniruddh it never worked
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:12
Please post the code you're using to play the file
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:13
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:13
Just the code for the audio file please? :P
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:13
```
<audio><source src="http://picosong.com/cdn/171b86b662b12b5b5409637358ef18f3.mp3" type="audio/mpeg"></audio>

.addListener(function(unit, value, total) {
       var bellSound = $("source").attr("src");
       if (total == 0){
         //alert("Time is up");
         $(".timeisup").html("Time is up.");

         bellSound.play();
       }  
    });
Ashraful Islam
@iashraful
Sep 01 2015 10:14
ok, am looking at Ms.TheHighPriestess's codepen
Martyna
@kasyrm
Sep 01 2015 10:14
@TheHighPriestess @awesomeaniruddh thanks I will start looking from there
CamperBot
@camperbot
Sep 01 2015 10:14
kasyrm sends brownie points to @thehighpriestess and @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 218 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
:star: 325 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Ashraful Islam
@iashraful
Sep 01 2015 10:14
@TheHighPriestess oh no, you are not doing it right
you need to declare an audio
:D
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:14
declare an audio?
Ashraful Islam
@iashraful
Sep 01 2015 10:15
var bellSound = new Audio($("source").attr("src"));
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:15
oh...so that's what's missing
Ashraful Islam
@iashraful
Sep 01 2015 10:16
:D
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:16
@iashraful thanks
CamperBot
@camperbot
Sep 01 2015 10:16
thehighpriestess sends brownie points to @iashraful :sparkles: :thumbsup: :sparkles:
:star: 329 | @iashraful | http://www.freecodecamp.com/iashraful
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 10:16
so close...yet so far LOL
works now
anknits
@anknits
Sep 01 2015 10:21
Bonfire: Convert HTML Entities
CamperBot
@camperbot
Sep 01 2015 10:21

:fire:Bonfire: Convert HTML Entities :link:

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

convert('Dolce & Gabbana');

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

more info:  bf details | bf links | hint

adilogin15
@adilogin15
Sep 01 2015 10:21

I am jst trying to run basic angular layout in a html file in sublime text editor . Not able to get the required result , am I missing something? for example if I try out that example in angular layout options .

https://material.angularjs.org/latest/#/layout/options

http://codepen.io/anon/pen/medqoB

anknits
@anknits
Sep 01 2015 10:21
hint
CamperBot
@camperbot
Sep 01 2015 10:21
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:22
Hey @anknits
Please post your code here
wiki format
CamperBot
@camperbot
Sep 01 2015 10:22

: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

Aniruddh Agarwal
@anrddh
Sep 01 2015 10:22
Following that guide
And please close your issue on github
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:22
@awesomeaniruddh so basically what happens is it maps the array and goes to first subarray
adilogin15
@adilogin15
Sep 01 2015 10:22
hey anyone here?
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:22
finds biggest value
and the returns it, as largest and then goes to second sub array
again and again
anknits
@anknits
Sep 01 2015 10:23
function convert(str) {
  // &colon;&rpar;
  return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g,'&apos').replace(/"/g, '&quot;');
}
convert('Dolce & Gabbana');
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:24
Bingo @AbiTyasTunggal
anknits
@anknits
Sep 01 2015 10:24
@awesomeaniruddh here it is
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:24
The .map() function works just like a for loop
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:24
Ah!
Very cool, thank you so much!
CamperBot
@camperbot
Sep 01 2015 10:24
if you want to thank someone, put an @ before their name!
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:25
I wish it had that .map() hint
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:25
You will learn more about that later in the functional programming section
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:25
How was I supposed to solve without that haha!
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:25
Replace the map with a for loop!
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:25
@adilogin15 seems no one here available currently is able to answer your question. :point_up: September 1, 2015 3:51 PM
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:25
I see! Thank you @awesomeaniruddh :D
CamperBot
@camperbot
Sep 01 2015 10:25
abityastunggal sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:warning: abityastunggal already gave awesomeaniruddh points
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:25
@anknits regex is not my strong suit
Can someone help @anknits with his code?
adilogin15
@adilogin15
Sep 01 2015 10:26
too busy people here :smile:
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:26
@awesomeaniruddh what's the concerned regex?
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:26
```
function convert(str) {
  // &colon;&rpar;
  return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g,'&apos').replace(/"/g, '&quot;');
}
convert('Dolce & Gabbana');
```
@anknits You don't need multiple replace statements
You can wrap all the characters in square brackets
Okay, that wouldn't work
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:27
How long have you been using FCC @awesomeaniruddh
?
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:27
@anknits Read about String.prototype.replace in http://devdocs.io/#q=js+string+replace and read
explain regex
CamperBot
@camperbot
Sep 01 2015 10:27

:point_right: regex [wiki]

Links to useful RegEx resources.

See also: Regex Tutorials | Testing | Games | Blogs | Software

:pencil: read more about regex on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:28
@anknits :point_up: September 1, 2015 3:57 PM
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:28
@AbiTyasTunggal I've been here since July I believe
Abi Tyas Tunggal
@AbiTyasTunggal
Sep 01 2015 10:28
@awesomeaniruddh how many hours per day? and how quickly do you usually ask for help when you are stuck?
Sorry for all the questions I want to learn as best I can :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:29
@AbiTyasTunggal I usually do 2 hours a day on weekdays, upto 5 on weekends
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:29
@AbiTyasTunggal just start learning from http://freecodecamp.com/map
When you stuck, just ask.
anknits
@anknits
Sep 01 2015 10:29
@awesomeaniruddh others seem to be working. the only problem lies with the apostrophe
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:30
@anknits you might need to escape it with a \
anknits
@anknits
Sep 01 2015 10:30
tried that too
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:30
Agian, I haven't done regex in a while
anknits
@anknits
Sep 01 2015 10:30
tried a switch case too
same problem persists
mbeatrizmagalhaes
@mbeatrizmagalhaes
Sep 01 2015 10:30
Hi! I'm having a problem in the jquery unit, where I havo to: "The second element in each of your well elements should bounce"
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:30
@anknits apostrophe shouldn't be a prob. I wonder why.... doesn't need to be escaped
what's the test case?
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:30
@AbiTyasTunggal As for asking for help, I usually Google the heck out of my problem first
mbeatrizmagalhaes
@mbeatrizmagalhaes
Sep 01 2015 10:31
what I've done was $(".well:nth-child(2)").addClass("animated bounce");
but it doesn't pass the test case..
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:31
But that's because FCC is my first 'social programming' experience
anknits
@anknits
Sep 01 2015 10:31
"Shindler's List"
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:31
@mbeatrizmagalhaes nope! Re-read the instructions again!
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:31
So googling for solutions is hardcoded in my DNA :P
Folks here are pretty helpful though, especially kind souls like @dting and @SaintPeter
And of course, @abhisekp
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:32
@anknits doesn't seem to be a problem. https://regex101.com/r/mG4bC8/1
@awesomeaniruddh thanks for NOT marking me as "kind" :(
CamperBot
@camperbot
Sep 01 2015 10:33
abhisekp sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 326 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:33
You're most welcome :)
anknits
@anknits
Sep 01 2015 10:34
@abhisekp but it doesn't work in FCC challenge
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:35
@awesomeaniruddh i've noticed this prob. come up very often. Any clue how to re-write the instructions so that won't be a prob. I think it crops up as a prob. becoz of it's prev. challenge. :point_up: September 1, 2015 4:01 PM
@anknits whc bf?
anknits
@anknits
Sep 01 2015 10:36
Bonfire: Convert HTML Entities
CamperBot
@camperbot
Sep 01 2015 10:36

:fire:Bonfire: Convert HTML Entities :link:

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

convert('Dolce & Gabbana');

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

more info:  bf details | bf links | hint

Aniruddh Agarwal
@anrddh
Sep 01 2015 10:37
Rewriting the instructions = rewriting the description of the problem?
That's what I do for a living at FCC Github Issues
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:37
@awesomeaniruddh yep! :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:37
I think I had trouble with the nth-class waypoint too
Though I don't remember how I fixed it
it = my code (not the waypoint)
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:38
@awesomeaniruddh even after reading the instructions, ppl write it as .well:nth-child instead of .target:nth-child. One of the reason is bcoz of it's previous waypoint.
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:39
I think that's what I did
Why don't you open an issue for it, and I'll make a PR
Costas Chaitas
@CostasChaitas
Sep 01 2015 10:42
anybody can explain me how can i create the 'animation' which fills the circle while time is passing like this codepenhttp://codepen.io/GeoffStorbeck/pen/RPbGxZ
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:42
@awesomeaniruddh you can open both of them. :D
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:43
The only issue I have with fixing issues is that gulp takes forever
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:45
@awesomeaniruddh no. you don't need to test it. Just change the instructions in github interface itself.
anknits
@anknits
Sep 01 2015 10:46
wrt convert html entities I see that "Shindler's List" is the only test case in quotation marks, rest are enclosed by apostrophe. Can that be an issue?
@awesomeaniruddh @abhisekp
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:48
@abhisekp Already have a pending PR
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:48
@anknits no. That's not an issue.
@anknits btw, if you're writing multiple replace, then you can also write like this str.replace('&', '&amp;');
No regex needed
Aniruddh Agarwal
@anrddh
Sep 01 2015 10:50
I'll just open an issue
avatarhzh
@avatarhzh
Sep 01 2015 10:51
Hey guys, I'm having trouble with waypoint 21 for Javascript
Yusef Habib
@yhabib
Sep 01 2015 10:52
Hi!! I’ve working in the Zipline Random Quote Machine and after making it work with an array of quotes, I would like to make it work with the forismatic API
avatarhzh
@avatarhzh
Sep 01 2015 10:52
I type in this as my code and it's not working: myArray.push("dog",3);
Yusef Habib
@yhabib
Sep 01 2015 10:53
but till now I didn’t be able to make the correct query. http://codepen.io/yhabib/pen/KdKyjE
anknits
@anknits
Sep 01 2015 10:53
@abhisekp thanks. can you show me writing a replace containing 2 replacements? Do they occur in pair like: str.replace('&', '&', ''', ''');
CamperBot
@camperbot
Sep 01 2015 10:53
:bulb: to format code use backticks! ``` more info
anknits
@anknits
Sep 01 2015 10:54
@abhisekp thanks. can you show me writing a replace containing 2 replacements? Do they occur in pair like: str.replace('&', '&', ''', ''');
CamperBot
@camperbot
Sep 01 2015 10:54
:bulb: to format code use backticks! ``` more info
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:54
Emil Aasa
@emilaasa
Sep 01 2015 10:54
@avatarhzh paste your code
it should work
Yusef Habib
@yhabib
Sep 01 2015 10:56
anyone have a tip for me?
avatarhzh
@avatarhzh
Sep 01 2015 10:56
@emilaasa no it's not working the part with the red crosses on the side also has a lot of buggy text
This is what I'm getting as a message next to the red X: assert((function(d){if(d[2] != undefined && d[0] == 'John' && d[1] == 23 && d[2][0] == 'dog' && d[2][1] == 3 && d[2].length == 2){return true;}else{return false;}})(myArray), 'myArray should only have the first two values left(["John", 23, ["dog", 3]])');myArray should only have the first two values left(["John", 23, ["dog", 3]])
Andrew
@anjanjanj
Sep 01 2015 10:57
@yhabib you can use jQuery and JSONP https://learn.jquery.com/ajax/working-with-jsonp/
Abhisek Pattnaik
@abhisekp
Sep 01 2015 10:57
@yhabib yes. :dollar:
Emil Aasa
@emilaasa
Sep 01 2015 10:57
Can you paste your code?
avatarhzh
@avatarhzh
Sep 01 2015 10:58
hold on for a sec let me just read the markdown again
Emil Aasa
@emilaasa
Sep 01 2015 10:58
not the tester output but what you have in your window
avatarhzh
@avatarhzh
Sep 01 2015 10:59

'''
var ourArray = ["Stimpson", "J", ["cat"]];
ourArray.pop();
ourArray.push(["happy", "joy"]);
// ourArray now equals ["Stimpson", "J", ["happy", "joy"]]

var myArray = ["John", 23, ["cat", 2]];
myArray.pop();
//Add a ["dog", 3] to the end of myArray using push()
// Only change code below this line.
myArray.push("dog", 3);

// 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(z){return 'myArray = ' + JSON.stringify(z);})(myArray);
'''

CamperBot
@camperbot
Sep 01 2015 10:59
:bulb: to format code use backticks! ``` more info
Emil Aasa
@emilaasa
Sep 01 2015 10:59
//Add a ["dog", 3] to the end of myArray using push()
// Only change code below this line.
myArray.push("dog", 3);
that is your problem
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:00
@anknits Works fine in http://repl.it/BEo9
Emil Aasa
@emilaasa
Sep 01 2015 11:00
you need to add an array [“dog”, 3]
with push
not “dog”, 3
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:01
@abhisekp Opened the issue
Let's hope someone comes along and fixes it
Emil Aasa
@emilaasa
Sep 01 2015 11:02
Right now you are pushing a string and then an integer, and the solution that will make the test pass is pushing an array containing a string and an integer.
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:02
If not, I'll do it once my current PR is merged/declined
avatarhzh
@avatarhzh
Sep 01 2015 11:02
@emilaasa yea thanks it worked
CamperBot
@camperbot
Sep 01 2015 11:02
avatarhzh sends brownie points to @emilaasa :sparkles: :thumbsup: :sparkles:
:star: 275 | @emilaasa | http://www.freecodecamp.com/emilaasa
Emil Aasa
@emilaasa
Sep 01 2015 11:02
np!
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:04
@anknits Your secret soup. :coffee: http://repl.it/BEo9/1
@anknits Your secret soup v2 :coffee: http://repl.it/BEo9/2
anknits
@anknits
Sep 01 2015 11:10
@abhisekp thanks
CamperBot
@camperbot
Sep 01 2015 11:10
anknits sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 357 | @abhisekp | http://www.freecodecamp.com/abhisekp
anknits
@anknits
Sep 01 2015 11:10
it works everywhere else, it seems
function convert(str) {
  // &colon;&rpar;
  re = new RegExp('(&|<|>|"|\')', 'g');
  str = str.replace(re, function(match) {
    switch (match) {
      case '&':
        return '&amp;';
      case '<':
        return '&lt;';
      case '>':
        return '&gt;';
      case '"':
        return '&quot;';
      case '\'':
        return '&apos;';
    }
  });

  return str;
}

convert('Dolce & Gabbana');
this was not working on FCC earlier. however it is working now.
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:11
Great!
Yusef Habib
@yhabib
Sep 01 2015 11:12
@anjanjanj thanks I will check it! nervethless my initial idea was to request for the html directly!
CamperBot
@camperbot
Sep 01 2015 11:12
yhabib sends brownie points to @anjanjanj :sparkles: :thumbsup: :sparkles:
:star: 229 | @anjanjanj | http://www.freecodecamp.com/anjanjanj
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:19
@anknits nice :+1: :point_up: September 1, 2015 4:40 PM
anknits
@anknits
Sep 01 2015 11:22
well thanks to you @abhisekp and @awesomeaniruddh
CamperBot
@camperbot
Sep 01 2015 11:22
anknits sends brownie points to @abhisekp and @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:warning: anknits already gave abhisekp points
:star: 328 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:22
Well I didn't help you, but ain't complaining :P
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 11:22
ok....the link to the mp3 file that I was using for my sound no longer works :(
it's no longer there
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:23
@anknits you can replace re = new RegExp('(&|<|>|"|\')', 'g'); with re = /[&<>"']/g
@TheHighPriestess lolz :D
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 11:24
this is ridiculous....where can I upload this file so that I can get a link wth a .mp3 ending?
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:24
@TheHighPriestess soundcloud any good?
I don't soundcloud allows linking to the mp3 directly
You'll have to use their audio player
I think
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:25
@awesomeaniruddh what if bandwidth gets out of control? Will I be charged?
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:25
AWS is only free for an year
I don't know about any bandwith issues
never used it
:P
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:26
@awesomeaniruddh that's a concern though! :P
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:26
They have 15 gigs of bandwith
I don't know if that's a lot, you decide
This message was deleted
This message was deleted
Either I am not typing know properly, or gitter just hates me
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:27
gitter hex u
Costas Chaitas
@CostasChaitas
Sep 01 2015 11:27
can anybody help me with the pomodoro clockhttp://codepen.io/rasakos/pen/XmWXpj
when the break time ends the app has a bug
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:27
@rasakos Lol, still having issues?
Costas Chaitas
@CostasChaitas
Sep 01 2015 11:27
cant figure it out
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:28
What's the bug?
Costas Chaitas
@CostasChaitas
Sep 01 2015 11:28
yes man i think this is the last issue
when the session time finhsh ,it runs the break time
when the break time finhs
normally it shall run the session time again
but it doesnt
:(
Stefano
@Stedelie
Sep 01 2015 11:38
Hi everyone, i'm haveing some trouble figuring out the make a person bonfire, is this the right place to ask for help?
Elizabeth Hatleli
@TheHighPriestess
Sep 01 2015 11:38
ok...for uploading files and getting direct links use kiwi6.com
Costas Chaitas
@CostasChaitas
Sep 01 2015 11:38
@awesomeaniruddh can u help ?
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:39
@rasakos I'm not very experienced with this stuff
I'm sorry, but I can't really help you with this
Costas Chaitas
@CostasChaitas
Sep 01 2015 11:40
ok mate
Spencer
@ThamKinJuhn
Sep 01 2015 11:43

Hey all,

Are their right and wrong ways of solving these bonfires? I've just started, but I'm feeling a little lost. If I spend enough time googling around there always seems to be a perfect method for solving a bonfire, however I'm able to solve it with simpler methods I've learned from the previous lessons. Should google around for the "most optimal" solution, or just write some code which works but isn't very elegant?

Example:
Bonfire: Return Largest Numbers in Arrays

function largestOfFour(arr) {
  var firstArray = [];
  var secondArray = [];
  var thirdArray = [];
  var fourthArray = [];
  var largestArray = [];
  firstArray = arr[0].sort(function(a, b){return b-a});;
  secondArray = arr[1].sort(function(a, b){return b-a});;
  thirdArray = arr[2].sort(function(a, b){return b-a});;
  fourthArray = arr[3].sort(function(a, b){return b-a});;
  largestArray.push(firstArray[0], secondArray[0], thirdArray[0], fourthArray[0]);
  return largestArray;
}

or

function largestOfFour(arr) {
  var largestArr = [];
  for (i=0;i<4;i++) {
    largestArr[i] = Math.max.apply( Math, arr[i]);
  }
  return largestArr;

Thanks for your time! =)

CamperBot
@camperbot
Sep 01 2015 11:43
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:44
@ThamKinJuhn Write your own code first
Once you have working code, you can Google for the more elegant solutions
There are no right or wrong solutions (the wrong ones are those that don't work)
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:44
@ThamKinJuhn One answer for you.
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:44
There however are better solutions
Some solutions have better readability (i.e. not using obscure functions or syntax)
Others have better optimisation (i.e. using the least processing time and power possible)
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:45
@ThamKinJuhn RTFM and Write your own code as @awesomeaniruddh says. :point_up: September 1, 2015 5:14 PM
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:45
Your goal is to achieve a balance.
Though of course, don't spend too much time on this because you are a beginner.
Spencer
@ThamKinJuhn
Sep 01 2015 11:46
@awesomeaniruddh @abhisekp Alright. Thanks for the information! since I'm new to coding I know that sometimes code is considered "better" than others, but its hard for me to know how just yet.
CamperBot
@camperbot
Sep 01 2015 11:46
thamkinjuhn sends brownie points to @awesomeaniruddh and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 359 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 329 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:46
Check out the Code Review chat room
Spencer
@ThamKinJuhn
Sep 01 2015 11:46
I'll focus on just writing stuff without looking up so much stuff. Thanks again =)
CamperBot
@camperbot
Sep 01 2015 11:46
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:46
You can post your code there to be reviewd
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:47
@ThamKinJuhn if you wanna lookup, then lookup in http://devdocs.io/#q=js
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:47
And get feedback on improvements that can be made
Spencer
@ThamKinJuhn
Sep 01 2015 11:47
Nice! Thanks for the link!
CamperBot
@camperbot
Sep 01 2015 11:47
if you want to thank someone, put an @ before their name!
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:47
And of course DevDocs, but I don't see it being that useful for a beginner
Spencer
@ThamKinJuhn
Sep 01 2015 11:48
Lol once I get a bit further into this then I'll look up what DevDocs is then ;)
Spatz
@Spatzerny
Sep 01 2015 11:50
@awesomeaniruddh WHY DIDNT ANYBODY SHOW ME THIS EARLIER!?
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:50
@awesomeaniruddh not being that useful for beginners?
Then how will they learn about methods with an easily searchable medium?
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:51
@abhisekp As an experienced dev, you already know what filter works
But perhaps you don't remember the syntax
In that case DevDocs is useful
Alistair Walsh
@alistairwalsh
Sep 01 2015 11:51
<style>h2{color: red;}</style> doesn't work, is this a known bug?
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:51
@awesomeaniruddh but the FCC teaches what methods to use... in the first place.
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:51
But as a beginner, you have no idea what filter is in the first place
@alistairwalsh I think I've seen a couple of issues on github regarding that?
Not sure
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:52
@alistairwalsh whc waypoint?
Alistair Walsh
@alistairwalsh
Sep 01 2015 11:52
[9] is that what you mean?
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:52
@alistairwalsh type waypoint <waypoint name>
Alistair Walsh
@alistairwalsh
Sep 01 2015 11:53
type it where?
waypoint <waypoint name>
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:53
waypoint jquery
explain waypoint jquery
CamperBot
@camperbot
Sep 01 2015 11:53
no wiki entry for: waypoint jquery
:pencil: click here to create one now!after creating your page type update to reload it here
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:53
explain waypoint html
CamperBot
@camperbot
Sep 01 2015 11:53
no wiki entry for: waypoint html
:pencil: click here to create one now!after creating your page type update to reload it here
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:54
find waypoint
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:54
@alistairwalsh whc one? :point_up: September 1, 2015 5:24 PM
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:54
find waypoint jquery
CamperBot
@camperbot
Sep 01 2015 11:54
find waypoint jquery
nothing found
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:54
clear
Damn, I thought it was a terminal :P
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:54
lolz :D
@awesomeaniruddh try pressing Ctrl+L :P
Aniruddh Agarwal
@anrddh
Sep 01 2015 11:55
Yeah typing clear there would work I guess
:P
lauratalaat
@lauratalaat
Sep 01 2015 11:56
Hi. Can anyone help me with this?
Alistair Walsh
@alistairwalsh
Sep 01 2015 11:56
waypoint-use-css-selectors-to-style-elements
Abhisek Pattnaik
@abhisekp
Sep 01 2015 11:58
explain waypoint use css
CamperBot
@camperbot
Sep 01 2015 11:58

:point_right: waypoint use css selectors to style elements [wiki]

Instead of giving style attributes one by one, we can do this to multiple elements at the same time.

You can create a style element like this: <style></style>.

Inside that style element, you can create a CSS selector for any HTML Elements. For example, if you wanted all h2 elements to be red, your style element would look like this: <style>h2 {color: red;}</style>.

Note that it's important to have both opening and closing curly braces ({ and }) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of your element's styles.
:pencil: read more about waypoint use css selectors to style elements on the FCC Wiki

Stein Gee
@Stiino0
Sep 01 2015 12:10
@lauratalaat what you got so far? Care to link your code? Three backticks ``` press enter to enter the code tags and paste your code ,then Ctrl + Enter
Randy MacLeod
@pumpjack62
Sep 01 2015 12:24
Hi folks, I just didi
lauratalaat
@lauratalaat
Sep 01 2015 12:25
@Stiino0 i don't know how to delete punctuation, case, and spacing.
Randy MacLeod
@pumpjack62
Sep 01 2015 12:26
oops, I just did 40 code challenges on my iphone over my inactive nightshift, but they did not showas completed and now I have to do them all over on my home computer
Stein Gee
@Stiino0
Sep 01 2015 12:26
Do code challenges work on iphone???
Hey @lauratalaat hint: try to use regular expressions
Normally you've learned that before you did the bonfires
Randy MacLeod
@pumpjack62
Sep 01 2015 12:28
yes, they go from the red x's to green checks when you get them right, but the submit and other buttons dont work, I had to refresh the page to see the check marks
and my total never changed, even as the completed challenges mounted
Shandeel
@Shandeel
Sep 01 2015 12:30
guys
i am stuck in the waypoint
changing the font and size of an element
i cannot figure out how to change the size of 2 of my paragraphs
any help?
Shandeel
@Shandeel
Sep 01 2015 12:36
nevermind , got it
Vulle
@Vulle
Sep 01 2015 12:38
@Shandeel in the css file: p { font-size: 16px; }
or in the <style>
p {
font-size: 15px;
}
</style>
Ok =)
sofiane97
@sofiane97
Sep 01 2015 12:44
hi guys
how to Make Dead Links using the Hash Symbol
Ahmed Elsersy
@sersy
Sep 01 2015 12:45
Bonfire: Factorialize a Number
Ridhima Gupta
@ridzgupta26
Sep 01 2015 12:50
I am struck in the Bonfire: Find the longest word in the string problem. I saw other solutions as well, but not able to understand what is wrong with my code.
var code ="formatted";
function findLongestWord(str) {
  var split = str.split(" ");
  var i;

  for (var i=0;i<split.length;i++){
         var length = [];
         length.push(split[i].length);
          return length.max();
      }
    }
findLongestWord('The quick brown fox jumped over the lazy dog');
Roy
@CruelCoin
Sep 01 2015 12:51
@ridzgupta26 Put your code in between these: ```. Above and below your code
Stein Gee
@Stiino0
Sep 01 2015 12:52

Doesn't it need to be on a new chat message?

var x = 0;

Apparently not, use Shift +Enter to go to a new line!

Roy
@CruelCoin
Sep 01 2015 12:53
function findLongestWord(str) {
var split = str.split(" ");
var i;
for (var i=0;i<split.length;i++){
var length = [];
length.push(split[i].length);
return length.max();
}
}
for me: (i prefer over and under)
```
function findLongestWord(str) {
var split = str.split(" ");
var i;
for (var i=0;i<split.length;i++){
var length = [];
length.push(split[i].length);
return length.max();
}
}
Stein Gee
@Stiino0
Sep 01 2015 12:53
pparently not, use Shift +Enter to go to a new line!
Thx @CruelCoin I didn't know shift enter. Now I do :)
CamperBot
@camperbot
Sep 01 2015 12:54
stiino0 sends brownie points to @cruelcoin :sparkles: :thumbsup: :sparkles:
:star: 150 | @cruelcoin | http://www.freecodecamp.com/cruelcoin
Roy
@CruelCoin
Sep 01 2015 12:54
function findLongestWord(str)
{
var split = str.split(" ");
var i;
for (var i=0;i<split.length;i++)
{
var length = [];
length.push(split[i].length);
return length.max();
}
}
@ridzgupta26 You need to define your length array outside of your loop.
Ridhima Gupta
@ridzgupta26
Sep 01 2015 12:55
@CruelCoin Finally got how to format that code here! Thanks!
CamperBot
@camperbot
Sep 01 2015 12:55
ridzgupta26 sends brownie points to @cruelcoin :sparkles: :thumbsup: :sparkles:
:star: 151 | @cruelcoin | http://www.freecodecamp.com/cruelcoin