These are chat archives for FreeCodeCamp/Help

25th
Oct 2015
Joel M. Swensen
@JoelMSwensen
Oct 25 2015 00:11 UTC
@dting here is the repo for that site: https://github.com/JoelMSwensen/quote-generator.git
any clues as to what i can change to get the api working?
app not site, sorry
Matt Anderson
@MDAWebDev
Oct 25 2015 00:23 UTC
"Apply static middleware to serve index.html file without any routes."
What does that even mean?
Rory Smith
@alanbuchanan
Oct 25 2015 00:25 UTC
as far as i understand, without using middleware the index.html can't be accessed because its location is static, whereas you want to be loading it like http://localhost:3000/index.html
the problem you have is that your quotes use "
then you are trying to use the quote inside an attribute you have surrounded by "
so what happens is you end up with somethign like <a href=""asdf""></a>
Joel M. Swensen
@JoelMSwensen
Oct 25 2015 00:30 UTC
OHHHHH! I get it
thank you!
CamperBot
@camperbot
Oct 25 2015 00:30 UTC
if you want to thank someone, put an @ before their name!
Joel M. Swensen
@JoelMSwensen
Oct 25 2015 00:30 UTC
@dting thank you!
CamperBot
@camperbot
Oct 25 2015 00:30 UTC
joelmswensen sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1462 | @dting | http://www.freecodecamp.com/dting
Rick
@rick1827
Oct 25 2015 01:03 UTC
hello all
this maybe a dumb question but stuck
image into a link lesson
can i use a element with a class
nevermind figured out
profoundconqueror
@profoundconqueror
Oct 25 2015 01:23 UTC
stuck on waypoint 32 of basic javascript If and Else Statements
it says that tails is not defined
James Smith
@matthew02
Oct 25 2015 01:23 UTC
@profoundconqueror Show your code, please.
profoundconqueror
@profoundconqueror
Oct 25 2015 01:23 UTC
if (0 === 1) {
  return heads;
} else {
  return tails;
}
Matt Luker
@mattnwa
Oct 25 2015 01:24 UTC
Wiki
CamperBot
@camperbot
Oct 25 2015 01:24 UTC
usage:
wiki $topic info on that topic
topics for a list of topics
Matt Luker
@mattnwa
Oct 25 2015 01:25 UTC
Topics
Wiki topics
CamperBot
@camperbot
Oct 25 2015 01:25 UTC
no wiki entry for: topics
:pencil: click here to create one now!after creating your page type update to reload it here
Matt Luker
@mattnwa
Oct 25 2015 01:25 UTC
Wiki $topics
CamperBot
@camperbot
Oct 25 2015 01:25 UTC
no wiki entry for: topics
:pencil: click here to create one now!after creating your page type update to reload it here
James Smith
@matthew02
Oct 25 2015 01:25 UTC
@profoundconqueror You need to be checking if flip === 0 instead of if 0 === 1.
profoundconqueror
@profoundconqueror
Oct 25 2015 01:26 UTC
oooh, thanks!
CamperBot
@camperbot
Oct 25 2015 01:26 UTC
if you want to thank someone, put an @ before their name!
James Smith
@matthew02
Oct 25 2015 01:26 UTC
@profoundconqueror :+1:
profoundconqueror
@profoundconqueror
Oct 25 2015 01:28 UTC
so my new code is
if (flip === 0) {
  return heads;
} else {
  return tails;
}
it's showing heads is not defined
James Smith
@matthew02
Oct 25 2015 01:29 UTC
@profoundconqueror heads and tails should be strings... need to put quotes around them.
profoundconqueror
@profoundconqueror
Oct 25 2015 01:31 UTC
lol, that did it, thanks again. @matthew02
CamperBot
@camperbot
Oct 25 2015 01:31 UTC
if you want to thank someone, put an @ before their name!
James Smith
@matthew02
Oct 25 2015 01:31 UTC
@profoundconqueror You bet!
novlem
@m3lv0n
Oct 25 2015 01:43 UTC
I'm definitely missing something in applying multiple class attributes I'm not clear on how my two classes pink text and blue text is translated into class="class1 class2"
Jon Martin
@Begbie2006
Oct 25 2015 02:04 UTC
cat-photo-form: <form id="cat-photo-form">
Any suggestions on why this isn't working: cat-photo-form: <form id="cat-photo-form">
James Smith
@matthew02
Oct 25 2015 02:06 UTC
@Begbie2006 Did you delete the action from the form?
Geepum Lee
@Geepum
Oct 25 2015 02:10 UTC
@Begbie2006 show us the image or link so that we know what you are talking about
Derek
@Lyonar
Oct 25 2015 02:20 UTC
Is it me or are some of the jQuery waypoints bugged?... in the sense that I have to click the run test/finished button more than once for the move on link to appear, the first time it will say my code isn't right, the next will go through without changes
Geepum Lee
@Geepum
Oct 25 2015 02:22 UTC
@Lyonar I had that problem once when i was on chrome using my phone, but i don't have the same problem again yet
Derek
@Lyonar
Oct 25 2015 02:25 UTC
@Geepum For what it's worth I'm using Firefox. It's not a big deal but it's happened a few times.
KofiAkorli
@KofiAkorli
Oct 25 2015 02:28 UTC
@Lyonar I also noticed I was having issues in firefox, try using chrome
Geepum Lee
@Geepum
Oct 25 2015 03:16 UTC
Hey guys, how do you generate random fractions with js?

function myFunction() {
// Change the 0 to Math.random().
// Only change code below this line.

return 0;

// Only change code above this line.
}

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

Herman Fassett
@HermanFassett
Oct 25 2015 03:18 UTC
@Geepum just return Math.random() instead of 0
Geepum Lee
@Geepum
Oct 25 2015 03:31 UTC
Thank you @HermanFassett !
CamperBot
@camperbot
Oct 25 2015 03:31 UTC
geepum sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 433 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Geepum Lee
@Geepum
Oct 25 2015 03:31 UTC
I was trying to make it more complicated!
Herman Fassett
@HermanFassett
Oct 25 2015 03:33 UTC
:P Yep, glad to help
Danny Libin
@Daynil
Oct 25 2015 03:46 UTC
Anyone here familiar with angular 2?
DevDani
@DevDani
Oct 25 2015 03:48 UTC
It's not out yet :p @Daynil
Danny Libin
@Daynil
Oct 25 2015 03:49 UTC
@DevDani It's in alpha, I'm just trying to get ahead of the game =D
I love working with it but it's pretty hard to get around road blocks since so few people use it
DevDani
@DevDani
Oct 25 2015 03:51 UTC
I tried it before found it (the Angular 1.x) all over the place, probably because im still very noob to web development ;)
Evan
@evanslaton
Oct 25 2015 04:23 UTC

Hi everyone! I'm trying to return the length of the longest word in a sentence and came up with some code that works on all the case except one. Can anyone tell me why it's returning '6' instead of '19' for the sentence at the bottom?

function findLongestWord(str) {
strArray = str.split(" ");
array = strArray.map(function(val){
return val.length;
});
array = array.sort();
return array[array.length - 1];
}

findLongestWord("What if we try a super-long word such as otorhinolaryngology");

Herman Fassett
@HermanFassett
Oct 25 2015 04:26 UTC
@evanslaton maybe remove the sort
actually :P
No
change sort to
array = array.sort(function(a,b) {
    return a - b;
});
Otherwise it sorts alphabetically or by first number in int string
Geepum Lee
@Geepum
Oct 25 2015 04:29 UTC
Hey guys
what does !== mean in js?
Evan
@evanslaton
Oct 25 2015 04:29 UTC
Thanks @HermanFassett! Not sure how it works but it did!
CamperBot
@camperbot
Oct 25 2015 04:29 UTC
evanslaton sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 437 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 25 2015 04:30 UTC
Not deeply equal to @Geepum
Yeah @evanslaton , that code just sorts numerically instead of alphabetically
marcusssss
@marcusssss
Oct 25 2015 04:42 UTC
You need an a element that links to http://freecatphotoapp.com.
<a herf="http://freecatphotoapp.com">
cat photos
</a>
anything wrong?
can anyone helps? thanks
CamperBot
@camperbot
Oct 25 2015 04:43 UTC
if you want to thank someone, put an @ before their name!
D/S
@dantesolis
Oct 25 2015 04:43 UTC
hey guys can someone tell me why am I getting an undefined error?
function findLongestWord(str) {
  var splitStr = str.split(‘');
  for ( var i = 0, longest = ''; i < splitStr.length; ++i)
    if (splitStr[i].length > longest.length) longest = splitStr[i];
  return longest;  
}
Herman Fassett
@HermanFassett
Oct 25 2015 04:44 UTC
@marcusssss it's href not herf
marcusssss
@marcusssss
Oct 25 2015 04:44 UTC
thanks @HermanFassett
CamperBot
@camperbot
Oct 25 2015 04:44 UTC
marcusssss sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 440 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 25 2015 04:45 UTC
@dantesolis you have a weird character in your split function. Make sure they're all the right type of mark. Also, you need to return the length as a number, no characters
marcusssss
@marcusssss
Oct 25 2015 04:46 UTC
it works, thank you
CamperBot
@camperbot
Oct 25 2015 04:46 UTC
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 25 2015 04:46 UTC
Yep
D/S
@dantesolis
Oct 25 2015 04:46 UTC
Thanks @HermanFassett
CamperBot
@camperbot
Oct 25 2015 04:46 UTC
dantesolis sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 441 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
marcusssss
@marcusssss
Oct 25 2015 05:10 UTC

Your p element should have the text "View more " (with a space after it).

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

can anyone helps?

Manav Bansal
@mbansal11
Oct 25 2015 05:17 UTC
are you stuck?
marcusssss
@marcusssss
Oct 25 2015 05:19 UTC
yes
stuck on "Your p element should have the text "View more " (with a space after it)." and have no idea
Manav Bansal
@mbansal11
Oct 25 2015 05:23 UTC
show me your code
marcusssss
@marcusssss
Oct 25 2015 05:23 UTC
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
Manav Bansal
@mbansal11
Oct 25 2015 05:24 UTC
your code is right
@HermanFassett are you there
Herman Fassett
@HermanFassett
Oct 25 2015 05:29 UTC
Yes
bajajrijul
@bajajrijul
Oct 25 2015 05:29 UTC
hey please anyone could just help me, I am lot confused with object And functions in javascript and use of this keyword in it, I am just a beginner, just help me a way out. Thanks!
CamperBot
@camperbot
Oct 25 2015 05:29 UTC
if you want to thank someone, put an @ before their name!
Manav Bansal
@mbansal11
Oct 25 2015 05:29 UTC
stuck in dead link
Herman Fassett
@HermanFassett
Oct 25 2015 05:29 UTC
Ok @mbansal11 so just in the quotes of your href put #
Manav Bansal
@mbansal11
Oct 25 2015 05:30 UTC
<p>Click here for <a #="http://www.freecatphotoapp.com">cat photos</a>.</p>
Herman Fassett
@HermanFassett
Oct 25 2015 05:31 UTC
you need <a href=""> and in the quotes put the #
Pranav Doshi
@pranavdoshi
Oct 25 2015 05:32 UTC
Hey guys need asap plzz on a program in eloquent javascript anyone here to help plzz reply
Manav Bansal
@mbansal11
Oct 25 2015 05:33 UTC
@HermanFassett thanks :)
CamperBot
@camperbot
Oct 25 2015 05:33 UTC
mbansal11 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 442 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
marcusssss
@marcusssss
Oct 25 2015 05:35 UTC
@mbansal11 so do you have any idea why it doesn't work
Mohamed Fahadh
@fahadh14
Oct 25 2015 05:35 UTC
guys anyone
got any good tutorials on wordpress
h4r1m4u
@h4r1m4u
Oct 25 2015 05:37 UTC
@marcusssss try resetting the code, reloading the page and entering the same code again. sometimes the waypoints get stuck even if the code is right and resetting/reloading helps
Pranav Doshi
@pranavdoshi
Oct 25 2015 05:38 UTC
anyone can explain we this code challenge plzz

Write a program that creates a string that represents an 8×8 grid, using newline characters to separate lines. At each position of the grid there is either a space or a “#” character. The characters should form a chess board.

Passing this string to console.log should show something like this:

# #

# #

# #

# #

# #

# #

# #

# #

When you have a program that generates this pattern, define a variable size = 8 and change the program so that it works for any size, outputting a grid of the given width and height.

chess board challenge
Program Structure -- Eloquent JavaScript 2015-10-25 11-09-05.png
marcusssss
@marcusssss
Oct 25 2015 05:43 UTC
thanks @h4r1m4u but I have tried this many times.
CamperBot
@camperbot
Oct 25 2015 05:43 UTC
marcusssss sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 308 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Manav Bansal
@mbansal11
Oct 25 2015 05:48 UTC
@h4r1m4u hey
stuck :P
how to nest input and form element
h4r1m4u
@h4r1m4u
Oct 25 2015 05:50 UTC

@mbansal11

<div>
  <p></p>
</div>

this is how you would nest <p> in a <div>

