These are chat archives for FreeCodeCamp/Help

18th
Oct 2015
Brian K
@BKtheDAD
Oct 18 2015 00:00
that’s awesome, what is your background prior to this?
Herman Fassett
@HermanFassett
Oct 18 2015 00:00
Coding off and on for about 6 years, js maybe past 2
The hardest bonfire imho was no repeats please
Chris
@Aoxom
Oct 18 2015 00:02
i just read the description for no repeats, then i hit "back" right away. lol
Phil Andy
@philandy
Oct 18 2015 00:19
would it be proper to master script then learn jQ?
Rory Smith
@alanbuchanan
Oct 18 2015 00:21
wondering if any angular people are around to help me with this $http stuff?http://stackoverflow.com/questions/33190600/using-put-to-update-a-vote-count
Jason
@Jauble
Oct 18 2015 00:22
Anyone know how to break out of a click function?
Hans van Riet
@hansinla
Oct 18 2015 00:24
@Jauble JS is non-blocking so you can just return
easyspirit
@easyspirit
Oct 18 2015 00:25

@hansinla Thanks for the input. I just tried a whole bunch of options. Then I tried this:

myCar["engines"] = 4;

I don’t recall a Waypoint showing this technique prior, but it worked! Thanks!

CamperBot
@camperbot
Oct 18 2015 00:25
easyspirit sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 542 | @hansinla | http://www.freecodecamp.com/hansinla
Jason
@Jauble
Oct 18 2015 00:29
@hansinla Thanks that's good to know. It doesn't seem to be doing what I want it to thought
*though
Steven Parker
@Philosophist
Oct 18 2015 00:46

I'm a bit lost in trying to figure out the first zipline of a web portfolio. I think the challenge needs to list out the possible tools we'll want to use from bootstrap there. There seem to also be a lot of bootstrap features needed for it which are not taught in previous waypoints.

Here's mine: http://codepen.io/Philosophist/pen/xwZGar
Any tips of what to try and figure out or search for next would be appreciated.

pappilino
@pappilino
Oct 18 2015 00:46
hi guys....
I'm trying to get a range of [1, 4] to be [1,2,3,4]. how can i do that? i tried using for loops
Brian K
@BKtheDAD
Oct 18 2015 00:48
help where do i belong
CamperBot
@camperbot
Oct 18 2015 00:48

:point_right: bonfire where do i belong [wiki]

Explanation:

This can be a tricky problem to understand. You need to find where in the array a number should be inserted by order, and return the index where it should go.

:pencil: read more about bonfire where do i belong on the FCC Wiki

Steven Parker
@Philosophist
Oct 18 2015 00:50
@pappilino Did you try using push()?
Herman Fassett
@HermanFassett
Oct 18 2015 00:50
@pappilino there are more ways than one to do that. For loop with push would be easiest
pappilino
@pappilino
Oct 18 2015 00:50
function sumAll(arr) {
  var min = Math.min.apply(null, arr);
  var max = Math.max.apply(null, arr);
  var newArr = [];
  for (var i = arr[0]; i < arr[1]; i++) {
      newArr.push(arr[i]);
  }
  return newArr;
}

sumAll([1, 4]);
i get [4,undefined,undefined]
Herman Fassett
@HermanFassett
Oct 18 2015 00:50
Do push(i) instead
@pappilino
pappilino
@pappilino
Oct 18 2015 00:51
yep.. got it
thanks @HermanFassett
CamperBot
@camperbot
Oct 18 2015 00:51
pappilino sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 384 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Steven Parker
@Philosophist
Oct 18 2015 00:52
@pappilino A side thought, the max and min variables seem unnecessary.
pappilino
@pappilino
Oct 18 2015 00:52
why?
oh, the array doesn't always come with smaller number first
so, is it still necessary?
Steven Parker
@Philosophist
Oct 18 2015 00:53
@pappilino I don't see any purpose that they serve. You never use them after establishing them.
pappilino
@pappilino
Oct 18 2015 00:55
i think that's the reason i still can't pass it
function sumAll(arr) {
  var min = Math.min.apply(null, arr);
  var max = Math.max.apply(null, arr);
  var tempArr = [min, max];
  var newArr = [];
  for (var i = tempArr[0]; i <= tempArr[1]; i++) {
      newArr.push(i);
  }
  return newArr.reduce(function(previousValue, currentValue) {
      return previousValue + currentValue;
  });
}

sumAll([1, 4]);
now it's passed
thanks for pointing it out @Philosophist
CamperBot
@camperbot
Oct 18 2015 00:56
pappilino sends brownie points to @philosophist :sparkles: :thumbsup: :sparkles:
:star: 283 | @philosophist | http://www.freecodecamp.com/philosophist
Bill
@kirah1314
Oct 18 2015 00:57
@pappilino you could also just put the min and max into your for loop instead of adding a reduce
Steven Parker
@Philosophist
Oct 18 2015 00:57
@pappilino Ahh, I would suggest then using an if test to establish which is lower. After that set your min var to the lowest and max to the highest, but don't use the MAth . min .apply thing. I'm not sure what it's supposed to do, but it seems unnecessarily complicated for what you need. Then you want to make sure to use your min/max variables in the for loop
NP
Cool, glad it worked!
pappilino
@pappilino
Oct 18 2015 00:59
without the .apply i got NaN from the Math.min.
Samantha Medeiros
@samanthamed
Oct 18 2015 01:04
does anyone know if I should be able to use Font Awesome icons within Codepen? I have both Bootstrap and Font Awesome added as external CSS files in the CSS settings, and I'm using the correct <i> classes for the icons I'm attempting to display, but I keep getting a broken icon box in the preview window
Jason
@Jauble
Oct 18 2015 01:04
This message was deleted
This message was deleted
Bill
@kirah1314
Oct 18 2015 01:06
@samanthamed I add this whenever I need to use font awesome and it has always worked for me. Add it to the html's head section:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
Samantha Medeiros
@samanthamed
Oct 18 2015 01:07
thanks @kirah1314, but unfortunately that isn't fixing it for me
CamperBot
@camperbot
Oct 18 2015 01:07
samanthamed sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 288 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Bill
@kirah1314
Oct 18 2015 01:07
@samanthamed ok, what codes are you using to the fonts?
share the codes or your codepen?
Samantha Medeiros
@samanthamed
Oct 18 2015 01:09
this is the section of HTML that I put the fa classes in...
Brian K
@BKtheDAD
Oct 18 2015 01:09

working on Where do I belong bonfire

function where(arr, num) {
  var when = arr.concat(num);
  var why = when.sort();
  var who = why.indexOf(num);


  // Find my place in this sorted array.
  return who;
}

where([2,5,10], 15);

why is this returning 1 and not 3?

Samantha Medeiros
@samanthamed
Oct 18 2015 01:10
sorry hang on, having trouble sending my code
  <button class="btn btn-primary" type="button" onclick="loadQuote()"><i class="fa fa-quote-left"></i> Give me another! <i class="fa fa-quote-right"></i></button>
Bill
@kirah1314
Oct 18 2015 01:11
@samanthamed hmm that looks about right
@samanthamed did you add the link I posted above to html/head section?
Samantha Medeiros
@samanthamed
Oct 18 2015 01:14
@kirah1314 I did, yeah
at this point I'm starting to wonder if it's just my browser (FF)...I'm going to try it in chrome to see if I can rule that out
Bill
@kirah1314
Oct 18 2015 01:14
@samanthamed try to remove the css link you added to your css settings
Samantha Medeiros
@samanthamed
Oct 18 2015 01:14
oh, I'll try that first
Bill
@kirah1314
Oct 18 2015 01:14
ok I'm using chrome btw
Samantha Medeiros
@samanthamed
Oct 18 2015 01:15
alas, removing it in settings didn't help either. off to try chrome
Bill
@kirah1314
Oct 18 2015 01:15
ok, if that doesn't work then you could post your codepen link and I could take a look if you want :)
Samantha Medeiros
@samanthamed
Oct 18 2015 01:16
huh busted in chrome too. okay, my codepen link is http://codepen.io/samanthamed/pen/GpOoyJ (definitely still in progress, ha)
Bill
@kirah1314
Oct 18 2015 01:19
@samanthamed ok it has something to do with your CSS stuff, if you remove all your CSS then you'll see the quotes
Samantha Medeiros
@samanthamed
Oct 18 2015 01:20
ok, I'm glad that's narrowed down now. thanks @kirah1314 !
CamperBot
@camperbot
Oct 18 2015 01:20
samanthamed sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: samanthamed already gave kirah1314 points
Bill
@kirah1314
Oct 18 2015 01:20
@samanthamed it's this:
* {
  text-align: center;
  font-family: Calibri !important;
  background-color: #eeeeee !important;
}
Samantha Medeiros
@samanthamed
Oct 18 2015 01:21
oh! the font family I'm guessing
Bill
@kirah1314
Oct 18 2015 01:21
@samanthamed glad to help :thumbsup:
yup the font family
bingo!
@samanthamed btw, I used the same exact quotes you're using on my zipline too lol
Chris
@Aoxom
Oct 18 2015 01:24
@bkthegeek because it is in this order "10, 15, 2, 5" i believe
Samantha Medeiros
@samanthamed
Oct 18 2015 01:25
@kirah1314 haha nice :+1: thanks again!
CamperBot
@camperbot
Oct 18 2015 01:25
samanthamed sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:warning: samanthamed already gave kirah1314 points
DJ
@qualitymanifest
Oct 18 2015 01:36
@bkthegeek @Aoxom is correct about the order it's coming in. your need to give your sort a function. see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
Edward Udelle
@EdwardUdelle
Oct 18 2015 03:33
Hi, I'm new to this site and I am stuck on the exercise giving a background color to a div element. I placed this code at the end within the style element and it does produce the desired result but I can't pass the exercise. What gives? div {background-color: gray;}
</style>
DJ
@qualitymanifest
Oct 18 2015 03:37
This message was deleted
@EdwardUdelle if that doesn't make sense paste all your code and i will take a look at it
Edward Udelle
@EdwardUdelle
Oct 18 2015 03:39
Here it is...

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

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

DJ
@qualitymanifest
Oct 18 2015 03:46
@EdwardUdelle in the instructions: "Create a class called gray-background with the background-color of gray. Assign this class to your div element."
so instead of just targeting "div" with your css you need to make a class like ".this-class-should-have-a-certain-name". and you need to give your div that class in your HTML
bruglesco
@bruglesco
Oct 18 2015 03:48
help format
CamperBot
@camperbot
Oct 18 2015 03:48

: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

OverTheNeptune
@OverTheNeptune
Oct 18 2015 03:48
@EdwardUdelle What @qualitymanifest said. The .red-text class that's already in the code provides a good model.
Francisco Pena
@daiky00
Oct 18 2015 03:51
hi anybody here
?
$('.main3').on('click', '.show', function() {
var id = $(this).attr('data-panel-id');
$('.project').hide(100);
$('.project').filter('#' + id).show(100);
})
i want to be able to close it on click and open on click
anyone?
bruglesco
@bruglesco
Oct 18 2015 03:53
help format
CamperBot
@camperbot
Oct 18 2015 03:53

: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

Edward Udelle
@EdwardUdelle
Oct 18 2015 03:55
Strange, I place that within the style element and it still does not pass.
Here's what I have now.
Aditya Pradhana
@adtpdn
Oct 18 2015 03:58
@EdwardUdelle can u gimme WayPoint links ?
bruglesco
@bruglesco
Oct 18 2015 04:00
show it again
OverTheNeptune
@OverTheNeptune
Oct 18 2015 04:00
@EdwardUdelle Did you apply the class to the <div> element in your html? If not, look at how the red-text class is used in the <h2> element for an example.
Edward Udelle
@EdwardUdelle
Oct 18 2015 04:06

Here's the style element so far.. <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;
}
div .gray-background {background-color:gray;}
</style>

