These are chat archives for FreeCodeCamp/Help

11th
Oct 2015
Juan Riquelme
@soulchainer
Oct 11 2015 00:02

@Charzoe Your portfolio looks stunning :D. But you want to remove this:

<html>

<head>
  <link href='https://fonts.googleapis.com/css?family=Lato:400,100,900,400italic,700,300italic,300&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>Charzoë's Portfolio</title>
</head>
<body>
...
</body>

From your HTML window. And put all the things about head (meta and title) in Settings → HTML tab → Stuff for <head>. And the css fonts in the CSS tab, giving only the url.
It's the way codepen (and other similar pages) work. You only need to give in that the code inside the <body> tag.
Because of that error, when you visit your codepen from a tablet or any other mobile device, the letters are so tiiiiiiny (because you didn't put the meta viewport tag in the correct place).

Gilbert Smith
@GJSmith3rd
Oct 11 2015 00:08
Anynoe know if there's a way to block comment in the FCC code editor?
Rex Schrader
@SaintPeter
Oct 11 2015 00:08
@Shifthawke huhwha?
Chris
@Shifthawke
Oct 11 2015 00:08
main chat
Use your prescence and tell them to drop it
Rodrigo
@Rpessoa
Oct 11 2015 00:09
Anyone has any suggestion how to start: Zipline: Build a Pomodoro Clock? should I look for a special JS library?
noobstar
@namsir
Oct 11 2015 00:09
@Rpessoa i just about to work on that zipline.
Gilbert Smith
@GJSmith3rd
Oct 11 2015 00:10
I just started that one. No progress yet but I'm gonna try to use d3.js, bootstrap and js workers.
noobstar
@namsir
Oct 11 2015 00:10
@Rpessoa i think jQuery should be good enough for that.
Chris
@Shifthawke
Oct 11 2015 00:10
@namsir I thought the nemo pic was funny btw.
Gilbert Smith
@GJSmith3rd
Oct 11 2015 00:11
@SaintPeter - know anyway to block comment in the FCC editor?
noobstar
@namsir
Oct 11 2015 00:11
@Shifthawke lol i just tried to make everybody laugh to calm down the arguments.
Rodrigo
@Rpessoa
Oct 11 2015 00:11
@namsir @GJSmith3rd thanks guys. d3.js I never looked into it. So will start with JQuery.
CamperBot
@camperbot
Oct 11 2015 00:11
rpessoa sends brownie points to @namsir and @gjsmith3rd :sparkles: :thumbsup: :sparkles:
:star: 331 | @gjsmith3rd | http://www.freecodecamp.com/gjsmith3rd
:star: 221 | @namsir | http://www.freecodecamp.com/namsir
noobstar
@namsir
Oct 11 2015 00:11
it was getting hot.
Hans van Riet
@hansinla
Oct 11 2015 00:11
@Rpessoa It can be done in plain JS. I used angular, but just as an excuse to play with it.
noobstar
@namsir
Oct 11 2015 00:12
@hansinla angular ui or just plain old angular?
Rodrigo
@Rpessoa
Oct 11 2015 00:12
hansinla, Angular is still an unexplored territory for me. :)
noobstar
@namsir
Oct 11 2015 00:13
@Rpessoa you will get there soon :)
Chris
@Shifthawke
Oct 11 2015 00:13
@namsir Yeah I know. I tried too. It was getting bad. I appreciate it, truly. But wanted to avoid any offense. Like that guy said right after me.
noobstar
@namsir
Oct 11 2015 00:14
@Shifthawke yeah i deleted it lol
Rex Schrader
@SaintPeter
Oct 11 2015 00:14
@GJSmith3rd Like so:
/*  I am a block Comment */
Gilbert Smith
@GJSmith3rd
Oct 11 2015 00:15
doh! Thanks @SaintPeter
CamperBot
@camperbot
Oct 11 2015 00:15
gjsmith3rd sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 968 | @saintpeter | http://www.freecodecamp.com/saintpeter
noobstar
@namsir
Oct 11 2015 00:17
watching some d3 tuts on youtube.
Kevin Diem
@kgdiem
Oct 11 2015 00:18
Anyone know why my Map The Debris bonfire isn't working?
function orbitalPeriod(arr) {
  var GM = 398600.4418;
  var earthRadius = 6367.4447;
  var twoPi = 2 * Math.PI;
  var a = arr[0].avgAlt + earthRadius;
  var root =  Math.pow(a,3) / GM;
  var sqrt = Math.sqrt(root);
  var c = Math.round(twoPi * sqrt);
  var ans = [{name: arr[0].name, orbitalPeriod: c}];

  return ans;
}

orbitalPeriod([{name : "moon", avgAlt : 378632.553}]);
it returns everything asked
i.e. identical to the tests
Herman Fassett
@HermanFassett
Oct 11 2015 00:21
Your last test doesn't
Kevin Diem
@kgdiem
Oct 11 2015 00:21
It seems to
Herman Fassett
@HermanFassett
Oct 11 2015 00:21
You're doing arr[0]
But you need to loop through all elements in the array for the second test
Kevin Diem
@kgdiem
Oct 11 2015 00:22
Oh, I read the test wrong. thanks @HermanFassett
CamperBot
@camperbot
Oct 11 2015 00:22
kgdiem sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 351 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 11 2015 00:22
Yep
Kevin Diem
@kgdiem
Oct 11 2015 00:22
I thought it was too easy lmao
Herman Fassett
@HermanFassett
Oct 11 2015 00:22
:)
Kevin Diem
@kgdiem
Oct 11 2015 00:26
@HermanFassett simple question about pairwise bonfire, are you summing the index of the values?
Herman Fassett
@HermanFassett
Oct 11 2015 00:27
It's not that simple I don't think
Kevin Diem
@kgdiem
Oct 11 2015 00:28
I mean what you return,
For example, pairwise([1, 4, 2, 3, 0, 5], 7) should return 11 because 4, 2, 3 and 5 can be paired with each other to equal 7.
I just don't understand why you return 11?
4 + 7 = 11?
Herman Fassett
@HermanFassett
Oct 11 2015 00:29
You're summing the indicies
4 is at index 1
2 is at index 2
3 at 3, 5 at 5, 5+3+2+1 = 11
So I guess your original question was right :)
Kevin Diem
@kgdiem
Oct 11 2015 00:30
Okay thanks lol
CamperBot
@camperbot
Oct 11 2015 00:30
if you want to thank someone, put an @ before their name!
Hans van Riet
@hansinla
Oct 11 2015 00:30
@namsir plain old
noobstar
@namsir
Oct 11 2015 00:35
@hansinla huh
Clayton
@cjg040103
Oct 11 2015 00:57
Anybody know what I need to do to fix this? I'm on the mutations bonfire.
function mutation(arr) {
  var a = arr[1];
  var b = arr[2];
  var c = a.split('');
  var d = b.split('');
  for(var i = 0; i < c.length(); i++) {
    var e = c.indexOf(d [0]);

  }


mutation(["hello", "hey"], "");
Aleksandar B.
@aleksandar-b
Oct 11 2015 01:06
@cjg040103 you need d.length not c. and in loop return false if c.indexOf(d [i] ) is -1, if I am not mistaking(don't remember).Outside return true.
Puiyee Tong
@pytong
Oct 11 2015 01:11
@cjg040103 It helps to name your variable in a more meaningful way. It can make the debugging process faster.
Alex
@wishe
Oct 11 2015 01:12
why length() do you need the parantheses?
Matt Yamamoto
@MattYamamoto
Oct 11 2015 01:14
@cjg040103 in addition to what's been mentioned, your for loop is only checking the first string's characters (your c var) against the first character of the second string ( d[0] ). You need to see if all of the second strings letters are present in the first string.
VeeShostak
@VeeShostak
Oct 11 2015 01:21
did you mean to type c.indexOf(d [i] ); (to go through each letter)
also c.length without parentheses
in addition, Hint: as it goes through each letter it will return the index if the letter exists. if not it returns a -1. so you can check for that accordingly
Clayton
@cjg040103
Oct 11 2015 01:22
@samosale thanks. I'll try that.
CamperBot
@camperbot
Oct 11 2015 01:22
cjg040103 sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 316 | @samosale | http://www.freecodecamp.com/samosale
Kevin Diem
@kgdiem
Oct 11 2015 01:23
working on the validate phone number bonfire, why isn't this a valid # 6505552368 ? I'm not sure how you could differentiate it from 555555555
Matt Yamamoto
@MattYamamoto
Oct 11 2015 01:23
@cjg040103 @VeeShostak thei variable is dependent on the lenght of the first string, so c.indexOf(d[i]) would not work properly if the second string was longer than the first
Coira Ellison
@Coira
Oct 11 2015 01:24
@kgdiem this is the one right? telephoneCheck("(6505552368)") it's because of the brackets
Kevin Diem
@kgdiem
Oct 11 2015 01:25
@Coira ahh, thanks
CamperBot
@camperbot
Oct 11 2015 01:25
kgdiem sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 270 | @coira | http://www.freecodecamp.com/coira
Matt Yamamoto
@MattYamamoto
Oct 11 2015 01:25
@kgdiem and just to be sure, your second number there isn't valid as it's only 9 characters long
Clayton
@cjg040103
Oct 11 2015 01:25
here is what I have now:
function mutation(arr) {
  var a = arr[1].toUpperCase();
  var b = arr[2].toUpperCase();
  var c = a.split('');
  var d = b.split('');
  for(var i = 0; i < d.length(); i++) {
    var e = c.indexOf(d [i]);
    if(e = -1) {
      return false;
    } else {
      return true;
    }
  }


mutation(["hello", "hey"], "");
Rex Schrader
@SaintPeter
Oct 11 2015 01:26
@cjg040103 ok, you are really close, but you've got a bit of a logical error there. The thing is that the conditions where you return true are not the opposite of returning false.
@cjg040103 You need to think about when you can return true.
Clayton
@cjg040103
Oct 11 2015 01:27
?
Rex Schrader
@SaintPeter
Oct 11 2015 01:27
@cjg040103 Well, what happens if the letter is found?
Kevin Diem
@kgdiem
Oct 11 2015 01:27
@MattYamamoto I just typed in 5, I meant for there to be 10 lol :p
Matt Yamamoto
@MattYamamoto
Oct 11 2015 01:27
@cjg040103 also, are your a and b vars defined correctly? Arrays are zero indexed.
Clayton
@cjg040103
Oct 11 2015 01:28
Then if all other letters are found in the word then return true.
Rex Schrader
@SaintPeter
Oct 11 2015 01:28
@cjg040103 Essentially, what happens if e > -1? Do you want to exit the function?
Clayton
@cjg040103
Oct 11 2015 01:28
@MattYamamoto good catch.
@SaintPeter no?
Rex Schrader
@SaintPeter
Oct 11 2015 01:28
@cjg040103 Right! But right now, the very first letter that is found, one way or another, your function will exit/return
Daniel Robinson
@danielrob
Oct 11 2015 01:28
Is it just me or does the Zipline: Build a Personal Portfolio example sites parallax work extremely badly in Chrome? I'm running Version 45.0.2454.101 (64-bit) on OSX.
Rex Schrader
@SaintPeter
Oct 11 2015 01:29
@cjg040103 Correct :D
Clayton
@cjg040103
Oct 11 2015 01:29
@SaintPeter so how do i fix it. im confuzzled.
:confused:
@danielrob don't know.
Rex Schrader
@SaintPeter
Oct 11 2015 01:29
@cjg040103 Remove the return truefrom your if statement. Figure out where it actually needs to go :D
SaintPeter @SaintPeter totally knows, but it not telling, because it's an important learning experience.
Rex Schrader
@SaintPeter
Oct 11 2015 01:30
@cjg040103 Talk through it - what conditions need to be fulfilled before you can return true?
Matt Yamamoto
@MattYamamoto
Oct 11 2015 01:31
@danielrob it's not a parallax effect (the background doesn't scroll at all), that being said, it works fine for me (same version chrome on windows)
Clayton
@cjg040103
Oct 11 2015 01:33
@SaintPeter here is what i gots now
function mutation(arr) {
  var a = arr[0].toUpperCase();
  var b = arr[1].toUpperCase();
  var c = a.split('');
  var d = b.split('');
  for(var i = 0; i < d.length(); i++) {
    var e = c.indexOf(d [i]);
    if(e = -1) {
      return false;
    } else if (e = b.length) {
      return true;
    } else {

    }
  }
}
mutation(["hello", "hey"], "");
i no knows what to put inside the else
Javed
@JayBee007
Oct 11 2015 01:34
hello fellow coders, I am trying to work through the zipline: random quote generator..but when I make an AJAX call to the website "forismatic" I get the following error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8080' is therefore not allowed access.
Clayton
@cjg040103
Oct 11 2015 01:34
@SaintPeter this is confusing, but i am closer then i ever have been!
Rex Schrader
@SaintPeter
Oct 11 2015 01:34
@cjg040103 You are very close
@cjg040103 Don't look at your code
noobstar
@namsir
Oct 11 2015 01:34
bonfire sorted union
CamperBot
@camperbot
Oct 11 2015 01:34

:fire:Bonfire: Sorted Union :link:

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

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

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

more info:  bf details | bf links | hint

Clayton
@cjg040103
Oct 11 2015 01:34
This message was deleted
noobstar
@namsir
Oct 11 2015 01:34
hint
CamperBot
@camperbot
Oct 11 2015 01:34
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Clayton
@cjg040103
Oct 11 2015 01:35
? @SaintPeter
noobstar
@namsir
Oct 11 2015 01:35
did anyone finish this bonfire?
Rex Schrader
@SaintPeter
Oct 11 2015 01:35
@cjg040103 Talk me through it - when can we return false? When can we return true? We're looping through, when is it ok to return true?
noobstar
@namsir
Oct 11 2015 01:36
just wonder if the params are dynamic or static 3 params.
Clayton
@cjg040103
Oct 11 2015 01:36
  1. when arr1 does not have all characters in arr[0] 2. when all characters in arr1 appear in arr[0] 3. #2
Rex Schrader
@SaintPeter
Oct 11 2015 01:37
@cjg040103 ok, so when you say "all", where in your code can you be 100% sure that it will be "all"?
Clayton
@cjg040103
Oct 11 2015 01:37
i dunno
ummm...
noobstar
@namsir
Oct 11 2015 01:38
bonefire mutation
Rex Schrader
@SaintPeter
Oct 11 2015 01:38
@cjg040103 If you're half way through the loop can you ever return true?
Clayton
@cjg040103
Oct 11 2015 01:38
the for loop
noobstar
@namsir
Oct 11 2015 01:38
bonfire mutation
CamperBot
@camperbot
Oct 11 2015 01:38

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

mutation(['hello', 'hey']);

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

Rex Schrader
@SaintPeter
Oct 11 2015 01:38
@cjg040103 What about 3/4 of the way through?
Clayton
@cjg040103
Oct 11 2015 01:38
@SaintPeter no.
Rex Schrader
@SaintPeter
Oct 11 2015 01:38
@cjg040103 Maybe, more to the point . . can you EVER return true from inside the loop?
Clayton
@cjg040103
Oct 11 2015 01:38
no?
Rex Schrader
@SaintPeter
Oct 11 2015 01:39
@cjg040103 Asking me or telling me? :D
Clayton
@cjg040103
Oct 11 2015 01:39
no.
Jose E. Pimentel
@jedpimentel
Oct 11 2015 01:39
have you tried it yet?
Rex Schrader
@SaintPeter
Oct 11 2015 01:39
@cjg040103 ok. So. Get that return true out of that loop. Where does it go?
noobstar
@namsir
Oct 11 2015 01:39
the mutation?
Clayton
@cjg040103
Oct 11 2015 01:39
inside the if/then statement.
Rex Schrader
@SaintPeter
Oct 11 2015 01:40
@cjg040103 Is the if statement inside the loop?
Clayton
@cjg040103
Oct 11 2015 01:40
WAIT I see what ur saying
Jose E. Pimentel
@jedpimentel
Oct 11 2015 01:40
This message was deleted
Clayton
@cjg040103
Oct 11 2015 01:40
i need the if/then outside the loop!
Rex Schrader
@SaintPeter
Oct 11 2015 01:40
@cjg040103 Nope
Clayton
@cjg040103
Oct 11 2015 01:41
@SaintPeter :(
doh.
Rex Schrader
@SaintPeter
Oct 11 2015 01:41
@cjg040103 Because what happens when you find a letter that's not in the other array? As soon as you find one that is missing, you can immediatly return false, right?
@cjg040103 Because it can't get any more false than false
Clayton
@cjg040103
Oct 11 2015 01:41
?
noobstar
@namsir
Oct 11 2015 01:41
@cjg040103 your if statement was wrong, you didn't use the comparison operator.
Rex Schrader
@SaintPeter
Oct 11 2015 01:41
@cjg040103 But to return true, we have to make sure that everything is found
Clayton
@cjg040103
Oct 11 2015 01:41
@namsir :)
noobstar
@namsir
Oct 11 2015 01:42
yeah, as soon as you found 1 letter with no match...return false and end :)
BOOM...headshot.
Rex Schrader
@SaintPeter
Oct 11 2015 01:43
@cjg040103 Like @namsir says :D - but in order to return true, we have to be done with the loop
Clayton
@cjg040103
Oct 11 2015 01:44
so how do i finish the loop?
thats whats been bothering me since I started
Rex Schrader
@SaintPeter
Oct 11 2015 01:44
@cjg040103 It'll finish all on its own.
@cjg040103 Basically, as soon as i < d.length is no longer true it'll stop
@cjg040103 So then you're after the closing curly brace at the end of the for loop
noobstar
@namsir
Oct 11 2015 01:46
your if then could be as simple as if found return true else return false.
Rex Schrader
@SaintPeter
Oct 11 2015 01:47
@namsir Nope, that's wrong for this one
VeeShostak
@VeeShostak
Oct 11 2015 01:49
Would this be bad practice then: break once false.
or use i = d.length to break in the if statement that returns false
noobstar
@namsir
Oct 11 2015 01:50
bf detail
CamperBot
@camperbot
Oct 11 2015 01:50
Sorry, can't find a bonfire called detail. [ Check the map? ]
Clayton
@cjg040103
Oct 11 2015 01:50
@SaintPeter Look, you've been really helpful lately and I thank you so much, but I need to go and I will see you later. Thank you so much!
CamperBot
@camperbot
Oct 11 2015 01:50
cjg040103 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 972 | @saintpeter | http://www.freecodecamp.com/saintpeter
noobstar
@namsir
Oct 11 2015 01:50
ok my turn lol
Rex Schrader
@SaintPeter
Oct 11 2015 01:50
@cjg040103 ok, sorry I wasn't able to walk you trough it
noobstar
@namsir
Oct 11 2015 01:50
hi SaintPeter.
Rex Schrader
@SaintPeter
Oct 11 2015 01:50
@cjg040103 Lemme annotate
@cjg040103
function mutation(arr) {
  var a = arr[0].toUpperCase();
  var b = arr[1].toUpperCase();
  var c = a.split('');
  var d = b.split('');
  for(var i = 0; i < d.length(); i++) {
    var e = c.indexOf(d [i]);
    if(e = -1) {
      return false;
    } /* else if (e = b.length) {   // CAn't use all this
      return true;
    } else {

    }*/ 
  }
  // Now we are certain that we don't have any missing letters
  return true;
}
mutation(["hello", "hey"], "");
Stefan Stokic
@StefanStokic
Oct 11 2015 01:51
http://codepen.io/KingInTheNorth/pen/EVvxLR can someone tell me what is wrong with my JS? It's simple stuff..
noobstar
@namsir
Oct 11 2015 01:52
@KingInTheNorth you listed the wrong function name?
('#submittweet').on('click', tweeter);
i would nest that function in the second param as an anonymous function.
Stefan Stokic
@StefanStokic
Oct 11 2015 01:54
what do you mean - and yeah, i need to et better at checking for typos
Matt Yamamoto
@MattYamamoto
Oct 11 2015 01:54
@KingInTheNorth you're also missing a $. $('#submittweet')
noobstar
@namsir
Oct 11 2015 01:54
lol yeah the $ too
$('#submittweet').on('click', function(){
    var tweettext = $('#tweet').val();
    $("#tweetbody").val(tweettext);
});
bonfire sorted union
CamperBot
@camperbot
Oct 11 2015 01:56

:fire:Bonfire: Sorted Union :link:

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

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

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

more info:  bf details | bf links | hint

noobstar
@namsir
Oct 11 2015 01:56
bf details
CamperBot
@camperbot
Oct 11 2015 01:56

:fire:Bonfire: Sorted Union :link:

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

unite([1, 2, 3], [5, 2, 1, 4], [2, 1]);
Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.
In other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.
The unique numbers should be sorted by their original order, but the final array should not be sorted in numerical order.
Check the assertion tests for examples.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
noobstar
@namsir
Oct 11 2015 01:58
are they asking for dynamic arguments?
Stefan Stokic
@StefanStokic
Oct 11 2015 01:58
@namsir Does thi look right? http://codepen.io/KingInTheNorth/pen/EVvxLR
noobstar
@namsir
Oct 11 2015 01:59
@KingInTheNorth it's even worst.....check out mine.
Matt Yamamoto
@MattYamamoto
Oct 11 2015 02:00
@KingInTheNorth he means that you don't need the outer twitter function
noobstar
@namsir
Oct 11 2015 02:00
@KingInTheNorth which challenge are you working on?
Stefan Stokic
@StefanStokic
Oct 11 2015 02:01
@namsir side project
:|
noobstar
@namsir
Oct 11 2015 02:01
@KingInTheNorth scroll up and see my code for you.
@KingInTheNorth
```
$('#submittweet').on('click', function(){
    var tweettext = $('#tweet').val();
    $("#tweetbody").val(tweettext);
});
```
Stefan Stokic
@StefanStokic
Oct 11 2015 02:02
Yeah, i realize what you did now
yeah
Sure @namsir Using your code... http://codepen.io/KingInTheNorth/pen/EVvxLR
noobstar
@namsir
Oct 11 2015 02:05
change $("#tweetbody").val(tweettext); to $("#tweetbody").text(tweettext);
Stefan Stokic
@StefanStokic
Oct 11 2015 02:05
Mind explaining the difference between val and text/
noobstar
@namsir
Oct 11 2015 02:05
@KingInTheNorth hold on....change your div to P
Stefan Stokic
@StefanStokic
Oct 11 2015 02:05
?
noobstar
@namsir
Oct 11 2015 02:06
you can't set text inside div
div is empty container that doesn't hold your literal texts.
either change div to p or add p inside your div.
Stefan Stokic
@StefanStokic
Oct 11 2015 02:12
Got it
noobstar
@namsir
Oct 11 2015 02:12
cool :)
Robert Richey
@0x0936
Oct 11 2015 03:11
@KingInTheNorth val gets a value from a form input element. use it on input and select elements, for example, because for these elements, text() will not work
noobstar
@namsir
Oct 11 2015 03:12
@0x0936 he simply wants to assign a text value to a div which text nor val will work.
Robert Richey
@0x0936
Oct 11 2015 03:13

