These are chat archives for FreeCodeCamp/Help

28th
Oct 2015
Singh Harpal
@harry9656
Oct 28 2015 00:01
@marzelin true :smirk:
Hayder Sharhan
@Zatara7
Oct 28 2015 00:16
How do I make an object return something like this? { 'fred': 30, 'barney': 40 }
that's not an array :\
Greg Smith
@PortableStick
Oct 28 2015 00:17
@Zatara7 What do you mean?
Hayder Sharhan
@Zatara7
Oct 28 2015 00:18
well i'm doing codewars.com challenge and it is asking me to make an object that would take an array like this: [['fred', 'barney'], [30,40]] and return this: { 'fred': 30, 'barney': 40 }
I am not sure how to make the object return something like that. It is foreign to my php/c++ background
Greg Smith
@PortableStick
Oct 28 2015 00:25
well, you need a function to return an object. The syntax for defining object properties programmatically is
var newObj = {};
newObj[propertyName] = value
It’s just a matter of iterating through the arrays
Jeremy Roe
@jeremyroe
Oct 28 2015 00:30
Anyone know if there is a bug in "Bonfire: Truncate a string” - The instructions state "If the length of the string is less than or equal to 3 characters, then the length of the three dots is not added to the string length.” but the test expects a solution of "truncate("A-", 1) should return "A…”. which seems to contradict the instructions?
Herman Fassett
@HermanFassett
Oct 28 2015 00:32
Only because the length argument is 1
Jeremy Roe
@jeremyroe
Oct 28 2015 00:33
Is it expecting that I calculate the input length including the … in all cases even when the input string is less than 3 at the source then?
because A- would be 2 which would fall under the less than 3 . . .
Jeremy Roe
@jeremyroe
Oct 28 2015 00:45
odd logic but I sorted it out - Thanks for the help
CamperBot
@camperbot
Oct 28 2015 00:45
if you want to thank someone, put an @ before their name!
Said Razzaq
@RubberTendo
Oct 28 2015 00:52
I need some help with sizing images on css, can someone help with the code, please?
Nic Galluzzo
@ngalluzzo
Oct 28 2015 01:00
looking for someone to review my SPA and offer feedback, suggestions... any takers?
Byron Lagrone
@byronic
Oct 28 2015 01:22
@jeremyroe it bothered me too, I created a corner-case in the function for that scenario and left it at that
rbunz
@rbunz08
Oct 28 2015 01:48
I have been working on a project of my own and I have hit a snag...is anyone comfortable with html, css, and php that can help me get a contact form working on a webpage??
@RubberTendo if you still need help, I may be able to...
Mandeep Singh
@MandeepMann
Oct 28 2015 02:03
what is an i element and what is it used for?
Anthony
@Guzko
Oct 28 2015 02:06
Okay so I need to make the div background gray what is wrong with what I have?
  div { 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>
  <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>
How do I assign the div style to the div tag it's self??
Do I need to put something inside the div tags?
rbunz
@rbunz08
Oct 28 2015 02:08
@MandeepMann I have used it when I input an icon such as with fontawesome
@Guzko I usually assign the div a class name and then instead of div {....} i put .classname {..}
Anthony
@Guzko
Oct 28 2015 02:11
@rbunz08 like this?
.gray-background {background-color: gray;}
i put it in the style
but how would I assign it to the div?
Herman Fassett
@HermanFassett
Oct 28 2015 02:11
As a class @Guzko
<div class="class-name">
rbunz
@rbunz08
Oct 28 2015 02:11
@Guzko yea try that Then put <div class = "grey-background">
Herman Fassett
@HermanFassett
Oct 28 2015 02:13
Or gray-background ;)
rbunz
@rbunz08
Oct 28 2015 02:13
@HermanFassett @Guzko Yea make sure the spelling is the same lol
Anthony
@Guzko
Oct 28 2015 02:15
It worked Thanks @rbunz08 @HermanFassett So basicly I put the .gray-background (or any other class) inside the style. Then add the <div class="classname"> to the beginning of the div?
CamperBot
@camperbot
Oct 28 2015 02:15
guzko sends brownie points to @rbunz08 and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 244 | @rbunz08 | http://www.freecodecamp.com/rbunz08
:star: 462 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
rbunz
@rbunz08
Oct 28 2015 02:15
@Guzko yep!
Herman Fassett
@HermanFassett
Oct 28 2015 02:15
;)
Anthony
@Guzko
Oct 28 2015 02:15
Alright now I know, I learn a new thing every day. Code is pretty fun to learn
rbunz
@rbunz08
Oct 28 2015 02:16
@Guzko Yes it is!
Herman Fassett
@HermanFassett
Oct 28 2015 02:16
Very
Even assembly
rbunz
@rbunz08
Oct 28 2015 02:16
now does anyone know how to create a contact form for a website?? It may use php?
Herman Fassett
@HermanFassett
Oct 28 2015 02:18
Well I know the html and css, for php I'm assuming you just get data from form and use mail() function
Mark Puetz
@Funkybunch2006
Oct 28 2015 02:19
Hey guys. Is it possible to separate an array of strings into individual arrays in which the elements are the individual characters?
Herman Fassett
@HermanFassett
Oct 28 2015 02:20
If I understand you right, yes @Funkybunch2006
@Funkybunch2006 do you mean splitting a string into an array where every element is a single character?
Oh
Are you talking 2d arrays?
Mark Puetz
@Funkybunch2006
Oct 28 2015 02:29
@HermanFassett I'm talking splitting a string into several strings within an array, then (most specifically) splitting each of the strings contained in that array into separate arrays (in which the strings have been split into their characters - each one an individual string). This way, the .reverse function will work on them. The actual objective is just to reverse the characters in every word of a string. This is the best way I can think to do it. Do you know of another?
Herman Fassett
@HermanFassett
Oct 28 2015 02:32
Are you meaning you want to reverse every word in string, but not the whole string itself?
Mark Puetz
@Funkybunch2006
Oct 28 2015 02:34
correct
Herman Fassett
@HermanFassett
Oct 28 2015 02:35
So can't you just split the whole string into individual words, loop through that array and reverse each element?
Mark Puetz
@Funkybunch2006
Oct 28 2015 02:36
I think Stack OVerflow may have answered my question, but I'm trying to do it specifically with the map() function. I'll play around with it, but if you have an idea off the top of your head, it's much appreciated.
map() as opposed to loops
Herman Fassett
@HermanFassett
Oct 28 2015 02:36
Ah ok
If it's just functional stuff you wanna use, forEach would be fine
Mark Puetz
@Funkybunch2006
Oct 28 2015 02:38
is forEach a keyword I don't know about? Pretty new.
Herman Fassett
@HermanFassett
Oct 28 2015 02:39
forEach just loops through array elements. Actually now that I think about it, map is probably better
Colton Ehrman
@coltonehrman
Oct 28 2015 02:51
forEach is an Array method that can be accessed on any array
rbunz
@rbunz08
Oct 28 2015 02:54
@HermanFassett I have done it but when I hit submit it brings up a white page with my php on it. I am not sure what I am doing wrong
Colton Ehrman
@coltonehrman
Oct 28 2015 02:55
@rbunz08 are u trying to redirect?
rbunz
@rbunz08
Oct 28 2015 02:56
like have the php in an external file? @coltonehrman
Colton Ehrman
@coltonehrman
Oct 28 2015 02:56
what r u trying to do?
and whats happening?
did u use php tags?
<?php ?>
rbunz
@rbunz08
Oct 28 2015 02:56
I am trying to make a contact form. I have an html file with the <form> and css linked to that. Then I have an external php file that I link in my html
and yes I have the php in the proper tags
Colton Ehrman
@coltonehrman
Oct 28 2015 02:57
ok and does ur forms action attr equal the php file?
how did u link ur php to ur html?
rbunz
@rbunz08
Oct 28 2015 02:59
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="description" content="Integrating Educational Technology in a 21st Century Classroom">
    <meta name="keywords" content="technology, apps, education, teaching, integration, 21st Century, classroom">
    <title>Integrating EducTech | Contact Me</title>

     <!-- link for bootstrap -->
    <link rel="stylesheet prefetch" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <!-- link to external css -->
    <link rel="stylesheet" href="../css/ipad.css">
    <link rel="stylesheet" href="../css/contact.css">
      <!-- font-awesome link -->
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
      <!-- google fonts links -->
      <link href='https://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
  </head>

  <body>
  <div class = "contact">
      <h1>Contact Me</h1>
      <div id = "line"></div></br>
      <p>You can email me at rebeccabunz@hotmail.com or fill out the form below. I will get back to you as soon as I can. Thank-you for your interest in Integrating EduTech.</p> 
      <div class="container-fluid">
             <div class = "contact-form">
                <form method="post" action="../php/contact.php">     
                    <label>Name</label>
                    <input name="name" placeholder="Your Name">

                    <label>Email</label>
                    <input name="email" type="email" placeholder="example@domain.com">

                    <label>Message</label>
                    <textarea name="message" placeholder="Your Message"></textarea>

                    <input id="submit" name="submit" type="submit" value="Submit">
                </form>
            </div> <!-- end of contact form -->
    </div> <!-- end of container --> 
</div> <!-- end of contact -->
    <!-- link to jquery and bootstrap.js --> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
    <!-- link to external javascript -->    
  <script src="../scripts/ipad.js"></script>
  </body>
</html>
CamperBot
@camperbot
Oct 28 2015 02:59
if you want to thank someone, put an @ before their name!
rbunz
@rbunz08
Oct 28 2015 02:59
thats my html
Colton Ehrman
@coltonehrman
Oct 28 2015 02:59
ok hold on
rbunz
@rbunz08
Oct 28 2015 02:59
the php file is saved in a folder called php and the file is called contact.php
Colton Ehrman
@coltonehrman
Oct 28 2015 02:59
and when u hit submit what happens?
rbunz
@rbunz08
Oct 28 2015 02:59
it comes up with a white page that has my php on it
Colton Ehrman
@coltonehrman
Oct 28 2015 03:00
it literally displays ur php?
rbunz
@rbunz08
Oct 28 2015 03:00
yea
Colton Ehrman
@coltonehrman
Oct 28 2015 03:00
ok paste ur php file in here
there must be something wrong with it
rbunz
@rbunz08
Oct 28 2015 03:00
<?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = $_POST['message'];
    $from = 'Integrating EduTech'; 
    $to = 'example@hotmail.com'; 
    $subject = 'Contact Form';

    $body = "From: $name\n E-Mail: $email\n Message:\n $message";

    if ($_POST['submit']) {                 
        if (mail ($to, $subject, $body, $from)) { 
        echo '<p>Your message has been sent!</p>';
        } 
        else { 
        echo '<p>Something went wrong, go back and try again!</p>'; 
        } 
    }
