These are chat archives for FreeCodeCamp/Help

27th
Oct 2015
Leon Noel
@leonnoel
Oct 27 2015 00:00
@valient your body
needs a color property
background-color is for the actual background; color is for text color
Valient47
@Valient47
Oct 27 2015 00:02
@leonnoel im sorry i dont understand, how do you mean color propoty
<body class="font-family""color-green"> </body>
.color-green { color: green; }
thats my code i dont know why it isnt working
Ryan
@Ryan-7
Oct 27 2015 00:04

function factorialize(num)

{

if (num<0) {
return 1;
}

else {
return factorialize(num-1);
}

}

factorialize(5);

Any idea how I can accomplish a return of the integer
Leon Noel
@leonnoel
Oct 27 2015 00:04
body {
background-color: green;     /*makes the background green*/
color: green;     /*Would make font green*/
}
Valient47
@Valient47
Oct 27 2015 00:05
yes but i put both of them and it stil dont work T_T
Leon Noel
@leonnoel
Oct 27 2015 00:05
Paste the code inside your style block
Valient47
@Valient47
Oct 27 2015 00:06
its all there
  body {
    background-color: green;
  }

  .color-green {
    color: green;
  }

  .font-family {
    font-family: Monospace;
  }

</style>
m-farooqui
@m-farooqui
Oct 27 2015 00:08
here is my code still stuck on the h1 element
<h1> Hello World </h1>
i am in waypoint 48
Leon Noel
@leonnoel
Oct 27 2015 00:08
@Valient47 You still haven't given the body a color of green
Look at how my pasted code above looks different then your body rule
Lewis Hey
@JorgiLaFord
Oct 27 2015 00:09
@m-farooqui as I said, you just need to take out the spaces in the " Hello World " to make it <h1>Hello World</h1>
Valient47
@Valient47
Oct 27 2015 00:10
okay its working @leonnoel sorry im just terrible at this
Carlton Stith
@carltonstith
Oct 27 2015 00:10
I need help with the .pop() function exercise
Leon Noel
@leonnoel
Oct 27 2015 00:10
No worries, have to start somewhere right?
Carlton Stith
@carltonstith
Oct 27 2015 00:11
does anyone know how to remove the first items from an array?
Chris
@Aoxom
Oct 27 2015 00:11
@m-farooqui what does the error say?
Carlton Stith
@carltonstith
Oct 27 2015 00:12
has anyone completed the manipulate arrays with pop exercise in JavaScript?
m-farooqui
@m-farooqui
Oct 27 2015 00:13
i am having a hard time with creating a h1 element and putting the text in there
Valient47
@Valient47
Oct 27 2015 00:13
enough for me for tonight, thanks all and have a good night/day
CamperBot
@camperbot
Oct 27 2015 00:13
if you want to thank someone, put an @ before their name!
Chris
@Aoxom
Oct 27 2015 00:13
@Valient47 maybe try moving your closing </body> tag at the end of your code, after the h1 line?
Lewis Hey
@JorgiLaFord
Oct 27 2015 00:14
@m-farooqui again, 3rd time now, you're just adding spaces into it. it has to be exactly what they tell you to put. So take out the spaces at the beginning and end of " Hello World "
Leon Noel
@leonnoel
Oct 27 2015 00:14
@m-farooqui You have a space before and after the text
Just remove the space and it should work like @JorgiLaFord mentioned
Lewis Hey
@JorgiLaFord
Oct 27 2015 00:15
@carltonstith in the removed variable, simply put myArray.pop(), and it will "pop" the last value in the array.
Ryan
@Ryan-7
Oct 27 2015 00:17

function factorialize(num)

{

if (num<0) {
return 1;
}

else {
return num * factorialize(num-1);
}

}

factorialize(5);

bonfire #3
CamperBot
@camperbot
Oct 27 2015 00:17
Sorry, can't find a bonfire called 3. [ Check the map? ]
Ryan
@Ryan-7
Oct 27 2015 00:17
imposibru !!!!
Bill
@kirah1314
Oct 27 2015 00:18
help format
CamperBot
@camperbot
Oct 27 2015 00:18

: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

Teejay Parker
@TeejayParker
Oct 27 2015 00:18
Let me know what you guys think, I used my website as a placeholder for now for the portfolio and the contact me buttons: http://codepen.io/TeejayParker/full/avLKJz/
Ryan
@Ryan-7
Oct 27 2015 00:18

``` function factorialize(num)

{

if (num<0) {
return 1;
}

else {
return num * factorialize(num-1);
}

}

factorialize(5);
```

```
Bill
@kirah1314
Oct 27 2015 00:19
@Ryan-7 the back-ticks should have their own separate lines
Ryan
@Ryan-7
Oct 27 2015 00:19
function factorialize(num)

{

  if (num<0) { 
    return 1;
   }


  else {
  return num * factorialize(num-1);
   }

}

factorialize(5);
m-farooqui
@m-farooqui
Oct 27 2015 00:20
@JorgiLaFord @leonnoel thank you its working
CamperBot
@camperbot
Oct 27 2015 00:20
m-farooqui sends brownie points to @jorgilaford and @leonnoel :sparkles: :thumbsup: :sparkles:
:star: 87 | @leonnoel | http://www.freecodecamp.com/leonnoel
:star: 170 | @jorgilaford | http://www.freecodecamp.com/jorgilaford
Chris
@Aoxom
Oct 27 2015 00:21
@Ryan-7 hmm, you are using that factorialize function inside the factorialize function.. functionception
Ryan
@Ryan-7
Oct 27 2015 00:21
lol
I'm trying to figure out recursion
I don't understand how to do the integral
Any tips
functionception lmao
like I understand in my head what I want to happen, but I cant code it
Chris
@Aoxom
Oct 27 2015 00:23
well im just a beginner too, but i cant get my brain to figure out what your inner factorialize function would do
Ryan
@Ryan-7
Oct 27 2015 00:23
I'm just trying to get the number to repeat itself
Chris
@Aoxom
Oct 27 2015 00:24
return num factorialize(num-1); so 5 functionception(5-1)
Bill
@kirah1314
Oct 27 2015 00:24
@TeejayParker looks awesome!! I like how I could change the background. My only suggestion is to change the font color of Change Background Image:It was hard to read with the lights in the background or change the starting wallpaper :thumbsup:
Chris
@Aoxom
Oct 27 2015 00:24
sorry, FCC italicized that automatically and made it hard to read
Teejay Parker
@TeejayParker
Oct 27 2015 00:24
awesome, i'll take a look at that :)
Ryan
@Ryan-7
Oct 27 2015 00:25
hmmm
Teejay Parker
@TeejayParker
Oct 27 2015 00:25
@kirah1314 thank you for the feedback :)
CamperBot
@camperbot
Oct 27 2015 00:25
teejayparker sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 295 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Chris
@Aoxom
Oct 27 2015 00:27
@Ryan-7 as a hint, i used a for loop in my solution
Ryan
@Ryan-7
Oct 27 2015 00:29
hmmm good diea
idea*
What did you l oop
the number?
Antonio HoYen
@AntonioHoYen
Oct 27 2015 00:29
@TeejayParker Nice!
Ryan
@Ryan-7
Oct 27 2015 00:30
How far into this are you @Aoxom
Chris
@Aoxom
Oct 27 2015 00:30
@Ryan-7 i made it so my loop would keep looping for the length of the given (num)
Bill
@kirah1314
Oct 27 2015 00:32
@Ryan-7 you're like 99% done with the codes you posted above :)
Chris
@Aoxom
Oct 27 2015 00:32
@Ryan-7 im just starting the intermediate algorithm scripting, and did a couple of the first ziplines. im still a beginner though, and going over the earlier bonfires is probably good practice for me
Ryan
@Ryan-7
Oct 27 2015 00:34
@Aoxom Cool, are you just learning for fun or do you want to pursue it professionally?
@kirah1314 I've been stuck for two hours trying different things
Bill
@kirah1314
Oct 27 2015 00:36
@Ryan-7 if (num<0) you just need to change this and you're done
Chris
@Aoxom
Oct 27 2015 00:36
@Ryan-7 both i suppose. id really love to do this professionally, in the long run
@Ryan-7 and i think kirah is right, you must be solving that bonfire with a different solution than me, so maybe ignore my advice earlier
Bill
@kirah1314
Oct 27 2015 00:39
@Ryan-7 think about it, if we multiply 0 with any number the result would be 0 so do you want to use 0?
Chris
@Aoxom
Oct 27 2015 00:40
but 0 isnt less than 0
Bill
@kirah1314
Oct 27 2015 00:41
^ hint
m-farooqui
@m-farooqui
Oct 27 2015 00:42
In waypoint 49 its asking to create a class pint-text which i did but when its comes to give my h1 element the color pink i am having a hard time
here is my code
<h1 class="pink-text"> Hello World </h1>
*pink-text
Chris
@Aoxom
Oct 27 2015 00:43
@m-farooqui what does your <style> look like?
Bill
@kirah1314
Oct 27 2015 00:43
@m-farooqui do you know how to:
Create a CSS class called pink-text that gives an element the color pink.
Give your h1 element the class of pink-text.
?
Carlton Stith
@carltonstith
Oct 27 2015 00:44
@JorgiLaFord I figured it out. I
Bill
@kirah1314
Oct 27 2015 00:45
@m-farooqui how do you reference pink-text after you added it as a class to h1?
m-farooqui
@m-farooqui
Oct 27 2015 00:45
yes
Ryan
@Ryan-7
Oct 27 2015 00:45
@kirah1314 !!
@kirah1314 It's crazy how one little thing can throw off it all. Thank you!!
CamperBot
@camperbot
Oct 27 2015 00:46
ryan-7 sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 296 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Lewis Hey
@JorgiLaFord
Oct 27 2015 00:47

```var Bike = function() {
// Only change code below this line.
this.speed = 100;
function addUnit(value) {
return value + "KM/H";
}

this.getSpeed = function () {
return addUnit(this.speed);
};

};``` So i'm supposed to make the method "getSpeed" accessible outside of the object, which I did by adding this.getSpeed, and addUnit(this.speed);, and then make myBike.speed undefined. It says I did the "getSpeed" part correctly, but when I make the myBike.speed undefied (using return) it says that is correct but then says the the getSpeed (being accessible outside the object) is now incorrect. Is this a bug? Or am I missing something due to awful instructions in this part? (waypoint make object properties private)

Bill
@kirah1314
Oct 27 2015 00:48
@Ryan-7 I know right!? Things have to be exact in programming sometimes missing a } is all it takes
m-farooqui
@m-farooqui
Oct 27 2015 00:49
@kirah1314 i was tyring to put as a color before the words "Hello World" but that didn't work
so color:pink-text Hello World
Bill
@kirah1314
Oct 27 2015 00:51
@m-farooqui the way to reference a class is .pink-text (notice the period in front?)
Francis Isberto
@icebert04
Oct 27 2015 00:51
What's the answer to Bonfire 10: Truncate a string?
Bill
@kirah1314
Oct 27 2015 00:51
@m-farooqui and then you have to put that between <style>..................</style>
Ryan
@Ryan-7
Oct 27 2015 00:53
@Kirah1314 Can you help me understand the math
Bill
@kirah1314
Oct 27 2015 00:53
@m-farooqui a good example is to look at this which is on the waypoint:
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
Ryan
@Ryan-7
Oct 27 2015 00:54
 num * factorialize(num-1);
I guess I'm not totally sure how the code works
Bill
@kirah1314
Oct 27 2015 00:54
@m-farooqui instead of body, you use .pink-text
@Ryan-7 the way I tried to understand it was using paper and pencil. Then go ahead and use num = 5
Ryan
@Ryan-7
Oct 27 2015 00:58
What is the factorialize function doing to the number
Lewis Hey
@JorgiLaFord
Oct 27 2015 00:59
Can anyone explain public/private properties in JS? Or know a good resource? The "instructions" in fcc are just "do this"
m-farooqui
@m-farooqui
Oct 27 2015 00:59
@kirah1314 thank you
CamperBot
@camperbot
Oct 27 2015 00:59
m-farooqui sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 297 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Oct 27 2015 00:59
@Ryan-7 it's looping it, counting down by 1 number less each loop, until num === 0
Lane Watson
@lanew
Oct 27 2015 01:00
Can anyone explain public/private properties in JS? Or know a good resource? The "instructions" in fcc are just "do this" agreed
Same here. I got two of the three to pass, but cannot figure out the myBike.speed undefined part
Chris
@Aoxom
Oct 27 2015 01:01
i think its like....5 * function(5-1), 4 * function(4-1), 3 * function(3-1), 2 * function(2-1), 1 * function(1-1), then the function stops firing because of your if statement
Lewis Hey
@JorgiLaFord
Oct 27 2015 01:02
To get it to work, take out the "this" from this.speed. It'll make it work, but I still don't get why it's private, or public, whichever one it is
Lane Watson
@lanew
Oct 27 2015 01:03
@JorgiLaFord I understand the theory behind it. I think it has to do with local/global scope, but the instructions seem pretty lackluster on this one and to introduce it like this.
Lewis Hey
@JorgiLaFord
Oct 27 2015 01:04
@lanew Is it just that "this.whatever" makes it publicly accessible, and without that it's private and can only be accessed inside the function?
Ryan
@Ryan-7
Oct 27 2015 01:05
hmmm
i dont get it
but its close to clicking
Lane Watson
@lanew
Oct 27 2015 01:05
@JorgiLaFord I got that part, but where is the myBike.speed go to be undefined? Inside the function or outside?
Lewis Hey
@JorgiLaFord
Oct 27 2015 01:07
```
Bill
@kirah1314
Oct 27 2015 01:08
@Ryan-7 did you come up with the codes yourself or you found it somewhere? :)
Lewis Hey
@JorgiLaFord
Oct 27 2015 01:08
var Bike = function() {
  // Only change code below this line.
  speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

  this.getSpeed = function () {
    return addUnit(this.speed);
  };

};
That's the solution I got to work. I have no idea why it works. And nobody has answered me thus far...
Lane Watson
@lanew
Oct 27 2015 01:09
@JorgiLaFord interesting. I got this to get two of three to pass: getSpeed = function () {
return addUnit(speed);
};
this.getSpeed = Bike;
};
Chris
@Aoxom
Oct 27 2015 01:09
5 * (5-1) * (4-1) * (3-1) * (2-1) @Ryan-7
Lewis Hey
@JorgiLaFord
Oct 27 2015 01:10
@lanew Again I have no idea why, as the instructions are awful and have no explanation. Also google has no answers...
Lane Watson
@lanew
Oct 27 2015 01:11
@JorgiLaFord I know. I've been moving steady. And bam, hit this one, look up private and public properties and methods on SO and google, and couldn't find it. Thanks for the code, but I really want to understand this. I think it has to do with Closure in JS?
CamperBot
@camperbot
Oct 27 2015 01:11
lanew sends brownie points to @jorgilaford :sparkles: :thumbsup: :sparkles:
:star: 173 | @jorgilaford | http://www.freecodecamp.com/jorgilaford
Ryan
@Ryan-7
Oct 27 2015 01:34
@Aoxom I got it now
kayerald23
@kayerald23
Oct 27 2015 01:38
hi im new in this site. can you please help me with my html code
This message was deleted