nesting <input> in a <form> is very similar
Manav Bansal
@mbansal11
Oct 25 2015 05:51 UTC
but input dosen't have closing tag
h4r1m4u
@h4r1m4u
Oct 25 2015 05:51 UTC
correct
Manav Bansal
@mbansal11
Oct 25 2015 05:52 UTC
<div>
<input type="text" placeholder="cat photo URL">
<form action="/submit-cat-photo"> </form>.
</div>
h4r1m4u
@h4r1m4u
Oct 25 2015 05:53 UTC
both your input and form are now nested inside div
the input is not nested in a form
to be nested it has to be between the <form> and </form> tags
Manav Bansal
@mbansal11
Oct 25 2015 05:53 UTC
bur i want to nest input in form
div elemet
element
h4r1m4u
@h4r1m4u
Oct 25 2015 05:54 UTC
your goal is to nest <input> in <form>
Manav Bansal
@mbansal11
Oct 25 2015 05:54 UTC
yes
h4r1m4u
@h4r1m4u
Oct 25 2015 05:55 UTC
the <div> and <p> example i gave you above is just an example to show you how to nest 2 different elements
you now need to do the same with <form> and <input>
Manav Bansal
@mbansal11
Oct 25 2015 05:55 UTC
ok let me try
h4r1m4u
@h4r1m4u
Oct 25 2015 05:55 UTC
in the code you posted, your <input> is outside of your <form>. it's not nested
Priya Dixit
@dixitpriya93
Oct 25 2015 05:58 UTC
Nest an Anchor Element within a Paragraph
I am unable to complete this challenge
can anyone help??
marcusssss
@marcusssss
Oct 25 2015 05:59 UTC
@dixitpriya93 I have same problem now
Farhad ali
@alifarhad
Oct 25 2015 06:00 UTC
could you give me the link ? @dixitpriya93
Priya Dixit
@dixitpriya93
Oct 25 2015 06:00 UTC
yeah sure @alifarhad
Farhad ali
@alifarhad
Oct 25 2015 06:01 UTC
nesting an anchor element within a paragraph means this
<p> 
<a href=#>some link </a>
</p>
where <p> is a paragraph tag and <a> is an anchor tag
Priya Dixit
@dixitpriya93
Oct 25 2015 06:01 UTC
yeah
@alifarhad
Farhad ali
@alifarhad
Oct 25 2015 06:02 UTC
so give it a try and see if its work ?
Manav Bansal
@mbansal11
Oct 25 2015 06:02 UTC
Guys stuck :(
Farhad ali
@alifarhad
Oct 25 2015 06:02 UTC
@mbansal11 what is it ?
Priya Dixit
@dixitpriya93
Oct 25 2015 06:02 UTC
@alifarhad Your p element should have the text "View more " (with a space after it).
this is he error
the*
Manav Bansal
@mbansal11
Oct 25 2015 06:03 UTC

<input type="text" placeholder="cat photo URL">

<form action="/submit-cat-photo"> </form>

how to nest them
Farhad ali
@alifarhad
Oct 25 2015 06:03 UTC
give me the link to this waypoint you are at @dixitpriya93
marcusssss
@marcusssss
Oct 25 2015 06:03 UTC
http://www.freecodecamp.com/challenges/waypoint-nest-an-anchor-element-within-a-paragraph#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Ca%20href%3D%22http%3A%2F%2Fwww.freecatphotoapp.com%22%3Ecat%20photos%3C%2Fa%3E%0A%0A%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%0A%0A%3Cp%20class%3D%22red-text%22%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A%3Cp%20class%3D%22red-text%22%3EPurr%20jump%20eat%20the%20grass%20rip%20the%20couch%20scratched%20sunbathe%2C%20shed%20everywhere%20rip%20the%20couch%20sleep%20in%20the%20sink%20fluffy%20fur%20catnip%20scratched.%3C%2Fp%3E%0A%0A%3Cp%3EView%20more%20%3Ca%20href%3D%22http%3A%2F%2Fwww.freecatphotoapp.com%22%3Ecat%20photos%3C%2Fa%3E%3C%2Fp%3E%0A
Priya Dixit
@dixitpriya93
Oct 25 2015 06:04 UTC
@alifarhad here it is http://freecodecamp.com/challenges/waypoint-nest-an-anchor-element-within-a-paragraph#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%3Cp%3E%22view%20more%20%3Ca%20href%3D%22http%3A%2F%2Fwww.freecatphotoapp.com%22%3Ecat%20photos%3C%2Fa%3E%22%3C%2Fp%3E%0A%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%0A%0A%3Cp%20class%3D%22red-text%22%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A%3Cp%20class%3D%22red-text%22%3EPurr%20jump%20eat%20the%20grass%20rip%20the%20couch%20scratched%20sunbathe%2C%20shed%20everywhere%20rip%20the%20couch%20sleep%20in%20the%20sink%20fluffy%20fur%20catnip%20scratched.%3C%2Fp%3E%0A
Manav Bansal
@mbansal11
Oct 25 2015 06:04 UTC
??
Farhad ali
@alifarhad
Oct 25 2015 06:04 UTC
ok stop
pls wait im on it
this link is a mess : d
Priya Dixit
@dixitpriya93
Oct 25 2015 06:05 UTC
thanx @alifarhad
CamperBot
@camperbot
Oct 25 2015 06:05 UTC
dixitpriya93 sends brownie points to @alifarhad :sparkles: :thumbsup: :sparkles:
:star: 206 | @alifarhad | http://www.freecodecamp.com/alifarhad
Manav Bansal
@mbansal11
Oct 25 2015 06:05 UTC
Help me :P
CamperBot
@camperbot
Oct 25 2015 06:05 UTC
no wiki entry for: me p
:pencil: click here to create one now!after creating your page type update to reload it here
Manav Bansal
@mbansal11
Oct 25 2015 06:07 UTC

<input type="text" placeholder="cat photo URL">

<form action="/submit-cat-photo"> </form>

how to nest them
hankim2020
@hankim2020
Oct 25 2015 06:10 UTC
hi newbie here can anyone help me with a simple javascript question?
Farhad ali
@alifarhad
Oct 25 2015 06:11 UTC
@mbansal11 give me the link of your waypoint
Priya Dixit
@dixitpriya93
Oct 25 2015 06:12 UTC
@alifarhad did you find anything?
Farhad ali
@alifarhad
Oct 25 2015 06:13 UTC
@dixitpriya93 yeah well i cant seem to find anything wrong with your code
but im working on it. the directions at there are pretty confusing
Amir M.
@Wingedcross
Oct 25 2015 06:15 UTC
@mbansal11 , Try this: <form action="/submit-cat-photo"><input type="text" placeholder="cat photo URL"></form>
@dixitpriya93 Remove the " "
Priya Dixit
@dixitpriya93
Oct 25 2015 06:17 UTC
thank you @Wingedcross
CamperBot
@camperbot
Oct 25 2015 06:17 UTC
dixitpriya93 sends brownie points to @wingedcross :sparkles: :thumbsup: :sparkles:
:star: 36 | @wingedcross | http://www.freecodecamp.com/wingedcross
Amir M.
@Wingedcross
Oct 25 2015 06:17 UTC
@dixitpriya93 My pleasure
Priya Dixit
@dixitpriya93
Oct 25 2015 06:17 UTC
But what is the difference
why with qoutes it was not working??
@Wingedcross
Amir M.
@Wingedcross
Oct 25 2015 06:17 UTC
The code WOULD work. But the test doesn't want that.
Priya Dixit
@dixitpriya93
Oct 25 2015 06:18 UTC
ohhhh....got it
Farhad ali
@alifarhad
Oct 25 2015 06:19 UTC
glad you got it done @dixitpriya93
marcusssss
@marcusssss
Oct 25 2015 06:20 UTC
@Wingedcross i have same problem on this but can't understand your suggest
<p>View more <a href=http://www.freecatphotoapp.com>cat photos</a></p>
here's my code
Farhad ali
@alifarhad
Oct 25 2015 06:20 UTC
@marcusssss he's telling you to paste this code in your exercise
<form action="/submit-cat-photo"><input type="text" placeholder="cat photo URL"></form>
Amir M.
@Wingedcross
Oct 25 2015 06:24 UTC
@marcusssss Would you give me the link to your Waypoint please
marcusssss
@marcusssss
Oct 25 2015 06:24 UTC
Nest an Anchor Element within a Paragraph
Amir M.
@Wingedcross
Oct 25 2015 06:25 UTC
Give me a moment
Take a look at it
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
the anchor part which starts with "<a" is "nested" inside the paragraph.
marcusssss
@marcusssss
Oct 25 2015 06:28 UTC
yes, i use this code but doesn't work
error is here" Your p element should have the text "View more " (with a space after it)."
Amir M.
@Wingedcross
Oct 25 2015 06:29 UTC
This is the code you gave me
<p>View more <a href=http://www.freecatphotoapp.com>cat photos</a></p>
Replace it with this one
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
marcusssss
@marcusssss
Oct 25 2015 06:30 UTC
okay, I added quote but still the same error
Farhad ali
@alifarhad
Oct 25 2015 06:31 UTC
cat app is such a pain in the class :D
Amir M.
@Wingedcross
Oct 25 2015 06:31 UTC
Try refreshing the page
The second code works for me
Or Reset the test
marcusssss
@marcusssss
Oct 25 2015 06:34 UTC
tried all this, but still not work
anyway, thanks @Wingedcross @alifarhad
CamperBot
@camperbot
Oct 25 2015 06:34 UTC
marcusssss sends brownie points to @wingedcross and @alifarhad :sparkles: :thumbsup: :sparkles:
:star: 38 | @wingedcross | http://www.freecodecamp.com/wingedcross
:star: 207 | @alifarhad | http://www.freecodecamp.com/alifarhad
Farhad ali
@alifarhad
Oct 25 2015 06:34 UTC
double check everything @marcusssss
Priya Dixit
@dixitpriya93
Oct 25 2015 06:34 UTC
@marcusssss remove commas
Farhad ali
@alifarhad
Oct 25 2015 06:34 UTC
that code provided by @Wingedcross works for me as well
marcusssss
@marcusssss
Oct 25 2015 06:35 UTC
@dixitpriya93 can't get this
Farhad ali
@alifarhad
Oct 25 2015 06:36 UTC
@dixitpriya93 ap ko hindi ati hai?
Amir M.
@Wingedcross
Oct 25 2015 06:36 UTC
@marcusssss Give me another link to your waypoint please
this one?
Amir M.
@Wingedcross
Oct 25 2015 06:37 UTC
The one you are working on right now
marcusssss
@marcusssss
Oct 25 2015 06:37 UTC
yeah, should be this one
Amir M.
@Wingedcross
Oct 25 2015 06:37 UTC
Remove the quotation marks " "
<p>view more <a href="http://www.freecatphotoapp.com">cat photos</a>.</p>
Should look like this
Piyush Vats
@piyushv
Oct 25 2015 06:39 UTC
hi guys just wondering. Ive just started doing the basic javascript waypoints. Is there any way to actually RUN the js im coding? When i click run tests it doesn't actually show me the output just test to see if my code is right or wrong!
Farhad ali
@alifarhad
Oct 25 2015 06:39 UTC
you can try "scratch pad" in the dev tools if you are on firefox @piyushv
otherwise if you prefer online, you can try this one https://jsfiddle.net/
Piyush Vats
@piyushv
Oct 25 2015 06:41 UTC
This message was deleted
CamperBot
@camperbot
Oct 25 2015 06:41 UTC
if you want to thank someone, put an @ before their name!
Piyush Vats
@piyushv
Oct 25 2015 06:41 UTC
thanks @alifarhad
CamperBot
@camperbot
Oct 25 2015 06:41 UTC
piyushv sends brownie points to @alifarhad :sparkles: :thumbsup: :sparkles:
:star: 208 | @alifarhad | http://www.freecodecamp.com/alifarhad
Farhad ali
@alifarhad
Oct 25 2015 06:41 UTC
mp
marcusssss
@marcusssss
Oct 25 2015 06:42 UTC
just can't work. I even copy paste the code you gave.
<
Farhad ali
@alifarhad
Oct 25 2015 06:43 UTC
give us a screenshot here, if you must @marcusssss
marcusssss
@marcusssss
Oct 25 2015 06:45 UTC
blob
Farhad ali
@alifarhad
Oct 25 2015 06:46 UTC
try capitalizing the first v like this View more
you need to be careful here. the whole thing is case sensitive
marcusssss
@marcusssss
Oct 25 2015 06:47 UTC
yes, i tried this also
Farhad ali
@alifarhad
Oct 25 2015 06:48 UTC
idk it should work
well how about you cut the whole thing and paste it right below your first <h2> that says cat app ?
marcusssss
@marcusssss
Oct 25 2015 06:50 UTC
it works....
thanks a lot!
CamperBot
@camperbot
Oct 25 2015 06:50 UTC
if you want to thank someone, put an @ before their name!
Amir M.
@Wingedcross
Oct 25 2015 06:50 UTC
@marcusssss Yay!
marcusssss
@marcusssss
Oct 25 2015 06:50 UTC
very strange, it didn't tells where to put this coed
*code
Farhad ali
@alifarhad
Oct 25 2015 06:50 UTC
coool @marcusssss
marcusssss
@marcusssss
Oct 25 2015 06:51 UTC
thanks @Wingedcross @alifarhad
CamperBot
@camperbot
Oct 25 2015 06:51 UTC
marcusssss sends brownie points to @wingedcross and @alifarhad :sparkles: :thumbsup: :sparkles:
:warning: marcusssss already gave alifarhad points
:warning: marcusssss already gave wingedcross points
Farhad ali
@alifarhad
Oct 25 2015 06:51 UTC
glad it worked :+1:
marcusssss
@marcusssss
Oct 25 2015 06:52 UTC
:)
VeryPlite
@VeryPlite
Oct 25 2015 06:59 UTC
Hey guys! I'm trying to make the second child in each of my wells bounce using jQuery and I don't know what I am doing wrong.
Farhad ali
@alifarhad
Oct 25 2015 06:59 UTC
i need to find a pair for building a quote machine
anyone interested here?
VeryPlite
@VeryPlite
Oct 25 2015 07:00 UTC
<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("color", "green");
    $(".target:nth-child(2)").addClass("animted bounce");

  });
</script>
Farhad ali
@alifarhad
Oct 25 2015 07:00 UTC
@VeryPlite provide me the link
VeryPlite
@VeryPlite
Oct 25 2015 07:00 UTC
That last line is my probem
Nevermind, I found out what I did wrong, but thanks anyway :D @alifarhad
CamperBot
@camperbot
Oct 25 2015 07:02 UTC
veryplite sends brownie points to @alifarhad :sparkles: :thumbsup: :sparkles:
:star: 209 | @alifarhad | http://www.freecodecamp.com/alifarhad
Farhad ali
@alifarhad
Oct 25 2015 07:02 UTC
that's coool :D @VeryPlite
Rex Schrader
@SaintPeter
Oct 25 2015 07:05 UTC
@VeryPlite DFTBA ;)
Thomson Muriyadan
@thedigitalmonk
Oct 25 2015 08:49 UTC
Hey guys how do they make that start button which changes to pause button and back to start when you click again?
There doesn’t seem to be a way to find if there is already an instance of setInterval running… Because when I click on start again it just calls setInterval again.
Instead of pausing i.e. calling clearInterval()
azaleas
@azaleas
Oct 25 2015 08:56 UTC

hi fellow campers, just started my angular training;) I'm stuck with this JS challenge:

app.controller('GalleryController', function(){
      this.current = 0;

    this.setCurrent = function(value){
        if (value === undefined) {
        this.current = 0;
      }
      else {
          this.current = value;
      }
    };
  });

Challenge descritiption: Add a method to GalleryController called setCurrent that accepts a value and assigns it to current. If no value is passed in, set current to 0.

What I'm doing wrong here?