?>
Colton Ehrman
@coltonehrman
Oct 28 2015 03:00
r u running this throu a server?
rbunz
@rbunz08
Oct 28 2015 03:01
um.. idk I am running it in CoffeeCup HTML text editor
Colton Ehrman
@coltonehrman
Oct 28 2015 03:01
OHHH lol
thats why
rbunz
@rbunz08
Oct 28 2015 03:01
can it not do php
?
Colton Ehrman
@coltonehrman
Oct 28 2015 03:01
yeh PHP must be run on a server
rbunz
@rbunz08
Oct 28 2015 03:01
o how do i do that>
Colton Ehrman
@coltonehrman
Oct 28 2015 03:01
browsers dont interpret php
what OS r u on?
rbunz
@rbunz08
Oct 28 2015 03:01
this is the first time I have used php so...
whats an OS lol
Colton Ehrman
@coltonehrman
Oct 28 2015 03:02
i see lol
and operating system
rbunz
@rbunz08
Oct 28 2015 03:02
windows 10?
Colton Ehrman
@coltonehrman
Oct 28 2015 03:02
mac windows linuz
windows :O
lol ok hold on
h4r1m4u
@h4r1m4u
Oct 28 2015 03:02
@rbunz08 you may want to edit the php code above and remove your email address. the chat archives are accessible to anyone (including spambots)
Colton Ehrman
@coltonehrman
Oct 28 2015 03:03
since u r a beginner its proller best u start of with a packaged environment such as XAMPP
Rex Schrader
@SaintPeter
Oct 28 2015 03:03
@rbunz08 If you want to practice with PHP, I encourage you to get "WAMP Server"
Colton Ehrman
@coltonehrman
Oct 28 2015 03:03
rbunz
@rbunz08
Oct 28 2015 03:03
So ur telling me I have been changing and redoing my code for a couple days and its not even cuz of my code?? lol
Colton Ehrman
@coltonehrman
Oct 28 2015 03:03
@SaintPeter shes on windows
Felipe Villalobos
@manteca
Oct 28 2015 03:03
yes, XAMP is teh easiest way on windows
rbunz
@rbunz08
Oct 28 2015 03:03
@h4r1m4u thanks
Rex Schrader
@SaintPeter
Oct 28 2015 03:03
@rbunz08 I like WampServer over XAMP, actually
CamperBot
@camperbot
Oct 28 2015 03:03
rbunz08 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 369 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Rex Schrader
@SaintPeter
Oct 28 2015 03:03
@rbunz08 @coltonehrman YMMV
Colton Ehrman
@coltonehrman
Oct 28 2015 03:04
XAMPP! lol
@rbunz08 heres another helpful link
Colton Ehrman
@coltonehrman
Oct 28 2015 03:05
WAMP is for WIMPS
rbunz
@rbunz08
Oct 28 2015 03:05
haha omg Ive started something...
Colton Ehrman
@coltonehrman
Oct 28 2015 03:06
@rbunz08 u may have trouble getting ur php to send mail on localhost
i did anyways and ended up abandoning my project :p lol
i figured sending mail can wait
rbunz
@rbunz08
Oct 28 2015 03:06
@coltonehrman dont tell me that lol
Rex Schrader
@SaintPeter
Oct 28 2015 03:06
@rbunz08 I'm not actually very partisan on this issue. If you've got someone who will teach you XAMPP, then more power to you
Colton Ehrman
@coltonehrman
Oct 28 2015 03:06
the real magic is in working with mysql
@rbunz08 dont worry too much about learning EVERYTHING about XAMPP WAMP or whatever. with these all u need is enough to get by
rbunz
@rbunz08
Oct 28 2015 03:07
@coltonehrman whats that?
Z.G.Hao
@akidox
Oct 28 2015 03:07
what dose form attributes do?
HTML
Colton Ehrman
@coltonehrman
Oct 28 2015 03:08
when u become really proficient then u will want to setup ur dev environment urself
rbunz
@rbunz08
Oct 28 2015 03:08
o :worried:
Colton Ehrman
@coltonehrman
Oct 28 2015 03:08
form attr method tells the browser what protocol to send ur request as GET POST etc
@rbunz08 mysql is a database
rbunz
@rbunz08
Oct 28 2015 03:09
thats sounds difficult
Colton Ehrman
@coltonehrman
Oct 28 2015 03:09
lol dont worry
take it little by little u will eventually be there
EHunt13
@EHunt13
Oct 28 2015 03:09
hey guys
rbunz
@rbunz08
Oct 28 2015 03:09
I feel like I have gotten as far as I can get on my own
Felipe Villalobos
@manteca
Oct 28 2015 03:09
@rbunz08 coltonehrman is right, it doesn't matter if you use WAMP or XAMPP, you follow the instruction installation and you are going to ready to code on PHP
Colton Ehrman
@coltonehrman
Oct 28 2015 03:10
@rbunz08 dont say that
keep pushin
Felipe Villalobos
@manteca
Oct 28 2015 03:10
it is not that hard
EHunt13
@EHunt13
Oct 28 2015 03:10
is there any chance someone can help me with a basic question?
this is my first time on here
Colton Ehrman
@coltonehrman
Oct 28 2015 03:10
look at it this way. the more problems u overcome the better u will become
welcome @EHunt13
whats the question?
rbunz
@rbunz08
Oct 28 2015 03:10
Im not bad with learning the code but when it comes to anything with servers or databases or actually uploading ur code...im done lol
Z.G.Hao
@akidox
Oct 28 2015 03:10
and the style “action" in form? @coltonehrman
EHunt13
@EHunt13
Oct 28 2015 03:10
i cant figure out where to next my text input element within a form element
create a form element in html
Colton Ehrman
@coltonehrman
Oct 28 2015 03:11
@rbunz08 that foundational knowledge is a must if u ever want to be a web developer
Felipe Villalobos
@manteca
Oct 28 2015 03:11
@rbunz08 XAMPP or WAMP solves that for you...
rbunz
@rbunz08
Oct 28 2015 03:11
@EHunt13 can you paste what you have?
Mark Puetz
@Funkybunch2006
Oct 28 2015 03:11
thanks @coltonehrman @HermanFassett
CamperBot
@camperbot
Oct 28 2015 03:11
funkybunch2006 sends brownie points to @coltonehrman and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 463 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
:star: 279 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Colton Ehrman
@coltonehrman
Oct 28 2015 03:11
@akidox action tells the browser where to send the request
EHunt13
@EHunt13
Oct 28 2015 03:11
<form action = "/submit-cat-photo"></form>
rbunz
@rbunz08
Oct 28 2015 03:11
@coltonehrman @manteca but where can I got to learn that ?
Colton Ehrman
@coltonehrman
Oct 28 2015 03:11
EHunt13
@EHunt13
Oct 28 2015 03:11
haha i think i just solved it
hang on
thanks
CamperBot
@camperbot
Oct 28 2015 03:12
if you want to thank someone, put an @ before their name!
Colton Ehrman
@coltonehrman
Oct 28 2015 03:12
my personal resource website :)
EHunt13
@EHunt13
Oct 28 2015 03:12
the text input has to be nested within that
not vice versa
rbunz
@rbunz08
Oct 28 2015 03:12
@coltonehrman ok thanks!
CamperBot
@camperbot
Oct 28 2015 03:12
rbunz08 sends brownie points to @coltonehrman :sparkles: :thumbsup: :sparkles:
:star: 280 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Colton Ehrman
@coltonehrman
Oct 28 2015 03:12
@rbunz08 i recommend getting a book on php
WARNING: make sure the book is relevant and not out of date
rbunz
@rbunz08
Oct 28 2015 03:12
@coltonehrman Ive been using codecademy
Colton Ehrman
@coltonehrman
Oct 28 2015 03:12
codeacademy is just for getting ur feet wet
or "hands dirty"
doesnt really teach u the underlying knowledge u need
Colton Ehrman
@coltonehrman
Oct 28 2015 03:13
like i said i would recommend getting a book
rbunz
@rbunz08
Oct 28 2015 03:13
@coltonehrman ok!
Felipe Villalobos
@manteca
Oct 28 2015 03:14
@rbunz08 http://code.tutsplus.com/ is a good page for learning.
Colton Ehrman
@coltonehrman
Oct 28 2015 03:14
EHunt13
@EHunt13
Oct 28 2015 03:14
<form action = "/submit-cat-photo" input type="text" placeholder="cat photo URL"></form>
still cant figure it out
Colton Ehrman
@coltonehrman
Oct 28 2015 03:14
input is a separate tag @EHunt13
it is not part of the form tag
<form action = "/submit-cat-photo"><input type="text" placeholder="cat photo URL"></form>
EHunt13
@EHunt13
Oct 28 2015 03:15
thats what i did first, and it didnt clear for "nest your text input element within a form element
ahh ok
thats how it connects
Colton Ehrman
@coltonehrman
Oct 28 2015 03:15
?
EHunt13
@EHunt13
Oct 28 2015 03:15
ill look at it and try to understand why
rbunz
@rbunz08
Oct 28 2015 03:16
@coltonehrman thanks Ill check it out!
CamperBot
@camperbot
Oct 28 2015 03:16
rbunz08 sends brownie points to @coltonehrman :sparkles: :thumbsup: :sparkles:
:warning: rbunz08 already gave coltonehrman points
Felipe Villalobos
@manteca
Oct 28 2015 03:16
@EHunt13 tha contains 2 tag element, the FORM and an INPUT tag that it's insiden the FORM element.
EHunt13
@EHunt13
Oct 28 2015 03:17
thanks!
CamperBot
@camperbot
Oct 28 2015 03:17
if you want to thank someone, put an @ before their name!
EHunt13
@EHunt13
Oct 28 2015 03:17
thanks @coltonehrman and @manteca and @camperbot
CamperBot
@camperbot
Oct 28 2015 03:17
ehunt13 sends brownie points to @coltonehrman and @manteca and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 281 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
:star: 18 | @manteca | http://www.freecodecamp.com/manteca
:star: 438 | @camperbot | http://www.freecodecamp.com/camperbot
Malikadil
@Malikadil
Oct 28 2015 03:19
<Style>h2{color: blue;}</style> how it colsing tag
Z.G.Hao
@akidox
Oct 28 2015 03:19
so the “/submit-cat-photo” receive the cat photos,as a server? @coltonehrman
Colton Ehrman
@coltonehrman
Oct 28 2015 03:20
submit-cat-photo is another file residing on the same server as the html file
Malikadil
@Malikadil
Oct 28 2015 03:20

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

<h2>CatPhotoApp</h2>

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

its solution
Z.G.Hao
@akidox
Oct 28 2015 03:21
I think I get it,thanks @coltonehrman
CamperBot
@camperbot
Oct 28 2015 03:21
akidox sends brownie points to @coltonehrman :sparkles: :thumbsup: :sparkles:
:star: 282 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
Colton Ehrman
@coltonehrman
Oct 28 2015 03:21
dont worry too much about it right now @akidox
Herlou
@herloub
Oct 28 2015 03:25
anyone can give some help? I'm stuck on rgb color. Tried this in my style but didn't work. <style>
body {color rgb(0,0,0,);
}
</style>
h4r1m4u
@h4r1m4u
Oct 28 2015 03:26
@herloub color: rgb(0,0,0);
notice the colon :
Z.G.Hao
@akidox
Oct 28 2015 03:26
thanks,I asked because I can’t understand what the next challenge’s description means @coltonehrman
CamperBot
@camperbot
Oct 28 2015 03:26
akidox sends brownie points to @coltonehrman :sparkles: :thumbsup: :sparkles:
:warning: akidox already gave coltonehrman points
Piyush Vats
@piyushv
Oct 28 2015 03:27
hi guys just doing a bonfire and ive completed it but for curiosity's sake, is there a more efficient way to go about the conditional logic part. code is below.
task is to repeat str 'num' number of times if num >= 0
function repeat(str, num) {
 if (num >= 0) {
   return str.repeat(num);
 } 
  else {
   return "";
 } 
}

repeat("abc", 3);
Herlou
@herloub
Oct 28 2015 03:28
@h4r1m4u I put the colon but nothing happened
h4r1m4u
@h4r1m4u
Oct 28 2015 03:28
@herloub could you post your updated code?
@herloub also, are you working on this waypoint: Use RGB values to Color Elements?
if yes, you're supposed to change the color of the background, not the text
Herlou
@herloub
Oct 28 2015 03:30
<style>
body {
color: rgb(0,0,0,);}
</style> @h4r1m4u
ronaldrdguez
@ronaldrdguez
Oct 28 2015 03:30
@piyushv I think the point is to implement repeat yourself instead of using the String's repeat method?
Herlou
@herloub
Oct 28 2015 03:31
@h4r1m4u yup
h4r1m4u
@h4r1m4u
Oct 28 2015 03:32
@herloub you have an extra comma inside the parentheses: it should be rgb(0,0,0); not rgb(0,0,0,);. and as i mentioned above, you need to use this to set the background color, not the color of the text to pass this waypoint
Herman Fassett
@HermanFassett
Oct 28 2015 03:32
@ronaldrdguez :D
@piyushv there really isn't an easier way though it could be made to look shorter and nicer
Felipe Villalobos
@manteca
Oct 28 2015 03:32
@herloub Erase the last , on the parentesis... rgb(0,0,0)
Herlou
@herloub
Oct 28 2015 03:33
@h4r1m4u got it, thank you!
CamperBot
@camperbot
Oct 28 2015 03:33
herloub sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 370 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 03:33
you're welcome, good work
Herlou
@herloub
Oct 28 2015 03:34
@manteca got it! I didn't see that! :) thank you!
CamperBot
@camperbot
Oct 28 2015 03:34
herloub sends brownie points to @manteca :sparkles: :thumbsup: :sparkles:
:star: 21 | @manteca | http://www.freecodecamp.com/manteca
Herman Fassett
@HermanFassett
Oct 28 2015 03:34
@piyushv for instance
function repeat(str, num) {
  return (num >= 0) ? str.repeat(num) : "";
}
ronaldrdguez
@ronaldrdguez
Oct 28 2015 03:34
What's the point in doing this?
function repeat(str, num) {
    return str.repeat(num);
}
Piyush Vats
@piyushv
Oct 28 2015 03:35
@ronaldrdguez lol but im lazy! i did do it the long way but then found out about str.repeat in the documentation fcc links you to in the bonfire :) @HermanFassett i do need to work on my formatting.
Herman Fassett
@HermanFassett
Oct 28 2015 03:35
If you can do it the long way, do it the easy way! :P
Piyush Vats
@piyushv
Oct 28 2015 03:38
thanks @HermanFassett
@ronaldrdguez i dont quite get what you mean?
CamperBot
@camperbot
Oct 28 2015 03:38
piyushv sends brownie points to @ronaldrdguez :sparkles: :thumbsup: :sparkles:
:star: 359 | @ronaldrdguez | http://www.freecodecamp.com/ronaldrdguez
Piyush Vats
@piyushv
Oct 28 2015 03:39
thanks @HermanFassett
CamperBot
@camperbot
Oct 28 2015 03:39
piyushv sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 464 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Herman Fassett
@HermanFassett
Oct 28 2015 03:40
Yep
Piyush Vats
@piyushv
Oct 28 2015 03:44
@HermanFassett just to confirm is this what youve done to condense the code? (condition ? ifTrue : ifFalse)
Herman Fassett
@HermanFassett
Oct 28 2015 03:44
Yeah
help ternary
CamperBot
@camperbot
Oct 28 2015 03:44

:point_right: js ternary [wiki]

The Ternary operator replaces an if/then block in a very small compact way.
It's mostly used in one liners for simple tests and replacements, like this:

var x = false;
var s = x ? "yes" : "no";
console.log(s);  //→ "no"

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

Piyush Vats
@piyushv
Oct 28 2015 03:44
awesome
Herlou
@herloub
Oct 28 2015 04:37
help please.
CamperBot
@camperbot
Oct 28 2015 04:37

:point_right: bonfire no repeats please [wiki]

Problem Explanation:

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

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

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

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

Herlou
@herloub
Oct 28 2015 04:37
<div class="col-xs-4"><button class="btn btn-block btn-primary">Like</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-info">Info</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-danger">Delete</button></div>
</div>
Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4. what did i do wrong?
joelscreative
@joelscreative
Oct 28 2015 04:40
I'm probably gonna be in here a LOT. Thanks everyone in advance!
CamperBot
@camperbot
Oct 28 2015 04:40
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 28 2015 04:41
@herloub that looks correct. could you post your whole code?
also, you can format the code you post by using backticks, the key under escape
wiki format
CamperBot
@camperbot
Oct 28 2015 04:41

: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

Herlou
@herloub
Oct 28 2015 04:42

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

<div class="container-fluid">
<h2 class="red-text text-center">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>

<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row" <div class="col-xs-4"><button> class="btn btn-block btn-primary">Like</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-info">Info</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-danger">Delete</button></div>
</div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

h4r1m4u
@h4r1m4u
Oct 28 2015 04:43
@herloub you forgot to close your .row div:
<div class="row" <div class="col-xs-4"><button> class="btn btn-block btn-primary">Like</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-info">Info</button></div>
<div class="col-xs-4"><button class="btn btn-block btn-danger">Delete</button></div>
</div>
it should be <div class="row">
use the code formatting please. it makes it much easier for other folks to review your code
Herlou
@herloub
Oct 28 2015 04:45
@h4r1m4u thank you. how do I use code formatting?
CamperBot
@camperbot
Oct 28 2015 04:45
herloub sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 371 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 04:46
@herloub use the backtick key. just under escape on your keyboard. here are the details :point_down:
wiki format
CamperBot
@camperbot
Oct 28 2015 04:46

: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

Randy Torres
@randytorres
Oct 28 2015 05:03
bonfire title case a sentence
CamperBot
@camperbot
Oct 28 2015 05:03

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

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

Return the provided string with the first letter of each word capitalized.

more info:  bf details | bf links | hint

Randy Torres
@randytorres
Oct 28 2015 05:03
bf details
CamperBot
@camperbot
Oct 28 2015 05:03