<style>
.red-text{

    color:red;
 }

</style>

<h2 class="red-text">CatPhotoApp</h2> , whats wrong with my code? its not working? it says here that my h2 element should be red??

tommy
@tommygebru
Oct 27 2015 01:46
your code looks fine I would just fix or adjust the spacing
something I am trying as I use FreeCodeCamp is have codepen.io open this allows me to "tidy" my code (There is a Tidy button that autocorrects spacing in your code) and create a personal project just for fun, at the same time as I learn from waypoints. I go back and forth every few minutes between the websites, I think it helps me learn and practice coding at the same time.
Herman Fassett
@HermanFassett
Oct 27 2015 01:50
Cool @tommygebru
Ryan
@Ryan-7
Oct 27 2015 01:53
what does += mean
Herman Fassett
@HermanFassett
Oct 27 2015 01:54
plus equals :P

For instance

a += b;

is equivalent to

a = a + b;
Ender Mendiluce
@Volkenas
Oct 27 2015 01:54
Correct
Ryan
@Ryan-7
Oct 27 2015 01:56
Question
Rex Schrader
@SaintPeter
Oct 27 2015 01:56
answer
Comical suggestion
Ryan
@Ryan-7
Oct 27 2015 01:56
function factorialize(num)

{

  if (num<1) { 
    return 1;
   }


  else {
  return num*factorialize(num-1);
   }

}

factorialize(5);
is the factorialize(5) called the argument
Rex Schrader
@SaintPeter
Oct 27 2015 01:57
@Ryan-7 You know, you really should solve these yourself rather than finding solutions on the interenet.
DTing
@dting
Oct 27 2015 01:57
@Ryan-7 num is the argument. or 5. factorialize is the function
Ryan
@Ryan-7
Oct 27 2015 01:57
thanks @dting
CamperBot
@camperbot
Oct 27 2015 01:57
ryan-7 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1473 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 27 2015 01:57
you call the function with the argument/s
Herman Fassett
@HermanFassett
Oct 27 2015 01:58
Though num is the parameter
Ryan
@Ryan-7
Oct 27 2015 01:59
I think I finally understand
casually used interchangably
but parameter is more correct.
Herman Fassett
@HermanFassett
Oct 27 2015 02:00
My teachers don't seem to think it's interchangeable
DTing
@dting
Oct 27 2015 02:01
well thats an academic setting
in the real world it is fairly common for people to refer to the parameter as the argument
Rex Schrader
@SaintPeter
Oct 27 2015 02:02
Parameter is the name of the local variable, Argument is what is passed into the parameter.
function test(Parameter1, Parameter2, Parameter3)  { /* some code */ }

test(Argument1, Arguement2, Arguement3);
Chris
@Aoxom
Oct 27 2015 02:05
thats some code you got there
Herman Fassett
@HermanFassett
Oct 27 2015 02:05
Argument and Arguement are interchangeable there
:P
Chris
@Aoxom
Oct 27 2015 02:05
ooooh snap!! haha
Rex Schrader
@SaintPeter
Oct 27 2015 02:06
@HermanFassett If I could spell, I'd be dangrous.
Anthony
@Guzko
Oct 27 2015 02:07
How do I comment this out?
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
nvm got it
Byron Lagrone
@byronic
Oct 27 2015 02:09
For reference, @Guzko -- <!-- an HTML comment -->
so they start with <!-- and end with -->
Anthony
@Guzko
Oct 27 2015 02:17
Thanks @byronic I need help resizing an image. With the class at smaller-image.
<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;
  }
</style>

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

<img 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>
CamperBot
@camperbot
Oct 27 2015 02:17
guzko sends brownie points to @byronic :sparkles: :thumbsup: :sparkles:
:star: 207 | @byronic | http://www.freecodecamp.com/byronic
Piyush Vats
@piyushv
Oct 27 2015 02:25
hi guys so i just started bonfires onto bonfire-reverse-a-string
ive got the solution already with code just wondering im performing operations on the same variable. how can i make my code more efficient and my that i mean is there a way to merge all of those functions into one line of code. sorry if i am not able to use the right terminology to describe what it is im asking for haha.
function reverseString(str) {
  var str = str.split("");
  var str = str.reverse();
  var str = str.join("");
  return str;
}