Jason
@Jauble
Oct 25 2015 08:58 UTC
@thedigitalmonk You want to start at back at the beginning or where you paused at?
Thomson Muriyadan
@thedigitalmonk
Oct 25 2015 09:06 UTC
I want to start from where I stopped. Ah! I was not storing that anyway at all. Of course it wouldn’t work. Going to look into this.
thanks for the tip @Jauble
CamperBot
@camperbot
Oct 25 2015 09:06 UTC
thedigitalmonk sends brownie points to @jauble :sparkles: :thumbsup: :sparkles:
:star: 214 | @jauble | http://www.freecodecamp.com/jauble
Serhii Borovskyi
@serhiicss
Oct 25 2015 09:08 UTC
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};
Could anyone help me to understand this code please?
Fairouz-t
@Fairouz-t
Oct 25 2015 09:08 UTC
hi I need your help guys I'm new to coding and I don't know how am I suppose to nest a form element. can anyone help?
Serhii Borovskyi
@serhiicss
Oct 25 2015 09:09 UTC
@Fairouz-t first, you need to use form tags and the rest of form elements go within those tags
Fairouz-t
@Fairouz-t
Oct 25 2015 09:10 UTC
ok
thank you soooo much @serhiicss
CamperBot
@camperbot
Oct 25 2015 09:12 UTC
fairouz-t sends brownie points to @serhiicss :sparkles: :thumbsup: :sparkles:
:star: 405 | @serhiicss | http://www.freecodecamp.com/serhiicss
kcchong56
@kcchong56
Oct 25 2015 09:38 UTC
@bajajrijul reset the page. then focus on two areas. 'speed
' and 'getspeed'
how does one add property to an instance without affecting inherited properties?
bajajrijul
@bajajrijul
Oct 25 2015 09:40 UTC
@kcchong56 do i need to create my own object of myBike here first?
I think i am not very much clear about this.
kcchong56
@kcchong56
Oct 25 2015 09:43 UTC
@bajajrijul the objects had been created. the idea is to change the property from private to public or public to private.
bajajrijul
@bajajrijul
Oct 25 2015 09:44 UTC
@kcchong56 ohkk i got it.
thanks.
CamperBot
@camperbot
Oct 25 2015 09:44 UTC
if you want to thank someone, put an @ before their name!
kcchong56
@kcchong56
Oct 25 2015 09:45 UTC
@bajajrijul let me know if you get pass the next one. i'm stucked =.="
@kevindewbrown ur values. they are not returned as text.
bajajrijul
@bajajrijul
Oct 25 2015 09:48 UTC
@kcchong56 sure.
Kevin Brown
@kevindewbrown
Oct 25 2015 09:48 UTC
For which values
kcchong56
@kcchong56
Oct 25 2015 09:49 UTC
@kevindewbrown heads should show as "heads" or tails should show as "tails".
bajajrijul
@bajajrijul
Oct 25 2015 09:49 UTC
@kevindewbrown put heads and tails in " " while returning.
Fennek
@fennekbe
Oct 25 2015 09:50 UTC
Hey, anyone has anything to say about my code here?
function largestOfFour(arr) {
  // You can do this!
  var newArr = ["", "", "", ""]
  for (var i = 0; i < arr.length; i++) {
    arr[i].sort(function(a, b) { return a < b });
    newArr[i] = arr[i][0];
  }


  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
Kevin Brown
@kevindewbrown
Oct 25 2015 09:52 UTC
Thanks @kcchong56 and @bajajrijul
CamperBot
@camperbot
Oct 25 2015 09:52 UTC
kevindewbrown sends brownie points to @kcchong56 and @bajajrijul :sparkles: :thumbsup: :sparkles:
:star: 62 | @bajajrijul | http://www.freecodecamp.com/bajajrijul
:star: 167 | @kcchong56 | http://www.freecodecamp.com/kcchong56
Kevin Brown
@kevindewbrown
Oct 25 2015 09:56 UTC
@fennekbe Which number are you on and can you give the complete problem?
Fennek
@fennekbe
Oct 25 2015 09:57 UTC
There's no problem, just ant to know if my code is appropriate. Need to find the biggest number in every set of 4 @kevindewbrown
want
Bonfire: Return Largest Numbers in Arrays
CamperBot
@camperbot
Oct 25 2015 09:57 UTC

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

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

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

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

more info:  bf details | bf links | hint

bajajrijul
@bajajrijul
Oct 25 2015 09:59 UTC
@kcchong56 put myCar.engines = 1; this will add property individually to the instance.
kcchong56
@kcchong56
Oct 25 2015 10:02 UTC
@bajajrijul thanks
CamperBot
@camperbot
Oct 25 2015 10:02 UTC
kcchong56 sends brownie points to @bajajrijul :sparkles: :thumbsup: :sparkles:
:star: 64 | @bajajrijul | http://www.freecodecamp.com/bajajrijul
kcchong56
@kcchong56
Oct 25 2015 10:03 UTC
i tried that earlier but i failed because i didn't put semicolon.
:(
21igor
@21igor
Oct 25 2015 10:05 UTC
Hi all!
I noticed that I need much more time than mentioned in the exercises. Ok, I need a bit time to to translate some words from English.
Is the mentioned time the average? I'm afrade to be the worst one.
bajajrijul
@bajajrijul
Oct 25 2015 10:05 UTC
:smile:
Fennek
@fennekbe
Oct 25 2015 10:06 UTC
@21igor I think it's more something you should aim for. But don't worry about it. Everyone can take this at his/her own pace
If you're stuck, you can ask for help here. If you get the exercises done, no matter how long it takes, then you're learning
kcchong56
@kcchong56
Oct 25 2015 10:13 UTC
@21igor i took longer than the estimated time. you're doing fine (i guess).
21igor
@21igor
Oct 25 2015 10:21 UTC
i hope too :)
Farhad ali
@alifarhad
Oct 25 2015 10:28 UTC
i have been here for more than 5 or so months
and I have barely finished the first 2 sections or so :D
the point being; take your own pace and enjoy every min of it
Laura Stephenson
@lauralstephenson
Oct 25 2015 10:32 UTC
Waypoint 2
Waypoint: House our page within a Bootstrap Container Fluid Div
Your div element should have the class container-fluid. Y
Make sure each of your div elements has a closing tag. N
Here's my code: ```
<div>
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3></div>```
Fennek
@fennekbe
Oct 25 2015 10:33 UTC
How can I add 2 strings together in my code without having to use the + operator?
newArr[0] = arr[0] + arr[1];
bajajrijul
@bajajrijul
Oct 25 2015 10:34 UTC
@fennekbe using .concat , I think it may work .
Laura Stephenson
@lauralstephenson
Oct 25 2015 10:35 UTC
I've tried putting my closing div in several places and I am apparently confused.
Fennek
@fennekbe
Oct 25 2015 10:36 UTC
@bajajrijul Ive tried but couldn't get it to work
newArr[0] = newArr[0].concat(arr[0]+arr[1]);
i've tried many different ways, but neither work
bajajrijul
@bajajrijul
Oct 25 2015 10:44 UTC
@fennekbe you must be doing something else wrong, look for that err.
@lauralstephenson you are using <div> twice check it.
Laura Stephenson
@lauralstephenson
Oct 25 2015 10:58 UTC
Thanks, @bajajrijul .
CamperBot
@camperbot
Oct 25 2015 10:58 UTC
lauralstephenson sends brownie points to @bajajrijul :sparkles: :thumbsup: :sparkles:
:star: 69 | @bajajrijul | http://www.freecodecamp.com/bajajrijul
Fennek
@fennekbe
Oct 25 2015 11:43 UTC
Bonfire: Chunky Monkey
I'm stuck on this one, could anyone point me in the right direction? Not just solving it for me please
function chunk(arr, size) {
  // Break it up.

  var total = 0;
  var newArray = [];

  while (total <  size) {
    for (var i = 0; i < arr.length / size; i++) {
      total = newArray.push(arr[i]);
    }
  }

  return newArray;
}

chunk(["a", "b", "c", "d"], 2);
CamperBot
@camperbot
Oct 25 2015 11:43 UTC
Sorry, can't find a bonfire called chunky monkeyim stuck on this one could anyone point me in the right direction not just solving it for me pleasefunction chunkarr size break it up var total 0 var newarray while total size for var i 0 i arrlength size i total newarraypusharri return newarraychunka b c d 2. [ Check the map? ]
Fennek
@fennekbe
Oct 25 2015 11:43 UTC
Bonfire: Chunky Monkey
CamperBot
@camperbot
Oct 25 2015 11:43 UTC

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

Fennek
@fennekbe
Oct 25 2015 12:03 UTC
anyone,
?
kevin florenz daus
@kevindaus
Oct 25 2015 12:04 UTC
waypoint-condense-arrays-with-reduce having trouble here .. using reduce..my code runs well using google chrome console , yet Im getting error from freecodecamp
Richard Morgan
@Richard-Morgan-UK
Oct 25 2015 12:04 UTC
Hello everyone. I just started CatPhotoApp today and I am having trouble with the smaller image width adjustment
Aleksander Gębicki
@Takumar
Oct 25 2015 12:10 UTC
@kevindaus and @Richard-Morgan-UK show your codes, we can't help you without that.
Abhishek
@Abhi493
Oct 25 2015 12:15 UTC
any1 wants to pair for pomodora zipline?
Aayush Kapoor
@xeoneux
Oct 25 2015 12:16 UTC
@Abhi493 Sure
Abhishek
@Abhi493
Oct 25 2015 12:17 UTC
@xeoneux thanks , just tell me how to pair?
CamperBot
@camperbot
Oct 25 2015 12:17 UTC
abhi493 sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 299 | @xeoneux | http://www.freecodecamp.com/xeoneux
Aayush Kapoor
@xeoneux
Oct 25 2015 12:17 UTC
@Abhi493 What's the procedure?
Abhishek
@Abhi493
Oct 25 2015 12:17 UTC
lol i am asking you.
Aayush Kapoor
@xeoneux
Oct 25 2015 12:18 UTC
@Abhi493 Hehe, I don't have a clue!
@Abhi493 I guess, we'd have to do that directly in CodePen
Aleksander Gębicki
@Takumar
Oct 25 2015 12:18 UTC
@xeoneux @Abhi493 install i.e. ScreenHero and work together on project. Using this soft you can discuss your project using microphones.
Abhishek
@Abhi493
Oct 25 2015 12:18 UTC
by forking the project ?
Aleksander Gębicki
@Takumar
Oct 25 2015 12:19 UTC
wiki pairing
CamperBot
@camperbot
Oct 25 2015 12:19 UTC

:point_right: bonfire dna pairing [wiki]

Problem Explanation:

  • You will get a DNA strand sequence and you need to get the pair and return it as a 2D array of the base pairs. Keep in mind that the provided strand should be first always.

:pencil: read more about bonfire dna pairing on the FCC Wiki

Aayush Kapoor
@xeoneux
Oct 25 2015 12:19 UTC
@Abhi493 We can use Koding or Cloud9
@Takumar Does that work on all the platforms?
Abhishek
@Abhi493
Oct 25 2015 12:19 UTC
say one name and lemme download @xeoneux
Aayush Kapoor
@xeoneux
Oct 25 2015 12:20 UTC
@Abhi493 You can use Koding online
Aleksander Gębicki
@Takumar
Oct 25 2015 12:20 UTC
on Linux you have to use other soft, ScreenHero works on Windows I don't know about Mac
Aayush Kapoor
@xeoneux
Oct 25 2015 12:20 UTC
@Abhi493 It's an online IDE
Aleksander Gębicki
@Takumar
Oct 25 2015 12:20 UTC
wiki screenhero
CamperBot
@camperbot
Oct 25 2015 12:20 UTC

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

Justin
@Justintlai
Oct 25 2015 12:21 UTC
hello i have a quick question. I am trying to add and commit in to git so I'm using " git commit -a" but it gives me an error saying files untracked. how does this function work? I know I can do it seperately to add and then commit but I want to do it in one command
Aayush Kapoor
@xeoneux
Oct 25 2015 12:22 UTC
@Takumar New user signups are closed atm for Screenhero
Aleksander Gębicki
@Takumar
Oct 25 2015 12:22 UTC
@Justintlai use git commit -am "Message"
files are untracked because you have to add them to staging area.
i.e. git add *.js
Cody Bouscaren
@codybousc
Oct 25 2015 12:23 UTC
find smallest common multiple
CamperBot
@camperbot
Oct 25 2015 12:23 UTC

find smallest common multiple

:zero: bonfire smallest common multiple

Aayush Kapoor
@xeoneux
Oct 25 2015 12:23 UTC
@Abhi493 Did you register for Koding?
Justin
@Justintlai
Oct 25 2015 12:24 UTC
@Takumar so I cannot do add and commit in one command line?
Aleksander Gębicki
@Takumar
Oct 25 2015 12:24 UTC
@xeoneux you can register to ScreenHero if you are invited to.
Aayush Kapoor
@xeoneux
Oct 25 2015 12:25 UTC
@Takumar Oh... Do you have an invite?
Aleksander Gębicki
@Takumar
Oct 25 2015 12:25 UTC
@Justintlai I wrote you. git commit -am "Your title of commit", you should be able to do two things at once.
Oh sorry that's not enough.
Abhishek
@Abhi493
Oct 25 2015 12:28 UTC
@xeoneux
Aleksander Gębicki
@Takumar
Oct 25 2015 12:28 UTC
@xeoneux wait a minute I'm on other computer I don't have SH here.
Abhishek
@Abhi493
Oct 25 2015 12:28 UTC
Registered
Justin
@Justintlai
Oct 25 2015 12:28 UTC
@Takumar Doesn't seem to work if the file is untracked :(
Aleksander Gębicki
@Takumar
Oct 25 2015 12:29 UTC
@Justintlai : "-a
--all
Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected."
you have to add files first and then you can commit all files at once.
Aayush Kapoor
@xeoneux
Oct 25 2015 12:30 UTC
@Abhi493 Cool! I'll add you to the VM
@Abhi493 What's your Koding username?
Justin
@Justintlai
Oct 25 2015 12:30 UTC
@Takumar ah okay thanks
CamperBot
@camperbot
Oct 25 2015 12:30 UTC
justintlai sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 547 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 25 2015 12:30 UTC
@xeoneux send me you e-mail on private chat I will send you invitation.
Abhishek
@Abhi493
Oct 25 2015 12:30 UTC
@xeoneux abhi493.koiding.io
koding*
Aleksander Gębicki
@Takumar
Oct 25 2015 12:32 UTC
@Abhi493 I can send you too invitation. I have used ScreenHero once in pairing but I liked it.
Abhishek
@Abhi493
Oct 25 2015 12:32 UTC
where on koding @Takumar ?
Aleksander Gębicki
@Takumar
Oct 25 2015 12:33 UTC
@Abhi493 no, to ScreenHero, send me your e-mail in private chat and I'll send you invitation.
Aayush Kapoor
@xeoneux
Oct 25 2015 12:33 UTC
@Abhi493 Added!
Abhishek
@Abhi493
Oct 25 2015 12:33 UTC
ok and i have to setup it first
Aleksander Gębicki
@Takumar
Oct 25 2015 12:34 UTC
@Abhi493 not public it will remain on Gitter public archives accessible!
@Abhi493 invitation sent. Edit your post and remove e-mail till you can!
Aayush Kapoor
@xeoneux
Oct 25 2015 12:37 UTC
@Abhi493 Did you join?
Yazed Jamal
@muyaszed
Oct 25 2015 13:33 UTC
This message was deleted
Yazed Jamal
@muyaszed
Oct 25 2015 13:39 UTC
Hi guys, I was working on Bonfire: Missing letters and manage solve the algorithm, but during the process I stumble with some error(output: "\U000") which I manage to solve by relocating some code. Unfortunate I cannot really understand fully the error is all about, below is the code before and after relocation:
 function fearNotLetter(str) {
  var error = 0;
  var missing;
  var strLength = str.split('').length -1;

  for(i=0;i<strLength;i++) {
    var check =  str.charCodeAt(i+1)-str.charCodeAt(i);

    if(check != 1) {

      missing = str.charCodeAt(i) + 1;
      error += 1;


      str = String.fromCharCode(missing);


    }


  }
  if (error == 0) {
          str = undefined;
  }





  return str;
}

fearNotLetter("abcdefghjklmno");
function fearNotLetter(str) {
  var error = 0;
  var missing;
  var strLength = str.split('').length -1;

  for(i=0;i<strLength;i++) {
    var check =  str.charCodeAt(i+1)-str.charCodeAt(i);

    if(check != 1) {

      missing = str.charCodeAt(i) + 1;
      error += 1;





    }


  }
  if (error == 0) {
          str = undefined;
  }else {
    str = String.fromCharCode(missing);
  }





  return str;
}

fearNotLetter("abcdefghjklmno");
Colleen Heidenreich
@liesel63
Oct 25 2015 14:25 UTC
What in the world am I doing wrong here.. i'm trying to understand the CSS class and here is what I did:

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

<h2>CatPhotoApp</h2>

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

can anyone tell me what's wrong here?
Joshua
@JBressi
Oct 25 2015 14:26 UTC
Hey guys im stuck on a waypoint. Its telling me to make sure each of my div elements have a closing tag. They do im not sure if im missing something but here is a copy of my code. Thanks
CamperBot
@camperbot
Oct 25 2015 14:26 UTC
if you want to thank someone, put an @ before their name!
Joshua
@JBressi
Oct 25 2015 14:26 UTC
  <div>
<div class="row">
  <div class="col-xs-8">
  <h2 class="text-primary text-center">CatPhotoApp</h2>
  </div>

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

  <div class="col-xs-4">
  <img src="http://bit.ly/fcc-running-cats" class="img-responsive">
  </div>
```
gjoko1
@gjoko1
Oct 25 2015 14:26 UTC
@liesel63 When defining a class you have use dot before it's name, ex. .red-text { color:red;}
Joshua
@JBressi
Oct 25 2015 14:27 UTC
oh wait do i have to many closers?
Colleen Heidenreich
@liesel63
Oct 25 2015 14:27 UTC

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

}
</style>