:fire:Bonfire: Title Case a Sentence :link:

function titleCase(str) {
  return str;
}

titleCase("I'm a little tea pot");
Return the provided string with the first letter of each word capitalized.
For the purpose of this exercise, you should also capitalize connecting words like 'the' and 'of'.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Mia Pike
@autMia
Oct 28 2015 05:14
hey im stuck on the challenge where you have to make getSpeed public
Bryan Wegman
@bwyan
Oct 28 2015 05:21
Hi @MiaP97, what part are you stuck on?
How to make it public?
Does anyone have a minute to look at my weather app and tell me why the Canvas with the icon in it isn’t aligned with the big temperature readout? http://codepen.io/bwyan/pen/vNKPLW
(I’ve set white borders on the two elements in question)
(I’ve also unwired the app from the weather and location APIs, so you’ll see bogus data for now)
Z.G.Hao
@akidox
Oct 28 2015 05:29
Does a required attribute means a user can't submit a empty text field?
Bryan Wegman
@bwyan
Oct 28 2015 05:31
in what context?
@akidox, on a form, ye.
*yes.
Z.G.Hao
@akidox
Oct 28 2015 05:33
How does it could be useful? @bwyan
Bryan Wegman
@bwyan
Oct 28 2015 05:34
You can add the “required” attribute to an input so that the user can’t leave that input blak.
blank
You can also style it in CSS with the :required pseudo class.
so for example…
input {
  border: green;
}

input:required {
  border: red;
}
h4r1m4u
@h4r1m4u
Oct 28 2015 05:36
@bwyan add vertical-align:top; to both your #icon1 and #temp elements' CSS
Z.G.Hao
@akidox
Oct 28 2015 05:36
you means a text field like “*username” means you have to fill it out?
Bryan Wegman
@bwyan
Oct 28 2015 05:36
@h4r1m4u thank you!
CamperBot
@camperbot
Oct 28 2015 05:36
bwyan sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 372 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Bryan Wegman
@bwyan
Oct 28 2015 05:36
Yes, that’s correct @akidox
h4r1m4u
@h4r1m4u
Oct 28 2015 05:37
my pleasure
Z.G.Hao
@akidox
Oct 28 2015 05:37
ok,thanks @bwyan
CamperBot
@camperbot
Oct 28 2015 05:37
akidox sends brownie points to @bwyan :sparkles: :thumbsup: :sparkles:
:star: 243 | @bwyan | http://www.freecodecamp.com/bwyan
Bryan Wegman
@bwyan
Oct 28 2015 05:38
@h4r1m4u, you’ve helped twice this week. Wish I could give you extra brownie points! Do you know why those two elements wouldn't naturally align to the top or bottom of the div?
Wayne
@waynek-9
Oct 28 2015 05:41
Hello everyone. I'm new to coding and i have run into my first snag. I'm having trouble with the "!important" override.
<h1 id="orange-text" class="pink-text !important; blue-text" style="color: white">Hello World!</h1>
This is what I have so far
Bryan Wegman
@bwyan
Oct 28 2015 05:41
(btw, after trying vertical-align:top, I ended up using vertical-align: middle and that looks better to me. For some reason I keep forgetting vertical-align because it seems like for years it was unavailable)
@akidox, glad to help!
Hi @waynek-9.
h4r1m4u
@h4r1m4u
Oct 28 2015 05:42
@bwyan no worries, bud. happy to help, especially with the more complicated requests. it's enjoyable. as for the explanation: inline-blocks are still "in-line" and the default vertical alignment is baseline which can be inconsistent. it's influenced by height. but setting the vertical-alignment to top will start all the inline blocks at the top
Bryan Wegman
@bwyan
Oct 28 2015 05:44
AAAH, I thought it might be aligned with the baseline. That’s a sensible default for most use cases, I suppose.
@waynek-9, I don’t think you can use semicolons in HTML attributes. Do you have a link to that challenge? (I can’t remember it)
Bereket Yeleussinov
@Bektaz
Oct 28 2015 05:46

hello there i am doing Waypoint: Nest an Anchor Element within a Paragraph
i did exactly what was required

<p>View more <a href="freecatphotoapp.com">cat photos</a></p>
It should give text "View more cat photos", where cat photos is the link, but when i run the test it is not running. Help me please where is the mistake here. I could not find any mistake, space everything is there

Bryan Wegman
@bwyan
Oct 28 2015 05:48
@waynek-9, I found the waypoint. You need to add !important to your style instead of to the H1 tag.
h4r1m4u
@h4r1m4u
Oct 28 2015 05:48
@waynek-9 class="pink-text !important; blue-text" you cannot put !important and the ; in an element's class declaration as bwyan says. !important is declared after your CSS rules and ; cannot be used in class declarations at all
Bryan Wegman
@bwyan
Oct 28 2015 05:48
Your H1 tag should be what they exercise started with:
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
Ihab Baghdadi
@ijb87
Oct 28 2015 05:49
@Bektaz which test doesn't work?
Bereket Yeleussinov
@Bektaz
Oct 28 2015 05:49
Waypoint: Nest an Anchor Element within a Paragraph
Wayne
@waynek-9
Oct 28 2015 05:50
I got it. Thanks for your help @bwyan @h4r1m4u
CamperBot
@camperbot
Oct 28 2015 05:50
waynek-9 sends brownie points to @bwyan and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 244 | @bwyan | http://www.freecodecamp.com/bwyan
:star: 373 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 05:50
@Bektaz shouldn't the link inside the <a> be http://www.freecatphotoapp.com instead of just freecatphotoapp.com?
Bereket Yeleussinov
@Bektaz
Oct 28 2015 05:52
sorry guys :worried: my silly mistake. the thing is i tried to play around with different possiilities and missed checking that option probably.
now it works fine :+1: thanks @h4r1m4u. Helping community here is really fast and efficient!
CamperBot
@camperbot
Oct 28 2015 05:53
bektaz sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 374 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 05:54
great!
Bryan Wegman
@bwyan
Oct 28 2015 05:56
You’re welcome @waynek-9! I hope you’re able to finish the waypoint now.
@Bektaz it’s almost always a silly mistake. Nothing to be sorry about!
They should rename this room to FreeCodeCamp/SillyMistakes
Bereket Yeleussinov
@Bektaz
Oct 28 2015 05:57
that is true :smile: :smile: @bwyan :+1:
Manish Rout
@mnshrt
Oct 28 2015 06:07

hi all, i'm unable to clear this waypoint that involves the addClass function of jquery <script>
$(document).ready(function() {

});
$("button").addClass("animated bounce");
</script>

is there any error?
h4r1m4u
@h4r1m4u
Oct 28 2015 06:09
@mnshrt
<script>
$(document).ready(function() {
  $("button").addClass("animated bounce");
});
</script>
it needs to be inside the document.ready function
Manish Rout
@mnshrt
Oct 28 2015 06:10
ok got it, @h4r1m4u thnx a lot
CamperBot
@camperbot
Oct 28 2015 06:10
mnshrt sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 375 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Chad Nickle
@FineBlend
Oct 28 2015 06:23
I can't pass this waypoint, it's telling me my <h1> should be blue, but it is blue already!
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  .pink-text {
    color: pink;
  }

  .blue-text 
  {color: blue
  }
</style>
<h1 class="pink-text"><h1 class="blue-text">Hello World!</h1>
Manish Rout
@mnshrt
Oct 28 2015 06:25
<h1 class="pink-text blue-text">
h4r1m4u
@h4r1m4u
Oct 28 2015 06:25
@FineBlend you're having two <h1> elements in your code, one of which is unclosed: <h1 class="pink-text"><h1 class="blue-text">Hello World!</h1>
remove the first opening tag: <h1 class="blue-text">Hello World!</h1>
Manish Rout
@mnshrt
Oct 28 2015 06:25
This message was deleted
Chad Nickle
@FineBlend
Oct 28 2015 06:27
Thank you @mnshrt that did the trick!
CamperBot
@camperbot
Oct 28 2015 06:27
fineblend sends brownie points to @mnshrt :sparkles: :thumbsup: :sparkles:
:star: 117 | @mnshrt | http://www.freecodecamp.com/mnshrt
Mongoliax
@Enkhnomin
Oct 28 2015 07:04
hello guys
Ankit Panwar
@coderNoob
Oct 28 2015 07:09
I do not understand what exactly we have to do in Bonfire: DNA pairing.
Reegan
@ReeganArockiasmy
Oct 28 2015 07:10
Hi team what is Bootstrap class
Singh Harpal
@harry9656
Oct 28 2015 07:20
@ReeganArockiasmy it is a name uses in your HTML to stylize your web page accordingly. The class name is recognized by the Bootstrap framework and uses it to modify the style of your content.
Abhisek Pattnaik
@abhisekp
Oct 28 2015 07:22
@harry9656 hi Harry!
Colton Ehrman
@coltonehrman
Oct 28 2015 07:22
@ReeganArockiasmy predefined css classes with elegant styling
Singh Harpal
@harry9656
Oct 28 2015 07:23
@abhisekp hey buddy :wave: . what's up?
Abhisek Pattnaik
@abhisekp
Oct 28 2015 07:23
ceiling, mountain, cloud, bed, stars, sun
Singh Harpal
@harry9656
Oct 28 2015 07:24
@abhisekp hmm that's not true if don't have any reference. That might also be down. :smirk:
How are you? :smile:
Markus Kiili
@Masd925
Oct 28 2015 07:26
@ReeganArockiasmy making web pages that look nice in different screen sizes is quite difficult, but a framework like Bootstrap makes it easy.
abhisekp @abhisekp was unable to get the previous message. ISS communication failure.
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:29

Hey guys, could someone help me with a AngularJS task?
I feel that the more nesting there needs to be, the more complex the code. I feel that I'm missing some fundamentals here.

Problem: In the chapter.html I see everything correctly, however, when clicking the next hyperlink, the URL gets updated, the view does not.

What am I missing, guys?

Here's my code:
ChapterController.js

app.controller('ChapterController', ['$scope', 'books', '$routeParams', function($scope, books, $routeParams) {
  books.success(function(data) {

    // Your code here
    $scope.book = data[$routeParams.bookId];
    $scope.chapter = data[$routeParams.chapterId];


    // If there no more chapters left, go back to the bookshelf view
    if($routeParams.chapterId >= $scope.book.chapters.length - 1) {
      $scope.nextChapterIndex = "#";
    }
  });

  // Using these properties to create the URLs in line 1 and line 11 of view/chapter.html
  $scope.currentBookIndex = parseInt($routeParams.bookId);
  $scope.currentChapterIndex = parseInt($routeParams.chapterId);
  $scope.nextChapterIndex = $scope.currentChapterIndex + 1;

}]);

chapter.html

<a class="button back" href="#/books/{{ currentBook }}">Back</a>
<div class="chapter" ng-repeat="chapter in book.chapters">
  <p><span class="title"> {{book.title}} </span> <span class="author"> {{book.author}} </span></p>
  <h2 class="chapter-title"> {{chapter.title}} </h2>

  <p ng-repeat="paragraph in chapter.paragraphs">{{ paragraph }}</p>

  <a class="button next" href="#/books/{{ currentBookIndex }}/chapters/{{ nextChapterIndex }}">Next</a>
</div>

Route

.when('/books/:bookId/chapters/:chapterId', {
    controller: 'ChapterController',
    templateUrl: 'views/chapter.html'
  })
CamperBot
@camperbot
Oct 28 2015 07:29
:trollface: troll problems? notify admins here
Abhisek Pattnaik
@abhisekp
Oct 28 2015 07:30
@harry9656 i'm fine thanks! How are you? Which topic are you at?
CamperBot
@camperbot
Oct 28 2015 07:30
abhisekp sends brownie points to @harry9656 :sparkles: :thumbsup: :sparkles:
:star: 297 | @harry9656 | http://www.freecodecamp.com/harry9656
DTing
@dting
Oct 28 2015 07:31
@Rolandisimo whats your books service look like?
Reegan
@ReeganArockiasmy
Oct 28 2015 07:32
@harry9656 @coltonehrman @Masd925 thanks
CamperBot
@camperbot
Oct 28 2015 07:32
reeganarockiasmy sends brownie points to @harry9656 and @coltonehrman and @masd925 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for masd925
:star: 283 | @coltonehrman | http://www.freecodecamp.com/coltonehrman
:star: 298 | @harry9656 | http://www.freecodecamp.com/harry9656
Singh Harpal
@harry9656
Oct 28 2015 07:33
@abhisekp I am at uni right now. Doing linear algebra. :p
So will talk to you later.
Bye :wave:
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:33
@dting
app.factory('books', ['$http', function($http) {
    return $http.get('https://s3.amazonaws.com/codecademy-content/courses/ltp4/books-api/books.json')
  .success(function(data) {
      return data;
  })
  .error(function(data) {
      return data;
  });
}]);
DTing
@dting
Oct 28 2015 07:34
@Rolandisimo also https://docs.angularjs.org/api/ng/directive/ngHref if you are going to use hashes in your href
but thats not your problem
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:35
@dting Thanks for the heads up.
DTing
@dting
Oct 28 2015 07:36
@Rolandisimo when you put a console.log inside that success callback function does it get logged whenever you click next?
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:40
@dting Yes, it gets logged if I add that.
DTing
@dting
Oct 28 2015 07:42
    $scope.book = data[$routeParams.bookId];
    $scope.chapter = data[$routeParams.chapterId];