reverseString("hello");
Herman Fassett
@HermanFassett
Oct 27 2015 02:27
Yeah you can do
return str.split("").reverse().join("");
DJ
@qualitymanifest
Oct 27 2015 02:27
@piyushv yes, you can chain .split('').reverse().join('');
@piyushv also, str is already defined since it is passed into the function so you shouldn't do var str here
Piyush Vats
@piyushv
Oct 27 2015 02:28
i see. thanks @qualitymanifest and @HermanFassett
CamperBot
@camperbot
Oct 27 2015 02:28
piyushv sends brownie points to @qualitymanifest and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 457 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
:star: 304 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
nothingness99
@nothingness99
Oct 27 2015 02:30
<u1>
<li class="red-text">milk</li>
<li class="red-text">cheese</li>
<li class="red-text">ice cream</li>
</u1>
Marc-Alexandru Baetica
@marcbaetica
Oct 27 2015 02:30
@piyushv also make sure to play around with the function to see what it does :)
like return "Hello Worldddd!!! YEEEEEHUUU!!!".split(" ").reverse().join(" !!!!!! ");
DJ
@qualitymanifest
Oct 27 2015 02:31
@nothingness99 you want to do ul not u1 (if i'm not mistaken...)
Byron Lagrone
@byronic
Oct 27 2015 02:31
@Guzko There are two steps to that (creating a class, and actually referencing it in an HTML tag)
What's giving you the trouble, exactly?
nothingness99
@nothingness99
Oct 27 2015 02:32
got that...thanks Qualitymanifest!
CamperBot
@camperbot
Oct 27 2015 02:32
if you want to thank someone, put an @ before their name!
nothingness99
@nothingness99
Oct 27 2015 02:32
thanks @qualitymanifest
CamperBot
@camperbot
Oct 27 2015 02:32
nothingness99 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 305 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Oct 27 2015 02:33
no problem
Anthony
@Guzko
Oct 27 2015 02:33
@byronic Where do I put the .smaller-image {width: 100px;}
Byron Lagrone
@byronic
Oct 27 2015 02:36
@Guzko that would go underneath (or alongside) your other CSS declarations
Natalie Patrice Tucker
@NataliePatriceTucker
Oct 27 2015 02:36
I'm on Waypoint: Manipulate Arrays with shift and can't figure out how to make myRemoved contain "john" since that string was removed from the original array how do I know reference it?
Byron Lagrone
@byronic
Oct 27 2015 02:36
so anywhere between your <style> and </style> tags
Anthony
@Guzko
Oct 27 2015 02:36
okay
Byron Lagrone
@byronic
Oct 27 2015 02:36
That action, by the way, is defining the class in CSS
Anthony
@Guzko
Oct 27 2015 02:37
What is wrong with this...
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
  .smaller-image { width: 100px; }
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">
Byron Lagrone
@byronic
Oct 27 2015 02:39
@Guzko you've defined the .smaller-image class but haven't added it to one of your HTML tags (that's the step that actually puts the CSS to use on one of your HTML elements)
For a hint on how to do it, note that you've already applied class="red-text" to your h2 tag
You'll need to do a very similar thing on the img ;)
to use your .smaller-image class
Anthony
@Guzko
Oct 27 2015 02:40
Okay. Thanks for not giving me the answer straight off. And giving me the opportunity to learn it myself. really appreciate it.
CamperBot
@camperbot
Oct 27 2015 02:40
if you want to thank someone, put an @ before their name!
Natalie Patrice Tucker
@NataliePatriceTucker
Oct 27 2015 02:43
Any one in the room who can help with Waypoint: Manipulate Arrays with shift
Charles Milam
@CharlesMilam
Oct 27 2015 02:44
What type of help are you needing? I'll do my best to assist.
Natalie Patrice Tucker
@NataliePatriceTucker
Oct 27 2015 02:44
I'm on Waypoint: Manipulate Arrays with shift and can't figure out how to make myRemoved contain "john" since that string was removed from the original array how do I know reference it?
how do i now reference it
Dan Morency
@g0shdanit
Oct 27 2015 02:46
var myCar = new Car();
engines = 1;
engines should be a number, what am i doing wrong?
Herman Fassett
@HermanFassett
Oct 27 2015 02:48
engines should be a property of myCar
Charles Milam
@CharlesMilam
Oct 27 2015 02:49
@blkdykegoddess hmmm, looking at my solution, and I don't see where John is being removed prior to you having to do it. Can you post your code?
Natalie Patrice Tucker
@NataliePatriceTucker
Oct 27 2015 02:50

@CharlesMilam var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.
myRemoved = myArray.shift();

var myRemoved = myArray; // This should be ["John"] and myArray should now be [23, ["dog", 3]].

// Only change code above this line.

Dan Morency
@g0shdanit
Oct 27 2015 02:50
@HermanFassett how you mean
h4r1m4u
@h4r1m4u
Oct 27 2015 02:50
@g0shdanit
var myDog = new Dog();
myDog.legs = 4;
Herman Fassett
@HermanFassett
Oct 27 2015 02:50
Like that^ @g0shdanit
There, legs is a property of myDog
Dan Morency
@g0shdanit
Oct 27 2015 02:51
OOOOOOOOO thanks @HermanFassett @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 02:51
g0shdanit sends brownie points to @hermanfassett and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 339 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 458 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Natalie Patrice Tucker
@NataliePatriceTucker
Oct 27 2015 02:51
@CharlesMilam the first part of the solution is correct, that the myArray should now equal [23, ["dog", 3]] but i can't figure this part out: myRemoved should contain "John".
Anthony
@Guzko
Oct 27 2015 02:51
@byronic Okay so I got one of two parts completed. I still need it to get 100px wide.
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
  .smaller-image {width: 100px;}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">

<img class="smaller-image {width: 100px;}">
Charles Milam
@CharlesMilam
Oct 27 2015 02:52
@blkdykegoddess and it initially does, but then you redefine it on the next line when you declare it again and assign myArray to it.
@Guzko you are close, but make your class for img similar to what you have done with the h2. Hint, you have already defined your CSS rule in the style section.
Natalie Patrice Tucker
@NataliePatriceTucker
Oct 27 2015 02:55
@CharlesMilam so should I create a variable to hold the shifted value? Or is the answer even simpler than that and have it output the shifted value. perhaps with console.log?
Anthony
@Guzko
Oct 27 2015 02:56
So why can't I close an img like (</img>) @byronic
Ulises Cabrera
@UlisesCabrera
Oct 27 2015 02:56
http://codepen.io/ulisescabrera/full/qOoKmJ/ I'm ready for some feedback on my calculator project!
Anthony
@Guzko
Oct 27 2015 02:57
@UlisesCabrera Wow that's GREAT! I hope I can make something like that when I get better at coding.
h4r1m4u
@h4r1m4u
Oct 27 2015 02:57
@Guzko <img> is a self-closing HTML tag. it doesn't need to be closed. there are self-closing tags, for example <br> (line break), <input> (input field), etc.
Anthony
@Guzko
Oct 27 2015 02:58
ok
ty
Ulises Cabrera
@UlisesCabrera
Oct 27 2015 02:58
@Guzko you will! just keep working on your coding skills and dont give up.
@Guzko Thanks!
CamperBot
@camperbot
Oct 27 2015 02:58
ulisescabrera sends brownie points to @guzko :sparkles: :thumbsup: :sparkles:
:star: 23 | @guzko | http://www.freecodecamp.com/guzko
Charles Milam
@CharlesMilam
Oct 27 2015 02:59
@blkdykegoddess Shift actually removes the first element in the array you apply it to. So think about what myArray and myRemoved contains after you this line executes => myRemoved = myArray.shift();
Anthony
@Guzko
Oct 27 2015 02:59
I just got started, and hope to eventually get into the cyber security field, or web design
Charles Milam
@CharlesMilam
Oct 27 2015 02:59
@blkdykegoddess and yes, maybe console.log each of those arrays immediately after running the above line.
Anthony
@Guzko
Oct 27 2015 03:00
WHAT IS WRONG WITH THIS.
<img class="smaller-image" {width: 100px;}>
Charles Milam
@CharlesMilam
Oct 27 2015 03:01
It is not correct syntax
h4r1m4u
@h4r1m4u
Oct 27 2015 03:01
@UlisesCabrera the calculator looks and works great. great job
Ulises Cabrera
@UlisesCabrera
Oct 27 2015 03:02
@h4r1m4u Thanks!
CamperBot
@camperbot
Oct 27 2015 03:02
ulisescabrera sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 341 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Charles Milam
@CharlesMilam
Oct 27 2015 03:02
@guzko look again how you styled the h2 with the class red-text, and do the same with the img and smaller-image.
@Guzko you are really close
Anthony
@Guzko
Oct 27 2015 03:03
This is fun, never thought I would be the type of person to enjoy being frustrated. lol
Okay so are the img pieces in the right place? Or should one be in the <style>???
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
  .smaller-image {width: 100px;}
</style>

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

<img src="https://bit.ly/fcc-relaxing-cat">

<img class="smaller-image">
h4r1m4u
@h4r1m4u
Oct 27 2015 03:08
@Guzko you need to assign the .smaller-image class to the relaxing-cat image. not create a new <img>
Charles Milam
@CharlesMilam
Oct 27 2015 03:08
They are in the right place. Should there be one image or two. As you have it you are trying to define two images. One has the link to the actual image, the other has the class to style it. If you only need one image, try combining the two.
h4r1m4u
@h4r1m4u
Oct 27 2015 03:08
delete the 2nd <img> tag and put the .smaller-image class on the first one
Nigel
@mrdutty
Oct 27 2015 03:09

Guys, I'm on the Waypoint: Comment out HTML
Comment out your h1 element and your p element, but leave your h2 element uncommented.

Remember that in order to start a comment, you need to use <!-- and to end a comment, you need to use -->.

Here you'll need to end the comment before your h2 element begins.

Here's my code: <h1>Hello World</h1>

<h2>CatPhotoApp</h2>
<!-->

<p>Hello Paragraph</p>
<!-->

what am I doing wrong?
h4r1m4u
@h4r1m4u
Oct 27 2015 03:09
@mrdutty <!-- <p>this paragraph is commented out</p> -->
Charles Milam
@CharlesMilam
Oct 27 2015 03:10
you are not ending the first comment. Read through the directions again about ending a comment.
h4r1m4u
@h4r1m4u
Oct 27 2015 03:10
you open the comment with <!-- then close it with -->
Anthony
@Guzko
Oct 27 2015 03:18
Okay I am stumped on where to place the class part.
<img .smaller-image { width: 100px;} src="https://bit.ly/fcc-relaxing-cat">
Charles Milam
@CharlesMilam
Oct 27 2015 03:20
just like you did here => <img class="smaller-image"> and just add in the src part.
Anthony
@Guzko
Oct 27 2015 03:21
OMG. thanks @CharlesMilam that was a tough one for me.
CamperBot
@camperbot
Oct 27 2015 03:21
guzko sends brownie points to @charlesmilam :sparkles: :thumbsup: :sparkles:
:star: 303 | @charlesmilam | http://www.freecodecamp.com/charlesmilam
Charles Milam
@CharlesMilam
Oct 27 2015 03:21
you are already defining the rule { width: 100px;} up in the style section. You just need to use the class name to make it work.
But you did it! Congrats!
Anthony
@Guzko
Oct 27 2015 03:22
okay so when I define something in the style, I just need to reference it below in the <img> tag and it will be applied?
or any other tag
Charles Milam
@CharlesMilam
Oct 27 2015 03:22
exactly
Anthony
@Guzko
Oct 27 2015 03:22
Okay sounds great shouldn't be a problem later hopefully
Charles Milam
@CharlesMilam
Oct 27 2015 03:23
You'll get the hang of it quick enough.
h4r1m4u
@h4r1m4u
Oct 27 2015 03:24
in CSS you create your styling rules (via styling elements, classes or ids). in HTML you then apply your classes or ids to HTML elements and they will be style automatically based on the rules you created in CSS @Guzko
Dan Morency
@g0shdanit
Oct 27 2015 03:25
anyone on bonfire want to pair?
Nigel
@mrdutty
Oct 27 2015 03:25
@CharlesMilam Got it...thx
CamperBot
@camperbot
Oct 27 2015 03:25
mrdutty sends brownie points to @charlesmilam :sparkles: :thumbsup: :sparkles:
:star: 304 | @charlesmilam | http://www.freecodecamp.com/charlesmilam
Charles Milam
@CharlesMilam
Oct 27 2015 03:27
@mrdutty Awesome, WTG!
Dan Morency
@g0shdanit
Oct 27 2015 03:29
find bonfire
Dan Morency
@g0shdanit
Oct 27 2015 03:30
find bonfire reverse
CamperBot
@camperbot
Oct 27 2015 03:30

find bonfire reverse

:zero: bonfire reverse a string

Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:43
var array = [2, 5, 9];
array.indexOf(2);     // 0
array.indexOf(7);     // -1
array.indexOf(9, 2);  // 2
array.indexOf(2, -1); // -1
array.indexOf(2, -3); // 0
If anyone can explain the last 3
I'm confused by the fact that there are two numbers in those last 3 examples
This is from MDN
I understand the first two
Anthony
@Guzko
Oct 27 2015 03:46
Okay so I'm trying to anchor text inside <p> what am I doing wrong.
<p>View more  
  <a href='freecatphotoapp.com'>
   cat photos
  </a>
</p>
Herman Fassett
@HermanFassett
Oct 27 2015 03:47
@alfonsogiron10 the second argument is the index to start searching from
Alyssa Jane Villanueva
@ajanev29
Oct 27 2015 03:48
hello, how to give if to form element?
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:49
That's really confusing, I get what you're saying but I cannot visualize it
@HermanFassett
Alyssa Jane Villanueva
@ajanev29
Oct 27 2015 03:49
how to give id to form element?
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:50
Like the last example you start searching at index -3?
Herman Fassett
@HermanFassett
Oct 27 2015 03:50
Yes
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:50
Then end up with 2 at index 0?
hm ok
var array = [2, 5, 9];
so what number is index -3
is it 2?
h4r1m4u
@h4r1m4u
Oct 27 2015 03:51
@alfonsogiron10 -3 just means 'start search searching 3 elements from the end'
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:51
and then if index -3 is 2
how did 2 come to be index 0
```
var array = [2, 5, 9];
array.indexOf(2);     // 0
array.indexOf(7);     // -1
array.indexOf(9, 2);  // 2
array.indexOf(2, -1); // -1
array.indexOf(2, -3); // 0
```
I know it's simple I just don't get it
like for the last one
it went full circle from index -3 to 0
to end up at the same number '2'
confuses me
and then for the third example it starts at index 2
h4r1m4u
@h4r1m4u
Oct 27 2015 03:53
@alfonsogiron10 the key is in the definition of the second parameter: " If the provided index value is a negative number, it is taken as the offset from the end of the array. "
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:53
and ends at index 2
h4r1m4u
@h4r1m4u
Oct 27 2015 03:54
the index of 2 is still 0. it's not -3
array[-3] will return undefined while array[0] will return 2
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:54
ok last question that I think will get me to truly understand
can you explain the difference between the last two examples
```
var array = [2, 5, 9];
array.indexOf(2);     // 0
array.indexOf(7);     // -1
array.indexOf(9, 2);  // 2
array.indexOf(2, -1); // -1
array.indexOf(2, -3); // 0
```
h4r1m4u
@h4r1m4u
Oct 27 2015 03:56
array.indexOf(2, -1); searches the array for number 2 starting one element from the end. 2 is not found in the sub-array, hence the function returns -1
array.indexOf(2, -3); searches the array for number 2 starting three elements from the end. 2 is found at 0 index position, hence 0 is returned
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:57
Ahhhhh thank you
CamperBot
@camperbot
Oct 27 2015 03:57
if you want to thank someone, put an @ before their name!
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:57
@h4r1m4u perfect explanation thanks
CamperBot
@camperbot
Oct 27 2015 03:57
alfonsogiron10 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 342 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
metalek
@metalek
Oct 27 2015 03:57
Hi all -- I'm currently working on the first basejump and was wondering if someone could help me out: I used the angular $http.put shortcut method to update the data for my polls and that worked when I first tried it about four hours ago, but now it does not work even when I run what I know is the exact same code as when I first tried it. Should I not be using a PUT request to update data? What am I doing wrong here?
h4r1m4u
@h4r1m4u
Oct 27 2015 03:57
@alfonsogiron10 you're welcome. what do you think array.indexOf(9, -1) will return?
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:58
that would be essentially the same as array.indexOf(9, 2) , so it would return 2?
h4r1m4u
@h4r1m4u
Oct 27 2015 03:58
:clap:
yes! :D
Alfonso Giron
@alfonsogiron10
Oct 27 2015 03:58
Nice haha :P
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:05

my h1 element should be orange, but it doesn't work...

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
#orange-text {
color: orange;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}

</style>

<h1 class="pink-text blue-text" id="orange-text">Hello World!</h1>

I literally spent an hour on it ^^'
h4r1m4u
@h4r1m4u
Oct 27 2015 04:07
@VivianiPrimo that looks fine to me. it should be orange. is that your entire code?
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:07
@h4r1m4u yes it is my whole code
thanks for the reply :)
CamperBot
@camperbot
Oct 27 2015 04:07
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 27 2015 04:07
is that one of the waypoints?
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:07
yes it is
h4r1m4u
@h4r1m4u
Oct 27 2015 04:08
try resetting the code, reloading the page and putting in the same code again
sometimes the waypoints get buggy
justindobbs
@justindobbs
Oct 27 2015 04:08
isn't this because you have pink and blue classes added on in as well?
h4r1m4u
@h4r1m4u
Oct 27 2015 04:08
@justindobbs no, the id definition has a higher priority
it should override the class styles
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:09
I tried but it didn't work.
@justindobbs It's required from me to let the pink and blue classes in the code
h4r1m4u
@h4r1m4u
Oct 27 2015 04:10
@VivianiPrimo which waypoint is it?
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:10
waypoint 51 in the HTML5 and CSS course
is it possible that it's a bug?
h4r1m4u
@h4r1m4u
Oct 27 2015 04:11
your code passes for me. try a different browser, see if that works
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:13
I usually use Chrome and now I tried in Safari but it still doesn't work
h4r1m4u
@h4r1m4u
Oct 27 2015 04:14
that's really strange. the code is fine. i'm not sure why it's not passing for you :/
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:14
so strange... but thanks for your time @h4r1m4u !!
CamperBot
@camperbot
Oct 27 2015 04:14
vivianiprimo sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 343 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 04:16
no problem. it bugs me you can't pass it even though the code is right
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:17
should I write to the admin or something like that?
h4r1m4u
@h4r1m4u
Oct 27 2015 04:18
yeah. might be worth reporting it as a bug
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:19
ok thanks (Y)!
CamperBot
@camperbot
Oct 27 2015 04:19
if you want to thank someone, put an @ before their name!
Bryan Wegman
@bwyan
Oct 27 2015 04:23
I’m having an access-control-allow-origin issue with codepen. Can anyone give me a hand?
h4r1m4u
@h4r1m4u
Oct 27 2015 04:23
@bwyan sure. got a link to your pen?
Батмөнх
@redaced
Oct 27 2015 04:24
hello all
Bryan Wegman
@bwyan
Oct 27 2015 04:25
@h4r1m4u, I made the app locally, and copy/pasted the code into codepen.
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:25
hello guys, any guidance on how to deal with BONFIRE (Basic Algorithm Scripting) exercises I'm having trouble getting them done, without looking for other resources everywhere on the internet...
Bryan Wegman
@bwyan
Oct 27 2015 04:26
Hi @redaced, hi @rodri0315.
I can probably get you pointed in the right direction, @rodri0315.
What are you trying to accomplish? What’s stumping you?
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:27
@VivianiPrimo try it in Mozilla Firefox, something similar happened to me around that waypoint
h4r1m4u
@h4r1m4u
Oct 27 2015 04:28
@bwyan which part of the code gives you the access-control-allow issue?
Bryan Wegman
@bwyan
Oct 27 2015 04:28
The call to api.forecast.io
h4r1m4u
@h4r1m4u
Oct 27 2015 04:28
strange, i don't get the error in the console
VivianiPrimo
@VivianiPrimo
Oct 27 2015 04:29
@rodri0315 It mysteriously works on Chrome now... But thanks!
CamperBot
@camperbot
Oct 27 2015 04:29
vivianiprimo sends brownie points to @rodri0315 :sparkles: :thumbsup: :sparkles:
:star: 187 | @rodri0315 | http://www.freecodecamp.com/rodri0315
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:30
well I am trying to get this Bonfire exercises done but I feel like is asking me to answer this questions without going through any teaching or examples :/
Bryan Wegman
@bwyan
Oct 27 2015 04:30
@h4r1m4u, strange. I’m getting it in Chrome and Safari for Mac.
Does the weather load for you?
h4r1m4u
@h4r1m4u
Oct 27 2015 04:31
@bwyan chrome on pc here. no, the weather doesn't load. digging into the code now to see what the issue might be
Bryan Wegman
@bwyan
Oct 27 2015 04:31
@rodri0315, now I see what you mean. Is this the first time you’ve worked with Javascript?
weird.
Works great on my local machine.
@h4r1m4u, let me post the code on Github
h4r1m4u
@h4r1m4u
Oct 27 2015 04:34
@bwyan adjust your weatherURL like this:
weatherURL = 'https://api.forecast.io/forecast/bf37ac889a6d441872e6c814194d5c3a/' + la + ',' + lo + '?callback=?';
notice the ?callback=? bit at the end
Bryan Wegman
@bwyan
Oct 27 2015 04:35
interesting.
h4r1m4u
@h4r1m4u
Oct 27 2015 04:35
this makes the getJSON call to use JSONP format which prevents the cross-domain origin issue
Bryan Wegman
@bwyan
Oct 27 2015 04:35
brilliant! Thanks @h4r1m4u !
CamperBot
@camperbot
Oct 27 2015 04:35
bwyan sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 344 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Bryan Wegman
@bwyan
Oct 27 2015 04:36
I’ve got some reading to do to learn about JSONP
h4r1m4u
@h4r1m4u
Oct 27 2015 04:36
my pleasure. you'll need to use this callback=? bit and JSONP for almost any of the ziplines that make calls to APIs
Sue
@Sueswebdesign
Oct 27 2015 04:38
@Guzko I have been following your conversation as I am just behind you in the CatApp. I read over the directions and I still cannot figure out how to get the image to be 100px. I was able to get the first part...How and where did you add the src after adding the smaller-image class?
Bryan Wegman
@bwyan
Oct 27 2015 04:38
@h4r1m4u: Good to know. Is that true for development outside of codepen as well?
h4r1m4u
@h4r1m4u
Oct 27 2015 04:39
@bwyan yea, it is. it's the browser that throws the cross-domain error
Bryan Wegman
@bwyan
Oct 27 2015 04:39
I’ve built some small apps with node.js running on local VMs, and a few of the Free Code Camp projects outside of codepen. This is the first time I’ve encountered it in a long time. Good to know!
h4r1m4u
@h4r1m4u
Oct 27 2015 04:40
btw, for whatever reason the browser geolocation doesn't work for me. i had the same implementation approach as you did, but couldn't get it to work in my chrome nor firefox
just so you know if you show the pen to somebody and they complain it's not working for them
Bryan Wegman
@bwyan
Oct 27 2015 04:41
Weird. The Navigator API is supposed to be supported.
h4r1m4u
@h4r1m4u
Oct 27 2015 04:41
@Sueswebdesign if you can post the code you have so far, i can help you
@bwyan yea, i know. i was stumped by it as well. i ended up getting the user's coordinates from their ip instead
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:42
@bwyan Yes, and I had been doing well all the way until I got into the BONFIRE exercises, I started okay but started to get problems where I wasn't feeling to comfortable even after reading their link they provide. Should I read a Javascript as I go along with this FCC course?
Austin Deming
@austinmdem
Oct 27 2015 04:42
Screen Shot 2015-10-26 at 9.39.39 PM.png
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:43
"Effective Javascript", is this a good book to read for Javascript
Austin Deming
@austinmdem
Oct 27 2015 04:43
Hey gang, what exactly am I not getting right?
Bryan Wegman
@bwyan
Oct 27 2015 04:43
@h4r1m4u, I think I’m going to write that as a fallback. I’m already using IP for the location name, since I couldn’t find an API that returned reliable names from coordinates for towns in my area.
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:44
@austinmdem I think is the space you have between (".slot")[0]
h4r1m4u
@h4r1m4u
Oct 27 2015 04:44
@bwyan nice. i used the same service http://ipinfo.io
Bryan Wegman
@bwyan
Oct 27 2015 04:44
@rodri0315, I used the intro to JS course at Codecademy to get the basics. I
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:45
okay, I will give it a try. thank you @bwyan did you like it?
CamperBot
@camperbot
Oct 27 2015 04:45
rodri0315 sends brownie points to @bwyan :sparkles: :thumbsup: :sparkles:
:star: 240 | @bwyan | http://www.freecodecamp.com/bwyan
Bryan Wegman
@bwyan
Oct 27 2015 04:45
I tried reading a few books but none were as helpful.
Austin Deming
@austinmdem
Oct 27 2015 04:45
@rodri0315 gaaaaah! Thanks! worked!
CamperBot
@camperbot
Oct 27 2015 04:45
austinmdem sends brownie points to @rodri0315 :sparkles: :thumbsup: :sparkles:
:star: 188 | @rodri0315 | http://www.freecodecamp.com/rodri0315
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:46
@austinmdem I got stuck on that exercise, and guess what I had done the same mistake as you did! haha.
Bryan Wegman
@bwyan
Oct 27 2015 04:46
@rodri0315, yes for the basics, it’s a great course. I don’t like how much handholding their curriculum gives you for learning beyond the basics. It leaves you feeling good but not knowing much.
(or building much confidence)
Austin Deming
@austinmdem
Oct 27 2015 04:46
@rodri0315 Yea, I figured it was something small I was missing. Just needed another pair of eyes, haha.
manoj kumar
@manojrammurthy
Oct 27 2015 04:47