<h2>CatPhotoApp</h2>

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

still wrong... should i get rid of something above?
gjoko1
@gjoko1
Oct 25 2015 14:28 UTC
@JBressi Make sure the number of <div> tags is the same as the number of </div> tags
h4r1m4u
@h4r1m4u
Oct 25 2015 14:28 UTC
@liesel63 what's your task in the waypoint?
Colleen Heidenreich
@liesel63
Oct 25 2015 14:29 UTC
seems like it is...
gjoko1
@gjoko1
Oct 25 2015 14:29 UTC
@liesel63 Now the class is defined right, but in order to take effect you have to add class="red-text" to the element you want to be red
Colleen Heidenreich
@liesel63
Oct 25 2015 14:29 UTC
@gjokomm Waypoint: Use a CSS Class to Style an Element
h4r1m4u
@h4r1m4u
Oct 25 2015 14:29 UTC
what @gjokomm says
gjoko1
@gjoko1
Oct 25 2015 14:29 UTC
for example if you want the heading to be red you'll use <h2 class="red-text">The red text</h2>
h4r1m4u
@h4r1m4u
Oct 25 2015 14:29 UTC
you need to apply your red-text class to your HTML element
Joshua
@JBressi
Oct 25 2015 14:30 UTC
@gjokomm thanks
CamperBot
@camperbot
Oct 25 2015 14:30 UTC
jbressi sends brownie points to @gjokomm :sparkles: :thumbsup: :sparkles:
:star: 3 | @gjokomm | http://www.freecodecamp.com/gjokomm
gjoko1
@gjoko1
Oct 25 2015 14:30 UTC
Does it work now? :)
Colleen Heidenreich
@liesel63
Oct 25 2015 14:30 UTC
@h4r1m4u @gjokomm @JBressi thank you! that worked!
CamperBot
@camperbot
Oct 25 2015 14:31 UTC
liesel63 sends brownie points to @h4r1m4u and @gjokomm and @jbressi :sparkles: :thumbsup: :sparkles:
:star: 4 | @gjokomm | http://www.freecodecamp.com/gjokomm
:star: 90 | @jbressi | http://www.freecodecamp.com/jbressi
:star: 309 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Joshua
@JBressi
Oct 25 2015 14:38 UTC
ok its telling me to add an i element with the classes fa fa-thumbs-up with in my button here is a copy of my code the button looks right but it tells me its not
 <i class="fa"><button class="btn btn-block btn-primary fa-thumbs-up">Like</button></i>
```
Myroslav
@werber
Oct 25 2015 14:39 UTC
add i elements inside button tag
before Like
Joshua
@JBressi
Oct 25 2015 14:39 UTC
@werber thanks
CamperBot
@camperbot
Oct 25 2015 14:39 UTC
jbressi sends brownie points to @werber :sparkles: :thumbsup: :sparkles:
:star: 209 | @werber | http://www.freecodecamp.com/werber
h4r1m4u
@h4r1m4u
Oct 25 2015 14:39 UTC
@JBressi <button><i class="..."></i> Like</button>
Joshua
@JBressi
Oct 25 2015 14:41 UTC
@h4r1m4u thanks
CamperBot
@camperbot
Oct 25 2015 14:41 UTC
jbressi sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 310 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Roger K.
@misterhtmlcss
Oct 25 2015 14:56 UTC

Hello!! I'm here and I've passed the exercise, but I lack an understanding :( Can I get help? It's this one.

"Waypoint: Generate Random Whole Numbers within a Range": http://freecodecamp.com/challenges/waypoint-generate-random-whole-numbers-within-a-range

My issue is I add in the piece of code is tells me to paste, but I don't understand why it works the way it does:
Math.floor(Math.random() * (max - min + 1)) + min
So Math.floor (I get it)
Math.random()*..... I don't get
This whole bit just makes no sense to me: (Math.random() * (max - min + 1)) + min
So random gives me a 0.333 example (some number between 0 and 1 right?)
Herman Fassett
@HermanFassett
Oct 25 2015 14:59 UTC
Yes
Roger K.
@misterhtmlcss
Oct 25 2015 14:59 UTC
Then I times that number by max-min+1 right?
which in this case is 10 (9-0+1)
h4r1m4u
@h4r1m4u
Oct 25 2015 15:00 UTC
then Math.floor rounds it
Roger K.
@misterhtmlcss
Oct 25 2015 15:00 UTC
Then it’s (9-0+1)+0
Herman Fassett
@HermanFassett
Oct 25 2015 15:00 UTC
Yeah, so you get 3.33, then add the min to that which is 0, floor it and there is a random number
Roger K.
@misterhtmlcss
Oct 25 2015 15:01 UTC
hmmm ok
h4r1m4u
@h4r1m4u
Oct 25 2015 15:02 UTC
since Math.random() returns only a random float between 0 and 1, this is basically just a mathematical expression that guarantees you get the random number from your min / max range
Ryan
@Ryan-7
Oct 25 2015 15:02 UTC
Anyone here familiar with FreeCodeCamp ?
nevermind..
lol
<script>
$(document).ready(function() {
$("button").addClass(animated);
$(".btn").addClass(shake);
$("#target1").addClass(btn-prmary);
});
</script>
Error I'm getting: Your #target1 element should have the classes animated‚ shake and btn-primary.
h4r1m4u
@h4r1m4u
Oct 25 2015 15:03 UTC
try calculating the expression for various random values between 0 and 1 and different min/max ranges like you did above and see what results you get. it'll help you understand the math behind it @pythonlabsstudent
Herman Fassett
@HermanFassett
Oct 25 2015 15:04 UTC
@Ryan-7 I think you need quotation marks like
$("button").addClass("animated");
Roger K.
@misterhtmlcss
Oct 25 2015 15:04 UTC
@h4r1m4u I’m starting to see I should have done that. Talking about it, even just this little bit really helped me. Thanks!! Amazing how a little externalization can assist a learner.
CamperBot
@camperbot
Oct 25 2015 15:04 UTC
pythonlabsstudent sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 311 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Herman Fassett
@HermanFassett
Oct 25 2015 15:04 UTC
Yeah
h4r1m4u
@h4r1m4u
Oct 25 2015 15:04 UTC
@pythonlabsstudent excellent!
Ryan
@Ryan-7
Oct 25 2015 15:05 UTC
@HermanFassett Thank you !!!!
CamperBot
@camperbot
Oct 25 2015 15:05 UTC
ryan-7 sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 445 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Ryan
@Ryan-7
Oct 25 2015 15:05 UTC
Coding on adderall makes me miss the little things sometimes -_-
Herman Fassett
@HermanFassett
Oct 25 2015 15:06 UTC
;)
Joshua
@JBressi
Oct 25 2015 15:07 UTC
ok its telling me to Add a div element with the class well inside each of your div elements with the class "col-xs-6"? i did that. am i missing something?
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6 well">

      </div>

    <div class="col-xs-6 well">


    </div>
  </div>
</div>
```
Herman Fassett
@HermanFassett
Oct 25 2015 15:07 UTC
@JBressi wrap each well div in a col-xs-6 div instead of all in one
h4r1m4u
@h4r1m4u
Oct 25 2015 15:08 UTC
@JBressi you didnt' add the <div>s with class well inside your cols
you added the class .well to your cols
Joshua
@JBressi
Oct 25 2015 15:08 UTC
so make seperate col-xs-6 divs?
Herman Fassett
@HermanFassett
Oct 25 2015 15:08 UTC
Yeah
Joshua
@JBressi
Oct 25 2015 15:08 UTC
@HermanFassett thanks
CamperBot
@camperbot
Oct 25 2015 15:08 UTC
jbressi sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 446 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
h4r1m4u
@h4r1m4u
Oct 25 2015 15:08 UTC
nest the divs
Ryan
@Ryan-7
Oct 25 2015 15:12 UTC
Do keyboard shortcuts exist for jumping around code?
h4r1m4u
@h4r1m4u
Oct 25 2015 15:13 UTC
in every decent code editor, yeah
Ryan
@Ryan-7
Oct 25 2015 15:14 UTC
Sweet.
Michael Omodele
@meriwon
Oct 25 2015 15:32 UTC
In "Label Bootstrap Buttons" it says, "give each of your button elements texts that corresponds to their id." I think I've done that but it remains stuck.
h4r1m4u
@h4r1m4u
Oct 25 2015 15:33 UTC
@meriwon post code or it didn't happen :)
Roger K.
@misterhtmlcss
Oct 25 2015 15:35 UTC
Hello... (again). All the code on this page makes no sense to me. http://freecodecamp.com/challenges/waypoint-make-object-properties-private
addStyle? styleMe? It's so random
h4r1m4u
@h4r1m4u
Oct 25 2015 15:36 UTC
@pythonlabsstudent addStyle is just the name of the function, it could be anything (almost). styleMe is just the name of the function parameter (some input that you pass to the function), so that you can work with it inside the function
Michael Omodele
@meriwon
Oct 25 2015 15:37 UTC
@h4r1m4u <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">
<h4>#target1</h4>
<button class="btn btn-default target" id="target1"></button>
<h4>#target2</h4>
<button class="btn btn-default target" id="target2"></button>
<h4>#target3</h4>
<button class="btn btn-default target" id="target3"></button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<h4>#target4</h4>
<button class="btn btn-default target" id="target4"></button>
<h4>#target5</h4>
<button class="btn btn-default target" id="target5"></button>
<h4>#target6</h4>
<button class="btn btn-default target" id="target6"></button>
</div>
</div>
</div>
</div>
h4r1m4u
@h4r1m4u
Oct 25 2015 15:37 UTC
  function myFunction(myVar){
    return 'The Current Gear Is: ' + myVar;
  }
would do exactly the same @pythonlabsstudent
Roger K.
@misterhtmlcss
Oct 25 2015 15:38 UTC
It gets really confusing when the names don't seem to relate. Then it's like style? are we talking about a car or a haircut?
you know what I mean @h4r1m4u ?
h4r1m4u
@h4r1m4u
Oct 25 2015 15:39 UTC
@meriwon you add <h4> tags with the id names. you're supposed to put the ids as text inside the buttons, here's an example: <button id="myButtonId">myButtonId</div>
@pythonlabsstudent yeah, that function could be named better in that waypoint. function addGear(gear) would make more sense
i see how it can be confusing
Roger K.
@misterhtmlcss
Oct 25 2015 15:40 UTC
@h4r1m4u again thanks for your help
CamperBot
@camperbot
Oct 25 2015 15:40 UTC
pythonlabsstudent sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pythonlabsstudent already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 25 2015 15:40 UTC
you're most welcome
Ryan
@Ryan-7
Oct 25 2015 15:41 UTC
Anyone see a problem here:
$('body').addClass('animated', 'hinge');
h4r1m4u
@h4r1m4u
Oct 25 2015 15:42 UTC
@Ryan-7 you add multiple classes to an element like so: $('body').addClass('animated hinge');
Ryan
@Ryan-7
Oct 25 2015 15:43 UTC
@h4r1m4u Thank you. I guess it's going to take a bit to recognize the difference between them all.
CamperBot
@camperbot
Oct 25 2015 15:43 UTC
ryan-7 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 312 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Ryan
@Ryan-7
Oct 25 2015 15:43 UTC
Like..
$("#target1").css("color", "red");
h4r1m4u
@h4r1m4u
Oct 25 2015 15:44 UTC
that's a bit different as you're adding a css property 'color' with value 'red' (color: red;)
Ryan
@Ryan-7
Oct 25 2015 15:44 UTC
True. I was told not to take notes, hopefully there is enough repetition to get this into my brain :)
h4r1m4u
@h4r1m4u
Oct 25 2015 15:45 UTC
you can always refer to the jquery docs if you're not sure: https://api.jquery.com/addclass/. the jquery documentation is very solid and has plenty of examples
super helpful. i don't remember all the nuances either
Ryan
@Ryan-7
Oct 25 2015 15:46 UTC
Is this a hobby of yours or do you work as a programmer professionally ?
h4r1m4u
@h4r1m4u
Oct 25 2015 15:46 UTC
professionally
i've been doing web dev for almost 10 years
Ryan
@Ryan-7
Oct 25 2015 15:46 UTC
Very cool. My dream is to self teach over the next 6 months and land a job as an entry front level developer.
h4r1m4u
@h4r1m4u
Oct 25 2015 15:46 UTC
but working on improving my javascript now
that's great. i think it's very doable
i learned everything by myself as well
Ryan
@Ryan-7
Oct 25 2015 15:47 UTC
Thanks, I've read a lot of similar success
CamperBot
@camperbot
Oct 25 2015 15:47 UTC
if you want to thank someone, put an @ before their name!
Ryan
@Ryan-7
Oct 25 2015 15:47 UTC
Really? thats encouraging
What were your main resources?
h4r1m4u
@h4r1m4u
Oct 25 2015 15:48 UTC
yeah. i had some programming courses at college, but it was pascal (which nobody uses anymore) and java (which was way beyond my head at the time)
i just worked on projects right away and learned that way
googled ton until i found a solution. slowly improved
Ryan
@Ryan-7
Oct 25 2015 15:48 UTC
Makes sense, learn by doing.
h4r1m4u
@h4r1m4u
Oct 25 2015 15:49 UTC
when i started there weren't that many structured resources like there are nowadays
Michael Omodele
@meriwon
Oct 25 2015 15:49 UTC
@h4r1m4u I am sorry but that doesn't seem to be the problem. Take a look at the error messages: Give your button element with the id target1 the text #target1.
Give your button element with the id target2 the text #target2.
Give your button element with the id target3 the text #target3.
Give your button element with the id target4 the text #target4.
Give your button element with the id target5 the text #target5.
Give your button element with the id target6 the text #target6.
Ryan
@Ryan-7
Oct 25 2015 15:49 UTC
My plan is to simply go through FreeCodeCamp, would you recommend doing anything else at the same time?
h4r1m4u
@h4r1m4u
Oct 25 2015 15:49 UTC
@meriwon could you post your updated code?
Michael Omodele
@meriwon
Oct 25 2015 15:54 UTC
@h4r1m4u Wow! I didn't quite get your instruction the first time. I've done it now and it works perfectly. Thanks.
CamperBot
@camperbot
Oct 25 2015 15:54 UTC
meriwon sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 313 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 25 2015 15:55 UTC
@meriwon great! glad to hear that
Corey Murray
@muzzaaa
Oct 25 2015 15:56 UTC
Don't quite understand how to set up the code on Waypoint: Bring your JavaScript Slot Machine to Life
if anyone can help
Marisol C
@Mariisun
Oct 25 2015 15:57 UTC
Has anyone gotten past Waypoint: Declare JavaScript Variables? I don't understand how to create a variable using my name?
Corey Murray
@muzzaaa
Oct 25 2015 15:57 UTC
i have
@Mariisun for me, var myName = "corey";
just substitute your name
Marisol C
@Mariisun
Oct 25 2015 15:58 UTC
gah! thank you!
CamperBot
@camperbot
Oct 25 2015 15:58 UTC
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 25 2015 15:59 UTC
@muzza96 what do you have so far for your waypoint?
Marisol C
@Mariisun
Oct 25 2015 15:59 UTC
@muzza96 Thank you!
CamperBot
@camperbot
Oct 25 2015 15:59 UTC
mariisun sends brownie points to @muzza96 :sparkles: :thumbsup: :sparkles:
:star: 170 | @muzza96 | http://www.freecodecamp.com/muzza96
Corey Murray
@muzzaaa
Oct 25 2015 15:59 UTC
@h4r1m4u what do you mean?
h4r1m4u
@h4r1m4u
Oct 25 2015 15:59 UTC
post your code?
Marisol C
@Mariisun
Oct 25 2015 15:59 UTC
me?
Corey Murray
@muzzaaa
Oct 25 2015 15:59 UTC
@Mariisun no worries, sometimes the instruction confuses you
@h4r1m4u for the question i posted?
h4r1m4u
@h4r1m4u
Oct 25 2015 16:00 UTC
@muzza96 yeah
happy to help but need to see what you got
@Mariisun the solution muzza96 gave should sort you out, but if you need more help, don't hesitate to ask
Corey Murray
@muzzaaa
Oct 25 2015 16:01 UTC
@h4r1m4u I don't have anything, it's confused me. I'll post the instructions though