@namsir I was answering his question

Mind explaining the difference between val and text/

@namsir and, text() will work to place text within a div
Solehjon
@Solehjon
Oct 11 2015 03:14
Give your button element with the id target1 the text #target1.(help me guys)
noobstar
@namsir
Oct 11 2015 03:14
@0x0936 so div will hold text inside it?
Robert Richey
@0x0936
Oct 11 2015 03:15
noobstar
@namsir
Oct 11 2015 03:16
@0x0936 oh ok. lol never knew that before
@0x0936 thanks
CamperBot
@camperbot
Oct 11 2015 03:16
namsir sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 263 | @0x0936 | http://www.freecodecamp.com/0x0936
noobstar
@namsir
Oct 11 2015 03:17
wouldn't that be considered as a bad practice?
Robert Richey
@0x0936
Oct 11 2015 03:18
is what a bad practice?
Chris
@Shifthawke
Oct 11 2015 03:18
@Solehjon What do you have so far?
And can you link the way point?
noobstar
@namsir
Oct 11 2015 03:18
place literal text inside div without nesting it in p or span
Robert Richey
@0x0936
Oct 11 2015 03:21
probably not a great idea for production code, because div is not semantic. but for testing / prototyping, it doesn't matter. div is just a block level element that can hold whatever you put into it
DinoHeras17
@DinoHeras17
Oct 11 2015 04:19
Could someone help me with this Waypoint.
Waypoint: Make Instances of Objects with a Constructor Function
Robert Richey
@0x0936
Oct 11 2015 04:23
@DinoHeras17 sure. Do you have a specific question?
Trish Snyder
@TrishSnyder
Oct 11 2015 04:24
Hi, I'm on the Confirm the ending bonfire and I thought the following code should work. Instead it's throwing an unexpected identifier.
function end(str, target) {
 //return substring at -1 position
  var lastNo = str.substr(-1);
  return lastNo;

  // check to see if === second argument

 if lastNo === target {
   return true;
 } else {return false;}

}

end("Bastian", "n", "");
Help?
CamperBot
@camperbot
Oct 11 2015 04:24

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Trish Snyder
@TrishSnyder
Oct 11 2015 04:24
Am I completely off base?
DinoHeras17
@DinoHeras17
Oct 11 2015 04:24
@0x0936 I don't have a specific question. I just don't really understand constructors
Robert Richey
@0x0936
Oct 11 2015 04:26
@TrishSnyder the error is from the if condition not having parentheses wrapping lastNo === target. There are some other issues after correcting that part.
Trish Snyder
@TrishSnyder
Oct 11 2015 04:26
Ugh... Thanks @DinoHeras17 . I'll check that out.
CamperBot
@camperbot
Oct 11 2015 04:26
trishsnyder sends brownie points to @dinoheras17 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for dinoheras17
Herman Fassett
@HermanFassett
Oct 11 2015 04:26
Keep in mind @TrishSnyder the target isn't always a single character
Trish Snyder
@TrishSnyder
Oct 11 2015 04:27
Oh, wait, not,Dino. Thanks @0x0936
CamperBot
@camperbot
Oct 11 2015 04:27
trishsnyder sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 264 | @0x0936 | http://www.freecodecamp.com/0x0936
Trish Snyder
@TrishSnyder
Oct 11 2015 04:28
Ok. I'll work on it further, but it was driving me crazy as I thought it should work, even if it didn't complete the bonfire.
Thanks @HermanFassett
CamperBot
@camperbot
Oct 11 2015 04:28
trishsnyder sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 356 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Alexandria
@Everydayppl
Oct 11 2015 04:29
I'm unsure why my h2 element isn't blue. Where did I go wrong? This is for the CSS style ( <style>h2 {color:blue;}</style>)
Robert Richey
@0x0936
Oct 11 2015 04:30
@DinoHeras17 constructors describe an object, like classes in other languages. var myCar = new Car(); this line creates a new car object. myCar can be given properties by using dot notation. myCar.color = "red" if we wanted to describe it's color, for example. Knowing this, how might you give myCar the engines property?

and if we had multiple cars, the properties on each are not shared - if the properties are added to the objects after being constructed

var myGreenCar = new Car();
myGreenCar.color = "green";

var myRedCar = new Car();
myRedCar.color = "red";

Does it make more sense now what a constructor does? It's like a blueprint that you build objects with.

Robert Richey
@0x0936
Oct 11 2015 04:36
@Everydayppl can you post all of your code?
tseamus
@tseamus
Oct 11 2015 04:37
Hey, y'all!
Two questions: 1) how to you post screenshots here?
DJ
@qualitymanifest
Oct 11 2015 04:38
@tseamus drag and drop, or upload them to something like tinypic
@tseamus if you're trying to post code it's better to post it as formatted text so we can copy/paste and test it out
Alexandria
@Everydayppl
Oct 11 2015 04:40
I see where I went wrong!