what am i doing wrong here<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("background-color",'green');
});
</script>

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<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>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>

Jorge Rodriguez
@rodri0315
Oct 27 2015 04:47
Yeah, that is what I've heard, but it is good for basic right. Okay, thank again @bwyan
CamperBot
@camperbot
Oct 27 2015 04:47
rodri0315 sends brownie points to @bwyan :sparkles: :thumbsup: :sparkles:
:warning: rodri0315 already gave bwyan points
manoj kumar
@manojrammurthy
Oct 27 2015 04:47
All children of #right-well should have green text.
Jorge Rodriguez
@rodri0315
Oct 27 2015 04:48
@manojrammurthy please paste your code with ``` so we can read the code much easier
Bryan Wegman
@bwyan
Oct 27 2015 04:48
@rodri0315, for a great book that covers the basics of building a full-stack app, try Learning Web Application Development, by Semmy Purewal. I learned a TON from that book.
manoj kumar
@manojrammurthy
Oct 27 2015 04:48

'''<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendTo("#right-well");
$("#target5").clone().appendTo("#left-well");
$("#target1").parent().css("background-color", "red");
$("#right-well").children().css("background-color",'green');
});
</script>

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<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>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>
'''

CamperBot
@camperbot
Oct 27 2015 04:48
:bulb: to format code use backticks! ``` more info
Bryan Wegman
@bwyan
Oct 27 2015 04:48
Semmy also happens to be a friend of mine.
h4r1m4u
@h4r1m4u
Oct 27 2015 04:48
@manojrammurthy $("#right-well").children().css("background-color",'green'); the children should have green text, not background. check the property name
manoj kumar
@manojrammurthy
Oct 27 2015 04:49
oh ok
thanks
CamperBot
@camperbot
Oct 27 2015 04:50
if you want to thank someone, put an @ before their name!
manoj kumar
@manojrammurthy
Oct 27 2015 04:50
@h4r1m4u thanks
CamperBot
@camperbot
Oct 27 2015 04:50
manojrammurthy sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 345 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 04:50
you're welcome
Colton Ehrman
@coltonehrman
Oct 27 2015 04:51
Bryan Wegman
@bwyan
Oct 27 2015 04:53
@h4r1m4u, the other tip I have to share is that I used the Bonfires to force me to read MDN’s JS documentation. As I spent more time with it, it started to make sense
*make more sense
h4r1m4u
@h4r1m4u
Oct 27 2015 04:55
@bwyan yeah, i hear you. i find dwelling here in the chat and responding to people's questions very useful in solidifying my understanding of the material, especial the various javascript functions
Bryan Wegman
@bwyan
Oct 27 2015 04:55
same here
h4r1m4u
@h4r1m4u
Oct 27 2015 04:58
@bwyan thanks for the 'learning web app dev' book reference, btw. i'll check it out. looks like a good book
CamperBot
@camperbot
Oct 27 2015 04:58
h4r1m4u sends brownie points to @bwyan :sparkles: :thumbsup: :sparkles:
:star: 241 | @bwyan | http://www.freecodecamp.com/bwyan
Bryan Wegman
@bwyan
Oct 27 2015 05:03
You’re welcome! It’s great. There are some typos and incorrect code examples in the first edition but I think theyv’e been sorted out now. The errata on his website are helpful.
I found the best benefits from that book came from trying to do the project along with him and only looking at the “answers” after trying to figure it out myself. I also did all of the “more practice and further reading” projects
Amir M.
@Wingedcross
Oct 27 2015 05:06
Hello
Can anyone figure out what's wrong with this code?
var myCar = new Car(); {
this.engines = 1;
}
"The property engines of myCar should be a number."
JavaScript, btw
Isaac
@BenBagBag
Oct 27 2015 05:09
@Wingedcross you have a semicolon after Car(), that shouldn't be there
Amir M.
@Wingedcross
Oct 27 2015 05:09
@BenBagBag It was there by default and removing it causes an error :<
Aayush Kapoor
@xeoneux
Oct 27 2015 05:12
@Wingedcross You create objects After you define a class
@Wingedcross It should be
var Car = function() {
  this.engines = 1;
}
var myCar = new Car();
Isaac
@BenBagBag
Oct 27 2015 05:16
@xeoneux The waypoint will not allow the property "engines" to be defined in the class constructor
Amy Baisden
@agb341
Oct 27 2015 05:17
What am I missing here? Can't get "Your div element should have the class container-fluid"
<div id="container-fluid">

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>

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

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


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

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

</div>
Amir M.
@Wingedcross
Oct 27 2015 05:17
Oh God
@agb341 <div id="container-fluid"> is the problem. Replace "id" with "class"
Amy Baisden
@agb341
Oct 27 2015 05:18
Ahhh.
Thanks @Wingedcross!
CamperBot
@camperbot
Oct 27 2015 05:18
agb341 sends brownie points to @wingedcross :sparkles: :thumbsup: :sparkles:
:star: 173 | @wingedcross | http://www.freecodecamp.com/wingedcross
Amir M.
@Wingedcross
Oct 27 2015 05:18
The error is pretty much self explanatory
Isaac
@BenBagBag
Oct 27 2015 05:18
@Wingedcross OK, I looked at the waypoint a little closer. You need to define engine in a new line, outside of curly brackets
try myCar.engines = 1;
on a new line
Amy Baisden
@agb341
Oct 27 2015 05:19
Hmm. Newbie here. Where do you see your error on Waypoints? I've just been working on them until I figure them out after the boxes don't go green.
Aayush Kapoor
@xeoneux
Oct 27 2015 05:19
@BenBagBag Oh. My bad. Should have looked at the Waypoint! Thanks
Amir M.
@Wingedcross
Oct 27 2015 05:19
@BenBagBag Great work. Thanks!
CamperBot
@camperbot
Oct 27 2015 05:19
wingedcross sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 227 | @benbagbag | http://www.freecodecamp.com/benbagbag
Isaac
@BenBagBag
Oct 27 2015 05:19
@xeoneux NP!
it's confusing!
Amir M.
@Wingedcross
Oct 27 2015 05:20
Yea
h4r1m4u
@h4r1m4u
Oct 27 2015 05:20
@agb341 they show in the sidebar (same place that shows the green checks for the points you passed in that particular waypoint)
Amir M.
@Wingedcross
Oct 27 2015 05:21
But why doesn't "this." string work? I mean it's working for the line above where it assigns the wheels property
Amy Baisden
@agb341
Oct 27 2015 05:22
Oh, I see. I'm up too late. It says class right there. Sorry guys. :smile:
Isaac
@BenBagBag
Oct 27 2015 05:22
@Wingedcross you're no longer in the object myCar
Amy Baisden
@agb341
Oct 27 2015 05:23
First night on FreeCodeCamp, and I'm on a bit of a binge. Might be time to call it a night.
h4r1m4u
@h4r1m4u
Oct 27 2015 05:23
@Wingedcross you use 'this' only in the object constructor function. it refers to the object itself because it doesn't have a name yet. but once you create an object with the constructor, you refer to the object by its name (e.g. myCar)
Isaac
@BenBagBag
Oct 27 2015 05:23
you've got to be within the object you're referring to in order to use "this."
using "this" outside the object constructor function is like walking around a field saying, "this one! this one!" and then everyone is confused. Being inside the object constructor function is like saying, "I am holding a piece of grass! I will tell you about THIS piece of grass and its many wonderful attributes!"
clearly it is late and I am coming up with AWESOME analogies
Amir M.
@Wingedcross
Oct 27 2015 05:25
Ah. It's making more sense by the second. Thanks, @h4r1m4u , @BenBagBag
CamperBot
@camperbot
Oct 27 2015 05:25
wingedcross sends brownie points to @h4r1m4u and @benbagbag :sparkles: :thumbsup: :sparkles:
:warning: wingedcross already gave benbagbag points
:star: 346 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Amir M.
@Wingedcross
Oct 27 2015 05:25
@BenBagBag The metaphors were great.
@agb341 Slow and steady wins the race! Well, there ain't a race here. Go nuts!
Isaac
@BenBagBag
Oct 27 2015 05:26
@Wingedcross haha, i'm glad you liked them
h4r1m4u
@h4r1m4u
Oct 27 2015 05:26
@BenBagBag @Wingedcross i like to use the baby analogy:
var Baby = function() {
    // this is the pregnancy constructor, we don't know this baby yet
    this.legs = 2;
    this.arms = 2;
}

var Peter = new Baby(); // Peter is born!

Peter.hair = 'blond'; // and he's got blond hair!
Peter.gender = 'male'; // and he's a dude!
Isaac
@BenBagBag
Oct 27 2015 05:27
@h4r1m4u nice!
Amir M.
@Wingedcross
Oct 27 2015 05:27
@BenBagBag Oh dear Lord. This is magnificent.
h4r1m4u
@h4r1m4u
Oct 27 2015 05:27
:)
Isaac
@BenBagBag
Oct 27 2015 05:28
@h4r1m4u now every time I'm coding up an object, if someone asks me what I'm doing, I'll be all like, "making a baby... WITH MY KEYBOARD"
h4r1m4u
@h4r1m4u
Oct 27 2015 05:28
buhahaha
Isaac
@BenBagBag
Oct 27 2015 05:28
thank you @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 05:28
benbagbag sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 347 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 05:28
my pleasure
Sue
@Sueswebdesign
Oct 27 2015 05:34
just like you did here => <img class="smaller-image"> and just add in the src part.
h4r1m4u
@h4r1m4u
Oct 27 2015 05:35
@Sueswebdesign could you post your code?
Sue
@Sueswebdesign
Oct 27 2015 05:35
I am still stumped. I have the first part with the following:
<img class= "smaller-image" { width: 100px; } src="https://bit.ly/fcc-relaxing-cat">
h4r1m4u
@h4r1m4u
Oct 27 2015 05:36
the { width: 100px; } doesn't belong in the <img> tag
Sue
@Sueswebdesign
Oct 27 2015 05:36
I still get the error that my image should be 100 pixels wide...
h4r1m4u
@h4r1m4u
Oct 27 2015 05:36
that's your CSS rule
you need to make it part of the .smaller-image CSS class:
<style>
.smaller-image {
  width: 100px;
}
</style>
then all you need to do is to apply the .smaller-image class on the <img> element and the style will be applied to it automatically
does that make sense? @Sueswebdesign
Sue
@Sueswebdesign
Oct 27 2015 05:43
@h4r1m4u <img class= "smaller-image" { width: 100px; } src="https://bit.ly/fcc-relaxing-cat"> This is not working for the actual change in size.
Abdoul Aziz Seck
@brother1492
Oct 27 2015 05:44
@h4r1m4u delete the {width:100px} inside the img element
Sue
@Sueswebdesign
Oct 27 2015 05:44
@h4r1m4u also, how do I get the code that I copy onto this message board to look like a screen shot? I am new to to my macbook pro.
Bill
@kirah1314
Oct 27 2015 05:45
help format
CamperBot
@camperbot
Oct 27 2015 05:45

: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

Abdoul Aziz Seck
@brother1492
Oct 27 2015 05:45
@h4r1m4u Sorry I thought you were the one asking the question
Батмөнх
@redaced
Oct 27 2015 05:48
echo "Hello World"
CamperBot
@camperbot
Oct 27 2015 05:48
@redaced said: echo "Hello World"
pratap chandra sahoo
@pratapnewborn
Oct 27 2015 05:51
puts "hi"
Sue
@Sueswebdesign
Oct 27 2015 05:53
@h4r1m4u I finally got it....GEEZ!<style>
.smaller-image { width: 100px; }</style>
<img class= "smaller-image" src="https://bit.ly/fcc-relaxing-cat">
@h4r1m4u that worked. The hints are not very easy...for me anyway....
@h4r1m4u Thank you and thank all of you. I am so new to this.
CamperBot
@camperbot
Oct 27 2015 05:57
sueswebdesign sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 348 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Togba C. Sapolucia Jr.
@orochisap
Oct 27 2015 05:58
did what they say on the waypoint...wtf
!important
semicolon and everything...
Isaac
@BenBagBag
Oct 27 2015 05:59
@orochisap are you asking a question?
Togba C. Sapolucia Jr.
@orochisap
Oct 27 2015 05:59
nevermind
formatting issue
Amir M.
@Wingedcross
Oct 27 2015 06:10
I'm at Bonfire now. Should I be scared
Isaac
@BenBagBag
Oct 27 2015 06:12
@Wingedcross No, don't be afraid! The only thing we have to fear is fear itself!
(Also possibly nukes, world wars, and presidents who imprison their own citizens)
But definitely not bonfires
Amir M.
@Wingedcross
Oct 27 2015 06:14
@BenBagBag My heart surely feels warmer.
Adenilson Arcanjo
@arcanjomjr
Oct 27 2015 06:17
Good night, people!
Why do you say $('body') instead of $("body") ?
Okay, apparently people are sleeping...
Laura Stephenson
@lauralstephenson
Oct 27 2015 06:29

help, I'm on Waypoint 52, directions are Waypoint: Access Array Data with Indexes
We can access the data inside arrays using indexes.

Array indexes are written in the same bracket notation that strings use, except that instead of specifying a character, they are specifying an entry in the array.

For example:

var array = [1,2,3];

array[0]; //equals 1

var data = array[1];

Create a variable called myData and set it to equal the first value of myArray.

CamperBot
@camperbot
Oct 27 2015 06:29
no wiki entry for: im on waypoint 52 directions are waypoint access array data with indexeswe can access the data inside arrays using indexesarray indexes are written in the same bracket notation that strings use except that instead of specifying a character they are specifying an entry in the arrayfor examplevar array 123array0 equals 1var data array1create a variable called mydata and set it to equal the first value of myarray
:pencil: click here to create one now!after creating your page type update to reload it here
Laura Stephenson
@lauralstephenson
Oct 27 2015 06:30
Here is my code~~~