Now we can detect a win. Let's get this slot machine working.

Let's use the jQuery selector $(".slot") to select all of the slots.

Once they are all selected, we can use bracket notation to access each individual slot:

$($(".slot")0).html(slotOne);

This jQuery will select the first and update the slot's HTML to display the correct number.

Use the above selector to display each number in its corresponding slot.

h4r1m4u
@h4r1m4u
Oct 25 2015 16:02 UTC
ok. which part confuses you?
Corey Murray
@muzzaaa
Oct 25 2015 16:02 UTC
<script>
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

    var images = ["http://i.imgur.com/9H17QFk.png", "http://i.imgur.com/9RmpXTy.png", "http://i.imgur.com/VJnmtt5.png"];

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

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

    // Only change code below this line.
I'm not sure what I'm meant to write
Jaykishan Kacha
@jaykishan10
Oct 25 2015 16:03 UTC
function truncate(str, num) {
// Clear out that junk in your trunk
if(str.length > num ) {
var c = str.length - num + 3 ;
var a = str.slice(0,str.length - c);
var b = "...";
a = a.concat(b);
return a;
}
return str;
}
truncate("A-", 1);
result is : "..."
needed result is : "A..."
what should i do??
Corey Murray
@muzzaaa
Oct 25 2015 16:03 UTC
I've gone through jQuery and understand it, just dont know what the instructions are telling me to do
Roger K.
@misterhtmlcss
Oct 25 2015 16:03 UTC
@Mariisun we are in the same place!! I'm on the next one. I'm struggling with Make Object Properties Private. @h4r1m4u has been a rock star for me today. Thanks bud. :)
CamperBot
@camperbot
Oct 25 2015 16:03 UTC
pythonlabsstudent sends brownie points to @mariisun and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pythonlabsstudent already gave h4r1m4u points
:star: 131 | @mariisun | http://www.freecodecamp.com/mariisun
katherynliza
@katherynliza
Oct 25 2015 16:03 UTC
This message was deleted
h4r1m4u
@h4r1m4u
Oct 25 2015 16:04 UTC
@muzza96 ok, so in the example, they give you this line of code $($(".slot")[0]).html(slotOne); what this does is update the first .slot HTML element with the slotOne variable
your goal is to add code that will update the second and third slot with slotTwo and slotThree variables respectively
@pythonlabsstudent awww. thank you!
CamperBot
@camperbot
Oct 25 2015 16:04 UTC
h4r1m4u sends brownie points to @pythonlabsstudent :sparkles: :thumbsup: :sparkles:
:star: 171 | @pythonlabsstudent | http://www.freecodecamp.com/pythonlabsstudent
katherynliza
@katherynliza
Oct 25 2015 16:06 UTC
What does this mean "Make sure your i element has a closing tag."
h4r1m4u
@h4r1m4u
Oct 25 2015 16:06 UTC
@katherynliza Use Font Awesome to add a thumbs-up icon to your like button by giving it a i element with the classes fa and fa-thumbs-up.
Roger K.
@misterhtmlcss
Oct 25 2015 16:06 UTC
@katherynliza I can probably help you with this one, but it's a challenge to figure out where you are. Can you just drop in the URL?
Corey Murray
@muzzaaa
Oct 25 2015 16:07 UTC
@h4r1m4u ah so just altering it, thats easy cant undertsand how it confused me
h4r1m4u
@h4r1m4u
Oct 25 2015 16:07 UTC
@katherynliza here's an example using a different icon: <button class="my-button"><i class="fa fa-heart"></i> My Button Text</button>
Corey Murray
@muzzaaa
Oct 25 2015 16:07 UTC
@h4r1m4u thanks
CamperBot
@camperbot
Oct 25 2015 16:07 UTC
muzza96 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 314 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
katherynliza
@katherynliza
Oct 25 2015 16:07 UTC
Thanks @h4r1m4u
CamperBot
@camperbot
Oct 25 2015 16:07 UTC
katherynliza sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 315 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 25 2015 16:08 UTC
@muzza96 my pleasure. most of the waypoints are literally just taking the code they give you in the sidebar and slightly modifying it
Jaykishan Kacha
@jaykishan10
Oct 25 2015 16:12 UTC

function truncate(str, num) {
// Clear out that junk in your trunk
if(str.length > num ) {
var c = str.length - num + 3 ;
var a = str.slice(0,str.length - c);
var b = "...";
a = a.concat(b);
return a;
}
return str;
}
truncate("A-", 1);

output needed : A...
what should i do??

and I've got no idea what to do
Like Zero
h4r1m4u
@h4r1m4u
Oct 25 2015 16:14 UTC
@jaykishan10 you'll need to add another if condition for string that are shorter than 3 character and handle them in a slightly different way
Roger K.
@misterhtmlcss
Oct 25 2015 16:14 UTC
@h4r1m4u .....So many different terms/variables, nestings, etc. Most of which I've not seen until now :(
h4r1m4u
@h4r1m4u
Oct 25 2015 16:15 UTC
@pythonlabsstudent alright, let me see if i can shed some light on it
Roger K.
@misterhtmlcss
Oct 25 2015 16:15 UTC
@h4r1m4u pretty please!!!
h4r1m4u
@h4r1m4u
Oct 25 2015 16:16 UTC
let's have a look at this as an example:
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};
Jaykishan Kacha
@jaykishan10
Oct 25 2015 16:16 UTC
okay
i will try
thanks @h4r1m4u
CamperBot
@camperbot
Oct 25 2015 16:16 UTC
jaykishan10 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 316 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 25 2015 16:17 UTC

@jaykishan10 do you understand why? look at these two lines:

var c = str.length - num + 3 ;
var a = str.slice(0,str.length - c);

and consider what they do if the input string is shorter than 3 characters

@pythonlabsstudent we create a function which is an object constructor. we save it into a variable called Car, so that later we can create new Car objects like so: var myNewFerrari = Car();
now let's have a look at the inside of the function
inside the constructor, the word 'this' refers to the object that the constructor creates
snehal9393
@snehal9393
Oct 25 2015 16:19 UTC
r<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" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
h4r1m4u
@h4r1m4u
Oct 25 2015 16:19 UTC
so this line this.gear = 1; gives every created Car object property 'gear' with a value of 1
Jaykishan Kacha
@jaykishan10
Oct 25 2015 16:20 UTC
it is working
thanks for help @h4r1m4u
CamperBot
@camperbot
Oct 25 2015 16:20 UTC
jaykishan10 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: jaykishan10 already gave h4r1m4u points
snehal9393
@snehal9393
Oct 25 2015 16:20 UTC
Hi, someone help me with this waypoint
Ryan
@Ryan-7
Oct 25 2015 16:21 UTC
what does myArray refer to? Arrangement ?
h4r1m4u
@h4r1m4u
Oct 25 2015 16:21 UTC
@pythonlabsstudent using the word 'this' also makes it public. so after i create myNewFerarri, i can get the value of the property gears like so: var howManyGears = myNewFerrari.gear;
@pythonlabsstudent are you able to follow me so far?
@Ryan-7 that should be jsut the name of the variable
Roger K.
@misterhtmlcss
Oct 25 2015 16:21 UTC
@snehal9393 what's the URL? @h4r1m4u I think so.
h4r1m4u
@h4r1m4u
Oct 25 2015 16:21 UTC
@jaykishan10 great!
Roger K.
@misterhtmlcss
Oct 25 2015 16:22 UTC
@h4r1m4u things like 'public', 'this' and so on are all new on this and last lesson.
h4r1m4u
@h4r1m4u
Oct 25 2015 16:22 UTC
@pythonlabsstudent ok, great. so let's have a look at the functions in the constructor:
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
Roger K.
@misterhtmlcss
Oct 25 2015 16:22 UTC
So it becomes confusing quickly after the very basics. @h4r1m4u ;0
h4r1m4u
@h4r1m4u
Oct 25 2015 16:23 UTC
we have two functions here: addStyle() and getGear(). same as before, using the word 'this', makes the getGear function public, so i can call it from outside of the object
var whatGear = myNewFerrari.getGear();
the addStyle() function is private. i have no way of accesssing it from outside of the object
i cannot do myNewFerrari.addStyle(). that won't work
Moisés Man
@moigithub
Oct 25 2015 16:24 UTC
then modify to make it public...
h4r1m4u
@h4r1m4u
Oct 25 2015 16:24 UTC
so the private functions can only be called from within the object itself
Moisés Man
@moigithub
Oct 25 2015 16:24 UTC
...if u wanna make outside accesible
h4r1m4u
@h4r1m4u
Oct 25 2015 16:25 UTC
and you can see that's exactly what's happening in the getGear() function. it calls the addStyle() function. and it can because it calls it from inside the object
@pythonlabsstudent so far so good?
Ryan
@Ryan-7
Oct 25 2015 16:28 UTC
How do I create a pop function in javascript ?
Roger K.
@misterhtmlcss
Oct 25 2015 16:28 UTC
@h4r1m4u yeah kinda.
Ryan
@Ryan-7
Oct 25 2015 16:29 UTC
nevrmind
i got it!
h4r1m4u
@h4r1m4u
Oct 25 2015 16:29 UTC
@Ryan-7 you dont' create it. it's part of javascript. but you can call it on an array: [1, 2, 3].pop(). this will remove the last element from the array, 3
Roger K.
@misterhtmlcss
Oct 25 2015 16:29 UTC
Let me marinate on this and I'll come back for part 2 in a few minutes @h4r1m4u ok? I think I need to re-read and think. I should try get this before you hold my hand further.
h4r1m4u
@h4r1m4u
Oct 25 2015 16:29 UTC
@pythonlabsstudent if you have questions, ask
Roger K.
@misterhtmlcss
Oct 25 2015 16:29 UTC
Thanks!
CamperBot
@camperbot
Oct 25 2015 16:29 UTC
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 25 2015 16:29 UTC
@Ryan-7 pop pop pop :balloon:
Roger K.
@misterhtmlcss
Oct 25 2015 16:29 UTC
@h4r1m4u thanks!
CamperBot
@camperbot
Oct 25 2015 16:29 UTC
pythonlabsstudent sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 317 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Ryan
@Ryan-7
Oct 25 2015 16:30 UTC
@abhisekp lol
Roger K.
@misterhtmlcss
Oct 25 2015 16:32 UTC
@h4r1m4u I got it!!! Thanks :)
CamperBot
@camperbot
Oct 25 2015 16:32 UTC
pythonlabsstudent sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pythonlabsstudent already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 25 2015 16:32 UTC
@pythonlabsstudent nice! great work!
and I can't figure out how to do it.
I've tried this:
var myCar = new Car();
myCar = function() {
"engines":250
}
This:
myCar = {
"engines":250
}
and this:
var myCar = new Car() {
this.engines = 4;
}
h4r1m4u
@h4r1m4u
Oct 25 2015 16:48 UTC
@pythonlabsstudent it's much simpler. what you're trying to do is close to creating a new constructor function, but that's not needed
Aleksander Gębicki
@Takumar
Oct 25 2015 16:48 UTC
@pythonlabsstudent you have now myCar object, so you don't have to create new object, just add new property to it. You have to do it outside of your constructor.
h4r1m4u
@h4r1m4u
Oct 25 2015 16:48 UTC
once you have your object created (by var myCar = Car()), you can assign new properties to it
myCar.color = 'red';
that gives myCar property 'color' of value 'red'
Roger K.
@misterhtmlcss
Oct 25 2015 16:49 UTC
myCar.engines = 4;
h4r1m4u
@h4r1m4u
Oct 25 2015 16:49 UTC
there you go :)
Roger K.
@misterhtmlcss
Oct 25 2015 16:49 UTC
CRAP I was so close with this one => this.engines = 4;
Aleksander Gębicki
@Takumar
Oct 25 2015 16:49 UTC
@pythonlabsstudent it was simpler than you thought.
h4r1m4u
@h4r1m4u
Oct 25 2015 16:50 UTC
remember, 'this' is used in the constructor function to refer to the object itself
Roger K.
@misterhtmlcss
Oct 25 2015 16:50 UTC
@h4r1m4u thanks! and yeah @Takumar it was, but I was on the right track at the beginning which is a good sign.
CamperBot
@camperbot
Oct 25 2015 16:50 UTC
pythonlabsstudent sends brownie points to @h4r1m4u and @takumar :sparkles: :thumbsup: :sparkles:
:warning: pythonlabsstudent already gave h4r1m4u points
:star: 548 | @takumar | http://www.freecodecamp.com/takumar
h4r1m4u
@h4r1m4u
Oct 25 2015 16:50 UTC
once you've constructed the object, you refer to it by the var name
Aleksander Gębicki
@Takumar
Oct 25 2015 16:50 UTC
@pythonlabsstudent you use "this" when you don't know your object (you are preparing template - constructor). You don't know how your new car will look exactly. You can create hundreds of cars (using constructor - your template), but the one you choose can be different because you have added to him 4 engines :-)
Roger K.
@misterhtmlcss
Oct 25 2015 16:52 UTC
@h4r1m4u is this because here:
var Car = function() {
this.wheels = 4;
};
I'm crafting the object? But with myCar I'm using the object, so I can't use *this. again?
h4r1m4u
@h4r1m4u
Oct 25 2015 16:53 UTC
yeah, here you're creating the constructor function which you'll be calling Car(). inside the function you don't know the name of the object yet as @Takumar said. hence the use of 'this' to refer to the object.
but once you create an object with the constructor function: var myCar = Car(), the object has a name: myCar
hence you refer to it by the var name
Aleksander Gębicki
@Takumar
Oct 25 2015 16:55 UTC
You create your object in the moment of declaring: var myCar = new Car(); it don't exist the moment you write constructor.
Chad Schmidt
@TheHexorcist
Oct 25 2015 16:59 UTC
how do i get help with mongodb waypoint?
Roger K.
@misterhtmlcss
Oct 25 2015 16:59 UTC
ahhhhhhhhh WOW I GET THIS NOW @Takumar @h4r1m4u. Thank you!! It finally clicked into place. Thank you!
CamperBot
@camperbot
Oct 25 2015 16:59 UTC
pythonlabsstudent sends brownie points to @takumar and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pythonlabsstudent already gave takumar points
:warning: pythonlabsstudent already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 25 2015 16:59 UTC
@pythonlabsstudent here's another example :)
// Baby constructor function, we still in momma's tummy
var Baby = function() {
  // we don't know what baby this function may bear
  this.eyes = 2;
  this.arms = 2;
  this.legs = 2;
}