<h2>CatPhotoApp,</h2>

<style>h2{color:blue;}</style>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>

tseamus
@tseamus
Oct 11 2015 04:43
Thanks @qualitymanifest !
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div> - the instructions for this waypoint were to nest all of the buttons inside a div with a class=row and then nest each of the buttons in a div with a class of col-xs-6. The code I was given is as such, the buttons are already nested. When I try and change the given div classes from col-xs-4 to col-xs-6 it says that I'm not doing it correctly. Any idea?
CamperBot
@camperbot
Oct 11 2015 04:43
tseamus sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
pwdd
@pwdd
Oct 11 2015 04:43

Hi. I finally managed to have bonfire steamroller working. At least, it works on my browser (I work using Firebug Console). But when I put it on FCC and run the tests, it breaks. It says that there is an "unresponsive script"
Here is my code:

function steamroller(arr) {
  var result = [];

  function flat(ar) {
    for (i = 0; i < ar.length; i++) {
    // if it is not an array just push it to the result array
      if (!Array.isArray(ar[i])) {
        result.push(ar[i]);
      // if it is an array, go back and loop through it again
      } else {
        flat(ar[i]);
      }
    }
  } 
  // call it on passed array
  flat(arr);
  return result;
}

Am I doing something wrong or there is a bug?

CamperBot
@camperbot
Oct 11 2015 04:43
:star: 265 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Herman Fassett
@HermanFassett
Oct 11 2015 04:43
@pwdd you were really close with your previous code :(
Trish Snyder
@TrishSnyder
Oct 11 2015 04:43
Thanks for the help! I finished the bonfire!
CamperBot
@camperbot
Oct 11 2015 04:43
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Oct 11 2015 04:44
@tseamus what's the name of this waypoint?
pwdd
@pwdd
Oct 11 2015 04:44
@HermanFassett Hi! It's "almost" the same code I had. And now it works. The problem is that it won't pass
tseamus
@tseamus
Oct 11 2015 04:45
Responsively Style Radio Buttons
Robert Richey
@0x0936
Oct 11 2015 04:46
@TrishSnyder nice! :)
pwdd
@pwdd
Oct 11 2015 04:46
@HermanFassett I only separated things into a function (flat) and called it on the passed array. I get the right results when I run it on Firebug Console, but it breaks on FCC :(
tseamus
@tseamus
Oct 11 2015 04:47
@qualitymanifest The camperbot gave me a link to your waypoints. I'm looking now, but I still can't figure it out.
Herman Fassett
@HermanFassett
Oct 11 2015 04:47
@pwdd all you needed with your previous code was
result = result.concat(steamroller...
pwdd
@pwdd
Oct 11 2015 04:48
I tried that @HermanFassett ! I would still get [1] as result
DJ
@qualitymanifest
Oct 11 2015 04:48
@tseamus okay. i'm kind of multitasking right now but i'll check it out. i remember someone else having a similar problem with this waypoint before
tseamus
@tseamus
Oct 11 2015 04:49
@qualitymanifest okay thank you.
CamperBot
@camperbot
Oct 11 2015 04:49
tseamus sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: tseamus already gave qualitymanifest points
Tyler Haas
@tylerthehaas
Oct 11 2015 04:49
is there a special help room for base jumps or is this the only help room?
Herman Fassett
@HermanFassett
Oct 11 2015 04:50
There's a special one I think
@pwdd well that's what worked for me
Tyler Haas
@tylerthehaas
Oct 11 2015 04:52
thanks
CamperBot
@camperbot
Oct 11 2015 04:52
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Oct 11 2015 04:54
@tseamus you're addressing the wrong part - you're dealing with the buttons, which is already done. you need to deal with your radio buttons
Tyler Haas
@tylerthehaas
Oct 11 2015 04:54
has anyone done the clementine tutorial for oauth?
tseamus
@tseamus
Oct 11 2015 04:57
Ohhh.
What's the difference between buttons and radio buttons?
DJ
@qualitymanifest
Oct 11 2015 04:58
@qualitymanifest your buttons are your like/info/delete buttons. your radio buttons are your indoor/outdoor buttons, which are further down
tseamus
@tseamus
Oct 11 2015 04:59
Ahh.
@qualitymanifest thanks a lot. I got it.
CamperBot
@camperbot
Oct 11 2015 05:03
tseamus sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: tseamus already gave qualitymanifest points
DJ
@qualitymanifest
Oct 11 2015 05:04
cool, no problem
Jelani Thompson
@JelaniThompson
Oct 11 2015 05:06
Hey guys, does anyone know why I'm getting this fatal error?
pwdd
@pwdd
Oct 11 2015 05:07
@HermanFassett Hi. Sorry, I was reading about bug. I tried again with the old code. You are right. It does work when I concat the result. I was doing that wrong: instead of result = result.concat... I only used result.concat.... Anyway, apparently it is a bug
Herman Fassett
@HermanFassett
Oct 11 2015 05:08
;)
Sudip Ghosh
@sudip007
Oct 11 2015 05:09
How to create instances of an object using a constructor?
Robert Richey
@0x0936
Oct 11 2015 05:13
var Plane = function() {
  this.wings = 2; // all new planes will have 2 wings
}

var plane = new Plane();

plane.color = "white";
DinoHeras17
@DinoHeras17
Oct 11 2015 05:15
@0x0936 Yeah that makes a lot more sense now. I finally figured out what I was doing wrong, but thank you very much!
CamperBot
@camperbot
Oct 11 2015 05:15
dinoheras17 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 265 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 11 2015 05:17
great :)
David Bouwkamp
@DavidBouw
Oct 11 2015 05:24

Waypoint: Use Responsive Design with Bootstrap Fluid Containers. <div>

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

.container-fluid{

}

...

what goes in the container-fluid class?
can't solve 1st step of the problem: Your div element should have the class container-fluid
VeeShostak
@VeeShostak
Oct 11 2015 05:28
1st nest all of your html ina div
2nd then create a class called container-fluid in the style tags. (it will be empty) @BrainDrainBahrain
3rd apply that class to the div element that you used to nest all of your html in step 1
David Bouwkamp
@DavidBouw
Oct 11 2015 05:30
<div>

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

  .container-fluid{

  }