// var ourArray = [1,2,3];
// var ourData = ourArray[0]; // equals 1

var myArray = [1,2,3];
// Only change code below this line.

array[0]; //equals 1

var MyData = array[1];

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myArray) !== "undefined" && typeof(myData) !== "undefined"){(function(y,z){return 'myArray = ' + JSON.stringify(y) + ', myData = ' + JSON.stringify(z);})(myArray, myData);}

```
Farrukh Askari
@askari01
Oct 27 2015 06:31
@BenBagBag thanks
CamperBot
@camperbot
Oct 27 2015 06:31
askari01 sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 229 | @benbagbag | http://www.freecodecamp.com/benbagbag
Emmanuel Annan
@Mrannan93
Oct 27 2015 06:31
How do you do heaD's and tails??
mgarcell
@mgarcell
Oct 27 2015 06:31
I'm having problems with this one: "Add an h4 element to each of your <div class="col-xs-6"> elements."
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<h4>#left-well</h4>
<div class="col-xs-6">
<div class="well" id="left-well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
</div>
</div>
I tried to search Google and some others said it may be a bug?
Harvey
@harvey56
Oct 27 2015 06:32
hi all! did anyone complete the calculator zipline ? there is something that i am a little stuck with. Would appreciate some help :)
Isaac
@BenBagBag
Oct 27 2015 06:38
@arcanjomjr There's no difference, single and double quotes are the same
@lauralstephenson did you notice that you've defined MyData as index 1 of "array"?
there are a couple of problems here: 1. they asked you to make a variable called "myData", not "MyData" 2. there is no variable name "array" (so you haven't referenced anything) 3. they asked you to reference the first item in the array. Is the first item the same as the item at index 1?
h4r1m4u
@h4r1m4u
Oct 27 2015 06:43
@Sueswebdesign great job, sue, well done! sorry for my late response, i was out for lunch. glad you got through the waypoint
mgarcell
@mgarcell
Oct 27 2015 06:45
I got it...I just needed to reset it and try again...buggy
Isaac
@BenBagBag
Oct 27 2015 06:45
@mgarcell looks like your first <h4> tag is right above your first col-xs-6 div, not inside it
mgarcell
@mgarcell
Oct 27 2015 06:46
@BenBagBag Ahh, that must've been it...Thanks!
CamperBot
@camperbot
Oct 27 2015 06:46
mgarcell sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 230 | @benbagbag | http://www.freecodecamp.com/benbagbag
Piyush Vats
@piyushv
Oct 27 2015 06:47
This message was deleted
Abdul Hamid HmDi
@axmxh
Oct 27 2015 06:47
This message was deleted
Emmanuel Annan
@Mrannan93
Oct 27 2015 06:47
Guys how about the heads and tails elements please.
Piyush Vats
@piyushv
Oct 27 2015 06:48

hi guys doing a BONFIRE link here
its the "check to see if string is a palindrome and my code is

function palindrome(str) {
  // Good luck!
  str1=str.replace(/[^\w\s]|_/g, "").replace(/\s/g, "").toLowerCase().split("").reverse().join();

  if(str1!=str1){
    return false;
  } else {
    return true;
  }


}



palindrome("not a palindrome");

for my true cases result is fine but the if else logic seems to be broken and when the condition is not met the function is not outputting false. im doing something really stupid cant figure it out tho!

h4r1m4u
@h4r1m4u
Oct 27 2015 06:50
@piyushv if(str1!=str1){ you're comparing the string to itself
it's always going to be true
Piyush Vats
@piyushv
Oct 27 2015 06:50
@h4r1m4u hey sorry that was a typo. same thing happens if its str!=str1

@h4r1m4u

function palindrome(str) {
  // Good luck!
  str1=str.replace(/[^\w\s]|_/g, "").replace(/\s/g, "").toLowerCase().split("").reverse().join();

  if(str1!=str){
    return false;
  } else {
    return true;
  }


}



palindrome("not a palindrome");

modified code same thing false cases work true cases not the right value being output

Abdul Hamid HmDi
@axmxh
Oct 27 2015 06:53
var ts,tb; //this is global
function starts(){
ts = parseInt($("#sl").html());
clock.setTime(ts);
clock.start();
  }

  function startb(){
    tb = parseInt($("#bl").html());
      clock.setTime(tb);
      clock.start();   
  }

    $('#play').click(function(){
      ts = parseInt($("#sl").html());
      starts();
      setTimeout(startb, ts);

    });
  I need help(Pomodoro Clock) ... to run break  after session ??
Piyush Vats
@piyushv
Oct 27 2015 06:55
This message was deleted
Laura Stephenson
@lauralstephenson
Oct 27 2015 06:55
Thanks, @BenBagBag ! Got it!
CamperBot
@camperbot
Oct 27 2015 06:55
lauralstephenson sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 231 | @benbagbag | http://www.freecodecamp.com/benbagbag
h4r1m4u
@h4r1m4u
Oct 27 2015 06:55
@piyushv you have an issue in your code: with your code, str1 will be e,m,o,r,d,n,i,l,a,p,a,t,o,n. if you want to join the individual characters into a single string without the commas, you need to use '' inside join(): join('')
the if statement is now fine, the problem is in how you generate str1
Piyush Vats
@piyushv
Oct 27 2015 06:58
@h4r1m4u thanks silly mistake i thought i had the quotes in there.
CamperBot
@camperbot
Oct 27 2015 06:58
piyushv sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 351 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 06:58
it's always the little things :)
Piyush Vats
@piyushv
Oct 27 2015 07:01

@h4r1m4u sorry to be a pain lol i made sure if else logic is fine, degbugged by returning the modified string aswell and now only the false cases work lol

function palindrome(str) {
  // Good luck!
  str1=str.replace(/[^\w\s]|_/g, "").replace(/\s/g, "").toLowerCase().split("").reverse().join("");

  if(str1==str){
    return true;
  } else {
    return false;
  }

}



palindrome("not a palindrome");

i debugged by optputting both strings aswell and they seem to be formatting correctly

h4r1m4u
@h4r1m4u
Oct 27 2015 07:04
@piyushv the issue is that when you generate str1, you remove whitespaces from str. but you leave str untouched, it still has spaces in it. naturally the two strings will not be equal
Piyush Vats
@piyushv
Oct 27 2015 07:04
@h4r1m4u sorry i just figured that out too.
@h4r1m4u thank u for your time. i need to debug a bit more before jumping on chat. appreciate it
CamperBot
@camperbot
Oct 27 2015 07:05
piyushv sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: piyushv already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 27 2015 07:05
no problem. it really helps if you log your variables into console and check the output. helps with debugging a lot
Adenilson Arcanjo
@arcanjomjr
Oct 27 2015 07:17
@BenBagBag Thanks!
CamperBot
@camperbot
Oct 27 2015 07:17
arcanjomjr sends brownie points to @benbagbag :sparkles: :thumbsup: :sparkles:
:star: 232 | @benbagbag | http://www.freecodecamp.com/benbagbag
DTing
@dting
Oct 27 2015 07:29
@piyushv you can try to improve your code by making just a single replace call.
D/S
@dantesolis
Oct 27 2015 07:34
Hey guys, I’m having problems with the Bonfire: Confirm the ending. I understand why my test fails, but I don’t know how to get the last two characters from the str, should I use something besides str.length?
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  var lastLength = target;
  var match = str.substr(-1);

  if (lastLength !== match) {
    return 'not a match'
  } else {
    return true;
  }
}
end("Bastian", "n");
DTing
@dting
Oct 27 2015 07:35
@dantesolis you arent using .length anywhere
you want the last x characters of str where x is the length of target
instead of using str.substr(-1) you would want to call substr with the negative length of target to get the last x characters
D/S
@dantesolis
Oct 27 2015 07:43
@dting thank you. Let me try that out
PS: length is what I thought about using :smile:
CamperBot
@camperbot
Oct 27 2015 07:43
dantesolis sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1475 | @dting | http://www.freecodecamp.com/dting
Tuan Hamid
@raymanlk
Oct 27 2015 07:44
having a bit of trouble with jquery waypoint, is something wrong here, $(document).ready(function() {
$(".well").addclass("animated shake");
});
DTing
@dting
Oct 27 2015 07:44
ahh sorry i misread your question
h4r1m4u
@h4r1m4u
Oct 27 2015 07:44
.addClass
@raymanlk
notice the capital C
Tuan Hamid
@raymanlk
Oct 27 2015 07:45
@h4r1m4u oh thank you so much
CamperBot
@camperbot
Oct 27 2015 07:45
raymanlk sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 352 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
CleverTrout
@CleverTrout
Oct 27 2015 08:03
What does this mean:
Be sure to delete all trailing comment tags, i.e. -->.
h4r1m4u
@h4r1m4u
Oct 27 2015 08:04
it means delete --> in your code
CleverTrout
@CleverTrout
Oct 27 2015 08:04
I don't have a clue.
Not so CleverTrout
h4r1m4u
@h4r1m4u
Oct 27 2015 08:05
@CleverTrout
<!-- <p>this is a commented out paragraph</p> -->
<p>this is a paragraph that's not commented out </p>
CleverTrout
@CleverTrout
Oct 27 2015 08:06
Thanks! I think I get it now
CamperBot
@camperbot
Oct 27 2015 08:06
if you want to thank someone, put an @ before their name!
CleverTrout
@CleverTrout
Oct 27 2015 08:06
Thanks @h$1m4u
CamperBot
@camperbot
Oct 27 2015 08:06
clevertrout sends brownie points to @h :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for h
h4r1m4u
@h4r1m4u
Oct 27 2015 08:06
by removing <!-- (which opens comment) and --> (which closes comment), you make the HTML code uncommented
CleverTrout
@CleverTrout
Oct 27 2015 08:06
@h4r1m4u
Thanks @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 08:06
clevertrout sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 353 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 08:06
my pleasure
CleverTrout
@CleverTrout
Oct 27 2015 08:09
I passed the challenge!
h4r1m4u
@h4r1m4u
Oct 27 2015 08:10
:clap: good job!
Phil
@PhilG112
Oct 27 2015 08:19
hi friends
i have an issue with my project, it isn't javascript however
Raghu Ranganathan
@razetime
Oct 27 2015 08:19
ok then. Go on.
Phil
@PhilG112
Oct 27 2015 08:22
anybody familiar with c# and the .net framework?
Raghu Ranganathan
@razetime
Oct 27 2015 08:22
nopey nopey nope.
You working on Visual Studio?
Phil
@PhilG112
Oct 27 2015 08:22
yas
Raghu Ranganathan
@razetime
Oct 27 2015 08:22
You probs won't get help here.
Phil
@PhilG112
Oct 27 2015 08:22
shiet
was worth a try haha
Abhishek
@Abhi493
Oct 27 2015 08:33
wiki screenhero
CamperBot
@camperbot
Oct 27 2015 08:33

:point_right: how to install screenhero [wiki]

Download for Mac

Download for Windows

You'll use Screenhero to pair program on the Bonfires and Zipline challenges.

Here are other alternatives to Screenhero as suggested by our fellow campers:

Manav Bansal
@mbansal11
Oct 27 2015 08:38
<script $(document).ready(function){$(document).ready(function() { function with });.></script>
help me!!
CamperBot
@camperbot
Oct 27 2015 08:38

:point_right: adding environment variables [wiki]

In Windows

Via GUI

  1. Download Varpanel.
  2. Open Varpanel.
  3. In PATH variable, add the relevant path (for example).

:pencil: read more about adding environment variables on the FCC Wiki

Erbold Namid
@erboldna
Oct 27 2015 08:39
Help me. What is "kitty ipsum text".
CamperBot
@camperbot
Oct 27 2015 08:39
no wiki entry for: me what is kitty ipsum text
:pencil: click here to create one now!after creating your page type update to reload it here
Dustin Frank
@DustInCompetent
Oct 27 2015 08:40
@erboldna "Kitty ipsum dolor sit amet. ..."
Manav Bansal
@mbansal11
Oct 27 2015 08:40
its a text that you have to mention to create
just mention in your code
Dustin Frank
@DustInCompetent
Oct 27 2015 08:40
@mbansal11 you put the closing > after the script. The script should be between > and <
Manav Bansal
@mbansal11
Oct 27 2015 08:41
i tried but its showing error
unexpected token) error
Dustin Frank
@DustInCompetent
Oct 27 2015 08:43
@mbansal11 try
<script> $(document).ready(function(){$(document).ready(function() { /*function with*/ });})</script>
Hold on.
marzelin
@marzelin
Oct 27 2015 08:43
@mbansal11 what are you trynig to do? Your code doesn't make much sense.
Erbold Namid
@erboldna
Oct 27 2015 08:45
@DustInCompetent than's.
Manav Bansal
@mbansal11
Oct 27 2015 08:46
not working
Natalia
@Natalia7
Oct 27 2015 08:46
Hello everyone! I have just started Free Code Camp and I am really enjoying it! I don't have any previous knowledge of HTML or CSS so I apologize if my question sounds silly. I am currently on Waypoint 18 and adding the thick green border to the image. I think I have done everything correctly because I can actually see that border around my image, but after I run the test, it doesn't allow me to go further and says : "Give your image a border width of 10px." In my CSS I have .thick-green-border {
border-width: 10px; border-style: solid; border-color: green;
} and in my HTML I've got <img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"> I have already given it border width of 10 px! What else does it want? :(
h4r1m4u
@h4r1m4u
Oct 27 2015 08:47
@mbansal11 what @DustInCompetent said was one of the issues. but what are you actually trying to do? function with doesn't do anything and is wrong
Manav Bansal
@mbansal11
Oct 27 2015 08:47
@h4r1m4u what should i do
h4r1m4u
@h4r1m4u
Oct 27 2015 08:47
@Natalia7 that looks correct. could you post all your code as you have it in the code pane?
@mbansal11 start by explaining what you're trying to do. it's not clear
Manav Bansal
@mbansal11
Oct 27 2015 08:48
Waypoint: Learn how Script Tags and Document Ready Work
Dustin Frank
@DustInCompetent
Oct 27 2015 08:48
@mbansal11 Why do you use a $(document).ready() function withing another one?
Manav Bansal
@mbansal11
Oct 27 2015 08:48
<script $(document).ready(function(){$(document).ready(function() { function with });})></script>
h4r1m4u
@h4r1m4u
Oct 27 2015 08:49
@mbansal11 all you need to do for that waypoint is to add the document.ready function:
<script>
  $(document).ready(function() {

  });
</script>
you misread the instructions. they tell you to close it with {); not to add the word 'with' into it
Dustin Frank
@DustInCompetent
Oct 27 2015 08:49
The function you give as argument for the ready-method will be run, when all html elements are loaded so just put the code you want to run...
Yeah. @h4r1m4u got it
Manav Bansal
@mbansal11
Oct 27 2015 08:50
@h4r1m4u @DustInCompetent thanks for helping :)
CamperBot
@camperbot
Oct 27 2015 08:50
mbansal11 sends brownie points to @h4r1m4u and @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 38 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
:star: 354 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 08:50
you're welcome
Manav Bansal
@mbansal11
Oct 27 2015 08:52
what script helps in
??
Dustin Frank
@DustInCompetent
Oct 27 2015 08:53
What's your question?
Natalia
@Natalia7
Oct 27 2015 08:54

@h4r1m4u It looks like this: <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

.smaller-image {
width: 100px;
}
.thick-green-border {
border-width: 10px; border-style: solid; border-color: green;
}
</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>

@h4r1m4u Wow I am sorry for that!
Dustin Frank
@DustInCompetent
Oct 27 2015 08: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;
  }

  .smaller-image {
    width: 100px;
  }
  .thick-green-border {
    border-width: 10px; border-style: solid; border-color: green;
  }
</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>
You're welcome
h4r1m4u
@h4r1m4u
Oct 27 2015 08:55
@Natalia7 that looks correct and should pass
try resetting the code, reloading the page and putting in the same code again
sometimes the waypoints get buggy and stuck
if that doesn't work, try the same in a different browser
Dustin Frank
@DustInCompetent
Oct 27 2015 08:57
@Natalia7 also, maybe close that <img> tag
h4r1m4u
@h4r1m4u
Oct 27 2015 08:58
@DustInCompetent ? <img> tags are self-closing
Natalia
@Natalia7
Oct 27 2015 08:58
@h4r1m4u Okay I will try, thank you! @DustInCompetent Btw, how can I do it the same way as you did? I am very sorry, you guys would say I am a noob, but next time I will know
CamperBot
@camperbot
Oct 27 2015 08:58
natalia7 sends brownie points to @h4r1m4u and @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 39 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
:star: 355 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 08:59
wiki format
CamperBot
@camperbot
Oct 27 2015 08:59

: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

h4r1m4u
@h4r1m4u
Oct 27 2015 08:59
@Natalia7 :point_up: the key is the backtick key (under escape) on your keyboard
Dustin Frank
@DustInCompetent
Oct 27 2015 08:59
@h4r1m4u don't they even need a /> at the end?
guess not.
h4r1m4u
@h4r1m4u
Oct 27 2015 09:01
@DustInCompetent it depends on the doctype you use for your page. the closing '/' is required only in XHTML & XML. with HTML5 doctype, you don't need it
Dustin Frank
@DustInCompetent
Oct 27 2015 09:01
thx @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 09:01
dustincompetent sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 356 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 09:01
the same is true for other elements like <br>, <hr>, etc.
Natalia
@Natalia7
Oct 27 2015 09:15
@h4r1m4u Oh well, I have tried everything... I am going to jump into the next waypoint. Thank you very much anyway!!
CamperBot
@camperbot
Oct 27 2015 09:15
natalia7 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: natalia7 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 27 2015 09:16
@Natalia7 strange! the code is just fine. if resetting the code or trying another browser didn't work for you, consider reporting it as a bug
Yogaraj
@yoga30696
Oct 27 2015 09:16
hello
Dustin Frank
@DustInCompetent
Oct 27 2015 09:16
@yoga30696 hi.
Yogaraj
@yoga30696
Oct 27 2015 09:17
@DustInCompetent hi.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:17
@yoga30696 looking for help?
Yogaraj
@yoga30696
Oct 27 2015 09:17

I have a doubt in waypoint.

editor.match(...) is null

How to solve this?

Dustin Frank
@DustInCompetent
Oct 27 2015 09:18
what value is editor
Yogaraj
@yoga30696
Oct 27 2015 09:19
Its just a starting session. Waypoint : Commenting HTML
I got like that.
What to do
Dustin Frank
@DustInCompetent
Oct 27 2015 09:19
You mean Waypoint: Uncomment HTML?
I'd like to take a look at it, can you send a link
Yogaraj
@yoga30696
Oct 27 2015 09:20
Its waypoint:Comment your HTML.
I got it working Dustin!! There is an instruction replaced by that line. I refreshed the page and I got it working.
Thanks @DustInCompetent
CamperBot
@camperbot
Oct 27 2015 09:21
yoga30696 sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 40 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Oct 27 2015 09:21
weird. Why can't I find that Waypoint? ...
@yoga30696 You're welcome I guess.
navin singh dalal
@dalalns
Oct 27 2015 09:22
Waypoint: Inherit Styles from the Body Element
i am having problem in solving this

<style>
body{
background-color:green;
font-family: Monospace;
}
.h1{
}

</style>

<h1>Hello World</h1>

can anybody help me with this code
?
this is part of html and css 48 number
Dustin Frank
@DustInCompetent
Oct 27 2015 09:24
.h1 is for elements with a "class" of h1
use just h1 instead
navin singh dalal
@dalalns
Oct 27 2015 09:24
still giving error
Khurram Naseem
@khurramn
Oct 27 2015 09:24
i need help with understanding the problem
h4r1m4u
@h4r1m4u
Oct 27 2015 09:24
@dalalns you're supposed to make the text green, not background
Khurram Naseem
@khurramn
Oct 27 2015 09:24
can i paste problem here?
Dustin Frank
@DustInCompetent
Oct 27 2015 09:25
<style>
  body{
    background-color: black;
    font-family: Monospace;
  }
  h1{
    color: green;
  }

</style>

<h1>Hello World</h1>
?
navin singh dalal
@dalalns
Oct 27 2015 09:25
thanks
CamperBot
@camperbot
Oct 27 2015 09:25
if you want to thank someone, put an @ before their name!
CleverTrout
@CleverTrout
Oct 27 2015 09:25
Your h2 element should be blue.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:25
you gave the body the wrong color
navin singh dalal
@dalalns
Oct 27 2015 09:25
@h4r1m4u
thanks
CamperBot
@camperbot
Oct 27 2015 09:25
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 27 2015 09:25
@DustInCompetent that's incorrect. the color should be inherited from body, not set for h1
Khurram Naseem
@khurramn
Oct 27 2015 09:25
hellow?
navin singh dalal
@dalalns
Oct 27 2015 09:25
@h4r1m4u thanks its solved now
CamperBot
@camperbot
Oct 27 2015 09:25
dalalns sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 357 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 09:25
@khurramn what do you need?
@dalalns you're welcome
Dustin Frank
@DustInCompetent
Oct 27 2015 09:26
oh I see, I skipped that, sorry
navin singh dalal
@dalalns
Oct 27 2015 09:26
i thought they were saying about background color
Khurram Naseem
@khurramn
Oct 27 2015 09:26

@h4r1m4u just need to understand it Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a "..." ending.

Note that the three dots at the end add to the string length.

If the length of the string is less than or equal to 3 characters, then the length of the three dots is not added to the string length

h4r1m4u
@h4r1m4u
Oct 27 2015 09:26
@DustInCompetent no problem
CleverTrout
@CleverTrout
Oct 27 2015 09:26
Help please.
CamperBot
@camperbot
Oct 27 2015 09:26

:point_right: bonfire no repeats please [wiki]

Problem Explanation:

  • This task requires us to look at each possible permutation of a string. This is best done using a recursion function. Being able to build a function which collects all permutations of a string is a common interview question, so there is no shortage of tutorials out there on how to do this, in many different code languages.
  • This task can still be daunting even after watching a tutorial. You will want to send each new use of the function 3 inputs: 1. a new string (or character array) that is being built, 2. a position in your new string that's going to be filled next, and 3. an idea of what characters (more specifically positions) from the original string have yet to be used. The pseudo code will look something like this:

    ```
    var str = ???;
    perm(current position in original string, what's been used in original string, current string build thus far){
    if(current string is finished) {
    print current string;
    }else{
    for(var i = 0; i < str.length; i++) {

    if(str[i] has not been used) {
      put str[i] into the current position;
      mark str[i] as used
      perm(current position in original string, what's been used in original string, current string build thus far)
      unmark str[i] as used because another branch in the tree for i + 1 will still likely use it;
    }

    }
    }
    }
    :pencil: read more about bonfire no repeats please on the FCC Wiki

h4r1m4u
@h4r1m4u
Oct 27 2015 09:26
@khurramn what do you not understand?
Unable to complete Task 3.
Your h2 element should be blue.
Thnx
CamperBot
@camperbot
Oct 27 2015 09:27
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 27 2015 09:27
@CleverTrout post your code
CleverTrout
@CleverTrout
Oct 27 2015 09:28

<style> {color: blue;} <h2>CatPhotoApp</h2></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>

h4r1m4u
@h4r1m4u
Oct 27 2015 09:28
@CleverTrout i think @DustInCompetent can take a stab at this one!
Dustin Frank
@DustInCompetent
Oct 27 2015 09:28
@CleverTrout stlye should be an attribute to your h2 element, not a tag around it.
Khurram Naseem
@khurramn
Oct 27 2015 09:29
i think i understand it
br
b
CleverTrout
@CleverTrout
Oct 27 2015 09:29
I don't understand.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:30
@CleverTrout everything that's inside a <style> tag will be handled as CSS text
CleverTrout
@CleverTrout
Oct 27 2015 09:30
Okay.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:30
so either put <h2>CatPhotoApp</h2>behind </style>
or remove the style tags and put it as an attribute inside of the h2 tag like this: <h2 style=" ... "> ... </h2>
Natalia
@Natalia7
Oct 27 2015 09:31
@h4r1m4u It worked! I tried IE (I am currently using Chrome), it's just a pity that I won't get it ticked in Chrome!
h4r1m4u
@h4r1m4u
Oct 27 2015 09:32
@CleverTrout in other words, you're mixing your HTML and CSS. furthermore, when defining CSS rules, you need to define them for specific elements, classes, or ids:
// this doesn't do anything
<style>
{ color: green;}
</style>

// this, on the other hand, does
<style>
p { color: green;}
</style>
CleverTrout
@CleverTrout
Oct 27 2015 09:32

@DustInCompetent : Codes looks like this

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

<h2>CatPhotoApp</h2>

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

h4r1m4u
@h4r1m4u
Oct 27 2015 09:33
@Natalia7 great! glad to hear that. it might be just a temporary hiccup for that particular waypoint. i'm using chrome exclusively and have passed all the waypoints with it
Harsh Gupta
@hgupta
Oct 27 2015 09:33
Is there any way to open an existing solution without the page running the script?
I was working on Bonfire: Exact Change in Advanced Algorithm Scripting and I think I made a mistake in the script which is either running in loop or causing stack overflow, causing the page to crash. But I am unable to debug it because it tries to run script as soon as I open the page.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:33
@CleverTrout almost, as @h4r1m4u just said, you'll also have to put the target of the style in front of the {}s
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:35
Is this possible?
var i = 0;

do(

   $(".myclick").on("click",funtion(){
    color = this.id;
    humanCreateAndPush(color);
    i++;
   }
)

while(color == compArray[i]);
can you place the on click inside a do-while loop?
I'm trying to capture all the clicks while a certain condition is being met
CleverTrout
@CleverTrout
Oct 27 2015 09:37
I still don't understand.
sEfirOtAE
@sEfirOtAE
Oct 27 2015 09:38
I am newbie. some1 help me abt this Your h2 element should degrade to the font Monospace when Lobster is not available.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:38

@CleverTrout

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

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet...</p>

or

<h2 style="color:blue;">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet...</p>
sEfirOtAE
@sEfirOtAE
Oct 27 2015 09:38
Your h2 element should degrade to the font Monospace when Lobster is not available.
CleverTrout
@CleverTrout
Oct 27 2015 09:39
Done thanks @DustInCompetent and @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 09:39
clevertrout sends brownie points to @dustincompetent and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 41 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
:star: 358 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Dustin Frank
@DustInCompetent
Oct 27 2015 09:44
@sEfirOtAE you can put more than one font as font-family.
If you put font-family: font1, font2, font3; it'll try to use font1. If that's not available, it'll use the next one and so on
@sEfirOtAE so if your h2 element is supposed to be written in Lobster or in monospace, when Lobster isn't available, you'll have to put both as font-family in a specific order.
Ankur Singh
@Ankurlvv
Oct 27 2015 09:46
"chai is not defined" this is problem i m facing in my bonfire "Tittle case a sentence"
Dustin Frank
@DustInCompetent
Oct 27 2015 09:46
@Ankurlvv Would you post your code?
h4r1m4u
@h4r1m4u
Oct 27 2015 09:47
@TheHighPriestess i don't think that will work. it will create an infinite while loop and hang your browser.
Dustin Frank
@DustInCompetent
Oct 27 2015 09:48
@Ankurlvv please? I mean, I'm gonna guess you just have a typo somewhere...
Manav Bansal
@mbansal11
Oct 27 2015 09:51
please tell me how jquery helps in web designing
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:51
@h4r1m4u well...the idea is that at some point color won't == compArray[i] ......but is it possible to put an on-click like that in a while loop?
h4r1m4u
@h4r1m4u
Oct 27 2015 09:52
@TheHighPriestess the problem is that the while loop will not 'wait' for the click. it'll just keep looping without interruptions because the while () statement will always be true
it'll hang your browser before the user has a chance to do anything
Ankur Singh
@Ankurlvv
Oct 27 2015 09:53

@DustInCompetent function titleCase(str) {

var arr = str.toLowerCase().split(" ");

console.log(arr);

var sentence = "";

arr.forEach(function(word){
    var first = word.charAt(0).toUpperCase(); 
    var rest = word.slice(1);
   var res = first + rest; 
   sentence += res + " "; 
     console.log(sentence);
});
sentence = sentence.trim();

return sentence;
}

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

Dustin Frank
@DustInCompetent
Oct 27 2015 09:53
@mbansal11 jQuery lets you shorten expressions like document.getElementById("id")to no more than $("#id") and adds a bunch of useful methods for getting and setting values of elements.
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:54
@h4r1m4u ok, I see...thanks
CamperBot
@camperbot
Oct 27 2015 09:54
thehighpriestess sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 359 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:55
I'm really hung up on the Simon zipline.
I've been trying for days...and I'm no closer to figuring it out.
Markus Kiili
@Masd925
Oct 27 2015 09:56
@mbansal11 Makes using Javascript on a web page easier and helps with cross-browser issues.
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:56
Here's what I need to do.
h4r1m4u
@h4r1m4u
Oct 27 2015 09:56
@TheHighPriestess from what i saw yesterday, you're pretty close. what's the main issue?
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:57
well...now I want to compare each human click...to each element in the computer generated array
in other words..the first human click will be compare to compArray[0] etc
Dustin Frank
@DustInCompetent
Oct 27 2015 09:57
@Ankurlvv try using a forloop instead:
for (var i = 0; i < arr.length; i++) {
var word = arr[i],
   first = word.charAt(0).toUpperCase(),
   rest = word.slice(1),
   res = first + rest,
   sentence += res + " ";
   console.log(sentence);
}
Ankur Singh
@Ankurlvv
Oct 27 2015 09:58
@DustInCompetent thanks
let me try
CamperBot
@camperbot
Oct 27 2015 09:58
ankurlvv sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 42 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 09:58
but i can't get past the part where it stops on the first click
I feel that I'm at the point where I need to look at someone else's code
Dustin Frank
@DustInCompetent
Oct 27 2015 10:00
@Ankurlvv maybe first has a special meaning in JavaScript and you might just wanna choose another name for that variable
sEfirOtAE
@sEfirOtAE
Oct 27 2015 10:00
Your h2 element should degrade to the font Monospace when Lobster is not available.
Vivek
@vivek28111992
Oct 27 2015 10:01
please somebody help me with Waypoint: Make Object Properties Private
sEfirOtAE
@sEfirOtAE
Oct 27 2015 10:01
what should i do? Your h2 element should degrade to the font Monospace when Lobster is not available.
Dustin Frank
@DustInCompetent
Oct 27 2015 10:01
@sEfirOtAE you can put more than one font as font-family.
If you put font-family: font1, font2, font3; it'll try to use font1. If that's not available, it'll use the next one and so on.
So if your h2 element is supposed to be written in Lobster or in monospace, when Lobster isn't available, you'll have to put both as font-family in a specific order.
@sEfirOtAE I already answered that
Vivek
@vivek28111992
Oct 27 2015 10:01

//Let's create an object with two functions. One attached as a property and one not.
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};

var Bike = function() {
// Only change code below this line.
this.speed = 100;
function addUnit(value) {
return value + "KM/H";
}

this.getSpeed = function () {
return addUnit(this.speed);
};

};

// Only change code above this line.
var myCar = new Car();
var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};
this my code & I want to make myBike.speed as undefined