// baby is born and we call him Michael
var Michael = Baby();

// we weighted the baby after it was born and we see he's got black hair
Michael.weight = 3.5;
Michael.hair = 'black';

// another baby is born, Eve
var Eve = Baby();
Eve.hair = 'blond';
Roger K.
@misterhtmlcss
Oct 25 2015 17:00 UTC
How do you post code like that @h4r1m4u ? I'd like to do it too.
h4r1m4u
@h4r1m4u
Oct 25 2015 17:00 UTC
wiki format
CamperBot
@camperbot
Oct 25 2015 17:00 UTC

: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 25 2015 17:01 UTC
backtick (the key under escape) is the key you're looking for
Roger K.
@misterhtmlcss
Oct 25 2015 17:02 UTC
 <html>
@h4r1m4u got it. Thanks!
CamperBot
@camperbot
Oct 25 2015 17:02 UTC
pythonlabsstudent sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: pythonlabsstudent already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 25 2015 17:02 UTC
:)
Ryan
@Ryan-7
Oct 25 2015 17:08 UTC
what does i++ mean when its in a loop function?
h4r1m4u
@h4r1m4u
Oct 25 2015 17:08 UTC
increase var i by 1
Ryan
@Ryan-7
Oct 25 2015 17:08 UTC
for(var i=0; i<5; i++){
myArray.push(i);
}
oh ok
thanks @h4r1m4u
CamperBot
@camperbot
Oct 25 2015 17:08 UTC
ryan-7 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 318 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 25 2015 17:09 UTC
no prob. i-- is to decrease it by 1
Ryan
@Ryan-7
Oct 25 2015 17:09 UTC
Are these things suppose to come intuitively ?
Abhisek Pattnaik
@abhisekp
Oct 25 2015 17:09 UTC
@Ryan-7 nope! It's better to use i = i + 1
Ryan
@Ryan-7
Oct 25 2015 17:09 UTC
I guess I could have figured it out if I stared at it long enough lol
yeah i + 1 seems more "normal" to me
h4r1m4u
@h4r1m4u
Oct 25 2015 17:09 UTC
it's not better per se. it may be more intuitive, but it's too long
everybody uses i++
Ryan
@Ryan-7
Oct 25 2015 17:10 UTC
That makes sense
h4r1m4u
@h4r1m4u
Oct 25 2015 17:10 UTC
it's not a javascript thing either. pretty much all programming languages have some variation of this
Abhisek Pattnaik
@abhisekp
Oct 25 2015 17:10 UTC
@Ryan-7 as long as it adds elegance, it's better.
But everyone writes as :point_up: October 25, 2015 10:39 PM
h4r1m4u
@h4r1m4u
Oct 25 2015 17:12 UTC
@Ryan-7 imo, FCC provides you with a decent study structure, but they don't really explain much. you need to google, ask, and research to actually understand the material presented to you. hence, no, understanding i++ is not supposed to come to you naturally, there's no way it would if it's the first time you see it.
Ryan
@Ryan-7
Oct 25 2015 17:18 UTC
@h4r1m4u Thanks.
CamperBot
@camperbot
Oct 25 2015 17:18 UTC
ryan-7 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: ryan-7 already gave h4r1m4u points
Abhishek
@Abhi493
Oct 25 2015 17:19 UTC
@abhisekp
Ryan
@Ryan-7
Oct 25 2015 17:19 UTC
I cant wait until I get to a point of understanding where I would use what I learned in a real life situation
Thinking in terms of coding
h4r1m4u
@h4r1m4u
Oct 25 2015 17:20 UTC
yeah, i hear you. i find web development very rewarding in the sense that you start creating something from nothing. it's great to see your code manifest on the screen so that you can interact with it
Ryan
@Ryan-7
Oct 25 2015 17:20 UTC
for sure. I kind of relate it to guitar, creating something out of nothing
Abhishek
@Abhi493
Oct 25 2015 17:20 UTC
i need help on calculator zipline
how to make the calculator do multiple calculations ?
Ryan
@Ryan-7
Oct 25 2015 17:20 UTC
I like that coders are problem solvers
make the world efficient
h4r1m4u
@h4r1m4u
Oct 25 2015 17:21 UTC
yeah, for sure
@Abhi493 i don't think there's a simple answer. it really depends on how you've implemented your calculator so far. but in my calculator, i chain the user input, evaluate it and display the tentative result on the display, until the user hits =
Abhishek
@Abhi493
Oct 25 2015 17:23 UTC
ya @h4r1m4u my question is after entering = , how to add more calculation with previous result
h4r1m4u
@h4r1m4u
Oct 25 2015 17:24 UTC
@Abhi493 ah. the way i do it is i check if there's a number on the screen. if yes, the user can press an operator (+, -, /, *) and enter another number.
but if the user presses a number after pressing = instead of an operator, the new number will overwrite the previous result and the calculator will start working from the start again
Ryan
@Ryan-7
Oct 25 2015 17:27 UTC
this chat room is cool
Abhishek
@Abhi493
Oct 25 2015 17:29 UTC
@h4r1m4u
@Ryan-7 Welcome !!!
katherynliza
@katherynliza
Oct 25 2015 17:30 UTC
I am suppose to do this. "Use the jQuery addClass() function to give the classes animated and bounce to your button elements" What did I do wrong?
This message was deleted
Abhishek
@Abhi493
Oct 25 2015 17:31 UTC
@katherynliza
h4r1m4u
@h4r1m4u
Oct 25 2015 17:31 UTC
@katherynliza put the $("button")... line inside the document.ready function
Abhishek
@Abhi493
Oct 25 2015 17:31 UTC
put your statements inside the ready function
h4r1m4u
@h4r1m4u
Oct 25 2015 17:32 UTC

@Abhi493

  try{
    document.getElementById("display").value = eval(entries);
    entries = '';
    number = '';
     }

here you reset your entries and number after pressing =. if you do that, you can't chain any more operations to the previous result

you should reset entries only after the user presses a number key after pressing =
Abhishek
@Abhi493
Oct 25 2015 17:34 UTC
thanks @h4r1m4u
CamperBot
@camperbot
Oct 25 2015 17:34 UTC
abhi493 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 319 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 25 2015 17:34 UTC
you can add some sort of a variable into your code that will track whether = was pressed or not. you'll then check the value of this variable when a number key is pressed and if it's true, you'll reset entries.
Abhishek
@Abhi493
Oct 25 2015 17:34 UTC
trying to do what u said
h4r1m4u
@h4r1m4u
Oct 25 2015 17:34 UTC
i'd have to spend more time looking at your code to give you exact solution, but i think this should give you enough to go on
Ryan
@Ryan-7
Oct 25 2015 17:37 UTC
Can someone help me understand this mathematical statement
Math.floor(Math.random() * (1 - 0 + 1)) + 0;
let's say the random number generated is 4
h4r1m4u
@h4r1m4u
Oct 25 2015 17:38 UTC
@Ryan-7 Math.random() generates a random float between 0 and 1
0.25, 0.67, 0.99, etc.
Ryan
@Ryan-7
Oct 25 2015 17:40 UTC
how does it become a whole number then
h4r1m4u
@h4r1m4u
Oct 25 2015 17:42 UTC
Math.floor
this rounds it
Aleksander Gębicki
@Takumar
Oct 25 2015 17:48 UTC
@h4r1m4u let's add it rounds it down, so 2.999 becomes 2.
h4r1m4u
@h4r1m4u
Oct 25 2015 17:48 UTC
yup
Aleksander Gębicki
@Takumar
Oct 25 2015 17:52 UTC
@Ryan-7 so Math.floor(Math.random()); will always give you in result 0. You have to multiply Math.floor(Math.random() * num); to get bigger values, i.e if num = 2; you can get in result 0 or 1. When you want to get 2, you have to write something like: Math.floor(Math.random() * (2 +1));
Ryan
@Ryan-7
Oct 25 2015 17:56 UTC
Okay so Math.random always gives between 0 -.99. math.Floor will rounds down, always resulting in zero. So if the random number was .60, multiply it by 2 and we get 1.2 which is rounded to 1. right?
h4r1m4u
@h4r1m4u
Oct 25 2015 18:01 UTC
correct
Ryan
@Ryan-7
Oct 25 2015 18:02 UTC
So I guess my question is, why does FCC use Math.floor(Math.random() * (1 - 0 + 1)) + 0
instead of just Math.floor(Math.random()*2)
if trying to create a simple coin flip game with outcomes of 0 or 1
h4r1m4u
@h4r1m4u
Oct 25 2015 18:04 UTC
in this case both would work. but in some of the later waypoints, they use a very similar expression to generate random numbers from a custom min / max range (e.g. a random number between 1 and 10). so it kinda prepares you for that
Ryan
@Ryan-7
Oct 25 2015 18:06 UTC
(1 - 0 + 1) + 0 = 2 right?
this math is done first before multiplying by the random number
i forgot my mathematical order of operations..
Doug Wells
@dougwells
Oct 25 2015 18:07 UTC
Is there a way to mark sections "complete" in FreeCodeCamp? I am coming here from Meteor and Ruby. I have the HTML/CSS/Bootstrap down pretty well already. Quick Google search turned up nothing ... Thanks
CamperBot
@camperbot
Oct 25 2015 18:07 UTC
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 25 2015 18:08 UTC
@dougwells no, you have to pass each and every exercise. you cannot skip
Math.floor(Math.random() * (1 - 0 + 1)) + 0
1) first (1 - 0 + 1) gets calculated.
2) then it gets mutliplied by MathRandom()
3) then it's floored
4) then +0 is added
@Ryan-7
Ryan
@Ryan-7
Oct 25 2015 18:09 UTC
Perfect. Thank you @h4r1m4u . At least this will get my simple math skills up to par...
CamperBot
@camperbot
Oct 25 2015 18:09 UTC
ryan-7 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 321 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 25 2015 18:09 UTC
i should rephrase that - i.e. if you want the certificate in the end. otherwise you're free to work on whichever exercise you'd like
@dougwells
you're welcome @Ryan-7
Ryan
@Ryan-7
Oct 25 2015 18:10 UTC
Can someone give me the solution

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

// Only change code below this line.

if (0 === 1) {
return true;

} else {
return false;
}

minakasiin
@minakasiin
Oct 25 2015 18:11 UTC
Umm why do you have (0 === 1) after the if?
h4r1m4u
@h4r1m4u
Oct 25 2015 18:11 UTC
you need to return 'heads' and 'tails'. not true or false
also what @minakasiin says
Ryan
@Ryan-7
Oct 25 2015 18:11 UTC
oops i meant (1 === 2)
but not sure what that means
minakasiin
@minakasiin
Oct 25 2015 18:11 UTC
But why?
You don't need it, I believe.
Ryan
@Ryan-7
Oct 25 2015 18:12 UTC

For example:

if (1 === 2) {

  return true;

} else {

  return false;

}

I guess I was copying the example
minakasiin
@minakasiin
Oct 25 2015 18:12 UTC
But that doesn't do anything...
// Create an if-else statement here to return "heads" if flip is 0 . Otherwise return "tails".
h4r1m4u
@h4r1m4u
Oct 25 2015 18:14 UTC
@Ryan-7 you're saving the randomly generated number into the variable 'flip'. you need to do something with that
Ryan
@Ryan-7
Oct 25 2015 18:18 UTC
yeah I guess I'm stuck
minakasiin
@minakasiin
Oct 25 2015 18:19 UTC
This message was deleted
sergejscherbakov
@sergejscherbakov
Oct 25 2015 18:20 UTC
Hello world
CamperBot
@camperbot
Oct 25 2015 18:20 UTC

welcome to FreeCodeCamp @sergejscherbakov!

minakasiin
@minakasiin
Oct 25 2015 18:21 UTC
hello hello sergej
Ryan-7 it pretty much tells you what to do.
// Create an if-else statement here to return "heads" if flip is 0 . Otherwise return "tails".
So if flip is 0, you will return heads.
Ryan
@Ryan-7
Oct 25 2015 18:23 UTC

if (0) {
return heads;

} else
return tails;

minakasiin
@minakasiin
Oct 25 2015 18:24 UTC
You are not comparing anything in that.
if (0) doesn't do anything. You need something to compare. And you have a variable for that, 'var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;'
Thomson Muriyadan
@thedigitalmonk
Oct 25 2015 18:25 UTC
Is there like an imgur for sound clips?
Ryan
@Ryan-7
Oct 25 2015 18:28 UTC
What would be an example of comparison
if (var=0)
h4r1m4u
@h4r1m4u
Oct 25 2015 18:29 UTC
if (myAge == 20) {
  ...
}
minakasiin
@minakasiin
Oct 25 2015 18:30 UTC
after "var" comes the name of your variable
lnuic
@lnuic
Oct 25 2015 18:30 UTC

How to get:

{name: "moon", avgAlt: 378632.553}

NOT:

{"name": "moon", "avgAlt": 378632.553}
Nick Kasten
@kastentx
Oct 25 2015 18:31 UTC
Using only one equals sign assigns 0 to var, using 2 (or 3) makes it a comparison @Ryan-7
if (var==0) instead of if (var=0)
wstrauss123
@wstrauss123
Oct 25 2015 18:34 UTC
@Inuic I think JavaScript takes the first version and changes it to the second it not already in the second form.
lnuic
@lnuic
Oct 25 2015 18:35 UTC
@wstrauss123 it passed with second version after coding the same task again -.- tnx anyway
CamperBot
@camperbot
Oct 25 2015 18:35 UTC
lnuic sends brownie points to @wstrauss123 :sparkles: :thumbsup: :sparkles:
:star: 205 | @wstrauss123 | http://www.freecodecamp.com/wstrauss123
wstrauss123
@wstrauss123
Oct 25 2015 18:36 UTC
Cool. I,m glad it worked out for you.
Sean Campbell
@natac13
Oct 25 2015 18:45 UTC
Hey everyone I have been trying to work through nodeschool's stream-adventures and browserify-adventure but I am having enormous trouble getting through and understanding them. Has anyone got any advice or links they found helpful?? This is really eating me up as going over the previous challenges does not help... and looking on google only provides answers which I do not understand how to create myself....
Pixori
@Pixori
Oct 25 2015 19:00 UTC
hello everyone! )
lnuic
@lnuic
Oct 25 2015 19:01 UTC
hi @Pixori
Chris
@Aoxom
Oct 25 2015 19:01 UTC
hello
lnuic
@lnuic
Oct 25 2015 19:17 UTC
Hello World
CamperBot
@camperbot
Oct 25 2015 19:17 UTC

welcome to FreeCodeCamp @lnuic!