<style>
...
</div>
oh so it goes into style{}
so it's a scope issue?
or did i forget to apply it to the div and that was the problem?
Robert Richey
@0x0936
Oct 11 2015 05:31
@BrainDrainBahrain you don't need a style rule for the class .container-fluid
wrap all of your html inside one div tag. then give the div tag class="container-fluid"
erika
@erikasf
Oct 11 2015 05:32
hi im stuck on the easiest bonfire. its the repeat a string i tried the string.repeat(num) and i even tried using polyfill http://jsbin.com/fisowecaba/edit?html,js,console,output
David Bouwkamp
@DavidBouw
Oct 11 2015 05:33
Thanks 0x0936. I understand now
CamperBot
@camperbot
Oct 11 2015 05:33
if you want to thank someone, put an @ before their name!
Robert Richey
@0x0936
Oct 11 2015 05:36
@erikasf how would you describe, in plain English, the steps your code should take to solve the problem?
erika
@erikasf
Oct 11 2015 05:36
take the amount of times the string should print, ensure that its not a negative number, if it is throw an error'
if its not, then print the string the amount of times equal to n
ive tried str*num to no avail
@0x0936 @erikasf
take the amount of times the string should print, ensure that its not a negative number, if it is throw an error'
if its not, then print the string the amount of times equal to n
ive tried str*num to no avail
Robert Richey
@0x0936
Oct 11 2015 05:40
so if num < 1, return "", else ? // we can use recursion here
Solehjon
@Solehjon
Oct 11 2015 05:40
You should add $(document).ready(function() { to the beginning of your script element.
Close your $(document).ready(function() { function with });.
CAN YOU GUYS HELP ME
erika
@erikasf
Oct 11 2015 05:42
@0x0936 while i can draw you a diagram of what steps are taken in recursion and i can explain the loading and unloading of the stack, for the life of me i'm drawing huge blanks on how to set it up
i knowi have to set my base case, because we don't any infinite loops, and then cranial flatulation
Solehjon
@Solehjon
Oct 11 2015 05:44
@Solehjon
You should add $(document).ready(function() { to the beginning of your script element.
Close your $(document).ready(function() { function with });.
CAN YOU GUYS HELP ME
Robert Richey
@0x0936
Oct 11 2015 05:44
@erikasf
function repeat(str, num) {
  // base case
  if (num < 1) { return ""; }

  return // this is a one liner, similar to a recursive factorial
}
return the current string + the result from calling repeat again with the current string and num decremented
Mistereo
@Mistereo
Oct 11 2015 05:46
I guess recursion is a bit harder to understand than simple for/while loop.
erika
@erikasf
Oct 11 2015 05:46

and thats awesome, i have that..glad to see i'm not off the deep end yet, but i'm drawing blanks '''function repeat(str, num) {
// base case
if (num < 1) { return ""; }

return str * num
};
repeat('apple',3);
=NAN '''

CamperBot
@camperbot
Oct 11 2015 05:46
:bulb: to format code use backticks! ``` more info
Vatsala Swaroop
@smarshy
Oct 11 2015 05:47
Smallest Common Multiple
erika
@erikasf
Oct 11 2015 05:47
thanks hit the wrong one.
CamperBot
@camperbot
Oct 11 2015 05:47
if you want to thank someone, put an @ before their name!
erika
@erikasf
Oct 11 2015 05:48

```function repeat(str, num) {
// base case
if (num < 1) { return ""; }

return str * num
};
repeat('apple',3);
NaN

Vatsala Swaroop
@smarshy
Oct 11 2015 05:48
Bonfire: Smallest Common Multiple
CamperBot
@camperbot
Oct 11 2015 05:48

:fire:Bonfire: Smallest Common Multiple :link:

function smallestCommons(arr) {
  return arr;
}


smallestCommons([1,5]);

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

more info:  bf details | bf links | hint

Vatsala Swaroop
@smarshy
Oct 11 2015 05:48
hint
CamperBot
@camperbot
Oct 11 2015 05:48
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Mistereo
@Mistereo
Oct 11 2015 05:49
@erikasf you can't multiply numbers by string. At least it's not possible in JavaScript.
erika
@erikasf
Oct 11 2015 05:50
@Mistereo grrrrrr...i think we need to have a talk with the ecma about this. why does str.repeat(n) not work?
justindobbs
@justindobbs
Oct 11 2015 05:50
try though num*str
erika
@erikasf
Oct 11 2015 05:50
oh @justindobbs thanks i shall
CamperBot
@camperbot
Oct 11 2015 05:50
erikasf sends brownie points to @justindobbs :sparkles: :thumbsup: :sparkles:
:star: 312 | @justindobbs | http://www.freecodecamp.com/justindobbs
justindobbs
@justindobbs
Oct 11 2015 05:50
i believe that placing the number before the string will coerce the string to number
assuming num is actually a number
erika
@erikasf
Oct 11 2015 05:51
@justindobbs still Nan
Mistereo
@Mistereo
Oct 11 2015 05:51
@erikasf str.repeat(n) should work in modern browsers it's part of ES6.
Robert Richey
@0x0936
Oct 11 2015 05:51

@erikasf on the first call to repeat, str = "abc". The return statement will be "abc" + repeat("abc", 3 - 1);

The next call to repeat will return "abc" + repeat("abc", 2 - 1);

The last call to repeat will return "abc" + repeat("abc", 1 - 1); which returns the empty string "" and stops calling itself.

The returned strings from each call get concatenated and results in "abcabcabc".

Mistereo
@Mistereo
Oct 11 2015 05:52
@erikasf but maybe it's not allowed in this bonfire, cause you need to learn how it's work.
erika
@erikasf
Oct 11 2015 05:52
@0x0936 i so totally get that. i can tell you the theory i just have a block in writing it out in js
@Mistereo i believe thats exactly why
Robert Richey
@0x0936
Oct 11 2015 05:53
if (num < 1) { return ""; }
return str + repeat(str, num - 1);
Mistereo
@Mistereo
Oct 11 2015 05:53
@erikasf try to solve this task without recursion, with simple for loop.
erika
@erikasf
Oct 11 2015 05:53
oh (&)(&%^%$**%%...)im going to start a drinking problem tonight! why is it the easiest things kill me lol
thanks @Mistereo @0x0936 @justindobbs
CamperBot
@camperbot
Oct 11 2015 05:55
erikasf sends brownie points to @mistereo and @0x0936 and @justindobbs :sparkles: :thumbsup: :sparkles:
:warning: erikasf already gave justindobbs points
:star: 267 | @0x0936 | http://www.freecodecamp.com/0x0936
:star: 284 | @mistereo | http://www.freecodecamp.com/mistereo
erika
@erikasf
Oct 11 2015 05:55
im going to work it out over a few drinks perhaps find my maximum coding etoh level
Robert Richey
@0x0936
Oct 11 2015 05:55
@erikasf you clearly understand code. algorithms can be tricky for anyone. by looking at your jsbin, I'm guessing you have a C/C++ background because your comments talk about bits and you use bitwise operators
VeeShostak
@VeeShostak
Oct 11 2015 05:57
UX/UI
Robert Richey
@0x0936
Oct 11 2015 06:02
@erikasf I'll try to save you some effort in the future. I did some performance testing to see if JavaScript bitwise operators were faster than normal arithmetic operators. Over several tests, each crunching 10 billion calculations, one for 2 * 2 and the other 2 << 1. Both had near identical elapsed times.
In C++, bitwise is faster, but not in JavaScript.
erika
@erikasf
Oct 11 2015 06:06
@VeeShostak now your talking my language
@0x0936 thanks
CamperBot
@camperbot
Oct 11 2015 06:06
erikasf sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:warning: erikasf already gave 0x0936 points
Mistereo
@Mistereo
Oct 11 2015 06:06
Case of multiplying by 2 can easily be optimized to use bitwise. What about 2 << n vs 2 * (2 ^ n)?
VeeShostak
@VeeShostak
Oct 11 2015 06:07
haha
erika
@erikasf
Oct 11 2015 06:07
im out. have just gotten a call to work the ed at highlands. always a good time on a sat
VeeShostak
@VeeShostak
Oct 11 2015 06:07
@erikasf Best of luck
Robert Richey
@0x0936
Oct 11 2015 06:08
later @erikasf
@Mistereo those equations are not identical. 2 << n is 2^(n+1)
Mistereo
@Mistereo
Oct 11 2015 06:10
@0x0936 no, 2 << 1 is 2 ^ 2 :)
Robert Richey
@0x0936
Oct 11 2015 06:10
yeah, fixed
Mistereo
@Mistereo
Oct 11 2015 06:11
@0x0936 but I wrote 2 * (2 ^ n) which is? Yes 2 ^( n +1)
Robert Richey
@0x0936
Oct 11 2015 06:12
so it is. sorry about that
back to your question of optimization - before I completely derailed it - what test would you write to prove bitwise is faster than arithmetic operations in JS?
Mistereo
@Mistereo
Oct 11 2015 06:17
@0x0936 just check case where n is greater then 1, it's trivial to check if number is power of 2, but I'm not sure that compilers do that for us.
Robert Richey
@0x0936
Oct 11 2015 06:19
what function would you write to test that bitwise operations are faster than arithmetic? I've already been through this process. Stick the operation in a for loop, iterate billions of times and log the time it takes
Mistereo
@Mistereo
Oct 11 2015 06:21
the same, but you said that you tested 2 * 2 vs 2 << 1 :)
https://jsperf.com/ is a good place.
@0x0936 bitwise seems to be 2+ times faster for me (chrome) in this benchmark.
Mayank Jain
@MayankJ30
Oct 11 2015 06:25
Hey guys! Could anyone explain to me what we really need to do in this bonfire?
http://www.freecodecamp.com/challenges/bonfire-boo-who
Mistereo
@Mistereo
Oct 11 2015 06:27
@MayankJ30 you need to check that value is true or false.
@MayankJ30 so boo(true) return true, boo(false) return true, and return false in other cases.
Mayank Jain
@MayankJ30
Oct 11 2015 06:28
So why should NaN return true?
Hong
@JHxx
Oct 11 2015 06:28
Hi Guys, I need help on "Bonfire: No repeats please"
Mistereo
@Mistereo
Oct 11 2015 06:29
@MayankJ30 seems like typo.
@MayankJ30 boo(NaN) should return false.
Mayank Jain
@MayankJ30
Oct 11 2015 06:30
Hmm.. Oh okay. I'll report it as a bug .
Thanks! @Mistereo
CamperBot
@camperbot
Oct 11 2015 06:30
mayankj30 sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 285 | @mistereo | http://www.freecodecamp.com/mistereo
DJ
@qualitymanifest
Oct 11 2015 06:31
i haven't gotten there yet but i just tried that and solved it with a simple if/else statement
David Bouwkamp
@DavidBouw
Oct 11 2015 06:31
help script
CamperBot
@camperbot
Oct 11 2015 06:31

:point_right: free code camp javascript style guide [wiki]

Free Code Camp Style Guide

<small>or How Cool People Write JavaScript.</small>

:pencil: read more about free code camp javascript style guide on the FCC Wiki

Robert Richey
@0x0936
Oct 11 2015 06:32
@Mistereo the results I got from using a variable exponent did not change the difference in average times - both are nearly identical in time execution
test1.jpg
test2.jpg
Mistereo
@Mistereo
Oct 11 2015 06:32
@0x0936 check my jsperf link.
@0x0936 try to "Run tests" there.
David Bouwkamp
@DavidBouw
Oct 11 2015 06:33
Waypoint: Learn how Script Tags and Document Ready Work
<script $(document).ready(function(){
Robert Richey
@0x0936
Oct 11 2015 06:33
why would that be better than using pure JS in the dev console with no middle-ware?
Mistereo
@Mistereo
Oct 11 2015 06:34
@0x0936 you don't know how Math.pow is implemented.
David Bouwkamp
@DavidBouw
Oct 11 2015 06:34
This message was deleted
Robert Richey
@0x0936
Oct 11 2015 06:36
@Mistereo but my first set of tests didn't use Math.pow. It was just 2 * 2. Average execution times remained the same.
Mistereo
@Mistereo
Oct 11 2015 06:41
@0x0936
function test() {
  console.time("test");
  var x = 1;
  for (var i = 0; i < 1e5; i++) {
    x >>= 2;
    x <<= 2;
  }
  console.timeEnd("test");
}


function test2() {
  console.time("test2");
  var x = 1;
  for (var i = 0; i < 1e5; i++) {
    x /= 4;
    x *= 4;
  }
  console.timeEnd("test2");
}
My results: test: 1.283ms vs test2: 3.262ms
neoage
@neoage
Oct 11 2015 06:44
not able to understand how Your img element should have the class smaller-image.
Your image should be 100 pixels wide.
DJ
@qualitymanifest
Oct 11 2015 06:44
@Mistereo mind explaining to me what 1e5 means?
Mistereo
@Mistereo
Oct 11 2015 06:44
@qualitymanifest 1 * 10 ^ 5
DJ
@qualitymanifest
Oct 11 2015 06:45
@Mistereo so it's a bitwise expression?
Mistereo
@Mistereo
Oct 11 2015 06:45
@neoage you should wrap "smaller-image" with " and remove .
DJ
@qualitymanifest
Oct 11 2015 06:46
@Mistereo i'm not familiar with ^ except for it's use in regex
Mistereo
@Mistereo
Oct 11 2015 06:46
@qualitymanifest 1 * Math.pow(10, 5)
@qualitymanifest it's scientific notation.
neoage
@neoage
Oct 11 2015 06:47
thanks really appreciate :)
CamperBot
@camperbot
Oct 11 2015 06:47
if you want to thank someone, put an @ before their name!
Mistereo
@Mistereo
Oct 11 2015 06:47
1e5 = 100000
Robert Richey
@0x0936
Oct 11 2015 06:47
@Mistereo the speed difference only shows up when assigning the value to a variable. but when doing either operation, without assignment, speeds are identical. I suppose that's a moot point and is the fallacy of my testing. No practical program would perform arithmetic and throw away the result. When I add variable assignment, I see the significant speed difference. Bitwise operations are indeed faster. Thank you for your patience as I tried to understand this better.
CamperBot
@camperbot
Oct 11 2015 06:47
0x0936 sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 286 | @mistereo | http://www.freecodecamp.com/mistereo
DJ
@qualitymanifest
Oct 11 2015 06:48
@Mistereo ah. reading up on math.pow now. kind of making some sense. i'm learning things just from watching this debate
@Mistereo @0x0936 thanks
CamperBot
@camperbot
Oct 11 2015 06:48
qualitymanifest sends brownie points to @mistereo and @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 287 | @mistereo | http://www.freecodecamp.com/mistereo
:star: 268 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 11 2015 07:04
@neoage just need to change name of class from thin- to thick-
neoage
@neoage
Oct 11 2015 07:06
Thanks :)
CamperBot
@camperbot
Oct 11 2015 07:06
if you want to thank someone, put an @ before their name!
neoage
@neoage
Oct 11 2015 07:06
0x0936 Thanks :)
CamperBot
@camperbot
Oct 11 2015 07:06
if you want to thank someone, put an @ before their name!
Robert Richey
@0x0936
Oct 11 2015 07:07
close! lol. @neoage thanks is how that works :)
CamperBot
@camperbot
Oct 11 2015 07:07
0x0936 sends brownie points to @neoage :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for neoage
neoage
@neoage
Oct 11 2015 07:07
@0x0936 Thanks :)
Jason
@Jauble
Oct 11 2015 07:07
If there's a number next to a line in the console, what does that represent?
neoage
@neoage
Oct 11 2015 07:08
@camperbot :+1:
Robert Richey
@0x0936
Oct 11 2015 07:08
@Jauble browser dev console? far right?
Jason
@Jauble
Oct 11 2015 07:11
console.jpg
Robert Richey
@0x0936
Oct 11 2015 07:12
that's the number of times that exact output has been sent to console
consecutively
Jason
@Jauble
Oct 11 2015 07:13
@0x0936 Thanks. That's what I thought, just wanted to be sure. It was only supposed to return it 8 times, gotta find out where I screwed up now lol
CamperBot
@camperbot
Oct 11 2015 07:13
jauble sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 269 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 11 2015 07:14
If you want to post your code, I'll be happy to look at it.
Jason
@Jauble
Oct 11 2015 07:17
I was wondering because it printed 8 lines before and didn't put a number. I decided to try the code a different way and it only printed once with the number 16. I think it's probably an easy fix, but I'll post it if I can't get it. Thanks
CamperBot
@camperbot
Oct 11 2015 07:17
if you want to thank someone, put an @ before their name!
Sudip Ghosh
@sudip007
Oct 11 2015 07:29
Is my code right
Robert Richey
@0x0936
Oct 11 2015 07:31
@sudip007 post your code
0x0936 @0x0936 goes to bed
DJ
@qualitymanifest
Oct 11 2015 07:36
This message was deleted
neoage
@neoage
Oct 11 2015 07:37
This message was deleted
Stuck here :(
@camperbot ???
solved the rest but not understanding....... the red crosses........
Sasa
@tanasic
Oct 11 2015 07:45
@neoage it is simple.. instructions are very clear..
@neoage it says create a new P element aroung your A element
do you know what is p element and what is A element ?
Avil
@Avil172
Oct 11 2015 07:46
@neoage
your line 37 is the answer, just need to be in the correct place, plus fix syntax error
neoage
@neoage
Oct 11 2015 07:47
no kindly explain
Sasa
@tanasic
Oct 11 2015 07:48
@neoage I think you need to read some more about HTML elements and tags.. I know FCC only covers basics.. so for a total beginner might be difficult
neoage
@neoage
Oct 11 2015 07:49
@tanasic sure anything you suggest
@neoage http://htmldog.com/ is pretty good for beginnners
@neoage it is best for you to start here http://htmldog.com/guides/html/beginner/
neoage
@neoage
Oct 11 2015 07:51
@tanasic great sparkles: :+1:
alright just explain create a new p element around a element..
Sasa
@tanasic
Oct 11 2015 07:53
elements are links, headers, paragraphs
p is paragraph
<p>this is some paragrapsh text</p>
neoage
@neoage
Oct 11 2015 07:53
i got that then what wrong am i doing
Sasa
@tanasic
Oct 11 2015 07:53
create it aroung your A element
you know what that is ?
"a" element is link
neoage
@neoage
Oct 11 2015 07:54
cool
Sasa
@tanasic
Oct 11 2015 07:54
so basically you just need to create paragraph element around your link element
neoage
@neoage
Oct 11 2015 07:55
line 36 what is wrong
Mistereo
@Mistereo
Oct 11 2015 07:55
@neoage you create a new a element, instead you should wrap existed.
@neoage at line 30
neoage
@neoage
Oct 11 2015 07:56
so what should be line 30 like :(
I am new to all this
Mistereo
@Mistereo
Oct 11 2015 07:57
it should be wrapped with <p> ... </p>
Avil
@Avil172
Oct 11 2015 07:57
@neoage line 35/36 doesn't have the closing element tag.
you have written line 35/36 and 37 inside a single p element.
Mistereo
@Mistereo
Oct 11 2015 07:57
and contain "View more " text
neoage
@neoage
Oct 11 2015 07:57
okay cool let me try
see line 37 is it not that
Mistereo
@Mistereo
Oct 11 2015 08:00
@neoage it should be on line 30.
@neoage in line 37 you added a new a
@neoage instead you should wrap existed at line 30
neoage
@neoage
Oct 11 2015 08:04
Thanks got it :)
CamperBot
@camperbot
Oct 11 2015 08:04
if you want to thank someone, put an @ before their name!
neoage
@neoage
Oct 11 2015 08:04
@Mistereo :+1:
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:07
found a bug in --> Waypoint: Nest an Anchor Element within a Paragraph
DJ
@qualitymanifest
Oct 11 2015 08:07
@RAJAT--PALIWAL what is it?
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:08
there you need to next
nest <a> within <p> for View more cat photos
where cat photos is link
DJ
@qualitymanifest
Oct 11 2015 08:09
@RAJAT--PALIWAL works fine for me. can you post your code?
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:10
Test cases require you create a new <p> element like this <p>View more <a href="http://www.freecatphotoapp.com"> cat photos</a></p>
But another test says Your p element should have the text "View more " (with a space after it.
DJ
@qualitymanifest
Oct 11 2015 08:11
try it without a space after the opening <a> tag
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:11
and previous <p> elements have Lorem ipsum written inside it therefore test fails
I resolved it by using "View more " instead of "Lorem ipsum" inside previous <p> tags
I think this bug should be reported
What do you think
??
DJ
@qualitymanifest
Oct 11 2015 08:13
@RAJAT--PALIWAL can you post all the code from that? it may be a bug, just wondering why it works for me
Cyrus John
@CyrusPrime1111
Oct 11 2015 08:13
hello im new to freecodecamp
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:14
Welcome @CyrusPrime1111

<p class="red-text">View more </p>
<p class="red-text">View more </p>

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

This will work
Cyrus John
@CyrusPrime1111
Oct 11 2015 08:14
and im stuch with this create a deadlink using hash
stuck*
DJ
@qualitymanifest
Oct 11 2015 08:15
@CyrusPrime1111 <a href="#"></a>
Cyrus John
@CyrusPrime1111
Oct 11 2015 08:15
it says replace the herf attribute with #...and i bluntly replaced it with #...but it aint working...
Avil
@Avil172
Oct 11 2015 08:15
@RAJAT--PALIWAL the view more cat photos text has nothing to do with lorem ipsum text paragraph..
Cyrus John
@CyrusPrime1111
Oct 11 2015 08:16
Thank you @qualitymanifest
CamperBot
@camperbot
Oct 11 2015 08:16
cyrusprime1111 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 267 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Oct 11 2015 08:18
@RAJAT--PALIWAL that's an exact copy and paste of your code?
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:18

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

<p class="red-text">View more </p>
<p class="red-text">View more </p>

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

This is what working for me
@Avil172 It is because test requires <p> to have "View more " inside it.
@qualitymanifest check above code
Avil
@Avil172
Oct 11 2015 08:20
@RAJAT--PALIWAL yes, and that is exactly what the instruction asks you to do..
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:22
@Avil172 I want to say this is a bug because instruction was only that you create a new paragraph "View more cat photos" where "cat photos" is a link and We have to do this with nesting of <p><a></a></p>.
@qualitymanifest what do you think??
DJ
@qualitymanifest
Oct 11 2015 08:23
@Avil172 @RAJAT--PALIWAL it's actually fairly different from the instructions given that the two <p>'s with the class red-text are above the <p> with the nested <a> and they contain different text
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:24
@qualitymanifest Yes, that is what I am trying to say.
test should pass after adding nested <p>
DJ
@qualitymanifest
Oct 11 2015 08:25
@RAJAT--PALIWAL i feel like it's trivial (not important, as the lesson that is meant to be learned is... nest an <a> element within a <p> element) but feel free to submit it. FCC is always trying to get better, after all.
Avil
@Avil172
Oct 11 2015 08:26
@qualitymanifest, @RAJAT--PALIWAL
sorry i couldn't understand. the instruction didn't ask you to change the "final two paragraphs", but only the one which has "view more...."
so.. how is it incorrect? could you explain?
David Bouwkamp
@DavidBouw
Oct 11 2015 08:26
help javascript properties
CamperBot
@camperbot
Oct 11 2015 08:26
no wiki entry for: javascript properties
:pencil: click here to create one now!after creating your page type update to reload it here
Rajat Paliwal
@RAJAT--PALIWAL
Oct 11 2015 08:26
@qualitymanifest yes, I can see many people are having same problem and found different ways to solve it.
Avil
@Avil172
Oct 11 2015 08:27
@qualitymanifest @RAJAT--PALIWAL
http://imgur.com/yf9XkHh
David Bouwkamp
@DavidBouw
Oct 11 2015 08:27
help instances
CamperBot
@camperbot
Oct 11 2015 08:27

:point_right: waypoint make instances of objects with a constructor function [wiki]

A function that creates objects is called a constructor_, my favorite way of creating objects when you have to create more than one of the same object. You can also edit the second object to add more properties if needed. This is called creating _instances of an object.

Each new instance of this object inherits all the properties and methods of your original object.

var Car = function() {
   this.wheels = 4;
};

// New instance of Car object.
var myCar = new Car();

//Add the property "engines" to myCar, and make it a number.
myCar.engines = 1;

:pencil: read more about waypoint make instances of objects with a constructor function on the FCC Wiki

DJ
@qualitymanifest
Oct 11 2015 08:28
@RAJAT--PALIWAL i tried it again and i'm not sure i understand the problem. after deleting my code which passed and trying <p><a href="#"></a></p> and <p><a></a></p>, neither one works
@Avil172 yes that's what i did. it works
Abhisek Pattnaik
@abhisekp
Oct 11 2015 08:29
@Avil172 paste img. using this format ![](http://imgur.com/yf9XkHh)
Avil
@Avil172
Oct 11 2015 08:30
@RAJAT--PALIWAL @qualitymanifest
okay, let me explain it a bit...
any thing inside <a> is treated as a "clickable" link. you can use <a> anywhere and create "clickable" links. the link itself, resides inside href attribute
@abhisekp what do you think on this?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 08:31
:+1:
Avil
@Avil172
Oct 11 2015 08:32
@abhisekp hey!!!!!!!
DJ
@qualitymanifest
Oct 11 2015 08:32
@Avil172 yes, i understand. your solution is identical to mine. i thought i understood @RAJAT--PALIWAL 's problem, but it's not making sense to me anymore.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 08:32
@Avil172 hey! hey!! (in girl's soft tone) :P
Avil
@Avil172
Oct 11 2015 08:33
@abhisekp i mean what do you think? are the instructions here
http://freecodecamp.com/challenges/waypoint-nest-an-anchor-element-within-a-paragraph
incorrect?
DJ
@qualitymanifest
Oct 11 2015 08:33
@abhisekp the correct way to say that is hay hayyyyy ;)
Abhisek Pattnaik
@abhisekp
Oct 11 2015 08:33
@qualitymanifest hay hayyyy (in girl's soft tone) :P
Avil
@Avil172
Oct 11 2015 08:34
@abhisekp because i don't think that the instruction were incorrect.
DJ
@qualitymanifest
Oct 11 2015 08:34
hahaha
@Avil172 yeah i agree
Avil
@Avil172
Oct 11 2015 08:34
@abhisekp hey ! hey ! hey!
David Bouwkamp
@DavidBouw
Oct 11 2015 08:37
help filter
CamperBot
@camperbot
Oct 11 2015 08:37

:point_right: waypoint filter arrays with filter [wiki]

Filter is a useful method that can filter out values that don't match a certain criteria.

var array = [1,2,3,4,5,6,7,8,9,10];
  // Only change code below this line.
array = array.filter(function(val) {
  return val <= 5;
});

:pencil: read more about waypoint filter arrays with filter on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Oct 11 2015 08:38
brb after eating veg biriyani
Avil
@Avil172
Oct 11 2015 08:39
@abhisekp just don't eat the leaves..(isn't it sunday today?)
DJ
@qualitymanifest
Oct 11 2015 08:39
@abhisekp psh i am still managing to post while eating a salad. that looks awesome though.
although i am going to sleep afterwards. goodnight (or morning?) @Avil172 @abhisekp
Avil
@Avil172
Oct 11 2015 08:42
@qualitymanifest here its afternoon
anyway, good night :+1:
Hong
@JHxx
Oct 11 2015 08:43
anyone have any idea about "Bonfire: No repeats please"?
how come the solution is: > permAlone('aabb')
[ 'abab', 'abab', 'abab', 'abab', 'baba', 'baba', 'baba', 'baba' ]
8
my understanding is there should be 2 entries counted as permutation.
but it is that 8 entries to pass the challenge
Abhisek Pattnaik
@abhisekp
Oct 11 2015 08:52
@Avil172 yes. GMT+5:30 is Sunday indeed. :P
Kevin Diem
@kgdiem
Oct 11 2015 08:54
any idea why my divs are going crazy on click?
http://codepen.io/kgdiem/pen/JYyjqz
David Bouwkamp
@DavidBouw
Oct 11 2015 08:55
help regex
CamperBot
@camperbot
Oct 11 2015 08:55

:point_right: js regex [wiki]

Links to useful RegEx resources.

See also: :clipboard: Tutorials | :syringe: Testing | :soccer: Games | :newspaper: Blogs | :package: Software

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

neoage
@neoage
Oct 11 2015 09:03
This message was deleted
David Bouwkamp
@DavidBouw
Oct 11 2015 09:03
function reverseString(str) {
  var array = str.split(/\D/, str.length-1);
  return array.join(array.reverse());
}

reverseString("hello", "");
Why is this returning: ",,,,,,,,,"? Shouldn't the string be split up according to my regex?
neoage
@neoage
Oct 11 2015 09:04
This message was deleted
Mistereo
@Mistereo
Oct 11 2015 09:04
@JHxx your permutations should not be uniq, so [ 'abab', 'abab', 'abab', 'abab', 'baba', 'baba', 'baba', 'baba' ] is different strings in terms of permutations and they satisfy condition, so result is 8.
neoage
@neoage
Oct 11 2015 09:04
This message was deleted
Kevin Diem
@kgdiem
Oct 11 2015 09:04
@BrainDrainBahrain you are just sorting NOT digits
neoage
@neoage
Oct 11 2015 09:04
This message was deleted
David Bouwkamp
@DavidBouw
Oct 11 2015 09:05
@kgdiem so i should not use a regex but instead an empty separator param?
neoage
@neoage
Oct 11 2015 09:06
This message was deleted
What wrong am i doing
Kevin Diem
@kgdiem
Oct 11 2015 09:06
/(\D)(,*)/ @BrainDrainBahrain you can still use a regex/ AFAIK there isn't a regex for just strings. Also, you need to join them like arr.join("") < to join w/o the "," from the array
Kevin Diem
@kgdiem
Oct 11 2015 09:07
@neoage are you being a troll?
CamperBot
@camperbot
Oct 11 2015 09:07
:trollface: troll problems? notify admins here
Kevin Diem
@kgdiem
Oct 11 2015 09:07
probably no one should click on your link. If you must post a picture you should drag and drop into the message bar @neoage
David Bouwkamp
@DavidBouw
Oct 11 2015 09:08
@kgdiem Can you help explain why the function call at the bottom has the second param "" when the function being called only has the str reference variable?
Kevin Diem
@kgdiem
Oct 11 2015 09:08
@BrainDrainBahrain what waypoint/bonfire?
neoage
@neoage
Oct 11 2015 09:08
@kgdiem no its just the page i connected with the picture does not open thats why
David Bouwkamp
@DavidBouw
Oct 11 2015 09:08
@kgdiem Bonfire: Reverse a String
@kgdiem No. 2
neoage
@neoage
Oct 11 2015 09:09
@kgdiem it did earlier
Kevin Diem
@kgdiem
Oct 11 2015 09:09
@neoage oh okay. I work in IT dept, see users open up links like one above and get viruses :p saw your past messages were deleted
@BrainDrainBahrain okay, no regex
@BrainDrainBahrain lemme look and answer your question
neoage
@neoage
Oct 11 2015 09:11
@kgdiem i am new still learning the ropes :worried:
Kevin Diem
@kgdiem
Oct 11 2015 09:12
@BrainDrainBahrain IDK why there is an empty string but you can return without it. Your issue above is first, no regex, then you shouldn't write array.join(array.reverse());, in JavaScript you can chain functions like so return array.reverse().join("")
@neoage in the future it'd probably be easier to do (new line) (new line) (code) (new line)
sorry it formatted lol (new line) ``` (new line) (code) (new line) ``` (new line)
okay, @neoage you wrote your form incorrectly. it is <form><input ....></form>
David Bouwkamp
@DavidBouw
Oct 11 2015 09:15
thanks @kgdiem
CamperBot
@camperbot
Oct 11 2015 09:15
braindrainbahrain sends brownie points to @kgdiem :sparkles: :thumbsup: :sparkles:
:star: 258 | @kgdiem | http://www.freecodecamp.com/kgdiem
Kevin Diem
@kgdiem
Oct 11 2015 09:15
np
Pravin Kerai
@yamd00t
Oct 11 2015 09:21
Hello guys, anyone interested in pair programming with me?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:23
@haribol007 which challenge?
Pravin Kerai
@yamd00t
Oct 11 2015 09:23
Bonfire
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:23
@haribol007 btw, for Pair programming, ask here https://gitter.im/FreeCodeCamp/LetsPair
CamperBot
@camperbot
Oct 11 2015 09:23
we're talking about bonfire :fire: Bonfire: Smallest Common Multiple
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:23
@haribol007 which bf?
Pravin Kerai
@yamd00t
Oct 11 2015 09:23
@abhisekp thanks for the sugeschun
CamperBot
@camperbot
Oct 11 2015 09:23
haribol007 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 569 | @abhisekp | http://www.freecodecamp.com/abhisekp
Pravin Kerai
@yamd00t
Oct 11 2015 09:24
@abhisekp Just started Bonfire: Reverse a string...
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:25
@haribol007 what's the issue?
Pravin Kerai
@yamd00t
Oct 11 2015 09:26
@abhisekp aha, no issues as of now, but just asking if anyone interested to make the process fast and fun
David Bouwkamp
@DavidBouw
Oct 11 2015 09:26
Does JS incorporate any data type casting in the language or is everything conversion related done with method calls?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:27
@haribol007 are you not already enjoying the bfs?

@haribol007 and you won't gain anything by making the process any faster. Try it yourself first and then if stuck think for 2 more days. And then ask here. We'll certainly help. :D

NOTE: If in hurry, you may ask in 24 hrs too. :P

neoage
@neoage
Oct 11 2015 09:29
@kgdiem sorry for troubling but not able to understand what wrong am i doing :( https://www.dropbox.com/s/cz0mg65mr74a26i/Screenshot%202015-10-11%2014.33.16.png?dl=0
and now the snapshot does not show
Pravin Kerai
@yamd00t
Oct 11 2015 09:29
@abhisekp it's awesome, I'm lovin' it
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:30
@BrainDrainBahrain JS data type casting is dynamic and can be done implicitly and explicitly using constructor functions of corresponding datatypes
Kevin Diem
@kgdiem
Oct 11 2015 09:30
@neoage you aren't including an input tag at all. You're putting it inside the form

@neoage
```

<form>

<input>

<form>
<input>
</form>
^^ this is how HTML works, open, close, with stuff in the middle. Input is a self closing tag
neoage
@neoage
Oct 11 2015 09:32
Screenshot 2015-10-11 13.06.18.png
Edper
@edper
Oct 11 2015 09:33
Hello @abhisekp did you see my refactored diff()
Kevin Diem
@kgdiem
Oct 11 2015 09:33
<div>
<img src="google.com">
<a href="#">Bill!</a>
<p> Hi </p>
<input type="text" placeholder="placeholder text">
<button> </button> 
</div>
neoage
@neoage
Oct 11 2015 09:33
@ anyone
Kevin Diem
@kgdiem
Oct 11 2015 09:34
@neoage <p> <a href="img.com">Words</a></p>
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:34
@edper sry! I've not yet seen yet. Didn't dting see it?
If not, i can check it now.
David Bouwkamp
@DavidBouw
Oct 11 2015 09:35
@abhisekp so something like foo.constructor = String; is a vaild conversion to type String?
Edper
@edper
Oct 11 2015 09:35
function diff(arr1, arr2) {
  if (arr2.length==0) return arr1;
  return arr1.length == 0 ? arr2 : (arr1.concat(arr2).filter(function(val,idx,a){
     return ((a.indexOf(val) == a.lastIndexOf(val) | ((arr1.indexOf(val) != arr1.lastIndexOf(val)) & arr2.indexOf(val)==-1) | ((arr2.indexOf(val) != arr2.lastIndexOf(val)) & arr1.indexOf(val)==-1) ));
  }));
}
Check it out against your sample that you gave me if it works.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:38
@BrainDrainBahrain nope! I said constructor function not constructor property. It's completely different.
Something like this
Boolean(""); // false
Boolean("false"); // true
String(false); // "false"
String(0); // "0"
David Bouwkamp
@DavidBouw
Oct 11 2015 09:40
This message was deleted
This message was deleted
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:43
@edper looks like the current code works. But lemme check the code line-by-line https://repl.it/BPDW/2
@edper are you aware that you've used Bitwise operators?
Edper
@edper
Oct 11 2015 09:46
Which one? the | operator?
David Bouwkamp
@DavidBouw
Oct 11 2015 09:46
@abhisekp var foo = "0"; if(Boolean(Number(foo)) return false else return true
I'm just trying to wrap my head around the flexibility of these types. Would the above be a valid conversion?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:47
@edper yep and the & operator
@BrainDrainBahrain sure! :+1: but your returns will be reversed
David Bouwkamp
@DavidBouw
Oct 11 2015 09:48
thanks @abhisekp
CamperBot
@camperbot
Oct 11 2015 09:48
braindrainbahrain sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 570 | @abhisekp | http://www.freecodecamp.com/abhisekp
creating a form element
Edper
@edper
Oct 11 2015 09:52
Honestly, I haven't been using JS for awhile and I know it should be || and && ala C, C++. Yes I wasn't aware.
;-)
But it would have the same effect since true is 1 and false is 0
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:53
@neoage what's the issue?
@edper i'll have to look into it and report.
neoage
@neoage
Oct 11 2015 09:53
<form input type="text" placeholder="cat photo URL" action="/submit-cat-photo" >

</form>
nesting text input element within a form element
@abhisekp
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:54
@neoage yes. add a input tag inside the form tag
neoage
@neoage
Oct 11 2015 09:55
This message was deleted
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:56
@ethanow hi
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:56
@neoage why paste twice?
Ethan Ow
@ethanow
Oct 11 2015 09:56
@abhisekp hi there!
neoage
@neoage
Oct 11 2015 09:57
@abhisekp see
Abhisek Pattnaik
@abhisekp
Oct 11 2015 09:58

@neoage nesting is done like this

<div>
     <p>lorem ipsum</p>
</div>

Here p tag is nested inside div tag.

neoage
@neoage
Oct 11 2015 09:58
okay let me try
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:01
@edper you're using the double equal symbol for equality check. Please use triple equals (strict equals).
Alan Wilson
@nulland
Oct 11 2015 10:01

Hello all. I'm a bit confused on Bonfire 2. How would I turn a string into an array? ```function reverseString(str) {
return str;
}

reverseString("hello", "");```

Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:02
@shehannf it's not official unless you say hello world
Edper
@edper
Oct 11 2015 10:03
they use the same function so the type is not really a question thus === would be unnecessary for me.
Alan Wilson
@nulland
Oct 11 2015 10:03
@abhisekp Thanks!
CamperBot
@camperbot
Oct 11 2015 10:03
nulland sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 571 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:05
@edper It's a good practice to always use === (strict equal)
David Bouwkamp
@DavidBouw
Oct 11 2015 10:10
function palindrome(str) {

  if(Array(str.replace("/\s/",'').toLowerCase()).reverse().join() === str){
  return true;
  }
  else{
    return false;
  }
}

palindrome("nope");
Why does this return true? I thought the constructor function was going to convert the newly lowerCased str to array so it can .reverse().join()?
This message was deleted
Juan Riquelme
@soulchainer
Oct 11 2015 10:12
join(""), @BrainDrainBahrain
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:12
This message was deleted
David Bouwkamp
@DavidBouw
Oct 11 2015 10:13
@abhisekp the constructor for an array returns true?
Juan Riquelme
@soulchainer
Oct 11 2015 10:14
plus yes, @abhisekp has some point still he deleted his message, because you have an extra parenthesis.
if(Array(str.replace("/\s/",'').toLowerCase().reverse().join("") === str){
You delete the extra parenthesis after toLowerCase() and join properly.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:15
that not the case @soulchainer (no extra parens)
Lemme look it properly
Juan Riquelme
@soulchainer
Oct 11 2015 10:15
No, @BrainDrainBahrain . What he was saying was that if you check Array(something) this return true.
@abhisekp Oh, yes xD. I look it bad. Then, like I said, only the join("").
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:16
@soulchainer yes. I was saying that but i didn't think on the code too much and replied so deleted my msg.
i'm sick. I think i've cold
Juan Riquelme
@soulchainer
Oct 11 2015 10:16
Yeah, I know :þ.
David Bouwkamp
@DavidBouw
Oct 11 2015 10:17
@soulchainer you're missing a parens in your correction of my code. Array( is hanging.
Juan Riquelme
@soulchainer
Oct 11 2015 10:17
Yeah, I already said that :3.
I think is only the join mistake.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:18
@BrainDrainBahrain your array only contains one element. So what to reverse?
David Bouwkamp
@DavidBouw
Oct 11 2015 10:18
@soulchainer alright, well anyway I'm intentionally trying to convert the currently-being-worked-on str to Array so it can validly make a call to .reverse().join("");. adding the "" to the join statement did not fix this problem
@abhisekp omg duh. i should .split()
thanks @abhisekp
CamperBot
@camperbot
Oct 11 2015 10:19
:warning: braindrainbahrain already gave abhisekp points
braindrainbahrain sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:19
@BrainDrainBahrain Hence, you don't need the Array contructor function.
Nikola Mitić
@JohneyCodeUp
Oct 11 2015 10:31

Hello good people.

arrayToSort = [100, 2 , 4, 3];
sortedArray = arrayToSort.sort();
console.log(arrayToSort);

Why the output of this code is

100, 2, 3,4

insted of

2,3,4,100

here is example jsfiddle: https://jsfiddle.net/JohneyCodeUp/tu691y88/

David Bouwkamp
@DavidBouw
Oct 11 2015 10:33
function palindrome(str) {

  if(str.replace("/\s\./","").toLowerCase().split("").reverse().join("") === str){
  return true +  " " +  str.replace("/\s\./",'').toLowerCase().split("").reverse().join("");
  }
  else{
    return false +  " " + str.replace("/\s\./","").toLowerCase().split("").reverse().join("");
  }
}

palindrome("race car.");
"false .rac ecar"
What's up with my regex not replacing the ws and period with ""?
Mistereo
@Mistereo
Oct 11 2015 10:33
@JohneyCodeUp because javascript by default sorts elements as strings.
@JohneyCodeUp you need a custom comparator to achieve desired result:
sortedArray = arrayToSort.sort(function (a, b) {
    return a - b;
});
Nikola Mitić
@JohneyCodeUp
Oct 11 2015 10:35
@Mistereo Nice thanks mate :D
CamperBot
@camperbot
Oct 11 2015 10:35
johneycodeup sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 288 | @mistereo | http://www.freecodecamp.com/mistereo
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:40
explain format
CamperBot
@camperbot
Oct 11 2015 10:42

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:43
haribol007 :point_up: October 11, 2015 4:12 PM
Edper
@edper
Oct 11 2015 10:44
@abhisekp sorry that I was not able to reply right away. I was talking to somebody. As for your suggestion I will probably try it.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:45
@edper i'm sick now. So i'm not explaining the importance of using strict equality everywhr. But you can find it on net. :D
Edper
@edper
Oct 11 2015 10:46
I'm trying JSLint for sanitizing my JS but it's too nitty gritty for me..lol
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:47
@edper whc editor you using?
Edper
@edper
Oct 11 2015 10:48
I am using directly from the browser and via FCC online editor. I use Atom by the way.
Sorry to hear that you're sick. I am praying for you to get well soon in JESUS' Name. You might probably take a break for a moment and come back when you're in full gear to be of great help in this thriving community. Thanks for your help by the way.
CamperBot
@camperbot
Oct 11 2015 10:50
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:51
@edper thanks. And use one or more of the following editors
CamperBot
@camperbot
Oct 11 2015 10:51
abhisekp sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:star: 47 | @edper | http://www.freecodecamp.com/edper
Edper
@edper
Oct 11 2015 10:52
Thanks @abhisekp!
CamperBot
@camperbot
Oct 11 2015 10:52
edper sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 572 | @abhisekp | http://www.freecodecamp.com/abhisekp
Edper
@edper
Oct 11 2015 10:54
I am using jsfiddle for online editing.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:56
@edper then you'll love switching to http://JSBin.com :D <3
Sudip Ghosh
@sudip007
Oct 11 2015 10:57
What regular expression should I use for ("0_0 (: /-\ :) 0-0") ?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 10:57
@sudip007 you just need to remove all the punctuations https://en.wikipedia.org/wiki/Punctuation
Manpreet Singh
@designviacode
Oct 11 2015 10:58
hey sudip i'm stuck there as well ..
Mahmoud AlSofyani
@msafar95
Oct 11 2015 10:58
Hello, I'm having problems with this line of code.
<p>View more <a href="http://www.freecatphotoapp.com">Cat photos </a> </p>
It says my "p" element must have the text View more with a space after it. Isn't that what I did?
Edper
@edper
Oct 11 2015 11:00
I might try it. But I like jsfiddle so far because you can choose which version of let's say JQuery you are going to use.
Manpreet Singh
@designviacode
Oct 11 2015 11:01
@abhisekp jsbin is awesome .. !! use it to test-run my code ..
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:01
@TheHighPriestess
I'm on the Wikipedia zipline. How am I supposed to get, for example, the title when the json is like this: query.pages.21721040.title????????
every number is different.
I'm confused
This API is ridiculous
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:02
@TheHighPriestess you're mentioning yourself. :P
Edper
@edper
Oct 11 2015 11:02
@msafar95 what challenge you are working on?
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:02
@edper I believe it's number 27
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:02
@edper you can do that using jsbin too.
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:03
@abhisekp haha
I copied and pasted that from the Zipline board
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:04
@TheHighPriestess the JSON is like this query.pages.21721040.title ???
impossible
anyway, it can be retrieved like this tho query.pages[21721040].title
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:06
Want me to take a screenshot?
what if I don't know the number?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:06
@TheHighPriestess but if you wanna retrieve for random number, ...
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:06
well...I want to search
but the retrieved results...have numbers...and if you don't know the number...you can't get at the information you need
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:08
try this
var pageDates = Object.keys(query.pages);
pageDates.forEach(function (date){
    var title = query.pages[date].title;
    // yada yada yada
});
Sudip Ghosh
@sudip007
Oct 11 2015 11:08
@designviacode @msafar95 just add this line of code
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:09
@sudip007 don't say answers...
@TheHighPriestess :point_up: October 11, 2015 4:38 PM
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:09
@sudip007 I'm trying to understand why it's not working. Not the answer
Manpreet Singh
@designviacode
Oct 11 2015 11:09
@sudip007 just solved it .. your hint of removing all punctuations helped out ..
Edper
@edper
Oct 11 2015 11:10
@msafar95 which number of 27 because there are many? ;-)
Manpreet Singh
@designviacode
Oct 11 2015 11:10
Thanks man ! :+1: :smile:
CamperBot
@camperbot
Oct 11 2015 11:10
if you want to thank someone, put an @ before their name!
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:10
@edper Waypoint: Nest an Anchor Element within a Paragraph
Manpreet Singh
@designviacode
Oct 11 2015 11:10
Thanks @sudip007 :+1: :smile:
CamperBot
@camperbot
Oct 11 2015 11:10
designviacode sends brownie points to @sudip007 :sparkles: :thumbsup: :sparkles:
:star: 184 | @sudip007 | http://www.freecodecamp.com/sudip007
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:10
@edper the very first group of exercises
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:11
@abhisekp I'm having trouble understanding that.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:11
@TheHighPriestess whc part?
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:11
Also...I don't think this is right..that I should have to do this
Something isn't right about my query string
but I can't figure out what it is
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:12
@TheHighPriestess yep! You should've whc you've learn it in bonfires.
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:12
@abhisekp Well...perhaps...but it shouldn't be necessary for this
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:13
@TheHighPriestess k. so what's the issue now?
Edper
@edper
Oct 11 2015 11:13
@msafar95 you're code seems to be correct. Did you try touch anything other than that?
<p>View more <a href="http://www.freecatphotoapp.com">Cat photos </a> </p>
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:14
@abhisekp it said that "query" was undefined
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:14
@edper yes, let me try refreshing the page. Could be a glitch
Edper
@edper
Oct 11 2015 11:14
@msafar95 I think you add a space as well after Cat photos it should be Cat photos with no space.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:15
@TheHighPriestess what's the code to retrieve and store in query var?
Sasa
@tanasic
Oct 11 2015 11:15
@edper I believe thats it...
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:15
@edper still doesn't go through :/
Sasa
@tanasic
Oct 11 2015 11:15
@msafar95 can you please copy your whole code here for us to see it
Mistereo
@Mistereo
Oct 11 2015 11:15
@msafar95 show your code.
Sasa
@tanasic
Oct 11 2015 11:15
@msafar95 but not plain text but exact code
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:15
@tanasic how do i do that?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:15
explain format
CamperBot
@camperbot
Oct 11 2015 11:15

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:15
@msafar95 :point_up: October 11, 2015 4:45 PM
Edper
@edper
Oct 11 2015 11:17
Try this one with no space after Cat photos
<p>View more <a href="http://www.freecatphotoapp.com">Cat photos</a></p>
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:18
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p>View more <a href="http://www.freecatphotoapp.com">Cat photos</a> </p>
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:18
Mistereo
@Mistereo
Oct 11 2015 11:18
@msafar95 why you moved a to the end?
@msafar95 move that last p with link to their initial position.
David Bouwkamp
@DavidBouw
Oct 11 2015 11:19
function palindrome(str) {

  if(str.replace("/\s\./","").toLowerCase().split("").reverse().join("") === str){
  return true +  " " +  str.replace("/\s\./g",'').toLowerCase().split("").reverse().join("");
  }
  else{
    return false +  " " + str.replace("/\s\./","").toLowerCase().split("").reverse().join("");
  }
}

palindrome("race car.");

Still struggling with theis regex. Why is my output

"false .rac ecar"

When is should have removed the period and the whitespace?

Edper
@edper
Oct 11 2015 11:20
@msafar95 your <p> code should be after <h2> and before the <img>.
Mahmoud AlSofyani
@msafar95
Oct 11 2015 11:21
@edper that worked. But I don't understand why it's position made a difference?
Mistereo
@Mistereo
Oct 11 2015 11:21
@BrainDrainBahrain first: regex literals should be without ".
David Bouwkamp
@DavidBouw
Oct 11 2015 11:22
@Mistereo still got the same output after removing the quotation marks
Mistereo
@Mistereo
Oct 11 2015 11:22
@BrainDrainBahrain second: your regex will match whitespace with following period not period or whitespace.
Edper
@edper
Oct 11 2015 11:22
The parser probably runs throughout the code sequentially and not simply finding the one that you are trying to add.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:23
@TheHighPriestess so what's the issue? I'm getting proper output in the console
Mistereo
@Mistereo
Oct 11 2015 11:23
@BrainDrainBahrain also you should use g modifier to replace all matches.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:23
@TheHighPriestess
Mistereo
@Mistereo
Oct 11 2015 11:24
@BrainDrainBahrain /\s|\./g
David Bouwkamp
@DavidBouw
Oct 11 2015 11:25
@Mistereo Thanks
CamperBot
@camperbot
Oct 11 2015 11:25
braindrainbahrain sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 289 | @mistereo | http://www.freecodecamp.com/mistereo
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:25
Hello World!
CamperBot
@camperbot
Oct 11 2015 11:25

welcome to FreeCodeCamp @Akfarhoud!

Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:26
Hey every one, nice to be here and meet you all.
Edper
@edper
Oct 11 2015 11:26
Welcome to FCC @Akfarhoud !
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:26
@abhisekp Yeah, I get that as well.
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:26
@Akfarhoud welcome aboard
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:26
thanks @edper
CamperBot
@camperbot
Oct 11 2015 11:26
akfarhoud sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
Mistereo
@Mistereo
Oct 11 2015 11:26
@Akfarhoud hi :)
CamperBot
@camperbot
Oct 11 2015 11:26
:star: 49 | @edper | http://www.freecodecamp.com/edper
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:26
thanks all :D
CamperBot
@camperbot
Oct 11 2015 11:26
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:26
@TheHighPriestess so what's the issue now?
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:26
I'm confused about how to get past tht number...since they're all different
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:27
@TheHighPriestess i already told you.
Object.keys http://devdocs.io/#q=js+Object+keys
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:27
I have a small question, its about example: "function palindrome(str)", does the (str) stand for string and when and where do I need to put it there?, I have searched google, but couldn't find the meaning of it.
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:29
@abhisekp Why would it tell me that query was undefined?
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:29
thanks @Mistereo
CamperBot
@camperbot
Oct 11 2015 11:29
akfarhoud sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 290 | @mistereo | http://www.freecodecamp.com/mistereo
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:29
thanks @abhisekp
CamperBot
@camperbot
Oct 11 2015 11:29
akfarhoud sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 574 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:30
any one?
Edper
@edper
Oct 11 2015 11:30
@BrainDrainBahrain why do you need to return true or false along with the reversed string?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:30
@TheHighPriestess But it doesn't
David Bouwkamp
@DavidBouw
Oct 11 2015 11:31
@Akfarhoud str stands for the reference variable name that is acting a a place holder for the string you enter in the function calls parameters: palindrome("race car") or palindrome("eye") are passed into the palindrome method and stored in the local variable 'str'
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:31
@Akfarhoud me me!!
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:31
@abhisekp Thanks. Is there a way for me to see a larger copy of that screenshot?
CamperBot
@camperbot
Oct 11 2015 11:31
thehighpriestess sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 575 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:32
@TheHighPriestess click it. :)
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:32
ok thank you @BrainDrainBahrain
CamperBot
@camperbot
Oct 11 2015 11:32
akfarhoud sends brownie points to @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for braindrainbahrain
David Bouwkamp
@DavidBouw
Oct 11 2015 11:32
@edper I've added the additional code to help with debugging. I only need the boolean answer to commit, but I don't fully understand how this problem works
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:32
ok..working now....don't know why it didn't work the first time i clicked it
Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:33
:wave: bye everyone
I'm sick. And i need to sleep. :sleeping: :zzz:
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:34
@BrainDrainBahrain so (str) is basically a (for example (var str = xyz))
David Bouwkamp
@DavidBouw
Oct 11 2015 11:34
 if(str.replace(/\s|\./g,"").toLowerCase().split("").reverse().join("") === str)
now it removes the whitespace and period but it has stopped reversing the string. How did I affect the reverse() function when I corrected the replace() param?
Edper
@edper
Oct 11 2015 11:35
@BrainDrainBahrain the pseudocode or algorithm could go like this.
  • Clean up the string with .()\/,-_ and space and store to str.
  • Reverse the cleaned str and store to strReverse for example.
  • return the comparison of the two like return str === strReverse
David Bouwkamp
@DavidBouw
Oct 11 2015 11:35
@Akfarhoud yea, but str is locally instanced to the method that's working on the string value of xyz.
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:37
so it means that
Mistereo
@Mistereo
Oct 11 2015 11:38
@BrainDrainBahrain str.replace(/\s|\./g,"").toLowerCase().split("").reverse().join("") this part should work.
Edper
@edper
Oct 11 2015 11:38
@BrainDrainBahrain You can use console.log by the way instead of returning the string itself.
Mistereo
@Mistereo
Oct 11 2015 11:38
@BrainDrainBahrain maybe there are another problem?
David Bouwkamp
@DavidBouw
Oct 11 2015 11:38
@edper thanks
CamperBot
@camperbot
Oct 11 2015 11:38
braindrainbahrain sends brownie points to @edper :sparkles: :thumbsup: :sparkles:
:star: 50 | @edper | http://www.freecodecamp.com/edper
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:38
function palindrome(str) is the line meaning that I'm going to change or edit the values of (str) which are held in the palindrom string of palindrom("eye") for example
Edper
@edper
Oct 11 2015 11:39
@Mistereo How about the ()-_ characters?
David Bouwkamp
@DavidBouw
Oct 11 2015 11:40
@Akfarhoud that's right. The value of str is defined when the function palindrome(str) is called with the value of str being defined as "eye"
Mistereo
@Mistereo
Oct 11 2015 11:40
@edper I mean this part should work for deleting (' ', '.') and reversing the string.
Wilkin Vásquez
@wilkin4
Oct 11 2015 11:40
Hello world!
CamperBot
@camperbot
Oct 11 2015 11:40

welcome to FreeCodeCamp @wilkin4!

Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:40
ok thanks a lot @BrainDrainBahrain
CamperBot
@camperbot
Oct 11 2015 11:40
akfarhoud sends brownie points to @braindrainbahrain :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for braindrainbahrain
Edper
@edper
Oct 11 2015 11:40
@Mistereo ok. Because it is not yet complete for cleaning the whole string.
Mistereo
@Mistereo
Oct 11 2015 11:40
@edper it was answer for "now it removes the whitespace and period but it has stopped reversing the string. How did I affect the reverse() function when I corrected the replace() param?"
Edper
@edper
Oct 11 2015 11:41
I got to go now for a moment. Need to be with my family. GOD bless you all. Happy coding!
Mistereo
@Mistereo
Oct 11 2015 11:41
@edper bye :)
David Bouwkamp
@DavidBouw
Oct 11 2015 11:43
function palindrome(str) {

  if(str.replace(/\s|\./g,"").toLowerCase().split("").reverse().join("") === str){
  return true;
  }
  else{
    return false;
  }
}

palindrome("race car");

Output:

false

Hmmm.

Abhisek Pattnaik
@abhisekp
Oct 11 2015 11:44
@TheHighPriestess https://www.getpostman.com
David Bouwkamp
@DavidBouw
Oct 11 2015 11:45
I can see a different problem with my regex that I'll run into down the road, but that doesn't explain why my replaced str isn't reversed or passing this input
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:46
@BrainDrainBahrain don't you need to make a new reversed variable for it to pass?
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:46
@abhisekp Thank you. I'll check it out. Right now I can't figure out my syntax
CamperBot
@camperbot
Oct 11 2015 11:46
thehighpriestess sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: thehighpriestess already gave abhisekp points
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:47
Can someone tell me what's wrong with my syntax here? http://codepen.io/highpriestess/pen/gaRBKZ
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 11:47
you already have str, make a new variable like var reversStr and compare them
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 11:47
I'm getting that little red exclamation mark
it says "unexpected token }"
Cyrus John
@CyrusPrime1111
Oct 11 2015 11:58
guys im in this " Learn how Script Tags and Document Ready Work "
it says chai not defiened
what does that mean..??
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:06
OK...someone tell me what's wrong with the syntax here:
 $.ajax(ajaxURL, {
                dataType: "jsonp",
                success: function(data) {
                  var PageDates = Object.keys(data.query.pages);
                  PageDates.forEach(function(date){
                    var title = data.query.pages[date].title;
                    console.log(title);
                  }}
specifically...the brackets and parentheses
Abdul Karim Farhoud
@Akfarhoud
Oct 11 2015 12:08
$.ajax(ajaxURL, should be $.ajax(ajaxURL), ???? maybe?
nvm
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:09
no, that's OK
Coira Ellison
@Coira
Oct 11 2015 12:09
    $.ajax({
    url: "http://example.com/",
    dataType: "jsonp",

    error: function(data) {
        console.log.error("error status " + data.status);
    },
    success: function(data) {
        // do something
    }
});
Mistereo
@Mistereo
Oct 11 2015 12:09
@TheHighPriestess is this all code?
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:10
yes
Mistereo
@Mistereo
Oct 11 2015 12:10
@TheHighPriestess where the closing '}
Coira Ellison
@Coira
Oct 11 2015 12:10
actually, think i've missed a bracket there too
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:10
even when I close it...it's not right
Coira Ellison
@Coira
Oct 11 2015 12:10
so hard doing it here without editor
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:11
i'm totally stumped
Here's the code in context: http://codepen.io/highpriestess/pen/gaRBKZ
Mistereo
@Mistereo
Oct 11 2015 12:11
$.ajax(ajaxURL, {
  dataType: "jsonp",
  success: function(data) {
    var PageDates = Object.keys(data.query.pages);
    PageDates.forEach(function(date){
      var title = data.query.pages[date].title;
      console.log(title);
    });
  }
});
Coira Ellison
@Coira
Oct 11 2015 12:12
@TheHighPriestess up there, that should work
Mistereo
@Mistereo
Oct 11 2015 12:12
oh, i see nw
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:12
let me try that
Mistereo
@Mistereo
Oct 11 2015 12:12
@TheHighPriestess check again, I edit it a sec ago. :)
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:12
no...same thing
Mistereo
@Mistereo
Oct 11 2015 12:12
@TheHighPriestess check again please :)
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:13
@Mistereo look at my codepen
Mistereo
@Mistereo
Oct 11 2015 12:13
link
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:13
you'll see the little exclamation mark
Mistereo
@Mistereo
Oct 11 2015 12:14
@TheHighPriestess give me a minute.
Coira Ellison
@Coira
Oct 11 2015 12:14
@TheHighPriestess oh it's your foreach, you're missing bracket
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:14
ok
Coira Ellison
@Coira
Oct 11 2015 12:14
PageDates.forEach(function(date){
  var title = data.query.pages[date].title;
  console.log(title);
})
does that work?
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:15
isn't that what I have>?
Coira Ellison
@Coira
Oct 11 2015 12:15
PageDates.forEach(function(date){
  var title = data.query.pages[date].title;
  console.log(title);
}
}
is what i got from your codepen
have they changed chat? i don't need to do the backtick things anymore
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:16
ah...ok...got it now
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:16
thank you @Coira
CamperBot
@camperbot
Oct 11 2015 12:16
thehighpriestess sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 271 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Oct 11 2015 12:16
oh good, matching brackets can be annoying
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:17
@Mistereo yeah...i was missing a paren. thank you
CamperBot
@camperbot
Oct 11 2015 12:17
thehighpriestess sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 291 | @mistereo | http://www.freecodecamp.com/mistereo
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:17
@Coira Yeah..that was driving me insane
Mistereo
@Mistereo
Oct 11 2015 12:17
@TheHighPriestess also note that if search results is empty you will get error.
Elizabeth Hatleli
@TheHighPriestess
Oct 11 2015 12:17
i'm not surprised haha
Well...I will fix that
at least it's working partially
PabloPap
@PabloPap
Oct 11 2015 12:24
function binaryAgent(str) {
    function getText(element){
        element = parseInt(element,2);
      console.log(String.fromCharCode(element));
        return String.fromCharCode(element);
    }
    var arr = str.split(" ");
    arr.forEach(getText);
}
why this does't work?
it returns undefined
Cyrus John
@CyrusPrime1111
Oct 11 2015 12:32
can anyone tell me what does this mean "chai is not defined"???..it asked me to add
add a script element at the top of your page.
Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });
Nikola Mitić
@JohneyCodeUp
Oct 11 2015 12:39
Hey good pople, question here :D
I wonder what would be some of better and more intelligent way of doing this.
Problem:

Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.
my solution:

function titleCase(str) {

  // 1. Convert to arrray
  str = str.split(' ');
  // 2. Iterate trough array and capitalized first letter
  str = str.map(function (word) {
    return word.charAt(0).toUpperCase() + word.slice(1);
  });
  // 3. Iterate trough array and lowercase rest of letters
  str = str.map(function (word, index) {
    return word.slice(0, 1) + word.slice(1).toLowerCase(); 
  });
  // 4. Back to string
  str = str.join(" ");

  return str;
}
Mistereo
@Mistereo
Oct 11 2015 12:42
@PabloPap where is return statement in your code?
@PabloPap you return nothing from binaryAgent
@JohneyCodeUp my solution was:
function capitalize(word) {
  return word.substr(0, 1).toUpperCase() + word.substr(1).toLowerCase();
} 
function titleCase(str) {
  return str.split(' ').map(capitalize).join(' ');
}
PabloPap
@PabloPap
Oct 11 2015 12:52

@Mistereo you mean

return arr.forEach(getText);

? it still doesn't work

what am i doing wrong ??????
Mistereo
@Mistereo
Oct 11 2015 12:53
@PabloPap forEach return nothing, it's just iterate over array items.
@PabloPap you probably want to use .map instead and join the result
PabloPap
@PabloPap
Oct 11 2015 12:54
@Mistereo ok i'll try this approach, thanks for the feedback
CamperBot
@camperbot
Oct 11 2015 12:54
pablopap sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 292 | @mistereo | http://www.freecodecamp.com/mistereo
neoage
@neoage
Oct 11 2015 12:55
got it :)
Sasa
@tanasic
Oct 11 2015 13:08
@neoage how old are you and is english your native language if I may ask :D
Shehan Neomal Fernando
@shehannf
Oct 11 2015 13:13
@abhisekp thanks Abhishek, I'll do it now.
CamperBot
@camperbot
Oct 11 2015 13:13
shehannf sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 576 | @abhisekp | http://www.freecodecamp.com/abhisekp
Shehan Neomal Fernando
@shehannf
Oct 11 2015 13:18
Hello world!
CamperBot
@camperbot
Oct 11 2015 13:18

welcome to FreeCodeCamp @shehannf!

Shehan Neomal Fernando
@shehannf
Oct 11 2015 13:18
Thanks :)
CamperBot
@camperbot
Oct 11 2015 13:18
if you want to thank someone, put an @ before their name!
Shehan Neomal Fernando
@shehannf
Oct 11 2015 13:19
@camperbot yeah sure :)
Shair Mir
@ShairMir
Oct 11 2015 13:22
Does bootstrap have a class to vertically align a div to the center
azaleas
@azaleas
Oct 11 2015 13:28
@ShairMir no
@ShairMir try vertical-align:middle
Kouty
@koouty
Oct 11 2015 13:30

Bonfire: Seek and Destroy http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy
her is my code. Strangely (really strange!), it is wrong. Why?

function passoire(arra, liste) {
    for (i = arra.length - 1; i >= 0; i --){
        var item = arra[i];

        for (j = liste.length - 1; j >= 0; j --) {
            var  elemt = liste[j];

            if (item == elemt) {
                 arra = arra.splice(i, 1);

            }
        }

   }
  return "passoire " + arra;
}




function destroyer(arr) {
  var elenco = Array.prototype.slice.call(arguments);

  liste = elenco.slice(1, elenco.length - 1);


  // Remove all the values
 return "resultat final:  " + passoire(arr, liste); 
}


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

All explanation will be appreciated!

CamperBot
@camperbot
Oct 11 2015 13:30
Sorry, can't find a bonfire called seek and destroyher is my code strangely really strange it is wrong whyfunction passoirearra liste for i arralength - 1 i 0 i -- var item arrai for j listelength - 1 j 0 j -- var elemt listej if item elemt arra arrasplicei 1 return passoire arrafunction destroyerarr var elenco arrayprototypeslicecallarguments liste elencoslice1 elencolength - 1 remove all the values return resultat final passoirearr liste destroyer1 2 3 1 2 3 2 3 all explanation will be appreciated. [ Check the map? ]
Shair Mir
@ShairMir
Oct 11 2015 13:42
@azaleas Yea i tried, but when setting the height to 600px of the container the image doesn't move to the center vertically
Coira Ellison
@Coira
Oct 11 2015 13:42
@navyvel this line here arra = arra.splice(i, 1);. splice() returns an array of elements removed, so you're removing an element from arra, then making arra that value
Kouty
@koouty
Oct 11 2015 13:42
@camperbot It's good now? the link is passted. If the question is not good formulated, I'll modify again
Coira Ellison
@Coira
Oct 11 2015 13:42
@navyvel oh, did you get it to work?
Nikola Mitić
@JohneyCodeUp
Oct 11 2015 13:46
@Mistereo almost the same as I, but more elegant, nice :D thanks
CamperBot
@camperbot
Oct 11 2015 13:46
johneycodeup sends brownie points to @mistereo :sparkles: :thumbsup: :sparkles:
:star: 293 | @mistereo | http://www.freecodecamp.com/mistereo
Kouty
@koouty
Oct 11 2015 13:51
This message was deleted
Kouty
@koouty
Oct 11 2015 14:00
@Coira Of course!
I need the complementary method of splice. Is that something correponding to this??
Coira Ellison
@Coira
Oct 11 2015 14:01
@navyvel i think you can use splice to add stuff as well as delete
@navyvel but i think you might have an easier time of it if you rewrote using .filter()
you shouldn't really modify an array you're looping over while you're looping over it, it can really screw things up
@navyvel oh, i see what you mean by complementary. arr.splice(...) will remove stuff from arr, you don't need to assign it to anything
Kouty
@koouty
Oct 11 2015 14:07
@Coira It's good THANK'S
arra = arra.splice is not good,
simply arra.splice is good.
the furter recomandation to use filter will be followed too. But I know now that We have two tools (arr.splice() if we want to returne the purified list and arr=arr.splice if we want to return the removed items. Very important.
function strainer(arra, liste) {
    for (i = arra.length - 1; i >= 0; i --){
        var item = arra[i];
        for (j = liste.length - 1; j >= 0; j --) {
            var  elemt = liste[j];
            if (item == elemt) {
                 arra.splice(i, 1);
            }
        }
   }
  return arra;
}
function destroyer(arr) {
  var elenco = Array.prototype.slice.call(arguments);

  liste = elenco.slice(1, elenco.length - 1);


  // Remove all the values
 return strainer(arr, liste); 
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
CamperBot
@camperbot
Oct 11 2015 14:07
navyvel sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 272 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Oct 11 2015 14:07
@navyvel yep, you got it :)
Jon
@JonAndres
Oct 11 2015 14:12
Hello world!
CamperBot
@camperbot
Oct 11 2015 14:12

welcome to FreeCodeCamp @JonAndres!

noobstar
@namsir
Oct 11 2015 14:12
hello world!
CamperBot
@camperbot
Oct 11 2015 14:12

welcome to FreeCodeCamp @namsir!

Kouty
@koouty
Oct 11 2015 14:13
\ @Coira the next step is with the filter
Coira Ellison
@Coira
Oct 11 2015 14:14
@navyvel ok, give me a shout if you need me
Pratik Khandagale
@allpratik
Oct 11 2015 14:17
@SaintPeter Hi there is another issue today as well. I has an issue with Waypoint: Create a Custom Heading in Bootstrsp section. Even after including class "col-xs-8" and "col-xs-4" for h2 and img tag respectively, execution shows error.

My code snippet ``` <div class="row">
<h2 class="col-xs-8 text-primary text-center">CatPhotoApp</h2>

<a href="#"><img class="col-xs-4 img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> </div>```

noobstar
@namsir
Oct 11 2015 14:21
@allpratik only add col-xs-8 and col-xs-4 in a div container.
Pratik Khandagale
@allpratik
Oct 11 2015 14:23
@namsir Will try and get back here
@namsir It worked!! But it does defeats the motive of this particular waypoint. Headline and image is not on same line, still it got passed!!
I think it's an issue.
noobstar
@namsir
Oct 11 2015 14:26
bonfire create a custom heading
CamperBot
@camperbot
Oct 11 2015 14:26
Sorry, can't find a bonfire called create a custom heading. [ Check the map? ]
Pratik Khandagale
@allpratik
Oct 11 2015 14:26
Or am I leaving something?
noobstar
@namsir
Oct 11 2015 14:26
bon fire create a custom heading
which bonfire is this?
Pratik Khandagale
@allpratik
Oct 11 2015 14:26
Waypoint: Create a Custom Heading
No. 12
in bootstrap section
noobstar
@namsir
Oct 11 2015 14:27
waypoint create a custom heading
Pratik Khandagale
@allpratik
Oct 11 2015 14:27
yes
noobstar
@namsir
Oct 11 2015 14:27
oh ok
Umoru Mohammed
@umoru
Oct 11 2015 14:27
Hi all and Good Afternoon from Ghana
Is there anyone here from Ghana?
noobstar
@namsir
Oct 11 2015 14:28
let me see your codes
Umoru Mohammed
@umoru
Oct 11 2015 14:29
I need a coding partner that I would be able to learn fast
Someone with relatively indept knowledge that is willing to share
Pratik Khandagale
@allpratik
Oct 11 2015 14:30
@namsir you want to see my code?
noobstar
@namsir
Oct 11 2015 14:30
@allpratik yes
Pratik Khandagale
@allpratik
Oct 11 2015 14:30
<div class="row">
<h2 class="col-xs-8 text-primary text-center">CatPhotoApp</h2>
<a href="#"><img class="col-xs-4 img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a> </div>
we are supposed to place heading and img on single line
noobstar
@namsir
Oct 11 2015 14:31
@allpratik lets try this. put your h2 element in a div
Pratik Khandagale
@allpratik
Oct 11 2015 14:31
ohkay... two separate div . one for h2 and other for img?
noobstar
@namsir
Oct 11 2015 14:31
yes
Pratik Khandagale
@allpratik
Oct 11 2015 14:31
just a moment
noobstar
@namsir
Oct 11 2015 14:31
but both are nested inside that div with class of row.
Pratik Khandagale
@allpratik
Oct 11 2015 14:31
yes
noobstar
@namsir
Oct 11 2015 14:32
Your h2 element and topmost img element should both be nested together within a div element with the class row. You already did this. but now you must wrap a div around your h2 and another div around your img
after you done that. post your code here for inspection.
Pratik Khandagale
@allpratik
Oct 11 2015 14:33
It worked!! Test also cleared.
noobstar
@namsir
Oct 11 2015 14:34
there you go :)
Pratik Khandagale
@allpratik
Oct 11 2015 14:34
Thanks @namsir !!
CamperBot
@camperbot
Oct 11 2015 14:34
allpratik sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:star: 224 | @namsir | http://www.freecodecamp.com/namsir
joshdavidson613
@joshdavidson613
Oct 11 2015 15:45
HI, I don't understand what problems I am having with "Waypoint: Target a Specific Child of an Element Using jQuery
"
Why doesn't the following line of code work:
$(".well:nth-child(2)").addClass("animated bounce");
Rex Schrader
@SaintPeter
Oct 11 2015 15:47
@joshdavidson613 From the description: target:nth-child(n)
@joshdavidson613 so, .target, not .well
joshdavidson613
@joshdavidson613
Oct 11 2015 15:48
so it really isn't targeting a 'child', it is targeting the 2nd target class
?
and thanks @SaintPeter
CamperBot
@camperbot
Oct 11 2015 15:50
joshdavidson613 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 974 | @saintpeter | http://www.freecodecamp.com/saintpeter
joshdavidson613
@joshdavidson613
Oct 11 2015 15:51
ahh, from another documentation source:
Select each element that is the third child of its parent:
weird command
Rex Schrader
@SaintPeter
Oct 11 2015 15:52
Weird, but useful
For example, if you want to do alternating striped rows in a table
You could do tr:nth-child(2)
joshdavidson613
@joshdavidson613
Oct 11 2015 15:53
yeah, see that
but the thing is that there is no "target" class, there is "target1", "target2", etc....so how does the selector work on "target"?
Mahmoud AlSofyani
@msafar95
Oct 11 2015 15:55
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
    .red-text {
        color: red;
    }
    h2 {
        font-family: Lobster, Monospace;
    }
    p {
        font-size: 16px;
        font-family: Monospace;
    }
    .thick-green-border {
        border-color: green;
        border-width: 10px;
        border-style: solid;
        border-radius: 50%;
    }
    .smaller-image {
        width: 100px;
    }
</style>

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

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

    <li 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.</li>
    <li 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.</li>
</ul>
I was asked to make sure my li elements have a closing tag. I made sure many times but it still won't go through. Any ideas?
Rex Schrader
@SaintPeter
Oct 11 2015 15:55
@joshdavidson613 There sure are target classes, take a look again. There are just #target1 IDs
@joshdavidson613 <button class="btn btn-default target" id="target1">#target1</button>
joshdavidson613
@joshdavidson613
Oct 11 2015 15:56
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
ahh, I am an idiot
thank's for point out
CamperBot
@camperbot
Oct 11 2015 15:57
if you want to thank someone, put an @ before their name!
joshdavidson613
@joshdavidson613
Oct 11 2015 15:57
@SaintPeter thanks!
CamperBot
@camperbot
Oct 11 2015 15:57
:warning: joshdavidson613 already gave saintpeter points
joshdavidson613 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
Hélio Guilherme
@HelioGuilherme66
Oct 11 2015 16:02
@msafar95 It is strange that orphan anchor for the image, inside <ul>. Also the long text for each <li> may confuse this test, try to reduce it.
Free i
@harishcse
Oct 11 2015 16:02
iam unable send the mail in out look in the php/ codignator
CatNipples98
@CatNipples98
Oct 11 2015 16:35
is there anyone that could help me?
Abhisek Pattnaik
@abhisekp
Oct 11 2015 16:36
@CatNipples98 about?