DJ
@qualitymanifest
Oct 18 2015 04:07
@EdwardUdelle you don't need the "div" before .gray-background. you apply the .gray-background class to your div in your HTML
@EdwardUdelle similar to what you did with .thick-green-border
Aditya Pradhana
@adtpdn
Oct 18 2015 04:09
Put class in HTML to link ur CSS
<div class="grey-background”> ……..</div>
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:12
@daiky00 :point_up: October 18, 2015 9:23 AM
Francisco Pena
@daiky00
Oct 18 2015 04:12
ok
$('.main3').on('click', '.show', function() {
var id = $(this).attr('data-panel-id');
$('.project').hide(100);
$('#' + id).toggle(100);
})
i want to do this
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:13
@daiky00 :point_up: October 18, 2015 9:23 AM
Francisco Pena
@daiky00
Oct 18 2015 04:13
check the link for reference
bruglesco
@bruglesco
Oct 18 2015 04:13
help format
CamperBot
@camperbot
Oct 18 2015 04:13

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:13
@daiky00 :point_up: October 18, 2015 9:43 AM
bruglesco
@bruglesco
Oct 18 2015 04:13
make your code more readable plz
easier to help you
Francisco Pena
@daiky00
Oct 18 2015 04:14
ok
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:14
@daiky00 making the code readable will make us easier to read and help you
Francisco Pena
@daiky00
Oct 18 2015 04:15
$('.main3').on('click', '.show', function() { var id = $(this).attr('data-panel-id'); $('.project').hide(100); $('#' + id).toggle(100); })
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:15
@daiky00 multiline pls. You're pasting a codeblock
Francisco Pena
@daiky00
Oct 18 2015 04:16
how do i do that
Aditya Pradhana
@adtpdn
Oct 18 2015 04:16
use shift + enter
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:16
:point_up: October 18, 2015 9:43 AM @daiky00
Francisco Pena
@daiky00
Oct 18 2015 04:16
$('.main3').on('click', '.show', function() {
var id = $(this).attr('data-panel-id');
$('.project').hide(100);
$('#' + id).toggle(100);
})
now i egt it
hahaha
and this what im trying to do
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:18
@daiky00 so what's the issue?
bruglesco
@bruglesco
Oct 18 2015 04:18
well your variable isnt doing what you want it to
Jason
@jimillett
Oct 18 2015 04:18
Can someone help me figure out what I am doing wrong on Bonfire: Reverse a String
CamperBot
@camperbot
Oct 18 2015 04:18
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Francisco Pena
@daiky00
Oct 18 2015 04:18
well
the problem is
everything is working but after you open it once it doesnt want to hide again
bruglesco
@bruglesco
Oct 18 2015 04:19
(#$(this).attr('data-panel-id')).toggle(100); isnt functioning code
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:19
@daiky00 yes. It does when you click it again
Francisco Pena
@daiky00
Oct 18 2015 04:19
nono it doesnt
Jason
@jimillett
Oct 18 2015 04:20
function reverseString(str) {
  array = str;
  array = array.reverse();
  str = array;
  return str;
}

reverseString("hello");
Francisco Pena
@daiky00
Oct 18 2015 04:20
what is that
?
DJ
@qualitymanifest
Oct 18 2015 04:20
@jimillett you need to use all the methods in the "helpful links"
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:21
@daiky00
DJ
@qualitymanifest
Oct 18 2015 04:21
@jimillett you can't reverse a string, you can reverse an array of characters, which is why you need .split. and it needs to be a string when you return it, so that's why you need .join
Francisco Pena
@daiky00
Oct 18 2015 04:22
blob
Jason
@jimillett
Oct 18 2015 04:22
ah ok that makes sense derp.
thanks
CamperBot
@camperbot
Oct 18 2015 04:22
if you want to thank someone, put an @ before their name!
Francisco Pena
@daiky00
Oct 18 2015 04:22
@abhisekp
DJ
@qualitymanifest
Oct 18 2015 04:22
@jimillett also there's no need for "array" (which should be initialized as "var array" if you did use it), you can do the whole thing to str... on one line, in fact.
Jason
@Jauble
Oct 18 2015 04:22
Hey @abhisekp any idea how to get my buttons to center when minimized? http://codepen.io/auble220/pen/avyZZE
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:22
@daiky00 btw, there is this $().data to access the data attr https://devdocs.io/jquery/data
Levyian
@levyian
Oct 18 2015 04:22
@jimillett convert the string to array using string.split() then reverse it and convert it back a string
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:23
@Jauble i thot you were doing the bfs
Jason
@jimillett
Oct 18 2015 04:23
got it thanks all :)
CamperBot
@camperbot
Oct 18 2015 04:23
if you want to thank someone, put an @ before their name!
Levyian
@levyian
Oct 18 2015 04:23
also initialize variable names with var name
although you don't need any addition variables for this one
Francisco Pena
@daiky00
Oct 18 2015 04:24
did anyone understand my code?
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:24
@Jauble wrap the buttons and center them using margin: 0 auto
@daiky00 yeah! I understood it. :)
Jason
@Jauble
Oct 18 2015 04:25
@abhisekp I started on the ziplines, then they moved the bf before the ziplines so I started on those, then they moved them back. I just decided to switch back and forth whatever I feel like working on
Francisco Pena
@daiky00
Oct 18 2015 04:25
blob
Edward Udelle
@EdwardUdelle
Oct 18 2015 04:25
Thank you all! The div element needs the class= "gray-background" and the style element needs .gray-background{background-color:gray;} I found the instructions a little confusing.
CamperBot
@camperbot
Oct 18 2015 04:25
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:25
@Jauble just do what you were doing. Don't switch.
Francisco Pena
@daiky00
Oct 18 2015 04:25
when i click it each image it show content below
the problem is you cant close it after you open it
Jason
@Jauble
Oct 18 2015 04:26
@abhisekp I think I tried using margin auto, but I'll try that
Francisco Pena
@daiky00
Oct 18 2015 04:27
how can record a videos
a video
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:27
@daiky00 clicking the img again doesn't work? like in the gif i showed above? :point_up: October 18, 2015 9:51 AM
explain animated gif
CamperBot
@camperbot
Oct 18 2015 04:27