Ethan Leyden
@Darksmurf
Oct 25 2015 19:20 UTC
The !important keyword, is that only supported through HTML5?
Michael Bomholt
@bomholtm
Oct 25 2015 19:22 UTC
@Darksmurf isnt it css?
Ethan Leyden
@Darksmurf
Oct 25 2015 19:23 UTC
Yes, but I thought CSS3 worked with HTML5...
Colton Ehrman
@coltonehrman
Oct 25 2015 19:24 UTC
@Darksmurf !important is css
css and css3 arent "different" just as html and html5 arent different
yes !important works
Ethan Leyden
@Darksmurf
Oct 25 2015 19:25 UTC
Well, yeah, but I thought it was like using the inline style attribute, that is CSS too, but I read somewhere that it was only supported through HTML5... I could be wrong though
Michael Bomholt
@bomholtm
Oct 25 2015 19:25 UTC
@Darksmurf css "works" with html but !important is css syntax and cannot be written in html
Colton Ehrman
@coltonehrman
Oct 25 2015 19:25 UTC
but it is bad practice
Ethan Leyden
@Darksmurf
Oct 25 2015 19:26 UTC
Ok, thanks @bomholt , @coltonehrman
CamperBot
@camperbot
Oct 25 2015 19:26 UTC
darksmurf sends brownie points to @bomholt and @coltonehrman :sparkles: :thumbsup: :sparkles:
:warning: darksmurf already gave coltonehrman points
:star: 389 | @bomholt | http://www.freecodecamp.com/bomholt
Michael Bomholt
@bomholtm
Oct 25 2015 19:26 UTC
you can use it inside html with style="...."
but as @coltonehrman said its bad practice
Colton Ehrman
@coltonehrman
Oct 25 2015 19:27 UTC
inline styling is also bad practice
Michael Bomholt
@bomholtm
Oct 25 2015 19:27 UTC
better define a class and put css where it belongs
Colton Ehrman
@coltonehrman
Oct 25 2015 19:27 UTC
^^^
or come up with a niffty selector to select exactly what u want
Ethan Leyden
@Darksmurf
Oct 25 2015 19:27 UTC
The fact that it is bad practice is probably why I've never heard it:nobody wants to give bad information.
Colton Ehrman
@coltonehrman
Oct 25 2015 19:27 UTC
without using any classes or anything
its "good" information just not recommended for use
this is usually advised to beginners. but more advanced people could use it without much worry.
but if a beginner may use it and then try and overwrite it somewhere and not get the styling they expected due to the !important and have a tough time figuring out what is wrong
Ethan Leyden
@Darksmurf
Oct 25 2015 19:29 UTC
ok
Colton Ehrman
@coltonehrman
Oct 25 2015 19:30 UTC
so summary. yes u can use it but DONT lol
no need too
Ryan
@Ryan-7
Oct 25 2015 19:30 UTC
Should I be googling things while going through FCC
Colton Ehrman
@coltonehrman
Oct 25 2015 19:30 UTC
yes @Ryan-7
Ryan
@Ryan-7
Oct 25 2015 19:30 UTC
or is everything I need to know suppose to be within the problem set
m-farooqui
@m-farooqui
Oct 25 2015 19:32 UTC
hi i am in module 31 and i am trying to put a submit button in the form element i have completed the 1, 2 and the 4 task but i am stuck on the 3 task
Ryan
@Ryan-7
Oct 25 2015 19:32 UTC
I've officially finished through Part 6. Basic Javascript. About 12 hrs of work over 3 days. I didnt have too much trouble, but if someone asked me to replicate that Slot Machine I THINK i could do it with the help of google.
Mettcon
@Mettcon
Oct 25 2015 19:32 UTC
how do i find the console.log output?
m-farooqui
@m-farooqui
Oct 25 2015 19:32 UTC
here is my code
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
<button type="submit" text="submit">
</button>
</form>
Ethan Leyden
@Darksmurf
Oct 25 2015 19:33 UTC
Did you put any text in the button element @m-farooqui
m-farooqui
@m-farooqui
Oct 25 2015 19:33 UTC
i did @Darksmurf but it doesnot seem to reconize it
Colton Ehrman
@coltonehrman
Oct 25 2015 19:33 UTC
@m-farooqui dont use text attribute on button (i dont even kno if its valid) put the buttons text in between button tags
@Mettcon open web inspector and go to console
Ethan Leyden
@Darksmurf
Oct 25 2015 19:34 UTC
So like this:
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
<button type="submit">
Submit
</button>
</form>
m-farooqui
@m-farooqui
Oct 25 2015 19:35 UTC
@Darksmurf thank you that solve the problem
CamperBot
@camperbot
Oct 25 2015 19:35 UTC
m-farooqui sends brownie points to @darksmurf :sparkles: :thumbsup: :sparkles:
:star: 71 | @darksmurf | http://www.freecodecamp.com/darksmurf
Ethan Leyden
@Darksmurf
Oct 25 2015 19:37 UTC
Anytime @m-farooqui
Michael Bomholt
@bomholtm
Oct 25 2015 19:37 UTC
@Ryan-7 imo google is the best tool for any programmer.. you soon will reach a point where you will look up stuff on other websites like MDN
Ryan
@Ryan-7
Oct 25 2015 19:38 UTC
I see.
I wish I knew if I am on the right track
It's hard to remember all of that information...
does the FCC hold your hand too much?
Michael Bomholt
@bomholtm
Oct 25 2015 19:39 UTC
and its basically google... google again... google again and then you will remember it by yourself :)
Ryan
@Ryan-7
Oct 25 2015 19:39 UTC
lol yeah true
Michael Bomholt
@bomholtm
Oct 25 2015 19:39 UTC
but be sure you look up information and not just the solution
SparksMKII
@SparksMKII
Oct 25 2015 19:39 UTC
@Ryan-7 Not really it throws you into the deep end on bonfires at least that's what it felt like to me :p
Michael Bomholt
@bomholtm
Oct 25 2015 19:40 UTC
and make sure you understand whats going on when you look up code
Ryan
@Ryan-7
Oct 25 2015 19:40 UTC
Did you do a lot of googling during bonfires
I feel like there is a huge learning curve, is there a point where things kind of "click"
SparksMKII
@SparksMKII
Oct 25 2015 19:41 UTC
Depends on the person just take your time untill you fully understand it
Michael Bomholt
@bomholtm
Oct 25 2015 19:41 UTC
@Ryan-7 bonfires give you the needed MDN links but i used google too and found other methods i could use
ziplines is where they really stop holding your hand
Ryan
@Ryan-7
Oct 25 2015 19:42 UTC
Cool. Yeah I decided to give myself 4-6hours a day for a month and then decide if it's something I want to pursue or have a passion for.
Ramakanth
@ramakanthmarda
Oct 25 2015 19:43 UTC
how to create an anchor text
<p>"cat photos"<a href="http://freecatphotoapp.com"></a></p>
i did this way bit im getting an error
Chris Crook
@chrisisacrook
Oct 25 2015 19:46 UTC
the text you are trying to anchor needs to be within the anchor tags
Mettcon
@Mettcon
Oct 25 2015 19:47 UTC
thanks @coltonehrman
CamperBot
@camperbot
Oct 25 2015 19:47 UTC
mettcon sends brownie points to @coltonehrman :sparkles: :thumbsup: :sparkles:
:star: 278 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Chris Crook
@chrisisacrook
Oct 25 2015 19:47 UTC
so it would be something like: <a href=""> Text that is linked </a>
Ramakanth
@ramakanthmarda
Oct 25 2015 19:56 UTC
@chrisisacrook thanx man !
CamperBot
@camperbot
Oct 25 2015 19:56 UTC
ramakanthmarda sends brownie points to @chrisisacrook :sparkles: :thumbsup: :sparkles:
:star: 174 | @chrisisacrook | http://www.freecodecamp.com/chrisisacrook
Michael Bomholt
@bomholtm
Oct 25 2015 20:07 UTC
@Ryan-7 i have to leave quick now. there is a interesting article about a passion is something you need to develop instead of something you are born with
maybe google that :)
programming can very frustrating too so yea found this article very usefull
Habakuk90
@Habakuk90
Oct 25 2015 20:12 UTC
Hey i am stuck with Waypoint: Create a JavaScript Slot Machine
Aleksander Gębicki
@Takumar
Oct 25 2015 20:13 UTC
@Habakuk90 what's your problem?
Habakuk90
@Habakuk90
Oct 25 2015 20:13 UTC
var slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
istn that what they want?
Ed Sztukowski
@Burgustu
Oct 25 2015 20:13 UTC
@Ryan-7 , i just finished up the 5th bonfire and I definitely hear you on the learning curve!
Habakuk90
@Habakuk90
Oct 25 2015 20:13 UTC
tells me that "runSlots" is not defined
Ed Sztukowski
@Burgustu
Oct 25 2015 20:14 UTC
I will say that the more I've kept at it, the more I remember tricks from earlier bonfires that help me get started at least before I'm totally lost
Habakuk90
@Habakuk90
Oct 25 2015 20:14 UTC
or do i have to give the slots the number through a function "runSlots()"?
lnuic
@lnuic
Oct 25 2015 20:14 UTC
i have two more bonfires to solve and then bonfires solved fck yea
Ed Sztukowski
@Burgustu
Oct 25 2015 20:15 UTC
I had a moment where it all clicked yesterday that I havent experienced before, it just took a while to get to that point
Herman Fassett
@HermanFassett
Oct 25 2015 20:15 UTC
It's a good feeling to finish them all @lnuic
Aleksander Gębicki
@Takumar
Oct 25 2015 20:15 UTC
@Habakuk90 yes, it should be inside function runSlots(). You should have such function in your code.
lnuic
@lnuic
Oct 25 2015 20:15 UTC
yea it's like winning a competition hehehe
Herman Fassett
@HermanFassett
Oct 25 2015 20:16 UTC
Permutations was probably the most difficult for me to figure out, though I think my friendly date had the longest code
Aleksander Gębicki
@Takumar
Oct 25 2015 20:18 UTC
@Habakuk90 you have three variables already declared in your function. After comment give them values like you wrote upper.
slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
but remember about slotOne and slotThree
lnuic
@lnuic
Oct 25 2015 20:19 UTC
yea but this bonfires are easy when you compare it with task on some competition @HermanFassett
Herman Fassett
@HermanFassett
Oct 25 2015 20:19 UTC
True
I'm probably going to start going through all these: http://coderbyte.com/CodingArea/Challenges/
just to see where I'm actually at
lnuic
@lnuic
Oct 25 2015 20:24 UTC
they are fake.. go on some real with c++ spoj.com , codeforces.com hsin.hr/coci/
shirleybacilio
@shirleybacilio
Oct 25 2015 20:24 UTC
HI! i need someone expert in Jquery :D
Habakuk90
@Habakuk90
Oct 25 2015 20:24 UTC
@Takumar well thanks for your help, not working tho
CamperBot
@camperbot
Oct 25 2015 20:24 UTC
habakuk90 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 551 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 25 2015 20:25 UTC
@Habakuk90 don't give up, show your code.
Ethan Leyden
@Darksmurf
Oct 25 2015 20:25 UTC
@shirleybacilio Here are a few resources for jQuery:
Habakuk90
@Habakuk90
Oct 25 2015 20:25 UTC
<script>