sEfirOtAE
@sEfirOtAE
Oct 27 2015 10:01
oook ty man
Vivek
@vivek28111992
Oct 27 2015 10:03
@DustInCompetent can you help me?
h4r1m4u
@h4r1m4u
Oct 27 2015 10:04
@TheHighPriestess in pseudocode the flow should go something like this:
if (playersTurn): // variable that tracks whether it's human turn or computer turn
  button.click => push color into humanArray;
  if (humanArray is sub array of computerArray && humanArray.length < computerArray.length):
    // so far user remembered all the color correctly, but there are more to go
    game continues, user can click more buttons;
else if (humanArray is sub array of computerArray && humanArray.length == computerArray.length):
   // user correctly remembered all the colors in the sequence, it's time for the computer to add another one
   it's computers turn to play;
else:
  human made a mistake, game is over
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:06
@h4r1m4u Ok...I will take a look at that.
I also Googled and found an example.
Dustin Frank
@DustInCompetent
Oct 27 2015 10:06
@vivek28111992 Sorry, I'm kinda busy right now. I'm sure @h4r1m4u can help ;)
Piyush Vats
@piyushv
Oct 27 2015 10:06
hi guys starting with the bonfires upto number 7. how do you start a problem? do you break it down on paper before starting to code? how do you find yourself coding the most efficiently?
h4r1m4u
@h4r1m4u
Oct 27 2015 10:07
@vivek28111992 what's the issue?
Piyush Vats
@piyushv
Oct 27 2015 10:07
very generic question i know but i find myself coding a solution and then looking at it and only then realising theres a easier way to go about it. i guess what im wondering is does this come with experience or do you go about planning a solution a certain way
Vivek
@vivek28111992
Oct 27 2015 10:08
myBike.speed should be undefined.
how to make it undefined?
h4r1m4u
@h4r1m4u
Oct 27 2015 10:08
@piyushv i just hack at the problem and try to solve it by coding. if you're new to programming, it may be hard, but eventually you'll develop a sense for how certain problems should be approached and solved
especially these bonfires. they're just small pieces of code. for larger projects, it may be worthwhile to plan your code division and architecture in advance
Rahul
@RahulReddy75
Oct 27 2015 10:09
This message was deleted
hi all, I have a very basic question about how plagiarism is handled by freecodecamp. In the ziplines , there are few projects where the sample reference code has a better technique and a efficient way of programming. So if i try to adapt the same logic as in the reference code will it be a act of plagiarism?
h4r1m4u
@h4r1m4u
Oct 27 2015 10:10
@vivek28111992 did you read the advice in the sidebar?
We can also create private properties and private methods, which aren't accessible from outside the object.