:point_right: create, upload and link animated gif image [wiki]

  1. Download LICEcap and install.
  2. Open and start recording to create animated GIF.
  3. Upload the .gif file in EZGIF.com.
    • Crop, Resize and Optimize as many times or as required.
  4. Download animated GIF.
  5. Upload image to imgur.com.
  6. Link image using ![image title](http://i.imgur.com/RqgGcf5.gif).
    :pencil: read more about create upload and link animated gif image on the FCC Wiki
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:27
@daiky00 :point_up: October 18, 2015 9:57 AM
Francisco Pena
@daiky00
Oct 18 2015 04:28
@abhisekp tahnks
@abhisekp thanks
CamperBot
@camperbot
Oct 18 2015 04:28
daiky00 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 615 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 18 2015 04:31
@daiky00 But lemme give you my trick how to upload it faster.
Jason
@Jauble
Oct 18 2015 04:33
@abhisekp Thanks that worked. I realized I had the id wrong in my css, so I'm guessing that's why it wasn't working before lol
CamperBot
@camperbot
Oct 18 2015 04:33
jauble sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 616 | @abhisekp | http://www.freecodecamp.com/abhisekp
3IBit
@3IBit
Oct 18 2015 04:44
Hello, gus
guys
How are you?
I am problem,
Create a new p element around your a element.
Your a element should be nested within your new p element.
Your p element should have the text "View more " (with a space after it).
But, I don't know what's to do.
what*
alex
@alexhudici
Oct 18 2015 04:51
what exercise is this?
bruglesco
@bruglesco
Oct 18 2015 04:51
you should have a p element with an a element inside it
Jose E. Pimentel
@jedpimentel
Oct 18 2015 04:56
@3IBit the ,<p> opening tag needs to be before the a element, the </p> closing tag needs to be after the a element
Jason
@Jauble
Oct 18 2015 05:08
Hey @jedpimentel. Do you know how to save the file you're working on in dev tools? I can't get it to work
Jose E. Pimentel
@jedpimentel
Oct 18 2015 05:08
unfortunately not
Jason
@Jauble
Oct 18 2015 05:09
@jedpimentel Oh ok thanks
CamperBot
@camperbot
Oct 18 2015 05:09
jauble sends brownie points to @jedpimentel :sparkles: :thumbsup: :sparkles:
:star: 368 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
joshchong
@joshchong
Oct 18 2015 05:17

hey guys, are you not able to replace the ".text." in this line with ".innerHTML" or ".textContent"?

$(document).ready(function(){ $("h1").text("Hello"); });

Herman Fassett
@HermanFassett
Oct 18 2015 05:17
You can do html or val
joshchong
@joshchong
Oct 18 2015 05:20
ok, but i'm just trying to understand conceptually, something like ".innerHTML" just doesn't work with jQuery or something?
Herman Fassett
@HermanFassett
Oct 18 2015 05:21
Well jquery is just a library of javascript
Jon
@jgtwo1
Oct 18 2015 05:24
how do I import a font
Herman Fassett
@HermanFassett
Oct 18 2015 05:25
Depends on if it's online or local
Jon
@jgtwo1
Oct 18 2015 05:25
its local
Herman Fassett
@HermanFassett
Oct 18 2015 05:26
You can import it in the css style like
@font-face {
  font-family: "Font Name";
  src: url("Fontfile-Regular.ttf") format("truetype");
}
Then just use it regularly as a font-family
Jacob Brown
@jab5
Oct 18 2015 05:31

I am having trouble on Waypoint: Use Hex Code for Specific Shades of Gray. Give your body element the background-color of a dark gray. My code says:

<style>
body {
background-color: dark gray;
color: #111111;
}
</style>
This does not work. Any suggestions?

Herman Fassett
@HermanFassett
Oct 18 2015 05:33
@jab5 you should set the background-color to the hex value. setting color doesn't change background-color
DTing
@dting
Oct 18 2015 05:34
@jab5 the color they want is #808080
Jacob Brown
@jab5
Oct 18 2015 05:34
that works. thanks
CamperBot
@camperbot
Oct 18 2015 05:34
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 18 2015 05:34
No the color they want is #111111 @dting
Jeremy
@jeremy03
Oct 18 2015 05:35
@jab5 dark gray is also #A9A9A9
DTing
@dting
Oct 18 2015 05:35
oh i guess i was looking at the previous challenge
Jeremy
@jeremy03
Oct 18 2015 05:36
@jab5 <style> body { background-color: #111111; } </style>
Jason
@Jauble
Oct 18 2015 05:54
Anyone know of any settings that would make it so that I can't save changes in dev tools? When I save as, nothing changes. When I do the same thing in a different browser it works though
Katie
@Katie-S
Oct 18 2015 05:56
help palindrome
CamperBot
@camperbot
Oct 18 2015 05:56

:point_right: bonfire check for palindromes [wiki]

Explanation:

You have to check if the string you get as an input is a palindrome and return true if it is, and false otherwise.

:pencil: read more about bonfire check for palindromes on the FCC Wiki

Katie
@Katie-S
Oct 18 2015 05:58
Can someone please look at this code and tell me either why it doesn't work or if there is place I can go to check my code to determine what is wrong when I'm doing it?
function palindrome(str) {
 var newstr = str.toLowerCase('');

  var array = newstr.split('').reverse().join('');

 if newstr == array;


  return true;
  else
    return false;
}



palindrome("eye");
I tried it without the single quotes after .toLowerCase(); but that didn't work either ?
bruglesco
@bruglesco
Oct 18 2015 06:00
@Katie-S ur if statement is missing sybols
if () { }
Herman Fassett
@HermanFassett
Oct 18 2015 06:01
Yes what @bruglesco said also you need to remove punctuation
Katie
@Katie-S
Oct 18 2015 06:04
Thanks @bruglesco . Now the only thing I've got to figure out is how to get it to ignore spaces and punctuation?
CamperBot
@camperbot
Oct 18 2015 06:04
katie-s sends brownie points to @bruglesco :sparkles: :thumbsup: :sparkles:
:star: 205 | @bruglesco | http://www.freecodecamp.com/bruglesco
Katie
@Katie-S
Oct 18 2015 06:05
Only other thing I don't get is if the word is "almostomla" it should return false but returns as undefined?
bruglesco
@bruglesco
Oct 18 2015 06:06
you need to use a regEx to remove spaces and punctuation
Katie
@Katie-S
Oct 18 2015 06:07
okay thank you. I'll have to go back and read some more. :)
CamperBot
@camperbot
Oct 18 2015 06:07
if you want to thank someone, put an @ before their name!
Esther
@kunjac
Oct 18 2015 06:20
Hi guys! I'm really new to this, does anyone have time to talk about the class definitions for CSS? My code keeps producing thr incorrect result
Katie
@Katie-S
Oct 18 2015 06:25
I feel as though I'm completely lost. Like I completed all the waypoints, but seems like I completely missed something now that I'm on the Bonfires? Like where did we learn about RegEx ?
Herman Fassett
@HermanFassett
Oct 18 2015 06:26
There were a few waypoints on regex
It was referred to by it's full name Regular Expressions
bruglesco
@bruglesco
Oct 18 2015 06:27
https://regex101.com/ should help tho
Herman Fassett
@HermanFassett
Oct 18 2015 06:27
Yeah that's a helpful site
Esther
@kunjac
Oct 18 2015 06:31
Nvm, got it!
Devon Jones
@jones-codes
Oct 18 2015 06:48
hey does anyone know how to fix the problem where a sort doesn't account for a 2nd digit?
DJ
@qualitymanifest
Oct 18 2015 06:49
@jones-codes as in 10 showing up before 2?
Devon Jones
@jones-codes
Oct 18 2015 06:49
as in 1-10 sort fine. but then item 11 butts in right after item1, instead of after item 10 where it should be
yeah
1-9 sort fine, i meant
DTing
@dting
Oct 18 2015 06:50
@jones-codes you need a comparisonFunction
DJ
@qualitymanifest
Oct 18 2015 06:50
@jones-codes it's outlined pretty well in there
DTing
@dting
Oct 18 2015 06:51
otherwise sort will be lexigraphically
Devon Jones
@jones-codes
Oct 18 2015 06:52
hmm thanks
CamperBot
@camperbot
Oct 18 2015 06:52
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Oct 18 2015 06:52
@dting good to know that's the word for it... hope i retain it haha
Devon Jones
@jones-codes
Oct 18 2015 06:52
thanks @qualitymanifest
CamperBot
@camperbot
Oct 18 2015 06:52
jones-codes sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 281 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Oct 18 2015 06:52
@dting thanks
CamperBot
@camperbot
Oct 18 2015 06:52
qualitymanifest sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1421 | @dting | http://www.freecodecamp.com/dting
Devon Jones
@jones-codes
Oct 18 2015 06:52
not sure how to apply that to meteor though
it's right there
DJ
@qualitymanifest
Oct 18 2015 06:53
@jones-codes haven't done meteor. maybe post your code? @dting is here after all!
Devon Jones
@jones-codes
Oct 18 2015 06:55
here's a sort specifier in meteor
DJ
@qualitymanifest
Oct 18 2015 06:55
@jones-codes but if the issue is what i think it is, the correct .sort function should fix it...
Devon Jones
@jones-codes
Oct 18 2015 06:55
Warriors.find({}, {sort: {rank: 1}});
DTing
@dting
Oct 18 2015 06:56
is rank a Number?
Devon Jones
@jones-codes
Oct 18 2015 06:56
yes
that finds every document in the Warriors collection, and sorts it by rank...until 9
DTing
@dting
Oct 18 2015 06:59
what happens to the rest of the values?
Devon Jones
@jones-codes
Oct 18 2015 06:59
I don't follow, which values?
DTing
@dting
Oct 18 2015 07:02
it sorts by rank until 9
then what happens?
Devon Jones
@jones-codes
Oct 18 2015 07:02
then 10-19 jump up before 2
DTing
@dting
Oct 18 2015 07:03
thats sounds like the rank is stored as a String
meteor should sort the in natural order
hmm
does it sort correctly
if you sort it descending?
Warriors.find({}, {sort: {rank: -1}});
DJ
@qualitymanifest
Oct 18 2015 07:06
somewhat off-topic but... what is meteor exactly? i'm not finding it on the map
Devon Jones
@jones-codes
Oct 18 2015 07:07
meteor is a js framework for live web apps
live/real-time
And no, making it negative doesn't sort it correctly either, starts with 9
DTing
@dting
Oct 18 2015 07:08
its like a verticalized javascript framework
Devon Jones
@jones-codes
Oct 18 2015 07:08
verticalized??
DTing
@dting
Oct 18 2015 07:09
it deals with basically the entire stack
data sever and front end
Devon Jones
@jones-codes
Oct 18 2015 07:09
yep!
DTing
@dting
Oct 18 2015 07:10
can you post your Warriors model
Devon Jones
@jones-codes
Oct 18 2015 07:12
Warriors = new Mongo.Collection("warriors");
if (Meteor.isServer) {
  Meteor.publish('theWarriors', function(){
    return Warriors.find();
  });

  Meteor.methods({
    'draftWarrior': function(selectedWarrior){
      var currentUserId = Meteor.userId();
      Warriors.update(selectedWarrior, {$addtoSet: {draftedBy: currentUserId}});
    },
    'insertWarriorData': function(warriorNameVar, rankVar, weaponVar, armorVar){
      var currentUserId = Meteor.userId();
      Warriors.insert({
        name: warriorNameVar,
        rank: rankVar,
        weapon: weaponVar,
        armor: armorVar,
        createdBy: currentUserId
      });
    },
    'removeWarriorData': function(selectedWarrior){
      var currentUserId = Meteor.userId();
      Warriors.remove(selectedWarrior);
      //Warriors.remove({_id: selectedWarrior, createdBy: currentUserId});
    }
  });
}
DTing
@dting
Oct 18 2015 07:13
and the function call where you add the rank?
err insert Warrior
DJ
@qualitymanifest
Oct 18 2015 07:13
@jones-codes oh okay. meteor.js... i thought you were talking about a bonfire or something. that's way out of my league currently. i'll leave you guys to it
Devon Jones
@jones-codes
Oct 18 2015 07:13
if (Meteor.isClient) {
  Meteor.subscribe('theWarriors');
  Template.warrior.helpers({
    warriors: function () {
      //Show highest rank at the top
      var currentUserId = Meteor.userId();
      return Warriors.find({}, {sort: {rank: -1}});
    }
  });
DTing
@dting
Oct 18 2015 07:14
where you call insertWarriorData
Devon Jones
@jones-codes
Oct 18 2015 07:14
Template.newWarrior.events({
    'submit form': function(event){
      event.preventDefault();
      var warriorNameVar = event.target.warriorName.value;
      var rankVar = event.target.rank.value;
      var weaponVar = event.target.weapon.value;
      var armorVar = event.target.armor.value;

      Meteor.call('insertWarriorData', warriorNameVar, rankVar, weaponVar, armorVar);
      event.target.warriorName.value = "";
      event.target.rank.value = "";
      event.target.weapon.value = "";
      event.target.armor.value = "";

     }
  });
here's the html field where rankVar is pulling the value from
<input class="form-control" type="number" name="rank" min="1" max="64" placeholder="Enter Warrior's Rank">
DTing
@dting
Oct 18 2015 07:18
    'insertWarriorData': function(warriorNameVar, rankVar, weaponVar, armorVar){
      check(rankVar, Number); // Insert this line
      var currentUserId = Meteor.userId();
      Warriors.insert({
        name: warriorNameVar,
        rank: rankVar,
        weapon: weaponVar,
        armor: armorVar,
        createdBy: currentUserId
      });
    },
try this:
      var rankVar = +event.target.rank.value;
you are storing strings
unary plus to conver the string to a number
Devon Jones
@jones-codes
Oct 18 2015 07:24
hmm now I'm not seeing the new Warriors enter
I enter*
DTing
@dting
Oct 18 2015 07:25
  event.target.rank.value = "";
probably because of this i guess you can
remove that check line
and just try the unary plus to convert values you set to numbers
oh actually
Devon Jones
@jones-codes
Oct 18 2015 07:33
I think I got it, I put this line inside the 'insertWarriorData' function
thanks @dting !
CamperBot
@camperbot
Oct 18 2015 07:33
jones-codes sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1423 | @dting | http://www.freecodecamp.com/dting
Devon Jones
@jones-codes
Oct 18 2015 07:33
rankVar = Number(rankVar);
DTing
@dting
Oct 18 2015 07:35
just be cautious that Number("") is 0
nice
Devon Jones
@jones-codes
Oct 18 2015 07:35
You mean if I forget to fill out that field?
This particular form is honestly just to make my life easier filling up the database
the real app will be allowing users to transfer warriors to their own databases...if I can ever figure that out
DTing
@dting
Oct 18 2015 07:49
nice good luck with the project
Devon Jones
@jones-codes
Oct 18 2015 07:51
thanks again for your help @dting
CamperBot
@camperbot
Oct 18 2015 07:51
jones-codes sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: jones-codes already gave dting points
Katie
@Katie-S
Oct 18 2015 08:17
Thanks guys I found them. I got the bonfire to read correctly all except the one that include punctuation? Here is my code the only issue is the one current str should return true and not false. How do I get it to leave in the symbols yet remove commas and periods?
function palindrome(str) { 
var newstr = str.replace(/[^\w\d]/gi,'').toLowerCase(); 
//return newstr;
 var strReverse = newstr.split('').reverse().join(''); 
//return strReverse; 
if (newstr==strReverse){ return true; } else { return false; 
}
 }
 palindrome("0_0 (: /-\ :smile: 0-0 ")
CamperBot
@camperbot
Oct 18 2015 08:17
if you want to thank someone, put an @ before their name!
Katie
@Katie-S
Oct 18 2015 08:19
Sorry that looks better
Do I just type in the symbols I want to keep inside of the brackets?
kaubin05
@kaubin05
Oct 18 2015 08:23
blob
Hello everyone, I am doing the twitch.tv zipline, and sometimes the status doesn't load for some users, and they stay neither online or offline. Does anyone know why that might be? Here is a link to what I have done so far...
Katie
@Katie-S
Oct 18 2015 08:29
Ooh I got it
Thanks guys
CamperBot
@camperbot
Oct 18 2015 08:29
if you want to thank someone, put an @ before their name!
Katie
@Katie-S
Oct 18 2015 08:31
Al I had to do was add |_ outside of the brackets to include underscore back in the replace expression to look like this
function palindrome(str) {


  var newstr = str.replace(/[^\w\d]|_/gi,'').toLowerCase();
//return newstr;

  var strReverse = newstr.split('').reverse().join('');
  //return strReverse;

if (newstr==strReverse){


  return true;
}
 else
   {
    return false;
}
}



palindrome("0_0 (: /-\ :) 0-0 ");
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 09:06
Did anyone implement the minimax algorithm for the tic tac toe zipline?
DTing
@dting
Oct 18 2015 09:30
@Katie-S the \d is redundant
\w is [A-Za-z0-9_]
also you can use \W which is [^A-Za-z0-9_]
so /\W|_/ or /[\W_]/also work
you can check them out at www.regex101.com
@TheHighPriestess I did minimax for my tictactoe
Brijesh Kumar
@brijesh68kumar
Oct 18 2015 09:34
pls help i am confused
Avishay
@avishayshushan
Oct 18 2015 09:42
@brijesh68kumar more details please
Manpreet Singh
@designviacode
Oct 18 2015 09:59
hey everyone.. i'm stuck at setting up ssh for github ..
Robert Means
@BoDonkey
Oct 18 2015 10:00
hey @designviacode - what do you mean?
Manpreet Singh
@designviacode
Oct 18 2015 10:01
here's what i've done till now..
successfully generated ssh keys ..
added them to my system and github...
added them to my ssh-agent ..
Robert Means
@BoDonkey
Oct 18 2015 10:01
@designviacode okay
what is giving you problems?
has anybody used the twitter API?
Manpreet Singh
@designviacode
Oct 18 2015 10:02
on running ssh -T git@github.com
it successfully shows
Hi designviacode! You've successfully authenticated, but GitHub does not
# provide shell access.
the problem is on trying to clone a repo via ssh .. or trying to access via ssh .. it doesn't work ..
and this is where i've no clue .. on how to move forward with this ..
Robert Means
@BoDonkey
Oct 18 2015 10:04
hmmmm...that is the message you should get if your ssh key is set up correctly
how are you trying to clone
Manpreet Singh
@designviacode
Oct 18 2015 10:04
using the ssh clone url ..
Robert Means
@BoDonkey
Oct 18 2015 10:08
so you tried "ssh git@github.com:(repo)"?
sorry for the emoji
: (
Manpreet Singh
@designviacode
Oct 18 2015 10:09
i just tried .. ssh git@github.com
PTY allocation request failed on channel 0
Hi designviacode! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
Robert Means
@BoDonkey
Oct 18 2015 10:14
can you show me the whole command you are typing?
ssh should just use the git@github.com cloning address
Manpreet Singh
@designviacode
Oct 18 2015 10:14
yeah sure ..
this is the repo i'm trying to clone .. from my account ..
Link : git@github.com:designviacode/hello-world.git
sorry ..
git@github.com:designviacode/hello-world.git
Robert Means
@BoDonkey
Oct 18 2015 10:16
emojis can be a *itch!
Manpreet Singh
@designviacode
Oct 18 2015 10:16
yeahh ..
:wink2:
Robert Means
@BoDonkey
Oct 18 2015 10:16
do you mind if I clone it?
Manpreet Singh
@designviacode
Oct 18 2015 10:16
yeah suree..
Robert Means
@BoDonkey
Oct 18 2015 10:17
so
'''
CamperBot
@camperbot
Oct 18 2015 10:17
:bulb: to format code use backticks! ``` more info
Robert Means
@BoDonkey
Oct 18 2015 10:18
git clone git@github.com:designviacode/hello-world.git
''' git clone git@github.com:designviacode/hello-world.git '''
CamperBot
@camperbot
Oct 18 2015 10:18
:bulb: to format code use backticks! ``` more info
Robert Means
@BoDonkey
Oct 18 2015 10:18
git clone git@github.com:designviacode/hello-world.git
worked for me
what do you get when you try that?
Manpreet Singh
@designviacode
Oct 18 2015 10:20
it worked ..
Robert Means
@BoDonkey
Oct 18 2015 10:21
cool
Manpreet Singh
@designviacode
Oct 18 2015 10:21
so does this mean now i can access github from .. terminal itself ..
Robert Means
@BoDonkey
Oct 18 2015 10:21
yeah
creating a new repo is complicated, but everything else is easily done from the terminal
Manpreet Singh
@designviacode
Oct 18 2015 10:22
thanks @BoDonkey :smile:
CamperBot
@camperbot
Oct 18 2015 10:22
designviacode sends brownie points to @bodonkey :sparkles: :thumbsup: :sparkles:
:star: 295 | @bodonkey | http://www.freecodecamp.com/bodonkey
Manpreet Singh
@designviacode
Oct 18 2015 10:25
@BoDonkey just one more query ..
on every commit ..
git asks for my username and password ..
every singhle time ..
Robert Means
@BoDonkey
Oct 18 2015 10:27
git config --global user.name "designviacode"
are you on a mac?
Manpreet Singh
@designviacode
Oct 18 2015 10:28
ubuntu ..
and its different there ..
so once i change it .. it should work ..
Robert Means
@BoDonkey
Oct 18 2015 10:30
hmmm. on mac there is a keychain for credentials--not sure about linux
Manpreet Singh
@designviacode
Oct 18 2015 10:30
i just changed it to represent designviacode..
Robert Means
@BoDonkey
Oct 18 2015 10:30
converted my macbook air to ubuntu--best decision ever
Manpreet Singh
@designviacode
Oct 18 2015 10:30
hehehe ..
now on running git config --global user.name it shows : designviacode
Sam
@slibre2
Oct 18 2015 10:34
Hi all I need help . Why this is wrong ? I try to nest element in form element : <form action="/submit-cat-photo"></form> It was refused , I don't know why . THANKS
@QuincyLarson Hi all I need help . Why this is wrong ? I try to nest element in form element : <form action="/submit-cat-photo"></form> It was refused , I don't know why . THANKS
CamperBot
@camperbot
Oct 18 2015 10:34
slibre2 sends brownie points to @quincylarson :sparkles: :thumbsup: :sparkles:
:star: 140 | @quincylarson | http://www.freecodecamp.com/quincylarson
Robert Means
@BoDonkey
Oct 18 2015 10:35
@designviacode looking around the interwebs, it looks like people on different flavors of unix using gnome-keyring
Manpreet Singh
@designviacode
Oct 18 2015 10:35
okay i'll try to do so .. thanks @BoDonkey for all your help .. :wink:
CamperBot
@camperbot
Oct 18 2015 10:35
designviacode sends brownie points to @bodonkey :sparkles: :thumbsup: :sparkles:
:warning: designviacode already gave bodonkey points
Robert Means
@BoDonkey
Oct 18 2015 10:39
@slibre2 what do you mean by "it was refused"?
Sam
@slibre2
Oct 18 2015 10:39
@BoDonkey It doesn't work . It's not validated
Robert Means
@BoDonkey
Oct 18 2015 10:40
@slibre2 is this at codeacademy or codeschool?
Sam
@slibre2
Oct 18 2015 10:40
@BoDonkey ? It's a free code camp
I m beginner waypoint 30
Robert Means
@BoDonkey
Oct 18 2015 10:41
@slibre2 which section? HTML5 and CSS?
@slibre2 okay CatPhotoApp, right?
Sam
@slibre2
Oct 18 2015 10:42
@BoDonkey yes !
yes
@boDonkey This is my answer : <form action="/submit-cat-photo"></form>
Robert Means
@BoDonkey
Oct 18 2015 10:45
@slibre2 where are you putting the </form>?
Sam
@slibre2
Oct 18 2015 10:46
@BoDonkey at the end as it is a closing tag
Robert Means
@BoDonkey
Oct 18 2015 10:46
@slibre2 is it after your <input type="text" placeholder="cat photo URL">?
Sam
@slibre2
Oct 18 2015 10:46
@BoDonkey Oh yes ! I put alone
Robert Means
@BoDonkey
Oct 18 2015 10:47
@slibre2 should be"

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

<input type="text" placeholder="cat photo URL">
</form>```

Sam
@slibre2
Oct 18 2015 10:47
@BoDonkey I was asking if I had to put it bewteen style ele
Robert Means
@BoDonkey
Oct 18 2015 10:48
@slibre2 be right back
Sam
@slibre2
Oct 18 2015 10:48
@BoDonkey Thanks . in input ele ; ok thanks a lot Bo
CamperBot
@camperbot
Oct 18 2015 10:48
slibre2 sends brownie points to @bodonkey :sparkles: :thumbsup: :sparkles:
:star: 296 | @bodonkey | http://www.freecodecamp.com/bodonkey
Abhisek Pattnaik
@abhisekp
Oct 18 2015 10:55
@slibre2 you don't need to mention quincy asking for help. We're here to help.
Sam
@slibre2
Oct 18 2015 11:11
@abhisekp ok ! sorry ! Because I had no answer So I thought I could ask the teacher ! Mr LARSON . sorry
Abhisek Pattnaik
@abhisekp
Oct 18 2015 11:22
@slibre2 he is too busy! That's the reason he created this awesome community where we can help each other and progress simultaneously. :D
Sam
@slibre2
Oct 18 2015 12:23
@abhisekp ok thanks for your explanations ! Is it possible to ask a question beginning with @all or to all ?
CamperBot
@camperbot
Oct 18 2015 12:23
slibre2 sends brownie points to @abhisekp and @all :sparkles: :thumbsup: :sparkles:
:star: 619 | @abhisekp | http://www.freecodecamp.com/abhisekp
:warning: could not find receiver for all
Nithin Sastry Tellapuri
@NithinSastry
Oct 18 2015 12:24
In jQuery challenges, I am not able to run tests for the first challenge
Sam
@slibre2
Oct 18 2015 12:24
@abhisekp yes that 's a very good communauty ! It's awesome ! worldwide ! great !
Nithin Sastry Tellapuri
@NithinSastry
Oct 18 2015 12:24
This message was deleted
Avishay
@avishayshushan
Oct 18 2015 13:38
hey i'm on the campers news app and i want to add the date of the post
like"poste by x on Oct 18"
the API retrieve this:
timePosted: 1445112631816
what format is it?
EclecticSquare
@EclecticSquare
Oct 18 2015 13:55
I am super stuck. Can anyone help me with the making the background of my form green. I have put the ID attribute everywhere I can think of. I can make it green but it negates the cat-photo-form portion. Ugh!
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 13:55
I need some eyes on this one. Codepen ISN'T giving me an error message for this...but is it correct? Doesn't seem so to me:
var winModal = function () {
    if (xWins == true) {
        $(".winAlert").fadeIn(1000);
    } 
    else if (oWins == true) {
            $(".loseAlert").fadeIn(1000);
        }
}
};
@EclecticSquare which one are you doing?
Sasa
@tanasic
Oct 18 2015 13:57
@EclecticSquare let me see your code
EclecticSquare
@EclecticSquare
Oct 18 2015 13:57
using an ID attribute to Style an element
I'm so new to this. Give me a sec
Screen Shot 2015-10-18 at 9.58.37 AM.png
That's what I've got @tanasic
Sasa
@tanasic
Oct 18 2015 14:00
and what does it fail you ?
from this I dont see what you need to do
EclecticSquare
@EclecticSquare
Oct 18 2015 14:01
trying to make the background color of the form green
KofiAkorli
@KofiAkorli
Oct 18 2015 14:01
@EclecticSquare have you used the '#' in the CSS for id ?
Sasa
@tanasic
Oct 18 2015 14:01
@EclecticSquare paste the whole code so we can see whats wrong :/
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:01
This message was deleted
EclecticSquare
@EclecticSquare
Oct 18 2015 14:02
okay. I'll try
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:02
#cat-photo-form {
 background-color: green;
}
EclecticSquare
@EclecticSquare
Oct 18 2015 14:02

<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;
}
.gray-background {
background-color: gray
}
#cat-photo-element {
background-color: green; }

</style>

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

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

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

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

<form action="/submit-cat-photo" id="cat-photo-form" "cat-photo-element">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>

I've tried all of those things. Nothing is working.
I clearly don't know how to post the code correctly. Eesh! So much to learn.
Sasa
@tanasic
Oct 18 2015 14:03
@EclecticSquare whenever you get stuck, I advise you to read carefully what is asked of you ;)
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:04
@EclecticSquare #cat-photo-form
you have...#cat-photo-element
get rid of "cat-photo-element"
Sasa
@tanasic
Oct 18 2015 14:05
@tanasic because If I have learned anything here it is that ppl rush to do the coding and do not read/understand what is asked of them :/
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:05
Try this @EclecticSquare
#cat-photo-form {
 background-color: green;
}
KofiAkorli
@KofiAkorli
Oct 18 2015 14:05
@EclecticSquare replace the 'cat-photo-form' with 'cat-photo-element'
Sasa
@tanasic
Oct 18 2015 14:06
@EclecticSquare see.. that lessons says: "Try giving your form, which now has the id attribute of cat-photo-form, a green background.
"
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:06
change the word "element" to "form"
EclecticSquare
@EclecticSquare
Oct 18 2015 14:06
OMG! Thank you SOOOOOOO much @TheHighPriestess. That totally fixed it and helped to understand better where I messed up.
CamperBot
@camperbot
Oct 18 2015 14:06
eclecticsquare sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 298 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
EclecticSquare
@EclecticSquare
Oct 18 2015 14:06
Thanks everyone!
CamperBot
@camperbot
Oct 18 2015 14:06
if you want to thank someone, put an @ before their name!
EclecticSquare
@EclecticSquare
Oct 18 2015 14:08
Glad to know this is available. I was losing it over here. @tanasic @TheHighPriestess @camperbot @KofiAkorli
Sasa
@tanasic
Oct 18 2015 14:08
@EclecticSquare haha dont sweat it.. just stay calm :)
KofiAkorli
@KofiAkorli
Oct 18 2015 14:08
@EclecticSquare yeah, you're welcome
EclecticSquare
@EclecticSquare
Oct 18 2015 14:09
Yeahhh. You could end up with a lot of broken electronics if you don't. @tanasic
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:11
@EclecticSquare What happened was that your CSS didn't match your HTML. In your CSS you had "#cat-photo-element"...but in your HTML you had id="cat-photo-form".
EclecticSquare
@EclecticSquare
Oct 18 2015 14:12
Yes. Thank you @TheHighPriestess . From reading it, I was understanding it as 2 separate things but it all makes sense now. I didn't even think about it like that.
CamperBot
@camperbot
Oct 18 2015 14:12
eclecticsquare sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:warning: eclecticsquare already gave thehighpriestess points
Sasa
@tanasic
Oct 18 2015 14:12
@EclecticSquare when Im stuck I do two things: 1. carefuly, slowly read again all the instructions, 2. reset my code and start over... usually helps :)
EclecticSquare
@EclecticSquare
Oct 18 2015 14:13
okay. @tanasic I'll keep that in mind.
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:13
Sometimes I just take a break. Helps to clear the mind. Often..when I do that..I will come back and instantly figure it out.
KofiAkorli
@KofiAkorli
Oct 18 2015 14:14
@EclecticSquare here's a tip, you can let two class names control one element by putting a space between them like this
class = "first second"
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 14:17
...and after taking a break I just went back and figured out my problem
Matt Leonard
@matty22
Oct 18 2015 14:22
@TheHighPriestess Yeah, sometimes I overthink it if I sit there and be stubborn. If I walk away and come back with a fresh train of thought, I realize it's usually much simpler than I was making it.
EclecticSquare
@EclecticSquare
Oct 18 2015 14:24
This place is a wealth of info and help. So glad I stopped being scared to ask for help for fear of sounding like a complete idiot.
back to the coding adventure I go
Saad
@saadi123
Oct 18 2015 14:24

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

};

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

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

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

What I'm doing wrong? This error shows up :
"The Property engines of myCar should be a number"

I've even used this.engines = 1;
ronaldrdguez
@ronaldrdguez
Oct 18 2015 14:26
@saadi123 if you use this.engines, thisis bound to global, use myCar.engines = 1 instead.
Saad
@saadi123
Oct 18 2015 14:27
@ronaldrdguez thanks. It worked. Just for guidance. Even if this.engines is global, isn't it still the property of myCar ?
CamperBot
@camperbot
Oct 18 2015 14:27
saadi123 sends brownie points to @ronaldrdguez :sparkles: :thumbsup: :sparkles:
:star: 356 | @ronaldrdguez | http://www.freecodecamp.com/ronaldrdguez
Francesco Eri
@francescoeri
Oct 18 2015 14:39
sorry im new and Im only learning, i just need to ask a simple question

on my task "Give elements with the red-text class a font-size of 16px." what am I doing wrong?

<style>
.red-text {
color: red;
}
h1 { font-size: 16px; }
</style>

<h2>CatPhotoApp</h2>

<p class="red-text" class="h1">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" class="h1">kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.
</p>

ronaldrdguez
@ronaldrdguez
Oct 18 2015 14:43
@saadi123 When you do this.property = value outside the function definition. this Has nothing to do with Car anymore, instead it refers to the global object. What you’re doing in that case is basically creating a global variable, same as engines = 1. Take a look at Udacitys Object Oriented Javascript course, they have a nice explanation on the parameter this.
Aneeq-ur-Rehman
@aneequrrehman
Oct 18 2015 14:46
@francescoeri You have to add font-size: 16px in your .red-text class.
.red-text {
color: red;
font-size: 16pz;
}
Francesco Eri
@francescoeri
Oct 18 2015 14:46
@aneequrrehman thankyou, and sorry for my stupid question
Aneeq-ur-Rehman
@aneequrrehman
Oct 18 2015 14:47
No problem :)
ronaldrdguez
@ronaldrdguez
Oct 18 2015 15:03
@francescoeri h1 { font-size: 16px; } adds the font size to every h1 on the page. You need to add the property to the .red-text selector so it will only be applied to elements with the red-text class.
Francesco Eri
@francescoeri
Oct 18 2015 15:05
@ronaldrdguez thankyou very much
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 15:12
Can someone tell me why the "loseAlert" div is showing even though I have this: $(".loseAlert").hide(); ?
I'm stumped.
Hans van Riet
@hansinla
Oct 18 2015 15:20
@TheHighPriestess Add this to your style sheet:
.loseAlert{
  display: none;
}
Daniil
@zerin108
Oct 18 2015 15:20
Hey, everyone, I'm stupid in regular expressions. And I need help to understand one algorithm: Bonfire: Title Case a Sentence. What is wrong:
CamperBot
@camperbot
Oct 18 2015 15:20
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Daniil
@zerin108
Oct 18 2015 15:20
function titleCase(str) {
var str = str.toLowerCase().replace(/\b./g, function(m){
return m.toUpperCase();
});
Moisés Man
@moigithub
Oct 18 2015 15:23
. matches any character (except newline)
https://regex101.com/
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 15:27
@hansinla Thank you! I completely overlooked that.
CamperBot
@camperbot
Oct 18 2015 15:27
thehighpriestess sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 543 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Oct 18 2015 15:28
@zerin108 \b. selects both words boundaries (beginning and end of word)
Daniel
@clevadani
Oct 18 2015 15:52
hey guys please what is wrong with my code.
function mutation(arr) {
  var Narr = arr[0].split("");
  var Marr = arr[1].split("");
  for(var i = 0; i < Marr.length; i++){
    if(Narr.indexOf(Narr[i]) !== -1){
      return true;
    }else{
      return false;
    }
  }
}

mutation(["hello", "hey"]);
Sydney Ekpo
@rejreign
Oct 18 2015 16:00
Thanks @jlslew I cracked it finally
CamperBot
@camperbot
Oct 18 2015 16:00
rejreign sends brownie points to @jlslew :sparkles: :thumbsup: :sparkles:
:star: 283 | @jlslew | http://www.freecodecamp.com/jlslew
Amy Cotlow
@acotlow
Oct 18 2015 16:02
hey all! i am currently working on my jquery section with free code camp and am having an issue with this one - can anyone tell me what my "Unexpected identifier" is?
Screenshot-FCC-jQuery.jpg
Aneeq-ur-Rehman
@aneequrrehman
Oct 18 2015 16:10

("button").addClass("animated");

You are missing the "." (dot operator) after the selected element.
Amy Cotlow
@acotlow
Oct 18 2015 16:11
oh jeez
@aneequrrehman brilliant
thanks for helping me see my silly error @aneequrrehman :)
CamperBot
@camperbot
Oct 18 2015 16:11
acotlow sends brownie points to @aneequrrehman :sparkles: :thumbsup: :sparkles:
:star: 180 | @aneequrrehman | http://www.freecodecamp.com/aneequrrehman
Francesco Eri
@francescoeri
Oct 18 2015 16:15
hi question, im on (Waypoint: Make Dead Links using the Hash Symbol)

I have write this on my code but does not work

<p>Click here for <#>="http://www.freecatphotoapp.com">cat photos</#>.</p>

M Used
@mildused
Oct 18 2015 16:16
I can help you out.
Francesco Eri
@francescoeri
Oct 18 2015 16:17
thankyou @mildused
M Used
@mildused
Oct 18 2015 16:17
your link is your href
so you should do a href=#
Aneeq-ur-Rehman
@aneequrrehman
Oct 18 2015 16:19
@francescoeri To create links, you use anchor tag i.e. <a></a>. Now, to add source to your anchor tag, you use the attribute href="". The target link is written in this href. For example
<a href="http://www.google.com">Google</a>. To make dead links, just replace that target link with "#". So <a href="#">Google</a>

In your case, it's just

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

Francesco Eri
@francescoeri
Oct 18 2015 16:20
a ok simple than what i thoug, thankyou guys @aneequrrehman @mildused
Nick Trull
@nicktrull
Oct 18 2015 16:26
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".

  // Only change code below this line.



  // Only change code above this line.
}

// We use this function to show you the value of your variable in your output box.
var result = myFunction();if(typeof(flip) !== "undefined" && typeof(flip) === "number" && typeof(result) !== "undefined" && typeof(result) === "string"){(function(y,z){return 'flip = ' + y.toString() + ', text = ' + z;})(flip, result);}
i feel like this exercise assumes i've done this kind of thing before. but i have not. and have no idea how to write what it wants. can anyone offer the solution and an explanation of why it's written that way? i've tried several wrong combinations but this is more technical than logical at the time to me.
This message was deleted
Jason Yang
@zjasonyang
Oct 18 2015 16:33
is these two means the same?
if(obj.hasOwnProperty(t[i])) {
    if(obj[t[i]] == source[t[i]]) {
        return true;
    }
}
return false;
if(!obj.hasOwnProperty(t[i]) || obj[t[i] !== source[t[i]])  {
    return flase;
}
return true;
Logan Tegman
@ltegman
Oct 18 2015 16:35

@nicktrull You need to follow the example in the sidebar of how to write an if-statement but change the comparison and return value to match what the question is asking you to do. Here’s what that should look like:

if (flip === 0) {
    return "heads";
  } else {
    return "tails";
  }

This code checks if the variable flip has the value zero and returns a string ”heads” if it does. Otherwise it returns a string ”tails”

@zjasonyang Yes, those two should accomplish the same thing.
Rex Schrader
@SaintPeter
Oct 18 2015 16:37
@zjasonyang Yes, I believe so. They both check to see if a property exists in obj and if it exists, if it's equal to the propery. If it neither exists nor is equal, it returns false. There are actually Boolean algebra formulas which say, roughly,
A && B === (!A || !B)
Nick Trull
@nicktrull
Oct 18 2015 16:46
@ltegman ok thank you. a few waypoints back when booleans were introduced i got the impression their values could only be true or false. didn't know i was supposed to change return to the values of heads and tails. that was my hang up. now clear thanks to you! booleans can have other values
CamperBot
@camperbot
Oct 18 2015 16:46
nicktrull sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 244 | @ltegman | http://www.freecodecamp.com/ltegman
Justin Dieter
@JDieter12
Oct 18 2015 16:47
Perhaps this is not the proper place to ask "interview process" questions, but I thought I'd try.
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:47
I'm looking at someone else's code and there are a few things that I find odd. For example, this:
// INITIALIZES GAME - keep after var newGame
$(document).ready(function () {
    newGame();
});
M Used
@mildused
Oct 18 2015 16:47
What is your question @TheHighPriestess
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:47
I would not have done it this way. I would have put everything inside .ready
@mildused The rest of the functions are OUTSIDE document.ready.
M Used
@mildused
Oct 18 2015 16:48
Well this is quite optimized actually
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:48
I'm wondering...why do it this way?
M Used
@mildused
Oct 18 2015 16:48
That means the functions are rendered while the page is loading
and when the page is loaded, the functions are quickly called
instead of waiting for the functions to be compiled and called after the window is ready
Logan Tegman
@ltegman
Oct 18 2015 16:49
@nicktrull booleans can only be true or false, but you can return values that are not booleans. We are returning a string in this case instead of a boolean.
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:49
newGame() calls the other functions....
M Used
@mildused
Oct 18 2015 16:49
Yes.
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:49
So...this is just for optimization?
M Used
@mildused
Oct 18 2015 16:49
Primarily, yes
It could also be used for setting it up as a component based js
if that function needs to be called again at any time, it is globally accessible
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:50
Notice that it says it should be placed AFTER newGame()
Nick Trull
@nicktrull
Oct 18 2015 16:50
@ltegman ah. more clarity. i press on. thanks again.
CamperBot
@camperbot
Oct 18 2015 16:50
nicktrull sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:warning: nicktrull already gave ltegman points
M Used
@mildused
Oct 18 2015 16:51
@TheHighPriestess That is so the function could be defined already
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:51
@mildused Would it have been incorrect to place eveything within document.ready?
M Used
@mildused
Oct 18 2015 16:52
@TheHighPriestess Not necessarily, but you could want to call those functions elsewhere, and that could have caused trouble
Elizabeth Hatleli
@TheHighPriestess
Oct 18 2015 16:53
Ok...I am making a note of what you're saying. I know that my javascript skills aren't that great. I feel that I have some serious gaps.
@mildused thank you for the information
CamperBot
@camperbot
Oct 18 2015 16:53
thehighpriestess sends brownie points to @mildused :sparkles: :thumbsup: :sparkles:
:star: 44 | @mildused | http://www.freecodecamp.com/mildused
Denis Zavedeev
@cac03
Oct 18 2015 17:00
Hi everyone. Please tell me does this http://codepen.io/caco3/full/rOYKmR/ work correctly?
M Used
@mildused
Oct 18 2015 17:00
Image doesn't work. My city doesn't show up
And this doesn't seem to be my weather
It should be able to get the weather of the user, not just yours
Denis Zavedeev
@cac03
Oct 18 2015 17:01
@mildused yes, I know. Did you opened that in the new window?
M Used
@mildused
Oct 18 2015 17:01
Yes
Seems to be Moscow weather even in different page
Denis Zavedeev
@cac03
Oct 18 2015 17:03
Somehing strange happens.
Rex Schrader
@SaintPeter
Oct 18 2015 17:03
@cac03 Works for me in Sacramento
Denis Zavedeev
@cac03
Oct 18 2015 17:04
@SaintPeter does image work?
Rex Schrader
@SaintPeter
Oct 18 2015 17:04
@cac03 Is there supposed to be a background image?
Denis Zavedeev
@cac03
Oct 18 2015 17:05
@SaintPeter no, it's just gray color.
Rex Schrader
@SaintPeter
Oct 18 2015 17:05
@cac03 I see a weather icon, if that's what you mean?
Denis Zavedeev
@cac03
Oct 18 2015 17:05
@SaintPeter yes.
Thanks @SaintPeter
CamperBot
@camperbot
Oct 18 2015 17:05
cac03 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1060 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 18 2015 17:06
blob
Denis Zavedeev
@cac03
Oct 18 2015 17:07
@SaintPeter thanks again. And I should fix sunrise and sunset time.
CamperBot
@camperbot
Oct 18 2015 17:07
cac03 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: cac03 already gave saintpeter points
Amir Ghafouri
@amirghafouri
Oct 18 2015 18:00
This message was deleted

For Waypoint: Bring your JavaScript Slot Machine to Life

I enter this as code:
$($".slot")[0]).html(slotOne);
$($".slot")[1]).html(slotTwo);
$($".slot")[2]).html(slotThree);

And it tells me:
missing ) after argument list

What am I doing wrong?

Rex Schrader
@SaintPeter
Oct 18 2015 18:04
@amirghafouri You're actually missing an opening (:
$($(".slot
Amir Ghafouri
@amirghafouri
Oct 18 2015 18:08
Oh wow that's embarrassing haha. Thank you @SaintPeter !
CamperBot
@camperbot
Oct 18 2015 18:08
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 18 2015 18:09
@amirghafouri Haha - happens to the best of us :D
Abdelrahman Mohamed Hassan
@abdonaguib
Oct 18 2015 18:15
Hi I am beginner here I wish anyone can help me I am still at an early stage I have a problem with "Waypoint: Inherit Styles from the Body Element " Can anyone help me

First, create a h1 element with the text Hello World.

Then, let's give all elements on your page the color of green by adding color: green; to your body element's style declaration.

Finally, give your body element the font-family of Monospace by adding font-family: Monospace; to your body element's style declaration.

Rex Schrader
@SaintPeter
Oct 18 2015 18:16
@abdonaguib ok, have you written any code?
Abdelrahman Mohamed Hassan
@abdonaguib
Oct 18 2015 18:16
thats what I have written I don't know what shall i add
<style>
body {
background-color: black; color:green; font-family:Monospace;
}
<h1> Hello World</h1>


</style>
Rex Schrader
@SaintPeter
Oct 18 2015 18:17
@abdonaguib You need to close your style tag above your HTML (Before the <h1> element)
Abdelrahman Mohamed Hassan
@abdonaguib
Oct 18 2015 18:18
This message was deleted
CamperBot
@camperbot
Oct 18 2015 18:18
if you want to thank someone, put an @ before their name!
Abdelrahman Mohamed Hassan
@abdonaguib
Oct 18 2015 18:19
@SaintPeter ohh yea silly mistake thank you very much
CamperBot
@camperbot
Oct 18 2015 18:19
abdonaguib sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1068 | @saintpeter | http://www.freecodecamp.com/saintpeter
Andrei-Mihai Cenusa
@ardinculori
Oct 18 2015 18:25
Waypoint: Create a Form Element
i have a problem
Rex Schrader
@SaintPeter
Oct 18 2015 18:25
@ardinculori What's the trouble?
Andrei-Mihai Cenusa
@ardinculori
Oct 18 2015 18:25
how to insert the form correct?
into the text fielrd
field
Rex Schrader
@SaintPeter
Oct 18 2015 18:26
@ardinculori Can you show what your code looks like?
Andrei-Mihai Cenusa
@ardinculori
Oct 18 2015 18:26
<input type="text" placeholder="cat photo URL">
i tried to insert it in front
between "text" and placholder"
doesn't work
Rex Schrader
@SaintPeter
Oct 18 2015 18:27
@ardinculori one moment
Andrei-Mihai Cenusa
@ardinculori
Oct 18 2015 18:28
ok
Rex Schrader
@SaintPeter
Oct 18 2015 18:29
@ardinculori Are you sure you're doing "Create a Form Element"?
@ardinculori As opposed to Create a text input?
Andrei-Mihai Cenusa
@ardinculori
Oct 18 2015 18:29
figure it out
figured it out
thankx anyway
this is the way the code should have been
<form action="/submit-cat-photo"><input type="text" placeholder="cat photo URL"></form>
Rex Schrader
@SaintPeter
Oct 18 2015 18:30
@ardinculori ok, cool
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 18:30
Back here…so I have another question with bootstrap menu bar…
When I try to implement the rest of the page, they stay in the “back” of the menu bar…forcing me to break line until the elements starts to appear
because if I don’t that, the first texts doesn’t appear on the page because they stay behind the <nav> element
how can I solve that?
Rex Schrader
@SaintPeter
Oct 18 2015 18:38
@dseabra1984 Do you have the navbar set to navbar-fixed?
@dseabra1984 because that forces it to stay fixed at the top of the page
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 18:38
yes, let me check it
navbar-fixed-top
I want that
to stay fixed on the top
I don’t know how to explain in english clearly…but if you want, take a look at this URL http://codepen.io/dseabra1984/pen/zvPaqb
You can see the text staying behind the menu bar
h4r1m4u
@h4r1m4u
Oct 18 2015 18:40
your content needs margin that's equal to the height of the navbar
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 18:41
the top margin? I will try
h4r1m4u
@h4r1m4u
Oct 18 2015 18:41
specifically:
.div1background {
 margin-top: 50px;
}
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 18:42
Brilliant
thank you very much @h4r1m4u
CamperBot
@camperbot
Oct 18 2015 18:42
dseabra1984 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 249 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 18 2015 18:42
my pleasure
Oleg Cherkasky
@gunrunners-paradise
Oct 18 2015 19:03
Can I get some help with a bonfire?
CamperBot
@camperbot
Oct 18 2015 19:03
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Oct 18 2015 19:05
@gunrunners-paradise Sure
@gunrunners-paradise Which one, what's the trouble?
Oleg Cherkasky
@gunrunners-paradise
Oct 18 2015 19:07
@saintPeter
I can't get this function to add to an object
function where(collection, source) {
  var arr;
  var src_keys = Object.keys(source);
  var src = source;
  var result = '';
  var bool = false;
  for(i=0;i<collection.length;i++) {
      arr = collection[i]
      for(k=0;k<src_keys.length;k++) {
        if(arr[src_keys[k]] === src[src_keys[k]]) {
        bool = true;
      } else {
        bool = false;
      }
    }
    if(bool === true) {
      result += arr;
    }
  }
  //arr = collection[0]["last"];
  //arr = collection[0].hasOwnProperty("first");
  //arr = collection[0][src_keys[0]];
  // What's in a name?
  return result;
}

//where([{ "a": 1 }, { "a": 1 }, { "a": 1, "b": 2 }], { "a": 1 })

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
CamperBot
@camperbot
Oct 18 2015 19:07
:bulb: to format code use backticks! ``` more info
Traci Thompson
@Traci7822
Oct 18 2015 19:07
using jQuery, how do you use $(".slot") selector to select all slots then assign values to respective slots?
Oleg Cherkasky
@gunrunners-paradise
Oct 18 2015 19:09
This is the Where art thou bonfire
So can someone help?
Anyone here?
Francisco Pena
@daiky00
Oct 18 2015 19:15
hi guys im stuck here
Rex Schrader
@SaintPeter
Oct 18 2015 19:17

@gunrunners-paradise

 if(arr[src_keys[k]] === src[src_keys[k]]) {
        bool = true;
      } else {
        bool = false;   // What if your first item doesn't match, but your second does?
      }

result needs to be an array, and push arr onto it

Francisco Pena
@daiky00
Oct 18 2015 19:18
var array = [4,5,6,7,8];
var singleVal = total;
// Only change code below this line.

var total = array.reduce(function(prev, cur)) {
  return prev+cur;
});
// Only change code above this line.
(function() {return singleVal;})();
i am stuck here can somebody tell me how to solve this
?
@SaintPeter
Rex Schrader
@SaintPeter
Oct 18 2015 19:20
@daiky00 One sec
Francisco Pena
@daiky00
Oct 18 2015 19:20
ok
h4r1m4u
@h4r1m4u
Oct 18 2015 19:20
@daiky00 line 2 is wrong
Francisco Pena
@daiky00
Oct 18 2015 19:21
line two?
h4r1m4u
@h4r1m4u
Oct 18 2015 19:21
change it to the original code var singleVal = 0
Francisco Pena
@daiky00
Oct 18 2015 19:21
but how do i insert the array total
in that value
?
in that variable a i meant
h4r1m4u
@h4r1m4u
Oct 18 2015 19:21
the total variable is updated when you run the reduce function
on line 5
Francisco Pena
@daiky00
Oct 18 2015 19:22

Reduce can be useful for condensing an array of numbers into one value.

var singleVal = array.reduce(function(previousVal, currentVal){

  return previousVal+currentVal;

});

Use the reduce function to sum all the values in array and assign it to singleVal.

Here are some helpful links:

Array.reduce()

h4r1m4u
@h4r1m4u
Oct 18 2015 19:22
shite, sorry. you also need to change line 5 to var singleVal = ....
Matt Yamamoto
@MattYamamoto
Oct 18 2015 19:23
@daiky00 and you have an extra ) in there
in your reduce function
Francisco Pena
@daiky00
Oct 18 2015 19:23
Program Execution Failure
oh
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:23
@daiky00 use proper variable names in the reduce method callback. The variable name prev doesn't tell a story. But you can replace it with total.
Francisco Pena
@daiky00
Oct 18 2015 19:24
@abhisekp thanks
CamperBot
@camperbot
Oct 18 2015 19:24
daiky00 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 620 | @abhisekp | http://www.freecodecamp.com/abhisekp
Francisco Pena
@daiky00
Oct 18 2015 19:24
@MattYamamoto tahnks
@MattYamamoto thanks
CamperBot
@camperbot
Oct 18 2015 19:24
daiky00 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 382 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Abhishek
@Abhi493
Oct 18 2015 19:24
why there's a semicolon behind the curly bracket in some places, and others there isn't in js unlike other lang?
Rex Schrader
@SaintPeter
Oct 18 2015 19:24
@Abhi493 Because it's an assignment
Francisco Pena
@daiky00
Oct 18 2015 19:24
@h4r1m4u thanks
CamperBot
@camperbot
Oct 18 2015 19:24
daiky00 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 250 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Rex Schrader
@SaintPeter
Oct 18 2015 19:25
@Abhi493 You've got a function that you're assigning to a variable
Abhishek
@Abhi493
Oct 18 2015 19:25
every time we assign we need a semicolon
Rex Schrader
@SaintPeter
Oct 18 2015 19:25
@Abhi493 IE:
var someFunct = function() { return 1; }; // Last semicolon needed to complete the assignement
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:26
@Abhi493 you only need semicolon after an expression or assignment of expression to a variable. But you don't need a semicolon after a statement.
Abhishek
@Abhi493
Oct 18 2015 19:26
ok thanks @abhisekp and @SaintPeter , got it
CamperBot
@camperbot
Oct 18 2015 19:26
abhi493 sends brownie points to @abhisekp and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 621 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 1071 | @saintpeter | http://www.freecodecamp.com/saintpeter
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:27
@Abhi493 now you must know which is an expression and which is a statement. Then won't face any difficulty. EVER.
Abhishek
@Abhi493
Oct 18 2015 19:27
but even if i use it works
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:28
@Abhi493 bcoz the shortest statement in JS is a semicolon. ;)
Abhishek
@Abhi493
Oct 18 2015 19:29
haha, we have a common name @abhisekp
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:30
@Abhi493 :)
But you shek and I just sek! ;)
Vectorjay
@Vectorjay
Oct 18 2015 19:38
Hello guyz
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:38
@Abhi493 you've yourName.length > myName.length
Rex Schrader
@SaintPeter
Oct 18 2015 19:39
@Vectorjay hey hey
Abhishek
@Abhi493
Oct 18 2015 19:39
hahahhaha but ur userName.length> myUserName.length lol
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:39
@Vectorjay Hellllloooo
Vectorjay
@Vectorjay
Oct 18 2015 19:39
@SaintPeter i'm good
Rex Schrader
@SaintPeter
Oct 18 2015 19:39
@Vectorjay Need a hand?
Vectorjay
@Vectorjay
Oct 18 2015 19:40
yeah please
Rex Schrader
@SaintPeter
Oct 18 2015 19:40
@Vectorjay Which waypoint?
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:41
@Vectorjay Can I apply cross product on you?
Vectorjay X Vectorjay
Vectorjay
@Vectorjay
Oct 18 2015 19:42
var city = prompt(" Which is your favourite city!").toUpperCase();

switch(city){
    case'Florida':
        if(city && Florida){
        console.log(" Awesome city to leave in");
        }else{
            console.log(" Florida is not awesome");
            }
            break;
    case'Broklyn':
        if(city || Broklyn){
        console.log("Gangstar area in the USA");
        }else{
            console.log("Not a ganstar city!");
            }
        break;
    case'Texas':
        console.log("Partly dorminated by rich africans");
        break;
    default:
        console.log(" You entered a wrong city");
}
Abhishek
@Abhi493
Oct 18 2015 19:42
i didn't know the consequences of using spoilers to complete the bonfire , i tried to understand it but as of now i forgot a lot, what should i do ? do it all again ???
Vectorjay
@Vectorjay
Oct 18 2015 19:42
Don't seem to know wht is wrong with that code
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:42
@Vectorjay check for 'FLORIDA', 'BROKLYN', etc
in UPPERCASE
Vectorjay
@Vectorjay
Oct 18 2015 19:43
@SaintPeter Did you get that
Rex Schrader
@SaintPeter
Oct 18 2015 19:44
@Vectorjay Which waypoint is this?
Ngaosathe
@ThekhoN
Oct 18 2015 19:44
Guys is it valid to have <img> inside a <h2> ? I encountered it for the first time...is it valid?
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:44
@Abhi493 practice, practice and practice once more
Rex Schrader
@SaintPeter
Oct 18 2015 19:45
@ThekhoN Yes, it should be valid. Maybe not "smart" or "clean", but valid
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:45
@ThekhoN perfectly valid as long as it makes sense
Vectorjay
@Vectorjay
Oct 18 2015 19:45
https://www.codecademy.com/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:45
@ThekhoN as in, is it sensible to draw in the HEADING section of your NOTEBOOK?
Abhishek
@Abhi493
Oct 18 2015 19:46
Practicing... js again...
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:46
@Abhi493 use CodeAcademy and don't forget to return here. We're waiting.
maybe with a :rose:
Abhishek
@Abhi493
Oct 18 2015 19:47
lol
i learned the js course there few months ago @codeacademy
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:48
do it once more
explain js res
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:48
@Abhi493 :point_up: October 19, 2015 1:18 AM
Ngaosathe
@ThekhoN
Oct 18 2015 19:48
hmmm..ok. But won't it be the best thing?
rather use div to contain em images right?
Abhishek
@Abhi493
Oct 18 2015 19:49
tysm @abhisekp thanks for all the res
Vectorjay
@Vectorjay
Oct 18 2015 19:49
@abhisekp thanks it worked
CamperBot
@camperbot
Oct 18 2015 19:49
abhi493 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: abhi493 already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:49
@ThekhoN does it seem best to draw images in the heading section of your notebook?
Abhishek
@Abhi493
Oct 18 2015 19:49
@camperbot THANKS too
CamperBot
@camperbot
Oct 18 2015 19:49
:star: 372 | @camperbot | http://www.freecodecamp.com/camperbot
abhi493 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:49
@ThekhoN HTML is about writing semantically.
Ngaosathe
@ThekhoN
Oct 18 2015 19:50
@abhisekp yes..but i encountered this in some one's code that's why i asked here..
i'm not advocating this in anyway..just wanted to know the best practice
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:51
@ThekhoN it's simply a markup language.
You mark: this is a heading
Then you mark: this is a para
Then: This is an image inbetween my texts in the para
Ngaosathe
@ThekhoN
Oct 18 2015 19:53
@abhisekp yes i get it.
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:53
@ThekhoN btw, if you are trying to use a logo near your heading or in your heading, you can use imgs inside heading
@ThekhoN but you can write the img. outside of heading and use CSS for styling the img. to show near the heading
normally, small imgs are used and it's perfectly alright
Ngaosathe
@ThekhoN
Oct 18 2015 19:55
hmmm..now would tat be semantically correct? maybe not..but we do that coz it's a logo..things aren't always black and white :)
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:55
@ThekhoN yep! :smile: you get it
CoreyThomas
@CoreyThomas
Oct 18 2015 19:56
adding icons?
Abhisek Pattnaik
@abhisekp
Oct 18 2015 19:56
@CoreyThomas maybe

that icon can be written outside of heading

<img src="icon.png">
<h1>I'm A Goat</h1>

and use CSS to do some magic and everything look perfect.
@ThekhoN

maybe use a div to wrap them for better styling
<div class="style-me">
    <img src="icon.png">
    <h1>I'm A Goat</h1>
</div>
Ngaosathe
@ThekhoN
Oct 18 2015 20:00
@abhisekp thanks
CamperBot
@camperbot
Oct 18 2015 20:00
thekhon sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 622 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:02
@ThekhoN happy codin :D
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 20:04
On the Ziplines, anybody knows how to make the effect of the background to stay fixed inside the divs as I scroll the page, and it changes do the next background when I reach the next div?
VeeShostak
@VeeShostak
Oct 18 2015 20:08
@dseabra1984 I think you use a jumbotron (bootstrap) set the background picture or color. and use background-attachment: fixed; or the default scroll
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 20:10
okay
let me try
great
thanks @VeeShostak
CamperBot
@camperbot
Oct 18 2015 20:14
dseabra1984 sends brownie points to @veeshostak :sparkles: :thumbsup: :sparkles:
:star: 197 | @veeshostak | http://www.freecodecamp.com/veeshostak
Andrei-Eduard Croitoru
@Andrei-Croitoru
Oct 18 2015 20:14
waypoint target the same hint
hint
CamperBot
@camperbot
Oct 18 2015 20:15
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:16
@Andrei-Croitoru here
@Andrei-Croitoru waypt. link pls
@dseabra1984 are you looking for parallax effect?
Andrei-Eduard Croitoru
@Andrei-Croitoru
Oct 18 2015 20:17
@abhisekp http://freecodecamp.com/challenges/waypoint-target-the-same-element-with-multiple-jquery-selectors#?solution=fccss%0A%20%20%24(document).ready(function()%20%7B%0A%20%20%20%20%24(%22button%22).addClass(animated)%3B%0A%20%20%20%20%24(%22.btn%22).addClass(shake)%3B%0A%20%20%20%20%24(%22%23target1%22).addClass(animated%2Cbtn-primary)%3B%0A%20%20%20%0A%20%20%7D)%3B%0Afcces%0A%0A%3C!--%20You%20shouldn't%20need%20to%20modify%20code%20below%20this%20line%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%20%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 20:18
Kind of @abhisekp ! but jumbotron do the work!
Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:18
@Andrei-Croitoru you can paste link in this format [Link Title](http://blablabla)
@Andrei-Croitoru when you use name of classes, quote them. They're strings.
and you can add multiple classes by adding a space between the class names
Abhishek
@Abhi493
Oct 18 2015 20:23
js explain res
Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:23
@Andrei-Croitoru writing it directly without quoting, makes javascript compiler think that they're variable names. But since, they're not, so it doesn't work
explain js res
Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:23
find js
CamperBot
@camperbot
Oct 18 2015 20:23

find js

:zero: js fundamental
:one: js resources
:two: zipline use the twitchtv json api
:three: js arguments
:four: js closures
:five: js falsy
:six: js filter
:seven: js for in
:eight: js for of
:nine: js for
:one::zero: js immutable
:one::one: js indexof
:one::two: js loops
:one::three: js map
:one::four: js regex
:one::five: js scope
:one::six: js slice
:one::seven: js ternary
:one::eight: js truthy
:one::nine: js undefined

limited to first 20 entries.
type find js again for more enteries.

Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:23
commands
CamperBot
@camperbot
Oct 18 2015 20:23

commands:

  • isCommand
  • cbot
  • echo
  • echojson
  • whoami
  • botversion
  • botstatus
  • botenv
  • archive
  • init
  • tooNoisy
  • help
  • menu
  • rooms
  • find
  • commands
  • music
  • announce
  • rollem
  • camperCount
  • welcome
  • hello
  • bob
  • wikiFooter
  • wikiUsage
  • wikiCantFind
  • wiki
  • messages
  • thanks
  • about
  • showInfoCallback
  • update
  • bonfire
  • checkBonfireCommands
  • searchBonfire
  • checkHasBonfire
  • inBonfireRoom
  • hint
  • bf
  • explain
  • bot
  • hi
  • index
  • thank
  • log
  • archives
Abhisek Pattnaik
@abhisekp
Oct 18 2015 20:24
@Abhi493 :point_up: October 19, 2015 1:53 AM
Abhishek
@Abhi493
Oct 18 2015 20:24
REALLY helpfull
Daniel Chiuratto Seabra
@daniel-chiuratto-seabra
Oct 18 2015 20:35
This message was deleted
This message was deleted
Francesco Eri
@francescoeri
Oct 18 2015 20:43

Hi, just a simple question, I have done this:

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

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

<h1 class="h1"> Hello World </h1>

But i think i have made some errors because It wont let me go trhu, I get this 2 errors:

  • "Give your body element the color property of green."
    -"Give your body element the font-family property of Monospace."

any help with this little problem.

CamperBot
@camperbot
Oct 18 2015 20:43

welcome to FreeCodeCamp @francescoeri!

Sasa
@tanasic
Oct 18 2015 20:44
@francescoeri it says give your BODY element...
did you do it ? :)
Hans van Riet
@hansinla
Oct 18 2015 20:44
@francescoeri You gave the requested properties to <h1> not to <body>
And h1 is not a class, so you need to lose the .
Francesco Eri
@francescoeri
Oct 18 2015 20:46
sorry I'm just learning I don't get it, so what i need to change?
Sasa
@tanasic
Oct 18 2015 20:47
dont worry
Hans van Riet
@hansinla
Oct 18 2015 20:47
@francescoeri Read the task again and carefully look at your code.
Sasa
@tanasic
Oct 18 2015 20:47
just read again what is it asking you, I suggest you delete / reset your code, read it carefuly and try again
Francesco Eri
@francescoeri
Oct 18 2015 20:47
ok ill try
Prateek Karnal
@Equlnox
Oct 18 2015 20:48
i m putting a border width of 10px but it doesn't accept it
Francesco Eri
@francescoeri
Oct 18 2015 20:48
heheh not easy when I have to translate from Italian to english in my head and then code it up ;)
Sasa
@tanasic
Oct 18 2015 20:48
@Equlnox lets see your code :)
@francescoeri haha that is usualy the problem..
Prateek Karnal
@Equlnox
Oct 18 2015 20:49

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

}
</style>

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

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

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

it says, give your image a border of 10 px
Sasa
@tanasic
Oct 18 2015 20:51
can you send me the screenshot so i can see the code and what it is failing you and asking you to do please
Prateek Karnal
@Equlnox
Oct 18 2015 20:51
okay
Sasa
@tanasic
Oct 18 2015 20:52
because that code looks ok to me :/
oh.. no need to..
see what you did there
Francesco Eri
@francescoeri
Oct 18 2015 20:52
:D thanks @hansinla @tanasic sometimes the easy tip (just delete, read and try) it's the most useful ;)
CamperBot
@camperbot
Oct 18 2015 20:52
francescoeri sends brownie points to @hansinla and @tanasic :sparkles: :thumbsup: :sparkles:
:star: 544 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 83 | @tanasic | http://www.freecodecamp.com/tanasic
Sasa
@tanasic
Oct 18 2015 20:53
@francescoeri yeah,... i tell that everyone here who gets stuck..
just rearead crefuly and reset
Prateek Karnal
@Equlnox
Oct 18 2015 20:53
whats the error?
Sasa
@tanasic
Oct 18 2015 20:53
sometimes it is some stupid typo.. but you cant see it.. so it is easier to do from scratch :D
@Equlnox well what have you wrote.. is is asking you to give your image a BORDER of 10 px
and what did you do ? :)
Francesco Eri
@francescoeri
Oct 18 2015 20:54
as I say as Italian I do need to concentrate allot to do it and if i just miss a word the whole thing goes banane
Prateek Karnal
@Equlnox
Oct 18 2015 20:55
@tanasic i don't see anything wrong with my code
Sasa
@tanasic
Oct 18 2015 20:56
how do you give a border to something please write here just that one line ?
Prateek Karnal
@Equlnox
Oct 18 2015 20:56
border-width: 10px;
Sasa
@tanasic
Oct 18 2015 20:57
no..
Prateek Karnal
@Equlnox
Oct 18 2015 20:57
then?
Sasa
@tanasic
Oct 18 2015 20:57
that is border WIDTH
it is not asking you for border width.. it is asking you for border ;)
get it now :) ?
Hans van Riet
@hansinla
Oct 18 2015 20:58
@Equlnox I think you just need to insert a space after : in your stylesheet.
Prateek Karnal
@Equlnox
Oct 18 2015 20:58
tried that
Sasa
@tanasic
Oct 18 2015 20:59
@hansinla that is not the problem..
Prateek Karnal
@Equlnox
Oct 18 2015 20:59
@tanasic what do you mean?
@tanasic can you just write that line of code?
Sasa
@tanasic
Oct 18 2015 20:59
@Equlnox it is asking you to set the border not border widht
its like color and background-color
they are different
Prateek Karnal
@Equlnox
Oct 18 2015 20:59
Your img element should have the class smaller-image.
Your img element should have the class thick-green-border.
Give your image a border width of 10px.
Give your image a border style of solid.
The border around your img element should be green.
Sasa
@tanasic
Oct 18 2015 21:00
just do what it says.. it isnt mentioning border-witdt
is is sayin to give BORDER of 10px
what lesson is that please
so i can check it out there
Hans van Riet
@hansinla
Oct 18 2015 21:00
@tanasic border-width: 10px; is correct
Prateek Karnal
@Equlnox
Oct 18 2015 21:00
the given sample syntax - .thin-red-border { border-color: red; border-width: 5px; border-style: solid; } </style>.
Waypoint: Add Borders Around your Elements
<style> .thin-red-border { border-color: red; border-width: 5px; border-style: solid; } </style>.
Sasa
@tanasic
Oct 18 2015 21:01
your code is ok..
Prateek Karnal
@Equlnox
Oct 18 2015 21:01
@hansinla i tried that ... didn't work
Sasa
@tanasic
Oct 18 2015 21:02
i've copy pasted it :S
Prateek Karnal
@Equlnox
Oct 18 2015 21:02
@tanasic works?
Sasa
@tanasic
Oct 18 2015 21:02
yes...
:S
i dunno what the problem is..
Hans van Riet
@hansinla
Oct 18 2015 21:02
@Equlnox Have you tried resetting the code and clearing the browser cache?
Prateek Karnal
@Equlnox
Oct 18 2015 21:02
i'll refresh the page then
Sasa
@tanasic
Oct 18 2015 21:02
maybe you should try reseting the code
@hansinla @Equlnox yea do that.. helps sometimes with tproblems like tihs... happens from time to time, dont worry, it is not just you :)
Prateek Karnal
@Equlnox
Oct 18 2015 21:05
its not working
Sasa
@tanasic
Oct 18 2015 21:05
o.O
Prateek Karnal
@Equlnox
Oct 18 2015 21:05
i even cleared the cache
Sasa
@tanasic
Oct 18 2015 21:05
can you please send the screenshot with code and error.. maybe we can help
Prateek Karnal
@Equlnox
Oct 18 2015 21:06
how do i send files in this chat?
Sasa
@tanasic
Oct 18 2015 21:07
@Equlnox dont know.. you can upload it on imgur
Sasa
@tanasic
Oct 18 2015 21:10
it is ok, image has 10px green border...
man this is some bug.. its definitely not you
Prateek Karnal
@Equlnox
Oct 18 2015 21:11
i'll just skip that level then
Sasa
@tanasic
Oct 18 2015 21:11
@Equlnox yea... dont worry that one is not required for certificate..
Kouty
@koouty
Oct 18 2015 21:14

My dear Roman Numeral Converter is dysfunctional:

function convert(num) {

   var rechim = num.toString().split("");
   var l = rechim.length - 1;
   console.log(rechim);
   if (rechim[-1] === 1) {rechim.splice(-1,1, "I")}
   else if (rechim[-1] === 2) {rechim.splice(l-1,1, "II")}
   else if (rechim[-1] === 3) {rechim.splice(l-1,1, "III")}
   else if (rechim[-1] === 4) {rechim.splice(l-1,1, "IV")}
   else if (rechim[-1] === 5) {rechim.splice(-l1,1, "V")}
   else if (rechim[-1] === 6) {rechim.splice(l-1,1, "VI")}
   else if (rechim[-1] === 7) {rechim.splice(l-1,1, "VII")}
   else if (rechim[-1] === 8) {rechim.splice(l-1,1, "VIII")}
   else if (rechim[-1] === 9) {rechim.splice(l-1,1, "IX")}
   else if (rechim[-1] === 0) {rechim.splice(l-1,1,"")}

     if      (rechim[-2] ===1) {rechim.splice(l-2,1,"X")}
     else if (rechim[-2] ===2) {rechim.splice(l-2,1,"XX")}
     else if (rechim[-2] ===3) {rechim.splice(l-2,1,"XXX")}
     else if (rechim[-2] ===4) {rechim.splice(l-2,1,"Xl")}
     else if (rechim[-2] ===5) {rechim.splice(l-2,1,"L")}
     else if (rechim[-2] ===6) {rechim.splice(l-2,1,"LX")}     
     else if (rechim[-2] ===7) {rechim.splice(l-2,1,"LXX")}     
     else if (rechim[-2] ===8) {rechim.splice(l-2,1,"LXXX")}     
     else if (rechim[-2] ===9) {rechim.splice(l-2,1,"XC")}      
     else if (rechim[-2] ===0) {rechim.splice(l-2,1,"")}


     if      (rechim[-3] ===1) {rechim.splice(l-3,1,"C")}
     else if (rechim[-3] ===2) {rechim.splice(l-3,1,"CC")}
     else if (rechim[-3] ===3) {rechim.splice(l-3,1,"CCC")}
     else if (rechim[-3] ===4) {rechim.splice(l-3,1,"CD")}
     else if (rechim[-3] ===5) {rechim.splice(l-3,1,"D")}
     else if (rechim[-3] ===6) {rechim.splice(l-31,"DC")}     
     else if (rechim[-3] ===7) {rechim.splice(l-3,1,"DCC")}     
     else if (rechim[-3] ===8) {rechim.splice(l-3,1,"DCCC")}     
     else if (rechim[-3] ===9) {rechim.splice(l-3,1,"CM")}      
     else if (rechim[-3] ===0) {rechim.splice(l-3,1,"")}
     console.log(rechim);
   return rechim.join("");
  }
convert(36);

surprising result: "36"

Rex Schrader
@SaintPeter
Oct 18 2015 21:15
@navyvel Goodness. A loop would be helpful
Prateek Karnal
@Equlnox
Oct 18 2015 21:18
can anyone suggest me a good text editor for developing html programs?
Rex Schrader
@SaintPeter
Oct 18 2015 21:18
@navyvel In general, you need to think about what is really happening when you're converting a number to a roman numeral:
Say I'm converting 2015
  • 2000 is greater than 1000 (M), and I can get 2 in there, so I start with MM
  • 2015 - 2000 = 15
  • 15 is not greater than 500 (D), 100(C), or 50(L)
  • 15 is greater than 10 (X) and I can fit 1 in, so now I have MMX
  • 15 - 10 = 5
  • 5 === 5 (V) and I get one, so now I have MMXV
  • 5 - 5 = 0, so I can stop
@Equlnox Atom is pretty nice. It has a ton of plugins, too, to make your life easier
Prateek Karnal
@Equlnox
Oct 18 2015 21:19
thanks
CamperBot
@camperbot
Oct 18 2015 21:19
if you want to thank someone, put an @ before their name!
Sasa
@tanasic
Oct 18 2015 21:20
@Equlnox u can also try microsofts new visual studio code.. it is pretty fast.. has their intelli sense and what not
i've switched from atom to visual code... much faster
Kouty
@koouty
Oct 18 2015 21:22
@SaintPeter I think that to convert the decimal number into a string and begin with the index of the sliced string to a roman character. Is it not faster?
2015 is 2 -> MM
0 -> ""
1 -> X
5 -> 5
that is MMXV;
No good?
Hans van Riet
@hansinla
Oct 18 2015 21:22
@Equlnox sublime 3
Rex Schrader
@SaintPeter
Oct 18 2015 21:23
@navyvel The problem is that values like 50 don't have a place value.
@navyvel IE: 75
Prateek Karnal
@Equlnox
Oct 18 2015 21:23
thanks every one :P
CamperBot
@camperbot
Oct 18 2015 21:23
if you want to thank someone, put an @ before their name!
Prateek Karnal
@Equlnox
Oct 18 2015 21:23
@hansinla @tanasic @SaintPeter thanks for your respective suggestions
CamperBot
@camperbot
Oct 18 2015 21:23
equlnox sends brownie points to @hansinla and @tanasic and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 545 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 85 | @tanasic | http://www.freecodecamp.com/tanasic
Rex Schrader
@SaintPeter
Oct 18 2015 21:23
@Equlnox Honestly, there are a ton of good tools out there. The best one is the one you know how to use. Pick one and stick with it and you're fine.
CamperBot
@camperbot
Oct 18 2015 21:23
:star: 1074 | @saintpeter | http://www.freecodecamp.com/saintpeter
Kouty
@koouty
Oct 18 2015 21:25
@SaintPeter
Why not? 7 -> LXX
and 5 -> V
75 -> LXXV no?
Rex Schrader
@SaintPeter
Oct 18 2015 21:25
@navyvel Or 500 - consider this:
  • 74 is not greater than 1000, 500, 100, but it is greater than 50, so "L"
  • 74 - 50 = 24
  • 24 is greater than 10, and I can fit 2, so "LXX"
  • 24 - 20 = 4
  • 4 = 4 (IV), so "LXXIV"
  • 4-4 = 0 so we're done
@navyvel Well, then you get into the situation that you have to spell out every possible roman value for each digit. Seems like a drag. Your code will be huge.
Kouty
@koouty
Oct 18 2015 21:31
@SaintPeter Right You're right. I agree with you.
But in my enormous code Is an error, why the split method don't replace the digits in Upper case letters? Can your explain this?
Rex Schrader
@SaintPeter
Oct 18 2015 21:38
@navyvel The problem may be that it's a string, not a number
pantelis
@pantelisB
Oct 18 2015 21:39
Hello!!!
KofiAkorli
@KofiAkorli
Oct 18 2015 21:39
@pantelisB hiii
Rex Schrader
@SaintPeter
Oct 18 2015 21:39
@navyvel You can use parseInt to turnit into a number
Kouty
@koouty
Oct 18 2015 21:46
@SaintPeter Sorry if I'm a bore... but for me the number will be turned into a string, through the toString method, and next sliced in an Array, and next the Array were spliced with suppressed digit-characters and replaced Up case letters.
Rex Schrader
@SaintPeter
Oct 18 2015 21:47
@navyvel Right, so each digit needs to be converted to a number with parseInt
@navyvel Or you need to compare it to a string
@navyvel IE: digit === '1' or digit === '2'
Kouty
@koouty
Oct 18 2015 21:49
@SaintPeter Yees
I understand, you're good, the === was out of my mind
Thank's so much and congratulation for the patience!
CamperBot
@camperbot
Oct 18 2015 21:49
navyvel sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1076 | @saintpeter | http://www.freecodecamp.com/saintpeter
Kouty
@koouty
Oct 18 2015 21:51
@camperbot You recognize the thank's. Is there an other word that is recognized as brownie points?
CamperBot
@camperbot
Oct 18 2015 21:51
navyvel sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 374 | @camperbot | http://www.freecodecamp.com/camperbot
Karolis
@Luomint
Oct 18 2015 21:54
bf fib
CamperBot
@camperbot
Oct 18 2015 21:54

:fire:Bonfire: Sum All Odd Fibonacci Numbers :link:

function sumFibs(num) {
  return num;
}

sumFibs(4);

Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.

more info:  bf details | bf links | hint

Karolis
@Luomint
Oct 18 2015 21:54
hint
CamperBot
@camperbot
Oct 18 2015 21:54
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Steven Parker
@Philosophist
Oct 18 2015 21:54
Hello help room. Can I get some feedback on the portfolio web page zipline? I'm feeling a bit lost on what to do next. http://codepen.io/Philosophist/pen/xwZGar
Like, how do I get the horizontal break lines to be clear and how do I push the content to not bury itself behind the nav bar?
Sasa
@tanasic
Oct 18 2015 21:58
margins/padding I guess
David Bouwkamp
@DavidBouw
Oct 18 2015 22:07
@Philosophist Nitpicking, but <hr> does not require a closing tag
Steven Parker
@Philosophist
Oct 18 2015 22:09
Oh, cool. I think I just figured out opacity for the hr. How do I get it to be longer like the one I'm reverse engineering? http://codepen.io/ThiagoFerreir4/full/eNMxEp
Okwudili
@Pat-Nebe
Oct 18 2015 22:13
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat alt="A cute orange cat lying on its back"></a>
I can't get this code to run. Can anyone find any error with this?
Xavier Sumba
@cuent
Oct 18 2015 22:25
Se
You are not closing " in src tag
@Pat-Nebe
Abby
@abbymorssy
Oct 18 2015 22:51

I have a jQuery question. I am currently doing a static todo app, and for dynamically generated checkboxes, the .change() event does not work, as opposed to a pre-existing checkbox (one that was part of the original DOM) where it would work. Why is that?

What I am trying to do is, if the user changes/clicks on the checkbox, a class would be toggled on its sibling <label>. It doesn’t work for injected checkboxes. How can I go about fixing this?

Esztee
@Esztee
Oct 18 2015 22:56
Hello guys, a little help here: "Waypoint: Use CSS Selectors to Style Elements" does not automatically go to the next Waypoint, even though I have the right solution. On the challenge map this is the only waypoint missing... any ideas what's happening?
This is HTML Waypoint 9.
Francesco Eri
@francescoeri
Oct 18 2015 22:57

hi sorry I'm a bit stuck here "Use Font Awesome to add a thumbs-up icon to your like button by giving it a i element with the classes fa and fa-thumbs-up."

this is what i did:

<button class="btn btn-block btn-primary fa i fa-thumbs-up">Like</button>

Moisés Man
@moigithub
Oct 18 2015 22:57
@abeermorssy use .on('change', .... for dinamyc
and "install" the listener event on a parent element
Francesco Eri
@francescoeri
Oct 18 2015 22:57
but it does not work
Esztee
@Esztee
Oct 18 2015 22:58
@francescoeri hint: <i ...> Like </i>
Jordan Bourne
@JordanBourne
Oct 18 2015 23:01
Why can I never get the last part of this function to run, even when the paramaters are met?
function yourTurn() {
  var currentPosition = 0;
  var pressTracker = 0;
  $('.gameButton').mousedown(function() {
    yourNum = parseInt(this.id)
    lightPressed(yourNum);
    yourSeq[currentPosition] = yourNum;
  })
  $('.gameButton').mouseup(function() {
    checkLight(currentPosition);
    currentPosition++;
    console.log(currentPosition, yourSeq.length);
  })
  if (currentPosition == 1) {
    console.log("done");
    return;
  }
}
Francesco Eri
@francescoeri
Oct 18 2015 23:01
@Esztee thankyou :)
Abby
@abbymorssy
Oct 18 2015 23:05
thanks, @moigithub. I'll try this now.
CamperBot
@camperbot
Oct 18 2015 23:05
abeermorssy sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 379 | @moigithub | http://www.freecodecamp.com/moigithub
Kevin Rogers
@kevintrogers
Oct 18 2015 23:05
Is there a way to request someone to codepair with?
Francesco Eri
@francescoeri
Oct 18 2015 23:16

hi, what does it means this :
"Give your form's text input field a class of form-control. "
and how i can fix it on the right way?
Here's my code:

<form action="/submit-cat-photo">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label>
</div>
</div>
<input type="text" placeholder="cat photo URL" required>
<button class="btn btn-primary" type="submit"><i class="fa fa-paper-plane"></i>Submit</button>
</form>

Travis
@TravisHi
Oct 18 2015 23:19
Does anyone know how to make a gutter in between foundation columns?
Aneeq-ur-Rehman
@aneequrrehman
Oct 18 2015 23:33

@francescoeri just give your text input field i.e. <input type="text" placeholder="cat photo URL" required> a class of "form-control." So it will be

<input class="form-control" type="text" placeholder="cat photo URL" required>
"form-control" is class from Bootstrap for input text fields.

Vixtar
@Vixtar
Oct 18 2015 23:46

Okay. I'm just starting out, and I can't get h2 to have the font-family Lobster. Here's my code:

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

h2 {
font-family: Lobster;
}

Can someone tell me what I'm doing wrong?

Rex Schrader
@SaintPeter
Oct 18 2015 23:46
@Vixtar You need to put your link above the <style> tag
Vixtar
@Vixtar
Oct 18 2015 23:47
@SaintPeter You are my hero. Thank you!
CamperBot
@camperbot
Oct 18 2015 23:47
vixtar sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1080 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jean Surkouf
@jesuarva
Oct 18 2015 23:59
@Vixtar the <link> element you could put it everywhere; just do not put it into a tag. vg: <element>…do no tput it here...</element>