this looks fishy to me
whats your data look like?
oh
i guess i can just look
Aayush Kapoor
@xeoneux
Oct 28 2015 07:43
Hi
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:43
The success data are 3 objects.
@dting
DTing
@dting
Oct 28 2015 07:44
@Rolandisimo i feel like that might be
$scope.book = data[$routeParams.bookId];
$scope.chapter = $scope.book.chapters[$routeParams.chapterId];
Aayush Kapoor
@xeoneux
Oct 28 2015 07:44
Shouldn't tests be a little more strict in the Bonfires?
I passed Everything Be True with
function every(collection, pre) {
  return typeof pre === "string" ? true : false;
}
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:47
@dting Yeah, probably. The chapter.html is somewhat wrong. I feel I get the ng-reapeats wrong or/and data bindings.
Aayush Kapoor
@xeoneux
Oct 28 2015 07:47
And Finders Keepers with
function find(arr, func) {
  return arr.filter(func)[0];
}
And Drop it with
function drop(arr, func) {
  return arr.filter(func);
}
Abhisek Pattnaik
@abhisekp
Oct 28 2015 07:47
about @Masd925
CamperBot
@camperbot
Oct 28 2015 07:47
:warning: no user found for masd925
DTing
@dting
Oct 28 2015 07:48
@Rolandisimo well if you are trying to display a single chapter you probably dont need a repeat in that view
it looks like your chapters view is displaying the entire book
Abhisek Pattnaik
@abhisekp
Oct 28 2015 07:48
about @SaintPeter
CamperBot
@camperbot
Oct 28 2015 07:48
:star: 1244 | @saintpeter | http://www.freecodecamp.com/saintpeter
Abhisek Pattnaik
@abhisekp
Oct 28 2015 07:48
@Masd925 :point_up: October 28, 2015 1:18 PM
FreeCodeCamp/FreeCodeCamp#3951
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:48
@dting :/ Exactly, just having a hard time figuring out the proper bindings.
@dting Yes, the whole book is displayed at once right now. I guess I need a ng-repeat only in the paragraph and proper bindings elsewhere.
DTing
@dting
Oct 28 2015 07:50
<a class="button back" href="#/books/{{ currentBook }}">Back</a>
<div class="chapter">
  <h2 class="chapter-title"> {{chapter.title}} </h2>

  <p ng-repeat="paragraph in chapter.paragraphs">{{ paragraph }}</p>

  <a class="button next" href="#/books/{{ currentBookIndex }}/chapters/{{ nextChapterIndex }}">Next</a>
</div>
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:52
@dting Yes, much obliged to you again. :) I was going in circles close to this solution.
@dting Thanks
CamperBot
@camperbot
Oct 28 2015 07:55
rolandisimo sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1476 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Oct 28 2015 07:56

controller

app.controller('ChapterController', ['$scope', 'books', '$routeParams', function($scope, books, $routeParams) {
  books.success(function(data) {
    var chapters = data[$routeParams.bookId].chapters;
    $scope.chapter = chapters[$routeParams.chapterId];

    // If there no more chapters left, go back to the bookshelf view
    if($routeParams.chapterId >= chapters.length - 1) {
      $scope.nextChapterIndex = "#";
    }
  });

  // Using these properties to create the URLs in line 1 and line 11 of view/chapter.html
  $scope.currentBookIndex = parseInt($routeParams.bookId);
  $scope.nextChapterIndex = parseInt($routeParams.chapterId) + 1;
}]);

chapter.html

<a class="button back" href="#/books/{{ currentBookIndex }}">Back</a>
<div class="chapter">
  <h2 class="chapter-title"> {{chapter.title}} </h2>

  <p ng-repeat="paragraph in chapter.paragraphs">{{ paragraph }}</p>

  <a class="button next" href="#/books/{{ currentBookIndex }}/chapters/{{ nextChapterIndex }}">Next</a>
</div>
CamperBot
@camperbot
Oct 28 2015 07:56
:trollface: troll problems? notify admins here
DTing
@dting
Oct 28 2015 07:56
np
Rolands Jegorovs
@Rolandisimo
Oct 28 2015 07:59
@dting Cool. Could you please explain the things you're doing here? Why is parseInt a better solution, creating a VAR etc?
DTing
@dting
Oct 28 2015 08:01
if you aren't binding the variable then you don't need to expose it by making it a scope var
21igor
@21igor
Oct 28 2015 08:10

Hi all!
Please help!
How to add the property in this case:
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.

DTing
@dting
Oct 28 2015 08:12
@21igor var myCar = new Car; will set myCar to the Car function
err
h4r1m4u
@h4r1m4u
Oct 28 2015 08:13
@21igor
var myDog = new Dog(); // creating object Dog
myDog.legs = 4; // adding property legs to myDog
now modify it for your own case of myCar
DTing
@dting
Oct 28 2015 08:14
you forgot new
h4r1m4u
@h4r1m4u
Oct 28 2015 08:14
shite, you're right. thanks @dting
CamperBot
@camperbot
Oct 28 2015 08:14
h4r1m4u sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1477 | @dting | http://www.freecodecamp.com/dting
21igor
@21igor
Oct 28 2015 08:15
@h4r1m4u
how to add the code to this chat loocking like a code with different colors and black background?
h4r1m4u
@h4r1m4u
Oct 28 2015 08:17
wiki format
CamperBot
@camperbot
Oct 28 2015 08:17

: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 28 2015 08:17
@21igor see above. the key is using the backtick key (which should be under escape on your keyboard)
DTing
@dting
Oct 28 2015 08:18
hmm i guess i was wrong
apparently javascript allows var myCar = new Car;
21igor
@21igor
Oct 28 2015 08:18
@camperbot
Morgan
@MorganK95
Oct 28 2015 08:27
Evening all, anyone here familar with git pages?
Z.G.Hao
@akidox
Oct 28 2015 08:40
Is "property" and "attribute" mean the same thing in HTML?
h4r1m4u
@h4r1m4u
Oct 28 2015 08:44
@akidox there's a subtle difference: http://stackoverflow.com/questions/6003819/properties-and-attributes-in-html. but when talking purely about HTML code, you'd typically say that an element has an attribute (which can be class, name, id, value, etc.), not a property
Marcin Sawicki
@Sawik8888
Oct 28 2015 08:44
'''
Nest two div class="col-xs-6" elements within your div class="row" element.
Make sure all your div elements have closing tags.
CamperBot
@camperbot
Oct 28 2015 08:44
:bulb: to format code use backticks! ``` more info
Marcin Sawicki
@Sawik8888
Oct 28 2015 08:45

'''

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row div" class="col-xs-6" div class="col-xs-6">