To do this, we omit the word this from the property or method declaration. // here's your clue
Dustin Frank
@DustInCompetent
Oct 27 2015 10:10
@vivek28111992 make it a private attribute of the Bike Object by declaring it with var (var speed = instead of this.speed =)
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:11
It's not plagiarism. That's how you learn.
Vivek
@vivek28111992
Oct 27 2015 10:12
got it
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:12
For example, I have spent quite some time on the Simon project. However, I'm stuck. So, now I will look at someone else's code....in order to learn.
Vivek
@vivek28111992
Oct 27 2015 10:12
Thanks @DustInCompetent and @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 10:12
vivek28111992 sends brownie points to @dustincompetent and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 360 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 43 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Rahul
@RahulReddy75
Oct 27 2015 10:12
@TheHighPriestess So how is plagiarism defined?
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:13
@Rahul1992 If you're just cutting and pasting someone's code
Dustin Frank
@DustInCompetent
Oct 27 2015 10:13
@Rahul1992 please, stop arguing on the internet.
wait a minute.
Qadir Pervez
@qadirpervez
Oct 27 2015 10:13
what to do in bonfires/
h4r1m4u
@h4r1m4u
Oct 27 2015 10:13
@Rahul1992 here's my take:
1) you should try to solve the zipline without looking at somebody else's code first.
2) if you solve the zipline, check how other people implemented it and compare how elegant your solution is to theirs
3) if you get stuck trying to solve the zipline, have a look at somebody's code for inspiration. look mainly at how they generally approached the problem. try to take that approach and work it into your own solution
if you copy their solution word for word, that'd be plagiarism
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:13
@h4r1m4u That's how I see it.
Abhishek
@Abhi493
Oct 27 2015 10:13
thanks for asking @qadirpervez
CamperBot
@camperbot
Oct 27 2015 10:13
abhi493 sends brownie points to @qadirpervez :sparkles: :thumbsup: :sparkles:
:star: 182 | @qadirpervez | http://www.freecodecamp.com/qadirpervez
Qadir Pervez
@qadirpervez
Oct 27 2015 10:14
help me
CamperBot
@camperbot
Oct 27 2015 10:14

:point_right: adding environment variables [wiki]

In Windows

Via GUI

  1. Download Varpanel.
  2. Open Varpanel.
  3. In PATH variable, add the relevant path (for example).

:pencil: read more about adding environment variables on the FCC Wiki

Abhishek
@Abhi493
Oct 27 2015 10:14
lol
Qadir Pervez
@qadirpervez
Oct 27 2015 10:14
thanks @Abhi493
CamperBot
@camperbot
Oct 27 2015 10:14
qadirpervez sends brownie points to @abhi493 :sparkles: :thumbsup: :sparkles:
:star: 253 | @abhi493 | http://www.freecodecamp.com/abhi493
Dustin Frank
@DustInCompetent
Oct 27 2015 10:14
thanks @camperbot
CamperBot
@camperbot
Oct 27 2015 10:14
dustincompetent sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 430 | @camperbot | http://www.freecodecamp.com/camperbot
Rahul
@RahulReddy75
Oct 27 2015 10:15
I get it... It is not a argument.. Just a basic question for clarification.
h4r1m4u
@h4r1m4u
Oct 27 2015 10:15
@Rahul1992 it's a valid question. i think dustin misread what you were asking
Ankit Panwar
@coderNoob
Oct 27 2015 10:15
Bonfire: Pig Latin is broken for test case number 3 ?
CamperBot
@camperbot
Oct 27 2015 10:15
Sorry, can't find a bonfire called pig latin is broken for test case number 3 . [ Check the map? ]
Piyush Vats
@piyushv
Oct 27 2015 10:15
on bofire 7 it says this under instractions "If you are writing your own Chai.js tests, be sure to use a deep equal statement instead of an equal statement when comparing arrays."
what is chai.js?
h4r1m4u
@h4r1m4u
Oct 27 2015 10:17
@piyushv http://chaijs.com/. you don't need to worry about it. i believe it's mainly for the folks contributing to FCC and writing the test cases for the bonfires.
Piyush Vats
@piyushv
Oct 27 2015 10:17
ah. thanks @h4r1m4u ur on fire today with the help. appreciated! :)
CamperBot
@camperbot
Oct 27 2015 10:17
piyushv sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 361 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Rahul
@RahulReddy75
Oct 27 2015 10:17
@h4r1m4u Its just about considering the logic part of the other code, If its efficient and a smart piece.
h4r1m4u @h4r1m4u blushes
Rahul
@RahulReddy75
Oct 27 2015 10:18
thanks @TheHighPriestess @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 10:18
rahul1992 sends brownie points to @thehighpriestess and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 362 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
:star: 305 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
h4r1m4u
@h4r1m4u
Oct 27 2015 10:18
@Rahul1992 completely valid to check someone else's code. as @TheHighPriestess said, how else would you learn? but i'd encourage you to do that only after you come up with your own solution
Rahul
@RahulReddy75
Oct 27 2015 10:19
yes yes absolutely..!!
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:20
@h4r1m4u ...or if you get completely stuck. You'll know when you're at that point.
h4r1m4u
@h4r1m4u
Oct 27 2015 10:21
yeah, exactly
Elizabeth Hatleli
@TheHighPriestess
Oct 27 2015 10:22
for example...right now i'm finding a bunch of tutorials for the simon game. I know that I'll be able to get a lot more out of them given the fact that I've spent time working on it myself
Rahul
@RahulReddy75
Oct 27 2015 10:22
ok ok
Aayush Kapoor
@aayushkapoor206
Oct 27 2015 10:23
Hi
If I complete Free Code Camp, will I be able to make a clone of Free Code Camp by myself?
Or is more expertise required?
h4r1m4u
@h4r1m4u
Oct 27 2015 10:29
@aayushkapoor206 it all comes down to how much you put into the learning. if you do the bare minimum just to pass all the exercises, no, you won't be able to create another FCC. if you really dig in and self-study and research, after some time you might be able to. that said, putting something like FCC together is a lot of work, it ain't a walk in the park
Aayush Kapoor
@aayushkapoor206
Oct 27 2015 10:31
@h4r1m4u Oh... So you need a lot more than 800 hours to get to that level?
AYE EVANS
@ignorantusguru
Oct 27 2015 10:32
Hey
h4r1m4u
@h4r1m4u
Oct 27 2015 10:32
@aayushkapoor206 starting from zero knowledge? yes, i'd say so for sure
Aayush Kapoor
@aayushkapoor206
Oct 27 2015 10:33
@h4r1m4u Hmm.. thanks
CamperBot
@camperbot
Oct 27 2015 10:33
aayushkapoor206 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 363 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
DustInCompetent @DustInCompetent is out to lunch
h4r1m4u @h4r1m4u lunched on brownies
Kathryn McGrath
@kathrynmc
Oct 27 2015 10:34
hi everyone I'm stuck on this waypoint: "Use the reduce function to sum all the values in array and assign it to singleVal." This is all I have so far var array = [4,5,6,7,8]; var singleVal = 0; // Only change code below this line. var singleVal = array.reduce(function(previousVal, currentVal){ return previousVal+currentVal; });
h4r1m4u
@h4r1m4u
Oct 27 2015 10:36
@kathrynmc that looks correct to me. what's the issue?
Kathryn McGrath
@kathrynmc
Oct 27 2015 10:37
@h4r1m4u it's throwing up an undefined when i run the code
marzelin
@marzelin
Oct 27 2015 10:38
@kathrynmc what does your function return?
is it singleVal?
Kathryn McGrath
@kathrynmc
Oct 27 2015 10:39
@marzelin (function() {return singleVal;})();
h4r1m4u
@h4r1m4u
Oct 27 2015 10:39
@kathrynmc can you post everything you have in the code pane?
Kathryn McGrath
@kathrynmc
Oct 27 2015 10:40
@h4r1m4u
var array = [4,5,6,7,8];
var singleVal = 0;
// Only change code below this line.
var singleVal = array.reduce(function(previousVal, currentVal){
  return
  previousVal+currentVal;
});


// Only change code above this line.
(function() {return singleVal;})();
h4r1m4u
@h4r1m4u
Oct 27 2015 10:41
put the return on the same line as previousVal+currentVal;
Kathryn McGrath
@kathrynmc
Oct 27 2015 10:42
@h4r1m4u thank you my god I didn't realise that made any difference!
CamperBot
@camperbot
Oct 27 2015 10:42
kathrynmc sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 364 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 10:42
yeah, it does. if you put return on a separate line, the function doesn't return anything.
or i should say, returns 'undefined'
Kathryn McGrath
@kathrynmc
Oct 27 2015 10:44
@h4r1m4u ah the pitfalls of a newb. thanks again.
CamperBot
@camperbot
Oct 27 2015 10:44
kathrynmc sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: kathrynmc already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 27 2015 10:47
happens to all of us. you're doing great!
Ankit Panwar
@coderNoob
Oct 27 2015 10:51
Can anyone give me resources for learning RegExp in JS?
Zarina
@zarinasaroyan
Oct 27 2015 10:53
Hi, Zarina here. needed some help. How to call a CSS class for an image
I just mentioned it after putting the source
<img src="https://bit.ly/fcc-relaxing-cat" smaller-image>
Michael Bomholt
@bomholtm
Oct 27 2015 10:54
@zarinasaroyan you need to add class=""
like you added source with src=""
h4r1m4u
@h4r1m4u
Oct 27 2015 10:55
@zarinasaroyan you give classes to any elements like so:
<p class="my-class-name"></p>
<input class="my-class-name">
it's the same for <img>
Zarina
@zarinasaroyan
Oct 27 2015 10:56
Thanks @bomholt & @h4r1m4u . It worked :)
CamperBot
@camperbot
Oct 27 2015 10:56
zarinasaroyan sends brownie points to @bomholt and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 392 | @bomholt | http://www.freecodecamp.com/bomholt
:star: 365 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Ankit Panwar
@coderNoob
Oct 27 2015 11:01
@marzelin Thanks
CamperBot
@camperbot
Oct 27 2015 11:01
codernoob sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:star: 393 | @marzelin | http://www.freecodecamp.com/marzelin
Mehrosh
@mehroshh
Oct 27 2015 11:06
guys i need help with my quote generator. anyone free to lend an ear?
Harsh Gupta
@hgupta
Oct 27 2015 11:07
@mehroshh you don't need to request for help
Post your question and we will help you
Mehrosh
@mehroshh
Oct 27 2015 11:07
ah that's sweet
anyways, here's my quote generator
now, everything is alright except that i can't get it to append a "tweet share" button
the code that im trying to append with each of my "note" is fine. I can see, it creates a button with each note, but it doesn't really work if you click on it
on the other hand, if I paste the same code in my "html" section, it works fine
but that's not what i want. I need it to appear at the bottom of each separate card
any idea how may I get around this?
marzelin
@marzelin
Oct 27 2015 11:11
@mehroshh first of all add target='_blank' to your <a> tag
Mehrosh
@mehroshh
Oct 27 2015 11:12
nice one @marzelin im on it
h4r1m4u
@h4r1m4u
Oct 27 2015 11:13
@mehroshh remove overflow: hidden; from .note in your CSS
that's the reason you dont' see the links
then you'll need to fix the alignment
Mehrosh
@mehroshh
Oct 27 2015 11:15
doesn't work even with the overflow removed @h4r1m4u
@marzelin i did as you said, and now even thou it seems to do the trick but again
as expected, it opens up a whole new idea
how about opening the whole thing inside a child window?
h4r1m4u
@h4r1m4u
Oct 27 2015 11:16
i can see the tweet links with overflow removed
oh hang on, i misread what you were asking
Mehrosh
@mehroshh
Oct 27 2015 11:17
yep @h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 11:17
what @marzelin says is correct. you need to add target="_blank" into the <a> tags. codepen prevents the links from opening otherwise
Mehrosh
@mehroshh
Oct 27 2015 11:18
it has no problem if i paste the exact same code in the "html" section
in fact, it actually displays the button quite properly with all the icon and stuff
let me crop a pic
Capture.PNG
see the image ? @h4r1m4u @marzelin i get the results right when i post this piece of code in the "html" section
marzelin
@marzelin
Oct 27 2015 11:21
@mehroshh where is the css rule for twitter-share-button?
Mehrosh
@mehroshh
Oct 27 2015 11:22
but the same code in the "js" shows up quite ugly with only a link on it
it needs the following code directly from twitter docs to get the whole thing done @marzelin
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
im totally stump !
i have no idea why it wont work when added dynamically with jquery ?
marzelin
@marzelin
Oct 27 2015 11:25
@mehroshh the reason could be that this code is run only at the loading of the page, so it doesn't work when you add elements dynamically afterwards
h4r1m4u
@h4r1m4u
Oct 27 2015 11:26
@mehroshh stick this into your JS:
...
$(".note:last").append("<a href='https://twitter.com/share' class='twitter-share-button' data-text='share this quote' data-via='Suchhhiiiii' data-size='large'>Tweet</a>");