var slotOne;
var slotTwo;
var slotThree;
function runSlots(){
slotOne =Math.floor(Math.random() (3 - 1 + 1)) + 1;
slotTwo = Math.floor(Math.random()
(3 - 1 + 1)) + 1;
slotThree=Math.floor(Math.random() * (3 - 1 + 1)) + 1;
return slotOne, slotTwo, slotThree;
}
runSlots();
</script>
Ethan Leyden
@Darksmurf
Oct 25 2015 20:25 UTC
Aleksander Gębicki
@Takumar
Oct 25 2015 20:26 UTC
@Habakuk90 you seem to changed original code. Move your variables declarations inside the function.
Habakuk90
@Habakuk90
Oct 25 2015 20:26 UTC
@Takumar Huh there was no original code :D
shirleybacilio
@shirleybacilio
Oct 25 2015 20:26 UTC
Thanks @Darksmurf ! :(
CamperBot
@camperbot
Oct 25 2015 20:26 UTC
shirleybacilio sends brownie points to @darksmurf :sparkles: :thumbsup: :sparkles:
:star: 101 | @darksmurf | http://www.freecodecamp.com/darksmurf
Habakuk90
@Habakuk90
Oct 25 2015 20:27 UTC
@Takumar I'll try to reload
Aleksander Gębicki
@Takumar
Oct 25 2015 20:27 UTC
@Habakuk90 don't reload, press the "Reset" button.
Herman Fassett
@HermanFassett
Oct 25 2015 20:27 UTC
Yeah reset your code @Habakuk90
Aleksander Gębicki
@Takumar
Oct 25 2015 20:28 UTC
@Habakuk90 your function should return an array of 3 variables not 3 variables separated by commas. return [a, b, c];
When you paste your code put three backticks ``` before and three after you code (in new lines).
shirleybacilio
@shirleybacilio
Oct 25 2015 20:29 UTC
Yhahahah Thank you very much! @Darksmurf @camperbot
CamperBot
@camperbot
Oct 25 2015 20:29 UTC
shirleybacilio sends brownie points to @darksmurf and @camperbot :sparkles: :thumbsup: :sparkles:
:warning: shirleybacilio already gave darksmurf points
:star: 416 | @camperbot | http://www.freecodecamp.com/camperbot
Habakuk90
@Habakuk90
Oct 25 2015 20:30 UTC
@Takumar Nice ok Thanks a lot. Worked now. Wonder why there was no code before
CamperBot
@camperbot
Oct 25 2015 20:30 UTC
habakuk90 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: habakuk90 already gave takumar points
Aleksander Gębicki
@Takumar
Oct 25 2015 20:31 UTC
@Habakuk90 maybe you tried to do that waypoint earlier, and removed code by accident?
Kevin Brown
@kevindewbrown
Oct 25 2015 20:31 UTC
Can someone help me with this
lnuic
@lnuic
Oct 25 2015 20:32 UTC
@kevindewbrown what is the problem ?
lnuic
@lnuic
Oct 25 2015 20:34 UTC
read description
var expression = /\d+/g; @kevindewbrown
Kevin Brown
@kevindewbrown
Oct 25 2015 20:36 UTC
@lnuic thanks I forgot two simple parts
CamperBot
@camperbot
Oct 25 2015 20:36 UTC
kevindewbrown sends brownie points to @lnuic :sparkles: :thumbsup: :sparkles:
:star: 235 | @lnuic | http://www.freecodecamp.com/lnuic
Ethan Leyden
@Darksmurf
Oct 25 2015 21:07 UTC
Could someone clarify the instructions?
gjoko1
@gjoko1
Oct 25 2015 21:10 UTC
@Darksmurf What Waypoint are you on?
Spencer Buster
@fspencerb
Oct 25 2015 21:10 UTC

// var numbers = [1,2,3];
// console.log(numbers); // logs [1,2,3]
// var removed = numbers.pop();
// console.log(numbers); // logs [1,2]
// console.log(removed); // logs 3

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

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

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

// my code is wrong but, I can't figure out how. can someone help?

David Wilbanks
@dwilbank68
Oct 25 2015 21:13 UTC
pop() doesn't normally take an argument
it pops the last value off, no matter what it is
yet you gave it an argument
Spencer Buster
@fspencerb
Oct 25 2015 21:14 UTC
the point is to remove ["cat", 2] from myArray and put it into the variable "removed".
Aleksander Gębicki
@Takumar
Oct 25 2015 21:15 UTC
@fspencerb but ["cat", 2] is just last element of myArray, so you can pop() it and put the result in variable removed. pop() function returns value it removes from an array.
Eddy Salvodon
@ESalvodon
Oct 25 2015 21:16 UTC
hey can someone help me with the slot machine example?
Spencer Buster
@fspencerb
Oct 25 2015 21:16 UTC
all I had to do was add ".pop()" onto the end of the removed variable being declared. I got it. thanks. I was trying to make it harder than it was.
CamperBot
@camperbot
Oct 25 2015 21:16 UTC
if you want to thank someone, put an @ before their name!
Spencer Buster
@fspencerb
Oct 25 2015 21:17 UTC
This message was deleted
CamperBot
@camperbot
Oct 25 2015 21:17 UTC
fspencerb sends brownie points to @esalvodon :sparkles: :thumbsup: :sparkles:
:star: 166 | @esalvodon | http://www.freecodecamp.com/esalvodon
Aleksander Gębicki
@Takumar
Oct 25 2015 21:17 UTC
@ESalvodon just ask, this is channel for getting help.
Eddy Salvodon
@ESalvodon
Oct 25 2015 21:17 UTC
$($(".slot") [0]).html(slotOne);
 $($(".slot") [1]).html(slotTwo);
 $($(".slot") [2]).html(slotThree);
Spencer Buster
@fspencerb
Oct 25 2015 21:17 UTC
thank you @Takumar
CamperBot
@camperbot
Oct 25 2015 21:17 UTC
fspencerb sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 555 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 25 2015 21:17 UTC
@ESalvodon remove spaces before brackets.
Eddy Salvodon
@ESalvodon
Oct 25 2015 21:17 UTC
keep getting the error: You should have used the the selector given in the description to select each slot and assign it the value of slotOne, slotTwo and slotThree respectively.
Spencer Buster
@fspencerb
Oct 25 2015 21:18 UTC
thank you @dwilbank68
CamperBot
@camperbot
Oct 25 2015 21:18 UTC
fspencerb sends brownie points to @dwilbank68 :sparkles: :thumbsup: :sparkles:
:star: 2 | @dwilbank68 | http://www.freecodecamp.com/dwilbank68
David Wilbanks
@dwilbank68
Oct 25 2015 21:19 UTC
yay thx
CamperBot
@camperbot
Oct 25 2015 21:19 UTC
if you want to thank someone, put an @ before their name!
Aleksander Gębicki
@Takumar
Oct 25 2015 21:19 UTC
@ESalvodon which waypoint it is?
Eddy Salvodon
@ESalvodon
Oct 25 2015 21:20 UTC
Thank you @Takumar
CamperBot
@camperbot
Oct 25 2015 21:20 UTC
esalvodon sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 556 | @takumar | http://www.freecodecamp.com/takumar
Eddy Salvodon
@ESalvodon
Oct 25 2015 21:20 UTC
got it to work
Aleksander Gębicki
@Takumar
Oct 25 2015 21:20 UTC
@ESalvodon you are master! :-)
Adnan
@Arbish
Oct 25 2015 21:21 UTC
I just broke one of the the pages (Bonfire:Mutations) with an endless while loop. Every time I land on the page it freezes before I can press reset. Any ideas?
Aleksander Gębicki
@Takumar
Oct 25 2015 21:21 UTC
@Arbish you have to clear cache of your web browser
Adnan
@Arbish
Oct 25 2015 21:22 UTC
ah thanks :-D
CamperBot
@camperbot
Oct 25 2015 21:22 UTC
if you want to thank someone, put an @ before their name!
Adnan
@Arbish
Oct 25 2015 21:22 UTC
@Takumar Thanks!
CamperBot
@camperbot
Oct 25 2015 21:22 UTC
arbish sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 557 | @takumar | http://www.freecodecamp.com/takumar
Ethan Leyden
@Darksmurf
Oct 25 2015 21:24 UTC
@gjoko1 Target the same element with multiple JQuery selectors.
Aleksander Gębicki
@Takumar
Oct 25 2015 21:25 UTC
@Darksmurf what's the trouble?
Ethan Leyden
@Darksmurf
Oct 25 2015 21:25 UTC
I don't understand the instructions, they are a bit vague..
Aleksander Gębicki
@Takumar
Oct 25 2015 21:27 UTC
@Darksmurf you have to change behaviour of first button in left-well.
It should look different (btn-primary) and be animated, shaking.
All it should be done with three instructions (in three ways).
Ethan Leyden
@Darksmurf
Oct 25 2015 21:28 UTC
Hmm.. let me try that, and I'll get back to you.
Aleksander Gębicki
@Takumar
Oct 25 2015 21:29 UTC
You have mentioned all three ways of targeting element.
I have to go for a few minutes.
Ethan Leyden
@Darksmurf
Oct 25 2015 21:30 UTC
Ok

So I did this @Takumar:

  $(document).ready(function() {
    $('button').('animated shake btn-primary');
    $('.btn').('animated shake btn-primary');
    $('#target1').('animated shake btn-primary');
  });

and it didn't work... I got an error saying
```
Unexpected token (

*
Unexpected token (
David Wilbanks
@dwilbank68
Oct 25 2015 21:36 UTC
you aren't providing any jQuery methods... you're just providing the arguments for those (missing) methods
Ethan Leyden
@Darksmurf
Oct 25 2015 21:37 UTC
Oooooh, that was a dumb mistake :)
Matt Leonard
@matty22
Oct 25 2015 21:37 UTC
@darksmurf You are using the .addClass() function, but leaving out addClass
Ethan Leyden
@Darksmurf
Oct 25 2015 21:37 UTC
Thanks guys
CamperBot
@camperbot
Oct 25 2015 21:37 UTC
if you want to thank someone, put an @ before their name!
Ethan Leyden
@Darksmurf
Oct 25 2015 21:38 UTC
Thanks @dwilbank68 @matty22
CamperBot
@camperbot
Oct 25 2015 21:38 UTC
darksmurf sends brownie points to @dwilbank68 and @matty22 :sparkles: :thumbsup: :sparkles:
:star: 3 | @dwilbank68 | http://www.freecodecamp.com/dwilbank68
:star: 203 | @matty22 | http://www.freecodecamp.com/matty22
Dibyea
@Dibyea
Oct 25 2015 21:52 UTC
anyone know how to make the gray-background in the div element?
David Wilbanks
@dwilbank68
Oct 25 2015 21:55 UTC
yeh - paste what you got so far...
navicyclical
@navicyclical
Oct 25 2015 21:55 UTC

I'm stuck on the truncate bonfire

```

``
function truncate(str, num) {
  // define local variables
  var stringToTrim = str
  var trimAtIndex = str.indexOf() - str.length();

  return str;
}

truncate("A-tisket a-tasket A green and yellow basket", 11);
Gvidas
@GvidasGVD
Oct 25 2015 21:56 UTC
hi, I think, I'm stuck on "Waypoint: Make Instances of Objects with a Constructor Function"

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

};

// Only change code below this line.
var myCar = new Car();

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

// Only change code above this line.
(function() {return JSON.stringify(myCar);})();

Dibyea
@Dibyea
Oct 25 2015 21:57 UTC
<div class="gray-background">

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>
Gvidas
@GvidasGVD
Oct 25 2015 21:57 UTC
The property wheels should still be 4 in the object constructor.
There should not be a property engines in the object constructor.
The property wheels of myCar should equal 4.
The property engines of myCar should be a number.
David Wilbanks
@dwilbank68
Oct 25 2015 21:57 UTC
@navicyclical trimAtIndex is created, but never used
@Dibyea ok your div is given a classname - now we have to see your css
.gray-background {
stuff goes here...
}
navicyclical
@navicyclical
Oct 25 2015 21:59 UTC
hint
CamperBot
@camperbot
Oct 25 2015 21:59 UTC
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Chad Sanders
@developer412
Oct 25 2015 22:00 UTC

how do I add font size? <style>
.red-text {
color: red
}

</style>

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

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

<p class="red-text">kitty ipsum 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>

David Wilbanks
@dwilbank68
Oct 25 2015 22:00 UTC
@navicyclical actually neither variable is ever used after it is created
Francesco Eri
@francescoeri
Oct 25 2015 22:00 UTC

hi guys im bit stuck in this

var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between min and max values instead of a decimal
  // Only change code below this line.
Math.floor(Math.random() * (max - min + 3)) + min
  return Math.random();

and my task is this : "The random number generated by myFunction should be an integer, not a decimal."

Ed Sztukowski
@Burgustu
Oct 25 2015 22:00 UTC
font-size: 6px
for example
Dibyea
@Dibyea
Oct 25 2015 22:01 UTC

Here's what I have @<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;
}

.gray-background {
background color:gray;
}
</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>

<div class="gray-background">

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

David Wilbanks
@dwilbank68
Oct 25 2015 22:01 UTC
@navicyclical www.w3schools.com/jsref/jsref_substring.asp is one way of getting a truncation happening
Dibyea
@Dibyea
Oct 25 2015 22:02 UTC
@dwilbank68
Chad Sanders
@developer412
Oct 25 2015 22:02 UTC
Thank you Dibyea! and Burgustu
CamperBot
@camperbot
Oct 25 2015 22:02 UTC
if you want to thank someone, put an @ before their name!
Chad Sanders
@developer412
Oct 25 2015 22:03 UTC
thanks @Dibyea and @Burgustu
CamperBot
@camperbot
Oct 25 2015 22:03 UTC
developer412 sends brownie points to @dibyea and @burgustu :sparkles: :thumbsup: :sparkles:
:star: 43 | @dibyea | http://www.freecodecamp.com/dibyea
:star: 200 | @burgustu | http://www.freecodecamp.com/burgustu
Dibyea
@Dibyea
Oct 25 2015 22:04 UTC

@dwilbank68 Here's what I have<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;
}

.gray-background {
background color:gray;
}
</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>

<div class="gray-background">

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

Ihee Xavier
@Altarmir
Oct 25 2015 22:05 UTC

someone please help me, i get RangeError when num is negative
function repeat(str, num) {
// repeat after me
var empty = "";
if (num == -num){
return empty;
}
else{
return str.repeat(num);}
}

repeat("abc", 3);

David Wilbanks
@dwilbank68
Oct 25 2015 22:05 UTC
check your css declaration - you're missing a '-'
Nick Savage
@nickysavage
Oct 25 2015 22:06 UTC
Hello everyone, haven't asked for help here before, but stuck. Hopefully this copy and past well. I just can not understand one part of the instructions.
Having a problem with Responsive Design with Bootstrap  Waypoint: Style Text Inputs as Form Controls Give the text input in your form the class form-control.
What is it asking me to do. Here are all four points to do. I can not understand the one above though.
Give the submit button in your form the classes btn btn-primary.
Add a <i class="fa fa-paper-plane"></i> within your submit button element.
Give the text input in your form the class form-control.
Make sure each of your i elements has a closing tag.
Ed Sztukowski
@Burgustu
Oct 25 2015 22:06 UTC
wp Style Text Inputs as Form Controls
Dibyea
@Dibyea
Oct 25 2015 22:07 UTC
Got it! thank you.@dwilbank68
CamperBot
@camperbot
Oct 25 2015 22:07 UTC
if you want to thank someone, put an @ before their name!
David Wilbanks
@dwilbank68
Oct 25 2015 22:07 UTC
@Dibyea using a nice IDE will make any typos turn a funny color...
me use WebStorm but there are probably cheaper ones that will do the trick too
Nick Savage
@nickysavage
Oct 25 2015 22:09 UTC
@Burgustu was that meant for me. I still do not understand. is WP for wordpress.
Dibyea
@Dibyea
Oct 25 2015 22:10 UTC
where can I get WebStorm@dwilbank68
Ed Sztukowski
@Burgustu
Oct 25 2015 22:10 UTC
@nickysavage sorry was trying to get the waypoint to link
Nick Savage
@nickysavage
Oct 25 2015 22:11 UTC
Dibyea thats a jetbrains product I think just so you know, if you have a student email, its free with that.
Ed Sztukowski
@Burgustu
Oct 25 2015 22:11 UTC
@nickysavage are you having issues with the top one? "Give the submit button in your form the classes btn btn-primary"?
Nick Savage
@nickysavage
Oct 25 2015 22:11 UTC
@Burgustu no I got three of them
let me paste
Give the text input in your form the class form-control.
David Wilbanks
@dwilbank68
Oct 25 2015 22:12 UTC
there were times when I pasted my code into WebStorm, looked for any errors or lint problems, then pasted it right back into FCC
Francesco Eri
@francescoeri
Oct 25 2015 22:12 UTC

hi guys im bit stuck in this

var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between min and max values instead of a decimal
  // Only change code below this line.
Math.floor(Math.random() * (max - min + 3)) + min
  return Math.random();

and my task is this : "The random number generated by myFunction should be an integer, not a decimal."

Ihee Xavier
@Altarmir
Oct 25 2015 22:12 UTC
@nickysavage <button class="btn btn-primary">Submit</button>
Ed Sztukowski
@Burgustu
Oct 25 2015 22:13 UTC
@nickysavage you need to look for a place in your code that has an input type of text
and give it a class
Nick Savage
@nickysavage
Oct 25 2015 22:13 UTC
so it means all places
maybe that is where I was confused will try
thanks @Burgustu
CamperBot
@camperbot
Oct 25 2015 22:13 UTC
nickysavage sends brownie points to @burgustu :sparkles: :thumbsup: :sparkles:
:star: 201 | @burgustu | http://www.freecodecamp.com/burgustu
Ed Sztukowski
@Burgustu
Oct 25 2015 22:14 UTC
@nickysavage no I think there's only one spot with an input type = "text"
Nick Savage
@nickysavage
Oct 25 2015 22:14 UTC
Okay I will look, old and can't work chat and the ide at the same time. I know it is sad, but remember I'm old, will be back if not. Thanks already sent.
CamperBot
@camperbot
Oct 25 2015 22:14 UTC
if you want to thank someone, put an @ before their name!
Nick Savage
@nickysavage
Oct 25 2015 22:15 UTC
lmao I thought camperbot was a real person
Francesco Eri
@francescoeri
Oct 25 2015 22:15 UTC
ok today noone here, ill come another day
Nick Savage
@nickysavage
Oct 25 2015 22:18 UTC
Thanks again, yes I was over thinking it. This chat is pretty neat, I see there are different people in each lesson. Wow, genius. Thanks again @Burgustu
CamperBot
@camperbot
Oct 25 2015 22:18 UTC
nickysavage sends brownie points to @burgustu :sparkles: :thumbsup: :sparkles:
:warning: nickysavage already gave burgustu points
Nick Savage
@nickysavage
Oct 25 2015 22:19 UTC
Would you be my best friend. I will give you my lunch every day. :-) joking
David Wilbanks
@dwilbank68
Oct 25 2015 22:19 UTC
@francescoeri you are returning Math.random(), which ignores all the work you did one line above
Francesco Eri
@francescoeri
Oct 25 2015 22:20 UTC
@dwilbank68 so that means I have to delete something?
David Wilbanks
@dwilbank68
Oct 25 2015 22:20 UTC
you have to save all that work you did into a variable
right now it is calculating a random number, and throwing it into nothingness
Ihee Xavier
@Altarmir
Oct 25 2015 22:21 UTC
my wifi is relly poor guy
David Wilbanks
@dwilbank68
Oct 25 2015 22:21 UTC
save that long line into a variable, and return that variable at the end
Francesco Eri
@francescoeri
Oct 25 2015 22:23 UTC
@dwilbank68
var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between min and max values instead of a decimal
  // Only change code below this line.

  var Math.floor(Math.random() * (max - min + 1)) + min
  return Math.random();
}
like this?
David Wilbanks
@dwilbank68
Oct 25 2015 22:23 UTC
what is the variable name?
you gotta give it a name
pick any...
like rand
Francesco Eri
@francescoeri
Oct 25 2015 22:24 UTC
can i use var myFunction ?