</div>
</div>
'''

CamperBot
@camperbot
Oct 28 2015 08:45
:bulb: to format code use backticks! ``` more info
Z.G.Hao
@akidox
Oct 28 2015 08:46
thanks a lot @h4r1m4u
CamperBot
@camperbot
Oct 28 2015 08:46
akidox sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 376 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 08:46
you're welcome
eren
@r4pp3r
Oct 28 2015 08:49
help me pls
CamperBot
@camperbot
Oct 28 2015 08:49
no wiki entry for: me pls
:pencil: click here to create one now!after creating your page type update to reload it here
eren
@r4pp3r
Oct 28 2015 08:49

Your p elements should use the font Monospace. <p font-size: 16px; class="red-text" { font-family: Monospace; }>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>

help me

Pratik Ratnaparkhi
@pratikr1593
Oct 28 2015 08:50
function reverseString(str) {
  return str;
}
var myArray = ['hello', 'howdy', 'greetings from earth'];
myArray.reverse(); 




reverseString("hello");
eren
@r4pp3r
Oct 28 2015 08:50
türk yok mu yardım etsin bana
Marcin Sawicki
@Sawik8888
Oct 28 2015 08:51
<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row div" class="col-xs-6" div class="col-xs-6">

  </div>
</div>
Create two div elements within your row, both with the class col-xs-6.
Nest two div class="col-xs-6" elements within your div class="row" element.
Make sure all your div elements have closing tags.
eren
@r4pp3r
Oct 28 2015 08:52
help me pls;
Your p elements should use the font Monospace.
;
CamperBot
@camperbot
Oct 28 2015 08:52
no wiki entry for: me plsyour p elements should use the font monospace
:pencil: click here to create one now!after creating your page type update to reload it here
Dustin Frank
@DustInCompetent
Oct 28 2015 08:52
@Sawik8888 you can't put a div into another div tag
h4r1m4u
@h4r1m4u
Oct 28 2015 08:53
@Sawik8888 this is how you nest divs (or any html elements):
<div class="outer"> <!-- outer div -->
  <div class="inner">some div</div> <!-- nested div (child of outer div) -->
  <div class="inner">some other div</div> <!-- nested div (child of outer div) -->
</div>
marzelin
@marzelin
Oct 28 2015 08:54
@Sawik8888 tag is some letters put between < and >.
If you see something between < and > this is an HTML tag.
there are two kinds of HTML tags: opening tag, and closing tag.
the only difference between them are that the closing tag has /. like in </div>
Z.G.Hao
@akidox
Oct 28 2015 08:55
I'd better read it later,can't understand it at all!😂 @h4r1m4u
Marcin Sawicki
@Sawik8888
Oct 28 2015 08:58
I got it @h4r1m4u thanks for your help :)
CamperBot
@camperbot
Oct 28 2015 08:58
sawik8888 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 377 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 08:58
@akidox ha. the simple, short answer is use 'attributes' when talking about HTML elements. in 95% cases you'll be right, and even in the remaining 5% people will know what you're referring to.
@Sawik8888 good work!
marzelin
@marzelin
Oct 28 2015 08:59
opening tag, content, and closing tag are known as HTML element: <opening tag> content</closing tag>
Z.G.Hao
@akidox
Oct 28 2015 09:00
Ok,got it.Thanks again. @h4r1m4u
CamperBot
@camperbot
Oct 28 2015 09:00
akidox sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: akidox already gave h4r1m4u points
Z.G.Hao
@akidox
Oct 28 2015 09:02
I'll keep the source page till one day I can understand it.
LM
@s3cur3n3t
Oct 28 2015 09:12
rning I'm having trouble turning a string into an array
can anyone help me please
Ihab Baghdadi
@ijb87
Oct 28 2015 09:13
what's your string?
sorry not that one
@s3cur3n3t what's your string?
LM
@s3cur3n3t
Oct 28 2015 09:16
var str = "Turntable";
Ihab Baghdadi
@ijb87
Oct 28 2015 09:16
use str.split("";
str.split("");
that will make each letter an element of an array
so declare an array and assign it to the method
you can say:
var str = str.split("");
LM
@s3cur3n3t
Oct 28 2015 09:18
ok
Ankit Panwar
@coderNoob
Oct 28 2015 09:20
This code keeps returning "Undefined" to me for str="abce". Why?
function fearNotLetter(str) {
  var start = str.charCodeAt(0);
  var end = str.charCodeAt(str.length-1);
  var missing;
  for(var i = start; i<=end; i++,start++){
    if(str[i]!=start){
      missing = str[i];
      break;
    }
  }
  return missing;
}
LM
@s3cur3n3t
Oct 28 2015 09:23
ijb87 I did that a«but giving me error str.split it's not a function
w:(
marzelin
@marzelin
Oct 28 2015 09:25
@coderNoob look at this piece of code if(str[i]!=start){ what you compare here? str[i] (a lettter) with start which is a number). Something is wrong here.
Ankit Panwar
@coderNoob
Oct 28 2015 09:26
@marzelin I just noticed and tried if(str.charCodeAt(i)!=start). Didn't work.
Raghu Ranganathan
@razetime
Oct 28 2015 09:26
@s3cur3n3t you probably left a semicolon.
LM
@s3cur3n3t
Oct 28 2015 09:28
veryfied all the semicolons @razetime :(
semicolons are therer
Raghu Ranganathan
@razetime
Oct 28 2015 09:29
Show ur code
LM
@s3cur3n3t
Oct 28 2015 09:29
on the places they should be
marzelin
@marzelin
Oct 28 2015 09:30
@coderNoob look what you assign i to in your for loop. I assume you want i to represent indexes of the str. Make it be so.
Raghu Ranganathan
@razetime
Oct 28 2015 09:30
Show your code
there are other people that can help
@s3cur3n3t
LM
@s3cur3n3t
Oct 28 2015 09:31

function str(string){
return string;
};

var str = str.split("");
str("Turntable")

yes I have the semicolon on the str("Turntable");
Aayush Kapoor
@xeoneux
Oct 28 2015 09:31
@s3cur3n3t Which Bonfire?
marzelin
@marzelin
Oct 28 2015 09:32
@s3cur3n3t it's very important to place your code in the right spot.
you want it to be a part of the function.
LM
@s3cur3n3t
Oct 28 2015 09:33
ok, ok
thanks let me give it a try again
CamperBot
@camperbot
Oct 28 2015 09:33
if you want to thank someone, put an @ before their name!
LM
@s3cur3n3t
Oct 28 2015 09:35
thanks @xeoneux @marzelin
CamperBot
@camperbot
Oct 28 2015 09:35
s3cur3n3t sends brownie points to @xeoneux and @marzelin :sparkles: :thumbsup: :sparkles:
:star: 304 | @xeoneux | http://www.freecodecamp.com/xeoneux
:star: 407 | @marzelin | http://www.freecodecamp.com/marzelin
LM
@s3cur3n3t
Oct 28 2015 09:35
wow
this is nice
and @xeonux the bonfire one
yes
Mihuleac Sergiu
@physicalit
Oct 28 2015 10:12
hi! for Waypoint: Target the same element with multiple jQuery Selectors don't know i get Only add one class with each of your three selectors. with X my code is $("button"),$(".btn"),$("#target1").addClass("animated shake btn-primary");
araa
@retrospective5
Oct 28 2015 10:35
Hi all! I wonder why "var expression" is not /\S+/ to find multiple occurences of non-space characters? Re: Waypoint: Invert Regular Expression Matches with JavaScript. What's the regex then if I needed to find a single non-space character? Appreciate help, thks!!
DavinaTaylor
@lilvina
Oct 28 2015 10:36
Hi, I was doing an algorithm factorial challenge and it seems I have an infinite loop running. Whenever I try to refresh the page, it doesn't do anything. How do you get out of an infinite loop on FreeCodeCamp?
araa
@retrospective5
Oct 28 2015 10:37
@lilvina Close and reopen the browser tab/window?
Rick
@rick1827
Oct 28 2015 10:37
stuck
DavinaTaylor
@lilvina
Oct 28 2015 10:37
@retrospective5 I tried that and it doesn't work.
Rick
@rick1827
Oct 28 2015 10:38
font awesome waypoint
<i class="btn btn-block btn-primary fa fa-thumbs-up">Like</i>
nest your i element within your button element
Rick
@rick1827
Oct 28 2015 10:43
not sure about what i did wrong
Yusef Habib
@yhabib
Oct 28 2015 10:46
@rick1827
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i>Like</button>
Rick
@rick1827
Oct 28 2015 10:46
?
Wow
Yusef Habib
@yhabib
Oct 28 2015 10:46
you have to insert the i element inside the button, otherwhise there is no button
Firewolfx25
@Firewolfx25
Oct 28 2015 11:51
hi guys i am having trouble with the responsive style radio buttons
it isn't working even though i wrap all buttons in a row div and each button in its own div
any suggestions?
Arnis Jaundzeikars
@SangSatori
Oct 28 2015 11:57
@MorganK95 I'm not sure if anyone replied yet; if you mean GitHub Pages, yeah, I have a small personal page hosted there.
dstreeter
@dstreeter
Oct 28 2015 11:57
Hi all,
Yogaraj
@yoga30696
Oct 28 2015 11:58
hello..
Øistein Haugland
@oisteinhaugland
Oct 28 2015 11:58
@dstreeter hi
Yogaraj
@yoga30696
Oct 28 2015 11:58
I'm looking for a help.. Could someone help me?
Jason Wood
@catapixel
Oct 28 2015 11:58
@yoga30696 what's your question?
Arnis Jaundzeikars
@SangSatori
Oct 28 2015 11:58
@MorganK95 If still relevant, my page is here - https://github.com/SangSatori/SangSatori.github.io/tree/master - happy to answer questions though there might be a delay.
And yes, ask ahead.
Yogaraj
@yoga30696
Oct 28 2015 11:59
reverse the string.
Jason Wood
@catapixel
Oct 28 2015 11:59
@yoga30696 what does your code look like so far?
Yogaraj
@yoga30696
Oct 28 2015 11:59
I used
var string = str.split(" ");
but its not working
Jason Wood
@catapixel
Oct 28 2015 11:59
string is a keyword. Just use another name for your variable
Yogaraj
@yoga30696
Oct 28 2015 12:00
Oh!! Thanks @catapixel
CamperBot
@camperbot
Oct 28 2015 12:00
yoga30696 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 525 | @catapixel | http://www.freecodecamp.com/catapixel
dstreeter
@dstreeter
Oct 28 2015 12:00
I'm on the waypoint 'give your JavaScript Slot Machine some stylish images'. I've completed the challenge but I don't really understand some of the code I had to use.
Jason Wood
@catapixel
Oct 28 2015 12:00
np
@dstreeter which part? What's your question about it?
dstreeter
@dstreeter
Oct 28 2015 12:01
$($(".slot")[0]).html('<img src = "' + images[slotOne-1] + '">');
I'm unsure of why the -1 is added to the end of slotOne?
I understand that I'm pulling an image based on the number generated, but what is the -1 actually saying?
Jason Wood
@catapixel
Oct 28 2015 12:03
Subtract 1 from the value held in the slotOne variable and the supply that index of the array
You need to do this because of the equation that you use to assign slotOne vs the way the images are indexed in the array. 0-2 for array but 1-3 for slots.
Arnis Jaundzeikars
@SangSatori
Oct 28 2015 12:06
Related to counting starting from zero (as in most programming languages), or no? Just curious. I haven't done that yet.
Jason Wood
@catapixel
Oct 28 2015 12:07
@dstreeter make sense now?
@SangSatori yes, in Javascript everything is zero indexed like most other languages
dstreeter
@dstreeter
Oct 28 2015 12:08

thanks @catapixel

That makes a lot of sense!

CamperBot
@camperbot
Oct 28 2015 12:08
dstreeter sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 526 | @catapixel | http://www.freecodecamp.com/catapixel
dstreeter
@dstreeter
Oct 28 2015 12:08
@catapixel Really useful
Jason Wood
@catapixel
Oct 28 2015 12:08
np
Yogaraj
@yoga30696
Oct 28 2015 12:16
@catapixel how to check palindrome in javascript
function palindrome(str) {
  // Good luck!
  str=str.toLowerCase();
  return str == str.split('').reverse().join('');
}
Here is my code!
Piyush Vats
@piyushv
Oct 28 2015 12:16
@yoga30696 ur not stripping punctuation
Yogaraj
@yoga30696
Oct 28 2015 12:17
@piyushv can't understand.. please elaborate
Piyush Vats
@piyushv
Oct 28 2015 12:18
to check for palindrome u need to remove all punctuation and spaces before checking to see if string is the same when reversed. ur code only splits reverses and joins.
Yogaraj
@yoga30696
Oct 28 2015 12:18
How to strip the punctuation?
Piyush Vats
@piyushv
Oct 28 2015 12:20
@yoga30696 the same way you find whitespaces waypoint find whitespaces
Yogaraj
@yoga30696
Oct 28 2015 12:21
Thanks @piyushv
CamperBot
@camperbot
Oct 28 2015 12:21
yoga30696 sends brownie points to @piyushv :sparkles: :thumbsup: :sparkles:
:star: 236 | @piyushv | http://www.freecodecamp.com/piyushv
Louis Swaans
@SenpaiMechtronix
Oct 28 2015 12:21
how do i copy my code?
Piyush Vats
@piyushv
Oct 28 2015 12:21
no worries @yoga30696
anthonygallina1
@anthonygallina1
Oct 28 2015 12:28
Does any one know where to post a issue if your portfolio is messed up?
normalactivity
@normalactivity
Oct 28 2015 12:44
Hi can someone help me with the code below?

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

Dustin Frank
@DustInCompetent
Oct 28 2015 12:47
@normalactivity you got a Car Object called myCar, which has a property called myCar.wheelswith a value of 4
now also add myCar.engines as property
normalactivity
@normalactivity
Oct 28 2015 12:49
yes @DustInCompetent thank you so much. I understood it now.
CamperBot
@camperbot
Oct 28 2015 12:49
normalactivity sends brownie points to @dustincompetent :sparkles: :thumbsup: :sparkles:
:star: 55 | @dustincompetent | http://www.freecodecamp.com/dustincompetent
Dustin Frank
@DustInCompetent
Oct 28 2015 12:50
np.
anthonygallina1
@anthonygallina1
Oct 28 2015 12:55
Does any one know the right place to post a issue if your portfolio is messed up?
h4r1m4u
@h4r1m4u
Oct 28 2015 12:56
still working on the portfolio @anthonygallina1 ? :D
(here's fine, or in the HelpZiplines channel)
anthonygallina1
@anthonygallina1
Oct 28 2015 13:01
@h4r1m4u my porfolio is jacked there are multiple listings and things I have completed are gone cant look back to help others afriad to do anything really
h4r1m4u
@h4r1m4u
Oct 28 2015 13:02
sorry to hear that @anthonygallina1 i've never had that issue with codepen. did you save the updates you made (in case you have the auto-saving featured disabled)?
Tommy Izen
@TommyIzen
Oct 28 2015 13:04
Bonfire Chunky Monkey hint
CamperBot
@camperbot
Oct 28 2015 13:04
Sorry, can't find a bonfire called chunky monkey hint. [ Check the map? ]
Tommy Izen
@TommyIzen
Oct 28 2015 13:04
Bonfire Chunky Monkey
CamperBot
@camperbot
Oct 28 2015 13:04

: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

Tommy Izen
@TommyIzen
Oct 28 2015 13:04
Bonfire Chunky Monkey | hint
CamperBot
@camperbot
Oct 28 2015 13:04
Sorry, can't find a bonfire called chunky monkey hint. [ Check the map? ]
Tommy Izen
@TommyIzen
Oct 28 2015 13:05
hint
CamperBot
@camperbot
Oct 28 2015 13:05
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Matt Leonard
@matty22
Oct 28 2015 13:05
@anthonygallina1 I've found Codepen to be flaky and just overall kind of difficult to use. I code in Sublime Text 2 and then paste what I've done into Codepen. That way I keep copies of everything on my machine and in OneDrive.
Anthony
@Guzko
Oct 28 2015 13:06
I need help creating a class called pin-text with the element h1.
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
 h1 {color: pink;}
</style>
<h1>Hello World!</h1>
*pink-text
anthonygallina1
@anthonygallina1
Oct 28 2015 13:07
@matty22 I started along time ago Can you look at my portfolio?
Matt Leonard
@matty22
Oct 28 2015 13:08
I only have about 10 minutes before I have to head off to work, but I can give it a quick once over.
h4r1m4u
@h4r1m4u
Oct 28 2015 13:08
@matty22 i do it the other way round. i code in codepen, then export the project once i'm done for backup
Matt Leonard
@matty22
Oct 28 2015 13:08
@h4r1m4u How can you stand to code in that little tiny box?
anthonygallina1
@anthonygallina1
Oct 28 2015 13:08
@h4r1m4u I have been doing that lately also
Ráfaga Gianesini
@rafagaseo
Oct 28 2015 13:08
@Guzko <h1 class="pink-text></h1>
h4r1m4u
@h4r1m4u
Oct 28 2015 13:08
@Guzko <h1 class="some-class">text</h1> this is how you give 'some-class' class to <h1>
@matty22 24" screen
Ráfaga Gianesini
@rafagaseo
Oct 28 2015 13:09
<h1 class="pink-text"></h1>
h4r1m4u
@h4r1m4u
Oct 28 2015 13:09
i move the editors around. mostly i change the JS code, the CSS and HTML doesn't change that much
Matt Leonard
@matty22
Oct 28 2015 13:09
@h4r1m4u Even so, I can't stand being confined to 1/6 of the screen.
h4r1m4u
@h4r1m4u
Oct 28 2015 13:09
so basically I have the JS code pane taking most of the screen space
you know you can resize the editors, yeah?
fjurcev
@fjurcev
Oct 28 2015 13:10
@Guzko you need to create class pink-text
.pink-text{color: pink;}
Matt Leonard
@matty22
Oct 28 2015 13:10
Yeah, I just would prefer for the preview pane to be in a separate browser window from the code.
h4r1m4u
@h4r1m4u
Oct 28 2015 13:10
i hear you. that'd be a nice feature
i use Sublime when doing actual work, but for these FCC projects I've found CodePen sufficient
Anthony
@Guzko
Oct 28 2015 13:12
This is what I got but it didnt work
  }
 .pink-text{color: pink;}
</style>
<h1 class=¨pink-text>Hello World!</h1>
Matt Leonard
@matty22
Oct 28 2015 13:12
@Guzko missing your closing " after pink-text
Anthony
@Guzko
Oct 28 2015 13:12
I just noticed thanks @matty22
CamperBot
@camperbot
Oct 28 2015 13:12
guzko sends brownie points to @matty22 :sparkles: :thumbsup: :sparkles:
fjurcev
@fjurcev
Oct 28 2015 13:12
@Guzko "pink-text"
CamperBot
@camperbot
Oct 28 2015 13:13
:star: 211 | @matty22 | http://www.freecodecamp.com/matty22
Anthony
@Guzko
Oct 28 2015 13:13
thanks
CamperBot
@camperbot
Oct 28 2015 13:13
if you want to thank someone, put an @ before their name!
anthonygallina1
@anthonygallina1
Oct 28 2015 13:13
looks like ti is on top move it down
Anthony
@Guzko
Oct 28 2015 13:14
What is wrong with this
color: green;
  }
 .pink-text {color:pink;}
</style>
<h1 class=¨pink-text¨>Hello World!</h1>
anthonygallina1
@anthonygallina1
Oct 28 2015 13:14
@matty22 how did the portfolio look? I had a 1hr panel interview for a job today and I think they are going to check.
Matt Leonard
@matty22
Oct 28 2015 13:15
You never sent it to me?
anthonygallina1
@anthonygallina1
Oct 28 2015 13:15
My FCC portfolio
Matt Leonard
@matty22
Oct 28 2015 13:16
Where is it?
Anthony
@Guzko
Oct 28 2015 13:16
This might be dumb question but I just started coding, and was wondering how do I make a portfolio with all the code that I do that isnt on FCC, do I do it on GitHub?
fjurcev
@fjurcev
Oct 28 2015 13:17
@Guzko you write it with the knowledge you earn before
Matt Leonard
@matty22
Oct 28 2015 13:18
@Guzko Honestly, when you're just getting started just save it in a folder on your computer. Github can be difficult to grasp in itself and trying to learn it at this stage will just slow you down in learning more interesting stuff.
Anthony
@Guzko
Oct 28 2015 13:18
What should I use to code, not on FCC?
anthonygallina1
@anthonygallina1
Oct 28 2015 13:19
What OS @Guzko
fjurcev
@fjurcev
Oct 28 2015 13:19
@Guzko you can use codepen.io
Anthony
@Guzko
Oct 28 2015 13:19
Thanks for all the help I gtg class ended. Will be back later.
CamperBot
@camperbot
Oct 28 2015 13:19
if you want to thank someone, put an @ before their name!
Matt Leonard
@matty22
Oct 28 2015 13:20
@anthonygallina1 My only critique is that your portfolio section is really busy. I'd replace the background image with something more solid because it's hard to tell which of those shapes are projects you've done and which are fuzzy background images.
anthonygallina1
@anthonygallina1
Oct 28 2015 13:20
yep jacked
Matt Leonard
@matty22
Oct 28 2015 13:21
Quick fix, just remove the background image and replace it with a very light gray background color.
Then also try to center that section as it's a bit off center.
I dont have server access to that I dont think]
Matt Leonard
@matty22
Oct 28 2015 13:23
Give the text under each of your projects some padding-top so it isn't riding right up against the project image
Misspelled "management" under your CMS project
anthonygallina1
@anthonygallina1
Oct 28 2015 13:24
@matty22 are you talking about a pen?
Matt Leonard
@matty22
Oct 28 2015 13:24
The portfolio you sent. It's in codepen, yes.
anthonygallina1
@anthonygallina1
Oct 28 2015 13:25
NO my Free Code Camp portfolio I keep dropping the link to.
:)
Matt Leonard
@matty22
Oct 28 2015 13:25
Oh, what type of feedback are you asking about on that?
anthonygallina1
@anthonygallina1
Oct 28 2015 13:27
Where to file a issue in the right place. Because I had a 1hr panel interview for a job and they will be looking at it. And it seems to have mulitiple entries fro things and much much much of my code is gone.
Piyush Vats
@piyushv
Oct 28 2015 13:28
hi guys just did the mutation bonfire MUTATIONS. ive completed the task but just wondering again if someone can talk me through how i can be more efficient. i feel like im using too many steps to solve the problem.
function mutation(arr) {

  for(i=0 ; i < arr[1].length; i++){
   if (arr[0].toLowerCase().indexOf(arr[1].toLowerCase().charAt(i)) < 0) {
     return false;
   }
    else {
      if (i === ((arr[1].length)-1)) {
        return true;
      }
    }   
  } 
}

mutation(["hello", "hey"]);
anthonygallina1
@anthonygallina1
Oct 28 2015 13:28
Is that what you are seeing when you check it?
@piyushv HI!
Piyush Vats
@piyushv
Oct 28 2015 13:29
@anthonygallina1 hi mate
marzelin
@marzelin
Oct 28 2015 13:31
@piyushv it's hard to tell what your code does, use some comments.
Muneshwar
@muneshwar
Oct 28 2015 13:34
hello
Kiy-Hong Tang
@kiytang
Oct 28 2015 13:37

Hi fellow campers, can anyone kindly explain how the inserted console.log(numbers) produces the output below. Thank you

var numbers = [4, 2, 5, 1, 3];
numbers.sort(function(a, b) {
   console.log(numbers);
   return a - b 
});

[ 4, 2, 5, 1, 3 ]
[ 2, 4, 5, 1, 3 ]
[ 2, 4, 5, 1, 3 ]
[ 2, 4, 5, 5, 3 ]
[ 2, 4, 4, 5, 3 ]
[ 1, 2, 4, 5, 3 ]
[ 1, 2, 4, 5, 5 ]
[ 1, 2, 4, 4, 5 ]
[ 1, 2, 3, 4, 5 ]

anthonygallina1
@anthonygallina1
Oct 28 2015 13:38
Sure let me pull up that one at look at it.
Oh wait I cant.
Joseph Botros
@josephwasily
Oct 28 2015 13:39
:D
Joe Hill
@cupofjoey
Oct 28 2015 13:40
lol
Joseph Botros
@josephwasily
Oct 28 2015 13:41
probably the call back function does nothing,what it executes is only the console.log(numbers), which the logging of the array while it is mutated
Blauelf
@Blauelf
Oct 28 2015 13:54
@piyushv 1st: Create and use a lowerCase copy of those strings, so you won't have to call toLowerCase() for each character.
2nd: You don't have to check if you are in the final loop, as you can always return true if the for loop finishes without returning false first. Just put a return true; after your for loop and remove the else path.
3rd: Less efficient, but shorter, could be a version with some() or every().
Piyush Vats
@piyushv
Oct 28 2015 13:57
hi guys if i were to run arr.filter(Boolean) on [7, "ate", "", false, 9, 1, "true"] why is the resulting array [7, "ate", 9, 1, "true"]
why does it only get rid of falsy and not truthy values?
@Blauelf thanks mate that helps a lot.
CamperBot
@camperbot
Oct 28 2015 14:00
piyushv sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 403 | @blauelf | http://www.freecodecamp.com/blauelf
Blauelf
@Blauelf
Oct 28 2015 14:03
@piyushv Boolean(value) returns false for falsy and true for truthy values, and filter() returns the values the given function returns a truthy return value for.
t1melord
@t1melord
Oct 28 2015 14:11

Create a second p element with the following 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.

Then, inside your <style> element, set the font-size of all p elements to 16 pixels.

Font size is controlled by the font-size CSS property, like this: h1 { font-size: 30px; }.

See if you can figure out how to give both of your p elements the font-size of 16 pixels (16px). You can do this inside the same <style> tag that we created for your red-text class.

CamperBot
@camperbot
Oct 28 2015 14:11
:trollface: troll problems? notify admins here
Bruhman503
@Bruhman503
Oct 28 2015 14:11
I can't seem to passed the "create custom heading" waypoint in the bootstrap chapter. It's asking to set col-xs-8 for my heading and col-xs-4 for my resting cat photo....after I do so I can't advance.
t1melord
@t1melord
Oct 28 2015 14:11
anyone know how to do this?
Bruhman503
@Bruhman503
Oct 28 2015 14:12

here is my code. if there is a better way to post it let me know.

<div class="container-fluid">
<div class="row">
<h2 class=" col-xs-8 text-primary text-center">CatPhotoApp</h2>

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

</div>

Joseph Botros
@josephwasily
Oct 28 2015 14:13
there is missing closing tag for the div container fluid
Bruhman503
@Bruhman503
Oct 28 2015 14:14
@josephwasily im sorry. but that is already there. I didn't want to post ALL of my code since it's somewhat lengthy at this point
Joseph Botros
@josephwasily
Oct 28 2015 14:14
xs-8 means only in the the extra smalll devices create (2/3) columns element, and the rest (1/3) another element
Bruhman503
@Bruhman503
Oct 28 2015 14:14
@josephwasily one of the previous lessons was to put all of my code in a container-fluid class....so the closing div was at the end. that was my mistake.
The code responds perfectly and does what it's supposed to do....but I can't advance.
Joseph Botros
@josephwasily
Oct 28 2015 14:16
what is the error that didn't make you advance?
or what level are you in?
Bruhman503
@Bruhman503
Oct 28 2015 14:18
@josephwasily i am in level 12 in the boostrap section. The error states that I do not have the img set in col-xs-4 (although I can see it is) and that the h2 element is not in col-xs-8 as well. (both are there and working properly)
Joseph Botros
@josephwasily
Oct 28 2015 14:19
ok you need to add each element of them inside a div element
what you have done is editing the classes of the existing elements
<div class="container-fluid">
<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-> </thick-green->border" src="https://bit.ly/fcc-relaxing-cat"></a></div>
</div>
</div>
@Bruhman503 ok?
Bruhman503
@Bruhman503
Oct 28 2015 14:21
ah. I see.
Joseph Botros
@josephwasily
Oct 28 2015 14:22
also the idea of <thick-green> isn't obvious, is it a tag or class name
the tag can't be inside a value of property class, only the class names that is used to manipulate css
Bruhman503
@Bruhman503
Oct 28 2015 14:23
@josephwasily thank you. Also...this is a silly question but how SHOULD I post my code in the room?
CamperBot
@camperbot
Oct 28 2015 14:23
bruhman503 sends brownie points to @josephwasily :sparkles: :thumbsup: :sparkles:
:star: 245 | @josephwasily | http://www.freecodecamp.com/josephwasily
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:25
There is something really fundamental here that I'm not understanding. This is the first time I've created an object like this and I'm getting back the error message: "this.playSimon is not a function" Why?
marzelin
@marzelin
Oct 28 2015 14:26
@TheHighPriestess this is not what you think it is
Sarai Flowers
@MadreDeLobos
Oct 28 2015 14:39

This is saying my P element shoud have the text "View More " with a space after it .. idk why its not working. ..
```<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> blah blah blah blah View More
<a href="http://www.freecatphotoapp.com"> Cat Photos </a> </p>

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
```

Bruhman503
@Bruhman503
Oct 28 2015 14:42
@c0d9x try placing "view more" inbetween the closing a tag and the closing P tag
<p>
<a href="http://www.freecatphotoapp.com"> Cat Photos </a>View more </p>
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:43
@marzelin ??
I don't think I need it.
it's someone else's code...pretty much
i'm just trying to see how it works
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:48
This person created a Game object
That's not the way I would have done it...but I was trying to understand how it works.
So far...I don't get it
I would have just used a bunch of functions
marzelin
@marzelin
Oct 28 2015 14:50
@TheHighPriestess have you removed something from that js code?
John Power
@powerjohn
Oct 28 2015 14:51
@TheHighPriestess have you tried removing the paranthesis from playSimon in the initialise function
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:51
yeah...a lot of it. I'm just testing parts of it..to learn how it works...doing it this way.
no...but it's a function
marzelin
@marzelin
Oct 28 2015 14:52
@TheHighPriestess this was important there
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:52
oh...i just removed them haha
i think maybe I should just do it using different functions...
instead of trying to figure out how it works
John Power
@powerjohn
Oct 28 2015 14:53
if you remove them the function is not called until the init function is called
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:53
i'm calling the initialize function
renquist
@renquist
Oct 28 2015 14:54
anyone help me with Waypoint: Use appendTo to Move Elements with jQuery
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:54
i get an error message saying that playSimon is not a function...but it is
renquist
@renquist
Oct 28 2015 14:54
it is asking me to append to the right-well
$("#target2").appendto("#right-well");
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:54
this is because i don't know how to work with objects
renquist
@renquist
Oct 28 2015 14:54
is my code^ is that incorrect
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 14:57
I hate to give up on this and go back to doing it the way I usually do it...because I was hoping to learn something new
but I have spent a lot of time on this so far...and I haven't really gotten anywhere
this seems like a crucial technique to understand
but few people seem to really understand it...which, I guess, should make me feel a bit better LOL
John Power
@powerjohn
Oct 28 2015 15:02
@TheHighPriestess what is the [play] selector i have never seen this syntax?
in your span
marzelin
@marzelin
Oct 28 2015 15:05
@TheHighPriestess hint: If function is defined within other function, you can't call it outside of that function.
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:06
I don't think i'm doing that...am i?
@powerjohn i haven't either
it advances the number
1st round....2nd round etc
I think I'm going to give up on this Game object idea and go back to just using a bunch of functions
I don't understand objects
Coira Ellison
@Coira
Oct 28 2015 15:11
@TheHighPriestess ugh, I know why that code's not working, but you're not going to like it... I don't like it!
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:11
that sounds ominous lol
Coira Ellison
@Coira
Oct 28 2015 15:12
stupid javascript stuff!
because you've bound a function in click, it looses scope and this doesn't refer to anything
(i think, this is new to me!)
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:13
hmm
well...it's an idea.
nobody really seems to understand object too well
Coira Ellison
@Coira
Oct 28 2015 15:13
so you can do var that = this and call that.playSimon(), but then as soon as you get into playsimon and use this, you run into trouble again
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:14
yes..i was thinking about this
I think I am going to give up this object idea
Coira Ellison
@Coira
Oct 28 2015 15:14
better off not using an object literal i think
marzelin
@marzelin
Oct 28 2015 15:14
@Coira you can use .bind() to change what this refers to
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:14
@TheHighPriestess don't give up on that... modular over spaghetti any day!!!
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:14
otherwise i will be here forever tring to figure it out
Coira Ellison
@Coira
Oct 28 2015 15:14
oh, try that ^ ^ , tell us if it works!
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:15
@ngalluzzo well...i mean..the create of a Game object and then all the fuctions as methods
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:15
I just went thru the same struggle making my first app
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:15
I'm just going to do it using different functions...no object
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:15
so many damn times I wanted to step away from it
Coira Ellison
@Coira
Oct 28 2015 15:15
what about an object with constructor (so it's not an object literal) ?
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:15
I don't understand objects
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:16
all the more reason to keep trying that :P
I just stepped in... so didn't see your original issue -- what was it?
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:16
it just wouldn't work...kept telling me that playSimon wasn't a function or something
Craig Morrison
@frogmorton
Oct 28 2015 15:16
Hey all, I've read the description of the bonfire "Make a Person", but I still don't understand what I'm meant to do
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:17
but is is a function...so I don't get it
h4r1m4u
@h4r1m4u
Oct 28 2015 15:18

@TheHighPriestess

    $("#start").on("click", function(){
    console.log('test');
    this.playSimon();
    });

'this' here refers to the #start button. not the Game object

that's why it's complaining it's not a function
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:18
@frogmorton here's some extra information about it
@h4r1m4u so...this isn't necessary?
Coira Ellison
@Coira
Oct 28 2015 15:19
can you pass scope in to on ?
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:19
@h4r1m4u i removed it but it still says that playSimon isn't defined
Coira Ellison
@Coira
Oct 28 2015 15:19
or context, or whatever the correct word is
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:19
wow..this is a tricky subject
i mean...i know what an object is...but I don't really know how to use one
this is why I avoid them
Craig Morrison
@frogmorton
Oct 28 2015 15:21
@TheHighPriestess I've already been to that page... I don't wish to look at the solution, but the hints don't really help me. I'm also kind of sucky with objects, and not confident in my use of them or "construction" of them.
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:21
@frogmorton join the club haha
nobody 'get's them
Craig Morrison
@frogmorton
Oct 28 2015 15:21
;)
h4r1m4u
@h4r1m4u
Oct 28 2015 15:21
you could do what @Coira suggested:
  initialize: function(){
    var that = this;
    $("#start").on("click", function(){
    console.log('test');
    that.playSimon();
    });
  },
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:22
ok...let me see what happens
now it says that compArray isn't defined
lol
Really...I think it's better if I ditch this object idea
@frogmorton is having the same problem I am. Objects are confusing.
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:24
I mean.. you're definitely going to have to make some fundamental changes
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:24
but..if you don't understand them...you can't use them
and this is why i have never used them
Craig Morrison
@frogmorton
Oct 28 2015 15:24
i don't think you should avoid it
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:24
but this stuff isn't just relevant for objects
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:24
when I see them I shudder
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:24
this is fundamental JS
Coira Ellison
@Coira
Oct 28 2015 15:24
this also gave the same result as using that
$("#start").on("click", this.playSimon);
Craig Morrison
@frogmorton
Oct 28 2015 15:25
That is part and parcel to the language, even if you don't like it
Coira Ellison
@Coira
Oct 28 2015 15:25
but after that, how do we get this correct??
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:25
well...you don't have to create a Game object
Craig Morrison
@frogmorton
Oct 28 2015 15:25
@ngalluzzo is right.
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:26
right but you're going to have the same issue without the object whenever you use nested functions
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:26
up to now...i have never used objects in any of my ziplines
and this is why
they're very confusing
Craig Morrison
@frogmorton
Oct 28 2015 15:27
That's like me saying, I'm a pianist and I suck at arpeggios, so I'm going to avoid playing them.
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:27
I know...and I really did try to understand this. However, I can't spend forever on it
everyone is just as confused
Craig Morrison
@frogmorton
Oct 28 2015 15:27
trust me... I know
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:28
they need more instructions on objects
Craig Morrison
@frogmorton
Oct 28 2015 15:28
I'm kind of dead in the water, after a good run on the first 2 batches of bonfires
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:28
because knowing what they are and using them are two different things
i have four bonfires left....
Craig Morrison
@frogmorton
Oct 28 2015 15:29
Well, that may be true, but we may have to seek out additional materials rather than complain to FCC about not having enough
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:29
for sure
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:29
i know...and I did haha
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:29
there's tons of stuff on function closures out there
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:29
oh...those are hard to understand as well...ugh
Craig Morrison
@frogmorton
Oct 28 2015 15:29
exactly
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:30
this stuff is difficult to describe...
Craig Morrison
@frogmorton
Oct 28 2015 15:30
I believe that's relevant to what I'm trying to work on, @ngalluzzo
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:30
I highly suggest you guys check out this guy's videos: https://www.youtube.com/watch?v=pOfwp6VlnlM
He goes through every single details for setting up a 'module'
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:31
even a very simple example of an object in actual USE would be beneficial
Craig Morrison
@frogmorton
Oct 28 2015 15:31
@TheHighPriestess I agree with you, actually. I'm not arguing or anything
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:31
@TheHighPriestess you're pretty knowledgable in jQuery so I think this will help a ton
YES! that's what this video does :)
he's got a whole series on it
changed my life preaches the gospel
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:31
ok..i will check it out.
haha
@ngalluzzo thanks
CamperBot
@camperbot
Oct 28 2015 15:31
thehighpriestess sends brownie points to @ngalluzzo :sparkles: :thumbsup: :sparkles:
:star: 98 | @ngalluzzo | http://www.freecodecamp.com/ngalluzzo
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:31
npnp
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:32
@frogmorton I know. I'm just complaining lol
I'm going to watch the video and shut up now
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:33
cool let me know how it goes
Craig Morrison
@frogmorton
Oct 28 2015 15:33
@TheHighPriestess me too
@ngalluzzo should we be starting on this #3 vid ?
or back up
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:34
well this one starts more at what @TheHighPriestess
is working on
I highly suggest the entire series though
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:34
@ngalluzzo you mean the entire Modular Javascript series of videos?
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:34
also I'll be glad to do a hangout and walk through some of this stuff with you guys... I just learned it myself but firm believer in teaching to learn!
yup yup
Craig Morrison
@frogmorton
Oct 28 2015 15:35
i mentioned that I'm trying to do the "Make a Person" bf
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:36
oh yup, let me find something for you that helped me on that.. one sec
Craig Morrison
@frogmorton
Oct 28 2015 15:36
so, object constructors, the this keyword and closures are key to that one
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:36
yup
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:36
Which is the first video?
I don't see a number 1
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:36
so any this.variable is a method
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:37
ah great...thanks\
CamperBot
@camperbot
Oct 28 2015 15:37
if you want to thank someone, put an @ before their name!
Coira Ellison
@Coira
Oct 28 2015 15:38
@TheHighPriestess i got it working if you'd like to see? or you going in a different direction?
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:38
i'm going to watch the whole series
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:38
@frogmorton what's important to understand private variables vs methods
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:38
@Coira sure...i would like to see it...yeah
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:38
is also*
moved the jquery bind outside the object literal, used .proxy (thanks stackoverflow!)
CamperBot
@camperbot
Oct 28 2015 15:39
if you want to thank someone, put an @ before their name!
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:39
you can add a variable to an object... var Name = 'Nick' .. this is accessible by all of your methods
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:39
@Coira I see...yeah. You're way ahead of me.
I'm going to copy it over to my pen
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:39
I have read that .proxy() is favored by .bind() now
you can use it the exact same way
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:40
@Coira thank you
CamperBot
@camperbot
Oct 28 2015 15:40
thehighpriestess sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 285 | @coira | http://www.freecodecamp.com/coira
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:40
@TheHighPriestess they cover .bind() in the series too!
Coira Ellison
@Coira
Oct 28 2015 15:40
i see, i didn't know about bind or proxy until this convo :)
Craig Morrison
@frogmorton
Oct 28 2015 15:40
so, you're recommending I start at the beginning of the playlist?
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:41
well...i'm going to leave it where it is now..and it is working now that @Coira worked on it.....and I'm going to watch that video series
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:41
@frogmorton yeah, but know that this specific exercise asks you to do things 1 specific way which isn't covered in the videos
Coira Ellison
@Coira
Oct 28 2015 15:41
thanks for the videos @ngalluzzo
CamperBot
@camperbot
Oct 28 2015 15:41
coira sends brownie points to @ngalluzzo :sparkles: :thumbsup: :sparkles:
:star: 99 | @ngalluzzo | http://www.freecodecamp.com/ngalluzzo
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:42
any time
Craig Morrison
@frogmorton
Oct 28 2015 15:42
yes, the hints on the wiki page seem to indicate that
but, since I'm so weak on this area, the hints don't actually help me much
*in this area
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:43
well...a few minutes into the first video now and it looks like exactly what I need
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:44
@TheHighPriestess glad to hear that :D
@frogmorton check this out http://phrogz.net/js/classes/OOPinJS.html
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:44
i'm exactly that person he's talking about...who knows how to use jquery to do that...but can't really make a modualr program
Coira Ellison
@Coira
Oct 28 2015 15:44
scope, context, objects seem to be uniquely difficult in js, i never had problems with them in other languages
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:44
right!
Coira Ellison
@Coira
Oct 28 2015 15:45
so if you're finding it difficult, just remember, it's all javascript's fault :p
Sarai Flowers
@MadreDeLobos
Oct 28 2015 15:45
<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>View More <a href="http://www.freecatphotoapp.com">  Cat Photos </a> </p>
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 15:45
haha
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:45
that's good to hear.. seeing how JS is my first language
Sarai Flowers
@MadreDeLobos
Oct 28 2015 15:45
i cant seem to get passed this. it keeps saying my <p> has to have View More with a space.. and then it wont let me pass..
Nic Galluzzo
@ngalluzzo
Oct 28 2015 15:46
always like to do the hard things first hah
Sarai Flowers
@MadreDeLobos
Oct 28 2015 15:46
"Your p element should have the text "View more " (with a space after it)."
Craig Morrison
@frogmorton
Oct 28 2015 15:46
Thanks @ngalluzzo I'll check it out
CamperBot
@camperbot
Oct 28 2015 15:46
frogmorton sends brownie points to @ngalluzzo :sparkles: :thumbsup: :sparkles:
:star: 100 | @ngalluzzo | http://www.freecodecamp.com/ngalluzzo
Waterburner TroubleMaker
@Waterburner
Oct 28 2015 15:46
Hello, everyone!
I need help with waypoint "Target a Specific Child of an Element Using jQuery"
h4r1m4u
@h4r1m4u
Oct 28 2015 15:48
@TheHighPriestess where did you get the code from? i'd be interested to see the whole thing, not just what you have in the pen.
btw, i just finished my Simon and leveraged objects in it as well, so i could share that with you in case you were interested.
Paul Simon Ongpin
@mochiii
Oct 28 2015 15:57
http://codepen.io/mochiii/full/NGMXpe/ i wonder how can I do the hover effects without moving the other elements. i think its a float but i dont know how to do it lol
Nic Galluzzo
@ngalluzzo
Oct 28 2015 16:01
maybe play around with changing the element's height / width and animating that?
looking good either way :)
Abhisek Pattnaik
@abhisekp
Oct 28 2015 16:01

"The best teachers are those who show you where to look, but don't tell you what to see."

—Alexandra K. Trenfor
jesscohen87
@jesscohen87
Oct 28 2015 16:07
In waypoint how do i make the image smaller. where do i put " <style> .smaller-image { width: 100px; } </style>
????
Craig Morrison
@frogmorton
Oct 28 2015 16:08
@abhisekp Nice Quote
h4r1m4u
@h4r1m4u
Oct 28 2015 16:08
@TheHighPriestess thank you. btw, the compArray is not defined error that comes up after we fixed the playSimon() is not a function error can be solved by changing the console.log call on line 25 (in the createAndPush function): instead of console.log(compArray); use console.log(this.compArray);
CamperBot
@camperbot
Oct 28 2015 16:08
h4r1m4u sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 306 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
Craig Morrison
@frogmorton
Oct 28 2015 16:08
@jesscohen87 either inline in the html or in the css, using an id or a class
h4r1m4u
@h4r1m4u
Oct 28 2015 16:09
@TheHighPriestess looking at the simon.js code, you can see that he uses the var that = this trick to pass the Game object itself to jQuery functions as well
Abhisek Pattnaik
@abhisekp
Oct 28 2015 16:09
@frogmorton thanks. The quotes come regularly using Momentum https://chrome.google.com/webstore/detail/momentum/laookkfknpbbblfpciffpaejjkokdgca
CamperBot
@camperbot
Oct 28 2015 16:09
abhisekp sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 288 | @frogmorton | http://www.freecodecamp.com/frogmorton
t1melord
@t1melord
Oct 28 2015 16:10

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

p {
font-size: 16px;
font-family: Monospace;
}
h2 {
font-family: <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
}
</style>

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

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

anything im doing wrong?
h4r1m4u
@h4r1m4u
Oct 28 2015 16:11

@t1melord

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

this is wrong

Craig Morrison
@frogmorton
Oct 28 2015 16:11
@abhisekp Oh, it's a Chrome plugin?
h4r1m4u
@h4r1m4u
Oct 28 2015 16:11
the <link> tag should be above your <style> tag
Abhisek Pattnaik
@abhisekp
Oct 28 2015 16:11
@frogmorton yes. Quotes along with nice background and much more
jesscohen87
@jesscohen87
Oct 28 2015 16:11
@frogmorton Thanks. I will try that
CamperBot
@camperbot
Oct 28 2015 16:11
jesscohen87 sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 289 | @frogmorton | http://www.freecodecamp.com/frogmorton
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 16:11
@h4r1m4u yeah...I saw that.
h4r1m4u
@h4r1m4u
Oct 28 2015 16:12
@t1melord then in the h2 CSS you'd write:
h2 {
 font-family: Lobster;
}
Craig Morrison
@frogmorton
Oct 28 2015 16:12
@t1melord you can link the google fonts in the head element, and then just name the particular font-family in the element you want to use it in, in the CSS page
Elizabeth Hatleli
@TheHighPriestess
Oct 28 2015 16:12
i think i need to watch that video series...
Craig Morrison
@frogmorton
Oct 28 2015 16:13
@jesscohen87 if you need more explicit explanation, don't hesitate to ask
Abhisek Pattnaik
@abhisekp
Oct 28 2015 16:13
@frogmorton Today's
Craig Morrison
@frogmorton
Oct 28 2015 16:14
gotcha
Nic Galluzzo
@ngalluzzo
Oct 28 2015 16:14
whelp i guess i better start working
h4r1m4u
@h4r1m4u
Oct 28 2015 16:15
@TheHighPriestess might be helpful. the objects can be really confusing and javascript is not primarily object-oriented language anyway, which doesn't help
Craig Morrison
@frogmorton
Oct 28 2015 16:15
@ngalluzzo what do you do for knack?
SandStorm_JS
@SandStorm44
Oct 28 2015 16:16
hi guys..there is a problem with this arrays using map method.. I could not find it
Craig Morrison
@frogmorton
Oct 28 2015 16:16
currently? (You're obviously on FCC to move towards web dev... correct me if I'm wrong)
Nic Galluzzo
@ngalluzzo
Oct 28 2015 16:16
customer success and small front-end stuff
SandStorm_JS
@SandStorm44
Oct 28 2015 16:16

//Use map to add three to each value in the array
var array = [1,2,3,4,5];
// Only change code below this line.
var number = array.map(function(num)
{
return num + 3;
});

// Only change code above this line.
(function() {return array;})();

whats wrong am i doing?
Nic Galluzzo
@ngalluzzo
Oct 28 2015 16:18
you're declaring 'number' but never returning it
Craig Morrison
@frogmorton
Oct 28 2015 16:18
@jesscohen87 the inline way would look like this:
t1melord
@t1melord
Oct 28 2015 16:19

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

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

h2 {
font-family: <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">.
}
</style>

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

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

<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Can someone please tell me what I am doing wrong. I do not know where to put the Lobster font link

SandStorm_JS
@SandStorm44
Oct 28 2015 16:19
@ngalluzzo got it..thank u
CamperBot
@camperbot
Oct 28 2015 16:19
rakeshvengala sends brownie points to @ngalluzzo :sparkles: :thumbsup: :sparkles:
:star: 101 | @ngalluzzo | http://www.freecodecamp.com/ngalluzzo
h4r1m4u
@h4r1m4u
Oct 28 2015 16:19
@t1melord i already answered your question. please check above
renquist
@renquist
Oct 28 2015 16:20

having issues with Waypoint: Use appendTo to Move Elements with jQuery

they want me to "Move your target2 element from your left-well to your right-well."

here is code:

<script>
$(document).ready(function() {
$("#target1").css("color", "red");
$("#target1").prop("disabled", true);
$("#target4").remove();
$("#target2").appendto("#right-well");
});
</script>

what am i doing wrong

h4r1m4u
@h4r1m4u
Oct 28 2015 16:21
@renquist appendTo(...) notice the capital t
jesscohen87
@jesscohen87
Oct 28 2015 16:21

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

SandStorm_JS
@SandStorm44
Oct 28 2015 16:21
@renquist i think, you are using appendto rather than appendTo
h4r1m4u
@h4r1m4u
Oct 28 2015 16:21
@renquist letter case matters in javascript. appendto != appendTo
jesscohen87
@jesscohen87
Oct 28 2015 16:22
@frogmorton can you tell me what I'm doing wrong
renquist
@renquist
Oct 28 2015 16:22
@h4r1m4u awesome thanks!
CamperBot
@camperbot
Oct 28 2015 16:22
renquist sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 378 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
renquist
@renquist
Oct 28 2015 16:22
@rakeshvengala thanks too!
CamperBot
@camperbot
Oct 28 2015 16:22
renquist sends brownie points to @rakeshvengala :sparkles: :thumbsup: :sparkles:
:star: 67 | @rakeshvengala | http://www.freecodecamp.com/rakeshvengala
h4r1m4u
@h4r1m4u
Oct 28 2015 16:22
@jesscohen87 what are you supposed to do in this waypoint?
t1melord
@t1melord
Oct 28 2015 16:23
@h4r1m4u Thank you for the help, sorry I didnt see your answer before
CamperBot
@camperbot
Oct 28 2015 16:23
t1melord sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 379 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
jesscohen87
@jesscohen87
Oct 28 2015 16:23
@h4r1m4u make the image smaller but for some reason its not working
h4r1m4u
@h4r1m4u
Oct 28 2015 16:23
@t1melord no problem, my pleasure
@jesscohen87 you created the .smaller-image class correctly. now you need to apply it to your <img> element
Craig Morrison
@frogmorton
Oct 28 2015 16:24
sure, if I see your code
h4r1m4u
@h4r1m4u
Oct 28 2015 16:24
you apply classes to elements like so: <p class="my-class">some text</p>
this is a paragraph with class 'my-class'. now apply your smaller-image class to your <img>
Craig Morrison
@frogmorton
Oct 28 2015 16:25
add the class to your img tag
2high2decide
@2high2decide
Oct 28 2015 16:25
can anyone help with the coin toss. heres how i wrote it up:
if flip = 0; {
    return true "heads" ;
} else {
    return false "tails";
}
h4r1m4u
@h4r1m4u
Oct 28 2015 16:25
@2high2decide remove the true and false
return only 'heads' and 'tails'
also, you need to wrap the conditional in brackets: if (flip == 0)
Craig Morrison
@frogmorton
Oct 28 2015 16:26
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
Marc-Alexandru Baetica
@marcbaetica
Oct 28 2015 16:26
@2high2decide
h4r1m4u
@h4r1m4u
Oct 28 2015 16:26
note the double ==. this is used for comparison. single = assigns value to a variable
Marc-Alexandru Baetica
@marcbaetica
Oct 28 2015 16:26
your condition comes with double comparisons
thank you @h4r1m4u
CamperBot
@camperbot
Oct 28 2015 16:26
marcbaetica sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 380 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
2high2decide
@2high2decide
Oct 28 2015 16:27
@h4r1m4u okay, i removed true and false and wrapped flip with ==, still no go
Craig Morrison
@frogmorton
Oct 28 2015 16:27
@jesscohen87 did you get it working?
h4r1m4u
@h4r1m4u
Oct 28 2015 16:27
can you post the updated code?
jesscohen87
@jesscohen87
Oct 28 2015 16:27
@frogmorton THANK YOU!!
CamperBot
@camperbot
Oct 28 2015 16:27
jesscohen87 sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:warning: jesscohen87 already gave frogmorton points
2high2decide
@2high2decide
Oct 28 2015 16:27
@h4r1m4u had a semi colon sitting somewhere it didnt need to be. worked, thank you!
CamperBot
@camperbot
Oct 28 2015 16:27
2high2decide sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 381 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
jesscohen87
@jesscohen87
Oct 28 2015 16:27
@h4r1m4u Thank you for your help too
h4r1m4u
@h4r1m4u
Oct 28 2015 16:28
nice. good job @2high2decide @jesscohen87
Craig Morrison
@frogmorton
Oct 28 2015 16:28
no problem
h4r1m4u
@h4r1m4u
Oct 28 2015 16:28
keep at it
2high2decide
@2high2decide
Oct 28 2015 16:28
if = is assign, == is comparison, what is ===
Marc-Alexandru Baetica
@marcbaetica
Oct 28 2015 16:29
but i wanna also add to @h4r1m4u 's statement that when you do if (flip == 0) it convers the type and compares the values (like if flip was a string '0' comparing that to number 0 returns true) whereas instead if (flip === 0) compares the value AND the type. @2high2decide
h4r1m4u
@h4r1m4u
Oct 28 2015 16:29
that's correct :point_up:
Craig Morrison
@frogmorton
Oct 28 2015 16:30
@jesscohen87 ;) anytime
Marc-Alexandru Baetica
@marcbaetica
Oct 28 2015 16:30
and if you put the semicolon at the end of the comparison operation you need to put that into brackets. otherwise dont add the semicolon at the end of the comparison operation @2high2decide
@h4r1m4u is mah G right there!! :)
2high2decide
@2high2decide
Oct 28 2015 16:31
@marcbaetica okay great, thank you
CamperBot
@camperbot
Oct 28 2015 16:31
2high2decide sends brownie points to @marcbaetica :sparkles: :thumbsup: :sparkles:
:star: 80 | @marcbaetica | http://www.freecodecamp.com/marcbaetica
Marc-Alexandru Baetica
@marcbaetica
Oct 28 2015 16:31
np :) keep pushing hard!!
h4r1m4u @h4r1m4u and @marcbaetica bros 4ever
minakasiin
@minakasiin
Oct 28 2015 16:37
In javascript for loop, what does the i++ do usually?
h4r1m4u
@h4r1m4u
Oct 28 2015 16:37
increases variable i by 1
minakasiin
@minakasiin
Oct 28 2015 16:37
oh yea, just found it. Thanks
CamperBot
@camperbot
Oct 28 2015 16:37
if you want to thank someone, put an @ before their name!
Blauelf
@Blauelf
Oct 28 2015 16:37
If it's an isolated statement, it is the same as i=i+1 or i+=1
minakasiin
@minakasiin
Oct 28 2015 16:37
thanks @h4r1m4u
CamperBot
@camperbot
Oct 28 2015 16:37
minakasiin sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 382 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 28 2015 16:38
no problem. you can also do i-- (decrease by 1) or i += 10 (increase by 10 [or any arbitrary value])
Blauelf
@Blauelf
Oct 28 2015 16:39
In other cases, i++ evaluates to i and increases i by one. ++i increases first, before evaluation. So var i=0; console.log(i++); outputs 0, while var i=0; console.log(++i); outputs 1. i is 1 after both statements.
renquist
@renquist
Oct 28 2015 16:40

can someone assist me please with Waypoint: Target the same element with multiple jQuery Selectors

i'm missing the requirement of "Only add one class with each of your three selectors."

<script>
$(document).ready(function() {
$("button");
$(".btn");
$("#target1").addClass("animated shake btn-primary");
});
</script>

h4r1m4u
@h4r1m4u
Oct 28 2015 16:41
@renquist $("#target1").addClass("animated shake btn-primary"); adds three classes to #target1
i believe you're supposed to give one class to button, one class to .btn and one class to #target1?
renquist
@renquist
Oct 28 2015 16:43
yup that's it thanks @h4r1m4u
CamperBot
@camperbot
Oct 28 2015 16:43
renquist sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: renquist already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 28 2015 16:43
:+1:
Deep2322
@Deep2322
Oct 28 2015 17:07
$(function(){
  var breaklength = 5 * 60;
  var sessionlength = 25 * 60;
  var isSession = true;
  var timeLeft = sessionlength;
  var timerInterval;
  var clickInterval;

  function switchSession(playsound){
    if(playsound){
      var bell = new Audio('http://files.wanhella.com/sounds/bell_ring.mp3');
    }
    bell.play();
  }

  if(isSession){
    timeleft = breaklength;
    isSession = false;
  }else
  {
    timeleft = sessionLength;
    isSession = true;
  } 


  function setSwitchButton(){
    if(isSession){
      $('#switch-btn').html('switch to break');
    }
    else{
      $('#switch-btn').html('switch to session');
    }
  }

  function formatSeconds(seconds){
    return seconds < 10 ? '0' + seconds : 'seconds'; 
  }

  //update timer

  function updateTimer(){
    var secondsLeft;
    var minutesLeft;

    if (timeLeft <= 0) {
      switchSession(true);
    }

    minutesLeft = Math.floor(timeleft/60);
    secondsLeft = timeLeft - minutesLeft *60;
    $('#time').html(minutesLeft + ':' + formatSeconds(secondsLeft));
    setSwitchButton();
  }

  //update timer lengths
  function updateTimerLengths(){
    if(sessionlength < 0){
      sessionLength = 0;
    }
    if(breaklength < 0){
      breakLength = 0;
    }

    $('.session-length').html(sessionlength/60);
    $('.breakLength').html(breaklength/60);
  }

  //reset values
  function init(){
    breaklength = 5 * 60;
    sessionlength = 25 * 60;
    isSession = true;
    clearInterval(timerInterval);
    clearInterval(clickInterval);
    if($('.board').hasClass('stop')){
      $('#go').html('Stop');
      $('board').removeClass('stop');
      $('board').addClass('go');
    }
    setSwitchButton();
    updateTimer();
    updateTimerLengths();
  }

  function clickHandler(id){
    switch(id){
        case 'session-plus':
        sessionlength += 60;
        if(isSession){
          timeLeft += 60;
        }
        break;

        case 'session-minus':
        sessionlength -= 60;
        if(isSession){
          timeLeft -= 60;
        }
        break;

        case 'break-plus':
        breaklength += 60;
        if(isSession){
          timeLeft += 60;
        }
        break;

        case 'break-minus':
        breaklength -= 60;
        if(isSession){
          timeLeft -= 60;
        }
        break;
    }
    updateTimerLengths();
    updateTimer();
  }

 $('i').on('mousedown',function(){
   var id = $(this).attr("id");
   clickHandler(id)
   clickInterval = setInterval(function(){
     clickHandler(id);
   },150);  
 }); 

  $('html').on('mouseup',function(){
    clearInterval(clickInterval);
  });

  $('.board').click(function(){
    if($('.board').hasClass('go')){
      $('#go').html('STOP');
      $('.board').removeClass('go');
      $('.board').addClass('stop');
      timerInterval = setInterval(function()       {
        timeLeft--;
        updateTimer();
      },1000); 
  }else{
    clearInterval(timerInterval);
    $('#go').html('GO');
    $('.board').removeClass('.stop');
    $('.board').addClass('.go');
  }
});

  $('.rest').click(init);

  $('#switch-btn').click(function(){
    switchSession(false);
    updateTimer();
  }); 
});
there is something wrong in this code in am not able to find out
Rex Schrader
@SaintPeter
Oct 28 2015 17:09
@Deep2322 This is from a Zipline?
Deep2322
@Deep2322
Oct 28 2015 17:10
i copied from codepen
Rex Schrader
@SaintPeter
Oct 28 2015 17:10
@Deep2322 WAY too much code for me to analyze. First, let's get you over to the right place - the /HelpZiplines channel. Secondly, once there, share your CodePen URL.
Deep2322
@Deep2322
Oct 28 2015 17:11
ok i will share my codepen
J Stokes
@jesstokes
Oct 28 2015 17:11
Hi all - anyone know what to do if you've pasted in Bonfire code that makes FCC puke... but the code is saved and executes when I go to the challenge... so I can't use the handy reset function?
Rex Schrader
@SaintPeter
Oct 28 2015 17:12
@Deep2322 Please, over at the /HelpZiplines channel
Geepum Lee
@Geepum
Oct 28 2015 17:16
Hi everyone,
can anyone help me solving this problem?
never mind... I solved it lol
David Wilbanks
@dwilbank68
Oct 28 2015 17:25
@dwilbanks68 thanks
CamperBot
@camperbot
Oct 28 2015 17:25
dwilbank68 sends brownie points to @dwilbanks68 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for dwilbanks68
David Wilbanks
@dwilbank68
Oct 28 2015 17:26
dwilbank68 thanks
CamperBot
@camperbot
Oct 28 2015 17:26
if you want to thank someone, put an @ before their name!
David Wilbanks
@dwilbank68
Oct 28 2015 17:26
@dwilbank68 thanks
CamperBot
@camperbot
Oct 28 2015 17:26
sorry dwilbank68, you can't send brownie points to yourself! :sparkles: :sparkles:
David Wilbanks
@dwilbank68
Oct 28 2015 17:26
haha
Joe Hill
@cupofjoey
Oct 28 2015 17:30
thanks @camperbot
CamperBot
@camperbot
Oct 28 2015 17:30
cupofjoey sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 442 | @camperbot | http://www.freecodecamp.com/camperbot
Jordan Pantley
@UnbackedMuffin
Oct 28 2015 17:33
Anyone feel like helping with the split strings waypoint?
Rex Schrader
@SaintPeter
Oct 28 2015 17:34
@UnbackedMuffin Sure, what's the trouble?
Jordan Pantley
@UnbackedMuffin
Oct 28 2015 17:34
I'm not understanding how you split by spaces

@SaintPeter - var string = "Split me into an array";
// Only change code below this line.

var array = string.split();

// Only change code above this line.
(function() {return array;})();

Nic Galluzzo
@ngalluzzo
Oct 28 2015 17:35
.split(' ')
.split() takes a parameter which lets you decide how to split things
Rex Schrader
@SaintPeter
Oct 28 2015 17:35
@UnbackedMuffin The split function takes the string it is used on and it breaks it into chunks, based on the pattern or element you pass it. Thus string.split('a') would break by the letter a
h4r1m4u
@h4r1m4u
Oct 28 2015 17:36
@UnbackedMuffin you need to add the character you want to split the string by as the parameter of the split function
Rex Schrader
@SaintPeter
Oct 28 2015 17:36
@ngalluzzo Appreciate you triyng to help, but I try not to give the answer when helping folks. It can be more helpful to give an example that is not the answer and let them come to it on their own.
Jordan Pantley
@UnbackedMuffin
Oct 28 2015 17:37
@SaintPeter @h4r1m4u You should split the string by its spaces.
Rex Schrader
@SaintPeter
Oct 28 2015 17:37
@UnbackedMuffin Yes - how do you tell .split what to split by? By giving it a value inbetween the parentheses: string.split(thingToSplitBy)
h4r1m4u
@h4r1m4u
Oct 28 2015 17:38
@UnbackedMuffin as @SaintPeter said above string.split('a') would break by the letter a. how do you think the function should look if you want to split the string by blank space?
Rex Schrader
@SaintPeter
Oct 28 2015 17:38
@UnbackedMuffin So, how do you tell it to split by "spaces"?
h4r1m4u
@h4r1m4u
Oct 28 2015 17:38
@ngalluzzo Appreciate you triyng to help, but I try not to give the answer when helping folks. It can be more helpful to give an example that is not the answer and let them come to it on their own.
glad to see someone have the same approach. thanks @SaintPeter
CamperBot
@camperbot
Oct 28 2015 17:38
h4r1m4u sends brownie points to @ngalluzzo and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 102 | @ngalluzzo | http://www.freecodecamp.com/ngalluzzo
:star: 1249 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jordan Pantley
@UnbackedMuffin
Oct 28 2015 17:45
@SaintPeter @h4r1m4u thanks, I tried using a space before but it didn't work.
CamperBot
@camperbot
Oct 28 2015 17:45
unbackedmuffin sends brownie points to @saintpeter and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1250 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 385 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
mattg425
@mattg425
Oct 28 2015 17:45
I was working on "Waypoint: Change the CSS of an Element Using jQuery" and have a question. if you were wanting to change the font color couldnt you just go directly to the element and do that? Im just not sure why you would ever use this?
Jordan Pantley
@UnbackedMuffin
Oct 28 2015 17:45
@SaintPeter @h4r1m4u I just reset the code and tried again
h4r1m4u
@h4r1m4u
Oct 28 2015 17:45
@UnbackedMuffin did you manage to figure it out now?
Jordan Pantley
@UnbackedMuffin
Oct 28 2015 17:45
yea
h4r1m4u
@h4r1m4u