twttr.widgets.load(); // this is the important bit
Mehrosh
@mehroshh
Oct 27 2015 11:26
it's a script right? so as far as i know once a script is loaded, it just stays there in the browser memory until the page is refreshed ?
h4r1m4u
@h4r1m4u
Oct 27 2015 11:27
no. the script in the head will only render the share buttons if they're part of the original DOM. if you add them using jQuery, you manipulate the DOM and need to specifically call the script.
that's why it worked if you pasted them into your HTML, but not if you generated them via the jQuery functions
Mehrosh
@mehroshh
Oct 27 2015 11:29
I see
let me try the last bit
bingo! it worked! you are a life saver ! @h4r1m4u
thanks a million @h4r1m4u @marzelin
h4r1m4u
@h4r1m4u
Oct 27 2015 11:30
:clap: :)
CamperBot
@camperbot
Oct 27 2015 11:30
mehroshh sends brownie points to @h4r1m4u and @marzelin :sparkles: :thumbsup: :sparkles:
:star: 395 | @marzelin | http://www.freecodecamp.com/marzelin
:star: 366 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 11:31
nice work, btw. it's looking great so far
Mehrosh
@mehroshh
Oct 27 2015 11:31
a million thanks and exactly one brownie point, tbp xD
CamperBot
@camperbot
Oct 27 2015 11:31
if you want to thank someone, put an @ before their name!
Mehrosh
@mehroshh
Oct 27 2015 11:31
thanks again ; p @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 11:31
mehroshh sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mehroshh already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 27 2015 11:31
my pleasure
h4r1m4u @h4r1m4u nom, nom, nom, what a tasty brownie
Mehrosh
@mehroshh
Oct 27 2015 11:31
so what's the theory behind `twttr.widgets.load()' again ? @h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 11:32
it reloads the twitter script you have added in <head>, so that it can render the share-buttons you added via DOM manipulation with jQuery
as you generate the quote cards, you're changing the DOM of the page. but the twitter script won't know it has changed unless you reload it
Mehrosh
@mehroshh
Oct 27 2015 11:34
that's brilliant @h4r1m4u pats at your back
i could not have figured it out myself in a century xD @h4r1m4u
h4r1m4u
@h4r1m4u
Oct 27 2015 11:37
glad i could help @mehroshh. i ran into something similar a few days ago myself and took me a while to figure it out
here's the documentation regarding the load() function: https://dev.twitter.com/web/javascript/initialization. might shed some additional light on why you need it
Mehrosh
@mehroshh
Oct 27 2015 11:39
great. thank you @h4r1m4u
CamperBot
@camperbot
Oct 27 2015 11:39
mehroshh sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mehroshh already gave h4r1m4u points
Anthony
@Guzko
Oct 27 2015 11:42
This is what I need to do, what is missing?
Your a element should be nested within your new p element.
Your p element should have the text "View more " (with a space after it).
<p> View more
  <a href="http://freecodecamp.com"> cat photos</a>
</p>
h4r1m4u
@h4r1m4u
Oct 27 2015 11:46
@Guzko the link needs to be to http://www.freecatphotoapp.com, not to http://www.freecodecamp.com
Anthony
@Guzko
Oct 27 2015 12:31
Okay so why does it say I don´t have ¨View more¨ in my p tag?
<p> View more 
  <a href="http://www.freecatphotoapp.com">
    cat photos
  </a>
</p>
Sardors
@Sardors
Oct 27 2015 12:35

Hi guys how to get last arguments from thisfunction destroyer(arr) {

return arr;
}

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

function returning only array, i can't access last two numbers ( 44, 3)
arr[1] isn't returning 44, instead it's returning 2
Yogaraj
@yoga30696
Oct 27 2015 12:37
This message was deleted
Laura Stephenson
@lauralstephenson
Oct 27 2015 12:40

Waypoint 66 if statements For example:

if (1 === 2) {

  return true;

} else {

  return false;

}

Let's use if and else statements to make a coin-flip game.

Create if and else statements to return the string "heads" if the flip variable is zero, or else return the string "tails" if the flip variable is not zero.

Sardors
@Sardors
Oct 27 2015 12:40

it's bonfire seek and destroy task

function destroyer(arr) {

  return arr;
}

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

how to get arguments located next to an array? arr1 isn't returning 44.

Laura Stephenson
@lauralstephenson
Oct 27 2015 12:40
myFunction should either return heads or tails. X
myFunction should return heads when flip equals 0 and tails when flip equals 1. X
You should have created a new if statement. Y
You should have created a new else statement.Y
Here's my code:```

if (0 === 1) {

  return true.heads;

} else {

  return false.tails;

}

What am I coding wrong?
Sardors
@Sardors
Oct 27 2015 12:47
@lauralstephenson 0 is never equal to 1 so result always will be "return false.tails"; and you can't use false as variable.
if(flip == 0){return "heads";} else{return "tails";}
Anthony
@Guzko
Oct 27 2015 12:50
Okay so why does it say I don´t have ¨View more¨ in my p tag?
<p> View more 
  <a href="http://www.freecatphotoapp.com">
    cat photos
  </a>
</p>
sergey
@sergeyBreslavets
Oct 27 2015 12:54
@Sardors var arr = [ [1, 2, 3, 1, 2, 3], 44, 3];
var last= arr.pop();
alert(last);
var last= arr.pop();
alert(last);
Sardors
@Sardors
Oct 27 2015 12:56
@sergeyBreslavets it isn't array i suppose.check it http://freecodecamp.com/challenges/bonfire-seek-and-destroy
Anthony
@Guzko
Oct 27 2015 13:01
This message was deleted
This message was deleted
What is wrong with this
<p> View more 
  <a href="http://www.freecatphotoapp.com">
    cat photos
  </a>
</p>
Laura Stephenson
@lauralstephenson
Oct 27 2015 13:03
Thanks, @Sardors !
CamperBot
@camperbot
Oct 27 2015 13:03
lauralstephenson sends brownie points to @sardors :sparkles: :thumbsup: :sparkles:
:star: 194 | @sardors | http://www.freecodecamp.com/sardors
Zeljko Sevic
@schewmeister
Oct 27 2015 13:09
hello everyone
Jaykishan Kacha
@jaykishan10
Oct 27 2015 13:11
need help with array.filter()
how is it worked?
marzelin
@marzelin
Oct 27 2015 13:12
@jaykishan10 it works like a sieve
returns only part of the array
Jaykishan Kacha
@jaykishan10
Oct 27 2015 13:13
okay
Zeljko Sevic
@schewmeister
Oct 27 2015 13:13
@jaykishan10 you put function inside brackets, and it will return part of the array which satisfies conditions
Jaykishan Kacha
@jaykishan10
Oct 27 2015 13:21
thanks @schewmeister
CamperBot
@camperbot
Oct 27 2015 13:21
jaykishan10 sends brownie points to @schewmeister :sparkles: :thumbsup: :sparkles:
:star: 320 | @schewmeister | http://www.freecodecamp.com/schewmeister
Jaykishan Kacha
@jaykishan10
Oct 27 2015 13:21
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  var x = new Boolean(false);
  function isBoolean(value){
     return value != x;
  }

 arr = arr.filter(isBoolean);
  return arr;
}
bouncer([false, null, 0, NaN, undefined, ""]);
i worte this code
output is (null,null,null)
instead of []
what is wrong?
Jason Wood
@catapixel
Oct 27 2015 13:29
@jaykishan10 in this case you are over complicating things. Each value is truthy or falsey. You don't need to check for equality. Just return value in your isBoolean function and you will automatically be returning true or false. Do you understand?
shiftie
@shiftie
Oct 27 2015 13:31
what's the goal? to remove all false, null,emtpy string values?
Jason Wood
@catapixel
Oct 27 2015 13:31
@shiftie you are trying to remove all falsey values from the supplied array
shiftie
@shiftie
Oct 27 2015 13:34
then he should just return value since 0 will get filtered as well as false as well as undefined....
Jason Wood
@catapixel
Oct 27 2015 13:37
@shiftie I agree. That's what I wrote just above.
marzelin
@marzelin
Oct 27 2015 13:42
Falsy values in javascript are false, null, 0, "", undefined, and NaN.
but when you compare those values to false (value == false), only 0 and "" give false result
Jason Wood
@catapixel
Oct 27 2015 13:45
@marzelin that is in fact the answer to @jaykishan10 's question about why his code was not working. Well done. I should've answered the question rather than just point to an easier way to complete the challenge.
marzelin
@marzelin
Oct 27 2015 13:49
@catapixel don't be so humble, you provided a useful piece of adivce :+1:
Jason Wood
@catapixel
Oct 27 2015 13:50
thanks @marzelin but still better to answer the question being asked. It's important in this case to understand why the evaluation didn't work so that the same mistake isn't made in the future.
CamperBot
@camperbot
Oct 27 2015 13:50
catapixel sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:star: 396 | @marzelin | http://www.freecodecamp.com/marzelin
Piyush Vats
@piyushv
Oct 27 2015 13:52
help notification
CamperBot
@camperbot
Oct 27 2015 13:52
no wiki entry for: notification
:pencil: click here to create one now!after creating your page type update to reload it here
Jaykishan Kacha
@jaykishan10
Oct 27 2015 14:01
thanks @catapixel
CamperBot
@camperbot
Oct 27 2015 14:01
jaykishan10 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 524 | @catapixel | http://www.freecodecamp.com/catapixel
Piyush Vats
@piyushv
Oct 27 2015 14:03
hi guys bofire bonfire-confirm-the-ending
in the instructions it mentions String.substr(); but my solution does not use this at all. i know this doesnt really matter but just for curiosity's sake wanted to check with you all to see if there is a more elegant solution. code is below-passed all tests
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor

  if((str.charAt(str.length - 1)) == target.charAt(target.length - 1)){
    return true;
  } else {
    return false;
  }
}

end("He has to give me a new name", "name");
marzelin
@marzelin
Oct 27 2015 14:05
@piyushv your code only checks for the last character, isn't it?
Deepanshu Kaushik
@daksh844
Oct 27 2015 14:06
Hi All, does anyone over here know D3.js am stuck on few problems since 3 weeks. Please let me know if anyone can help. Thanks alot
Piyush Vats
@piyushv
Oct 27 2015 14:07
@marzelin yep
shiftie
@shiftie
Oct 27 2015 14:08
you have to get the substring at offset = your target word length
marzelin
@marzelin
Oct 27 2015 14:09
@piyushv so it doesn't adhere to the requirements. You've just lucky that test aren't strict enough
Piyush Vats
@piyushv
Oct 27 2015 14:09
@yeh i just realised that.
@marzelin thanks. im checking to see if last letter of string is equal to last letter of argument instead of if string ends with argument
CamperBot
@camperbot
Oct 27 2015 14:09
piyushv sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:star: 397 | @marzelin | http://www.freecodecamp.com/marzelin
Raghu Ranganathan
@razetime
Oct 27 2015 14:14
@camperbot what are your commands?
Deepanshu Kaushik
@daksh844
Oct 27 2015 14:18
Hi all, does anybody over here know D3.js am stuck on few problems since 3 weeks. Please let me know if any one help. Thanks
Piyush Vats
@piyushv
Oct 27 2015 14:19
@marzelin how about this lol it passes all the tests but im afraid im doing something wrong still
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor

  if(str.substr(str.length-target.length) == target){
    return true;
  } else {
    return false;
  }


}

end("He has to give me a new name", "name");
Hitvardhan Singh Solanki
@Hitvardhan-Singh-Solanki
Oct 27 2015 14:20
hey guys can anyone help me with this code

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

var expression = /./gi;
var and = /and/gi;
// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
return testString.match(expression).length;
})();(function(){return test;})();
it is not passing me with my tests

marzelin
@marzelin
Oct 27 2015 14:21
@piyushv it looks all right. I approve this code ;) :+1:
Piyush Vats
@piyushv
Oct 27 2015 14:22
@Hitvardhan-Singh-Solanki which waypoint is this
@marzelin thanks mate
CamperBot
@camperbot
Oct 27 2015 14:22
piyushv sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:warning: piyushv already gave marzelin points
Hitvardhan Singh Solanki
@Hitvardhan-Singh-Solanki
Oct 27 2015 14:22
159
Chris
@ChrisB50
Oct 27 2015 14:23
Does anyone know how i can paste code properly using ipad, ive found the backticks just cant do the line break before pasting?
Kevin Atunda Nyakundi
@kellynyashatunda
Oct 27 2015 14:24
Am stuck.My JQuery does not run when the page loads