These are chat archives for FreeCodeCamp/Help

23rd
Oct 2015
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 00:00
it's quite strange that is won't paste them correctly for slotOne and slotTwo...
brookhensley
@brookhensley
Oct 23 2015 00:01
OK it's kills me to ask but, what am I doing wrong? <script>
$(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });
</script>
Alexa Godfrey
@alexagodfrey
Oct 23 2015 00:01
Hey guys, new to coding. Stuck on this problem. Can someone help me with id attributes? How do I make the form element have the background-color of green? Here is my form element: <form action="/submit-cat-photo" id="cat-photo-form">
Ian Barker
@IanBarkerDev
Oct 23 2015 00:02
@trandnash I'm not sure. We have the same code. My guess is that you accidentally deleted something outside and that is causing 1 and 2 not to update correctly.
@brookhensley $(document).ready(function() {)
@brookhensley $(document).ready(function() {});
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 00:03
@alexagodfrey style="background-color : green" i believe
inline CSS
Ian Barker
@IanBarkerDev
Oct 23 2015 00:04
@alexagodfrey Does it want you to do it inline or as a separate section?
Alexa Godfrey
@alexagodfrey
Oct 23 2015 00:05
It says "do not give your form any class or style attributes"
Herman Fassett
@HermanFassett
Oct 23 2015 00:05
So use ID styles @alexagodfrey
Alexa Godfrey
@alexagodfrey
Oct 23 2015 00:06
@HermanFassett Not sure how to do that
brookhensley
@brookhensley
Oct 23 2015 00:06
There must be something going else going on. It's not even returning any errors when I run tests. I appreciate the assist though
Alexa Godfrey
@alexagodfrey
Oct 23 2015 00:06
@HermanFassett I already have an Id style within the form element, says I can't use more than one?
Herman Fassett
@HermanFassett
Oct 23 2015 00:07

@alexagodfrey id selector is like

#id-of-element {
    places styles here...
}

If you link waypoint I can see what I did

Ian Barker
@IanBarkerDev
Oct 23 2015 00:07
So up in the <style></style> you have to add things.
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 00:07
@alexagodfrey then you will need to add it inside the CSS at the top, insiode. #id-cat-photo { background-color: green; }
Alexa Godfrey
@alexagodfrey
Oct 23 2015 00:11
I tried inputting ^^ under the <style></style>. Didn't work
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 00:12
@alexagodfrey <style> #cat-photo-form { background-color: green; } </style> should do it.
Ian Barker
@IanBarkerDev
Oct 23 2015 00:12
<style>
#my-id {
    font-size: 10px;
}
</style>
@alexagodfrey You can access ids with #s and classes with .s
Alexa Godfrey
@alexagodfrey
Oct 23 2015 00:13
@trandnash That worked, had to put it under the form and not up in the original CSS. THANK YOU all!! :)
CamperBot
@camperbot
Oct 23 2015 00:13
alexagodfrey sends brownie points to @trandnash :sparkles: :thumbsup: :sparkles:
:star: 195 | @trandnash | http://www.freecodecamp.com/trandnash
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 00:13
@alexagodfrey you are creating CSS for all elements in your code with the ID "cat-photo-form". IDs use the # character to select, like classes use the . character.
Herman Fassett
@HermanFassett
Oct 23 2015 00:14
;)
Earnest Cain
@ercain03
Oct 23 2015 00:59
how do you add an i element to a button?
Abhisek Pattnaik
@abhisekp
Oct 23 2015 01:01
@ercain03
<button><i class="fa fa-facebook">Facebook</button>
Earnest Cain
@ercain03
Oct 23 2015 01:01
nevermind got it
@abhisekp thanks
CamperBot
@camperbot
Oct 23 2015 01:01
ercain03 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 644 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 23 2015 01:02
@ercain03 but you already got it by yourself. :+1:
Ed Sztukowski
@Burgustu
Oct 23 2015 01:49
bf Find the Longest Word in a String
CamperBot
@camperbot
Oct 23 2015 01:49

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

findLongestWord('The quick brown fox jumped over the lazy dog');

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

Ed Sztukowski
@Burgustu
Oct 23 2015 01:50
So I need some help understanding the concept of running an if statement inside a for loop
Rex Schrader
@SaintPeter
Oct 23 2015 01:51
@Burgustu ok
@Burgustu Do you have some code, or just general questions?
Ed Sztukowski
@Burgustu
Oct 23 2015 01:52
Well I got close to finishing this bf for the longest word in a string
and ended up looking up some hints to point me in the right direction
Rex Schrader
@SaintPeter
Oct 23 2015 01:52
@Burgustu If you want to share what you have I can take a look at it, or I can talk in general about loops with if
wiki format
CamperBot
@camperbot
Oct 23 2015 01:52

: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

Ed Sztukowski
@Burgustu
Oct 23 2015 01:52
I guess it’s more of a general statement
er
general question
so
if I have this code here
for (var i = 0; i < longArray.length; i++ ) {
      if (longArray[i].length > words) {
       words = longArray[i].length; 
      }
  }
Im trying to walk myself through this
Rex Schrader
@SaintPeter
Oct 23 2015 01:54
@Burgustu ok. Have you initilized words?
Ed Sztukowski
@Burgustu
Oct 23 2015 01:54
i is 0, and 0 is less then the length of the array
Rex Schrader
@SaintPeter
Oct 23 2015 01:54
@Burgustu No, 0 is the first index in the array.
Herman Fassett
@HermanFassett
Oct 23 2015 01:54
Well i is initialized as 0
Rex Schrader
@SaintPeter
Oct 23 2015 01:54
@Burgustu IE:
var arr = [ 'a', 'b', 'c' ];
arr[0] === 'a'; // true
Ed Sztukowski
@Burgustu
Oct 23 2015 01:55
right
okay
so
does the for loop run all the way through once, then start over?
into the if statement?
Rex Schrader
@SaintPeter
Oct 23 2015 01:56
@Burgustu Nope. The loop starts at 0 and goes until i < longArray.length is no longer true. That will happen when i === longArray.length. Which is good, because longArray[longArray.length] === undefined - it would be off the end of the loop.
@Burgustu It only goes through once.
Ed Sztukowski
@Burgustu
Oct 23 2015 01:56
ahh okay
Rex Schrader
@SaintPeter
Oct 23 2015 01:57
If you want to convince yourself, head over to http://repl.it and add some console.log statements to your loop.
Ed Sztukowski
@Burgustu
Oct 23 2015 01:57
so once i === longArray.length, it goes into the if statement?
Rex Schrader
@SaintPeter
Oct 23 2015 01:58
@Burgustu Nope. The if statement is being evaluated once per loop. Everything inside the curly braces is being executed every loop.
Ed Sztukowski
@Burgustu
Oct 23 2015 01:58
okay excellent
Rex Schrader
@SaintPeter
Oct 23 2015 01:58
@Burgustu So it will be evaluated when i = 0, when i = 1, and so on
Ed Sztukowski
@Burgustu
Oct 23 2015 01:59
that’s exactly what i was wondering
@SaintPeter Thanks!
CamperBot
@camperbot
Oct 23 2015 01:59
burgustu sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1159 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 23 2015 01:59
@Burgustu The key thing is that i is being incremented at the END of each loop. So when i === longArray.length, the loop will NOT execute - it will be done and the program will continue after the curly brace closes
@Burgustu :D :D
Roy
@Victoroy
Oct 23 2015 02:02

Hello friends! I have a question about Javascript syntax. What is the difference between using the symbols '' and ""? For example, in the Bonfire: Reverse a String, I arrived at the following function: function

reverseString(str) {
return str.split("").reverse('').join('');
}

I switched the '' and "" symbols and the function still worked
Ed Sztukowski
@Burgustu
Oct 23 2015 02:03
i think it justs needs to be consistent when you use one
Herman Fassett
@HermanFassett
Oct 23 2015 02:03
They both work pretty much the same.
Though ' is always used for single chars
Roy
@Victoroy
Oct 23 2015 02:04
ah I see. Thank you @Burgustu and @HermanFassett
CamperBot
@camperbot
Oct 23 2015 02:04
victoroy sends brownie points to @burgustu and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 197 | @burgustu | http://www.freecodecamp.com/burgustu
:star: 419 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Edward Udelle
@EdwardUdelle
Oct 23 2015 02:05
Thanks @smashzen I was missing the form-control class in the text input also. Worked out well
CamperBot
@camperbot
Oct 23 2015 02:05
edwardudelle sends brownie points to @smashzen :sparkles: :thumbsup: :sparkles:
:star: 333 | @smashzen | http://www.freecodecamp.com/smashzen
Roy
@Victoroy
Oct 23 2015 02:05
One more question. At first my function didn't work because I didn't put the '' or "" symbols in the parenthesis. Are these symbols needed to tell the function to specifically target the string?

still referring to the function:

function reverseString(str) {
return str.split("").reverse('').join('');
}

Herman Fassett
@HermanFassett
Oct 23 2015 02:06
reverse shouldn't have anything inside parentheses
Roy
@Victoroy
Oct 23 2015 02:07
I see. why is that so?
Herman Fassett
@HermanFassett
Oct 23 2015 02:07
Because reverse is just saying reverse this, while split and join need the '' to tell it what to split or join at
With split("") you're telling it to split at every character
And join("") says to join each element of the array with a nothing :)
If you have just split() it won't be telling the function what character to split at
if you have split(" ") that will tell it to split at every space
Roy
@Victoroy
Oct 23 2015 02:09
ah, now it's so clear! Thanks a bunch @HermanFassett , that really helps
CamperBot
@camperbot
Oct 23 2015 02:09
victoroy sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: victoroy already gave hermanfassett points
Kevin Diem
@kgdiem
Oct 23 2015 02:13

@kgdiem
Working on the simon game, anyone know why this results in every button flashing?

function lightUp(){
  setInterval(function(){
    sequence.forEach(function(val){
      light(blocks[val]);
    })
  },600)

sequence == [1,2,3];
blocks == blocks = [$('#green'),$('#red'),$('#yellow'),$('#blue')];

Ed Sztukowski
@Burgustu
Oct 23 2015 02:18
in an if statement, if you don’t specify an “else” does nothing happen at all?
Kevin Diem
@kgdiem
Oct 23 2015 02:18
@Burgustu no
@Burgustu if you say if(1 === 2){alert("Blah")}
Ed Sztukowski
@Burgustu
Oct 23 2015 02:19
so if i have an “if statement” in a “for loop”, would it just hit back to the for loop and ignore it?
Kevin Diem
@kgdiem
Oct 23 2015 02:19
nothing will happen
Ed Sztukowski
@Burgustu
Oct 23 2015 02:19
like
Kevin Diem
@kgdiem
Oct 23 2015 02:19
yes if false it'll just go to the next one
Ed Sztukowski
@Burgustu
Oct 23 2015 02:19
for (var i = 2; 2 < longArray.length; i++ ) {
      if (longArray[2].length > 5) {
       words = longArray[2].length; 
      }
  }
nice
finally getting this
thats assuming that 5 is a larger number than longArray[2].length
I know the rest of the code looks wonky, Im replacing some of the variables to walk myself through it
DTing
@dting
Oct 23 2015 02:44
@Burgustu the middle statement is slightly off
you want to compare the variable i with the array length
also inside the for loop you want to use i when getting the element from the array. longArray[i].length > 5
Vixtar
@Vixtar
Oct 23 2015 02:48

Okay. Me again. This has got me completely stumped.

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

What is an "i element" and where the hell do I put it? I'm trying to nest it in the button code, and have come up with this:

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

Which adds the thumbs up but doesn't add the "i element".

bruglesco
@bruglesco
Oct 23 2015 03:04
<i></i>
@Vixtar
It is its own tag
Vixtar
@Vixtar
Oct 23 2015 03:14
All good. I worked it out! Huzzah! @bruglesco Thanks though.
CamperBot
@camperbot
Oct 23 2015 03:14
vixtar sends brownie points to @bruglesco :sparkles: :thumbsup: :sparkles:
:star: 208 | @bruglesco | http://www.freecodecamp.com/bruglesco
John Oksasoglu
@oksas
Oct 23 2015 03:28
anyone familiar with angular animations that wouldn't mind taking a look at something? my angular animation works great, except the animating elements flicker as the animation starts. I've found some info about this happening and tried a few different things to fix it, but nothing seems to be working D:
having trouble with the style element
John Oksasoglu
@oksas
Oct 23 2015 03:33
@EskimoBurd the syntax is gonna be something like this:
<style>
  h1 {
    font-size: 24px;
  }
</style>
does that help?
Matt Burd
@EskimoBurd
Oct 23 2015 03:35
@oksas it doesnt really but ty and i figured it out myself :)
Abhishek
@Abhi493
Oct 23 2015 03:41
hi web devs! :smile:
Abhisek Pattnaik
@abhisekp
Oct 23 2015 03:49
@Abhi493 hi. How many solved in http://Exercism.io?
not sure what i am missing
David Wilbanks
@dwilbank68
Oct 23 2015 03:52
your <h2> is missing any sort of class
Matt Burd
@EskimoBurd
Oct 23 2015 03:53
think yes, was about to say that
missing or something with the h2 is wrong, i assumed it was that but i get confused when i see the h2 links on the 7th line
David Wilbanks
@dwilbank68
Oct 23 2015 03:53
if it HAD a class, you could target THAT class in your css instead of targeting the entire h2
those are h2 tags
David Wilbanks
@dwilbank68
Oct 23 2015 03:54
and your class="whatever" goes inside the first of the two tags
Matt Burd
@EskimoBurd
Oct 23 2015 03:54
thats what i did didnt work but trying to get it
David Wilbanks
@dwilbank68
Oct 23 2015 03:55
OK that </h2> is html, and in between <style></style> tags we only write CSS...
so you gotta clear that </h2> off of line 4 first
Matt Burd
@EskimoBurd
Oct 23 2015 03:55
did that
Abhishek
@Abhi493
Oct 23 2015 03:56
@abhisekp i didn't get how to us eit
use*
David Wilbanks
@dwilbank68
Oct 23 2015 03:56
now instead of targetting h2 on line 2, you are targeting .red-text
Matt Burd
@EskimoBurd
Oct 23 2015 03:56
added that
David Wilbanks
@dwilbank68
Oct 23 2015 03:56
see the pic again?
Abhisek Pattnaik
@abhisekp
Oct 23 2015 03:57
@Abhi493 k. i can help get you started after 30 mins if you're around. :)
where i am now
David Wilbanks
@dwilbank68
Oct 23 2015 03:57
okay now line 7
Abhishek
@Abhi493
Oct 23 2015 03:57
ok @abhisekp , thank you very much
CamperBot
@camperbot
Oct 23 2015 03:57
abhi493 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 646 | @abhisekp | http://www.freecodecamp.com/abhisekp
David Wilbanks
@dwilbank68
Oct 23 2015 03:58
line 7, put class="whatever" inside the first h2 tag
Michael Bomholt
@bomholtm
Oct 23 2015 03:58
@EskimoBurd i cant remember the original task of that waypoint
but i think you have to give h2 the class of red-text
Matt Burd
@EskimoBurd
Oct 23 2015 03:59
class whatever ? i need to change the color, yes to red using red-text
David Wilbanks
@dwilbank68
Oct 23 2015 03:59
so red-text is the class, yes
Matt Burd
@EskimoBurd
Oct 23 2015 03:59
yes
its the class declariation
David Wilbanks
@dwilbank68
Oct 23 2015 04:00
yep and you should be seeint red letters about now
seeing
m-farooqui
@m-farooqui
Oct 23 2015 04:00
hi i am having trouble nesting a "form" element
m-farooqui
@m-farooqui
Oct 23 2015 04:00
i am in module 30 and hers is my code
Matt Burd
@EskimoBurd
Oct 23 2015 04:00
no red, i can make it red but it isnt the correct form
David Wilbanks
@dwilbank68
Oct 23 2015 04:01
line 7 hasn't been changed at all
m-farooqui
@m-farooqui
Oct 23 2015 04:01
This message was deleted
Waurick Borges
@waurickborges
Oct 23 2015 04:01
can anybody help me on uncommenting HTML
so far i have
m-farooqui
@m-farooqui
Oct 23 2015 04:01

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

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

Michael Bomholt
@bomholtm
Oct 23 2015 04:01
@EskimoBurd can you post the link of that fcc waypoint please?
Waurick Borges
@waurickborges
Oct 23 2015 04:02
Make your h1 element visible on your page by uncommenting it.
Make your h2 element visible on your page by uncommenting it.
Make your p element visible on your page by uncommenting it.
Matt Burd
@EskimoBurd
Oct 23 2015 04:02
got it actually ty
Waurick Borges
@waurickborges
Oct 23 2015 04:02
all correct
Matt Burd
@EskimoBurd
Oct 23 2015 04:02
its literally the last 3 modules have been just missing one little thing
David Wilbanks
@dwilbank68
Oct 23 2015 04:02
yay
m-farooqui
@m-farooqui
Oct 23 2015 04:05
out of the three target goals i got the last two but i am having a hard time with the first one which is about nesting
Lance Jordan
@lacostenycoder
Oct 23 2015 04:06
any CSS wiz's here?
David Wilbanks
@dwilbank68
Oct 23 2015 04:08
not a whiz, but have done the assignments
the input line is not down in between the form tags, and it needs to be
THEN it would be nested
shinjuwu
@shinjuwu
Oct 23 2015 04:13
i try some another regular expression , but can't work
how could i fixed it?
m-farooqui
@m-farooqui
Oct 23 2015 04:15
@dwilbank68 thdnk you
David Wilbanks
@dwilbank68
Oct 23 2015 04:15
yep
m-farooqui
@m-farooqui
Oct 23 2015 04:15
*thank you
CamperBot
@camperbot
Oct 23 2015 04:15
if you want to thank someone, put an @ before their name!
David Wilbanks
@dwilbank68
Oct 23 2015 04:16
camperbot is not too bright
Lance Jordan
@lacostenycoder
Oct 23 2015 04:19
@shinjuwu did you try using .split .join approach instead?
@shinjuwu you need to escape the '
your regex doesn't account for the '
but you don't need a regex to replace the first character of each word
you can use .split(' ' ) and then just change east first letter. then .join()
Lance Jordan
@lacostenycoder
Oct 23 2015 04:26
@dwilbank68 I don't know why my sections are showing what looks like it would be a resize text box triangle at lower right corner of each section.
David Wilbanks
@dwilbank68
Oct 23 2015 04:26
sounds like they are textarea elements (and should be something else)
shinjuwu
@shinjuwu
Oct 23 2015 04:27
@lacostenycoder I have slove this problem by use .split and .join ,i want try another way to slove it ^^
@lacostenycoder But i feel confuse by regular expression
Lance Jordan
@lacostenycoder
Oct 23 2015 04:32
well your regex isn't really doing anything
@shinjuwu what is the purpose of regex for this case? I don't understand what you're trying to remove
@shinjuwu regex is mainly used for string matching or string pattern matching
Lance Jordan
@lacostenycoder
Oct 23 2015 04:37
@shinjuwu but what is the pattern you're trying to match?
shinjuwu
@shinjuwu
Oct 23 2015 04:37
@lacostenycoder mmm... i'm new in regex
Matt Yamamoto
@MattYamamoto
Oct 23 2015 04:38
@shinjuwu try /\b(\w|')+\b/
actually, I'm not sure you need to even specify the word boundry
Lance Jordan
@lacostenycoder
Oct 23 2015 04:40
@shinjuwu @MattYamamoto can anyone explain to me WHY anyone would need a regex for this purpose?
Matt Yamamoto
@MattYamamoto
Oct 23 2015 04:42
@lacostenycoder if I understood @shinjuwu correctly it was merely an exercise in regex as they had already solved the challenge using split/join. I'm not sure that using regex here is wrong in any sense
Lance Jordan
@lacostenycoder
Oct 23 2015 04:43
@MattYamamoto I guess I just don't understand the logic behind regex when the pattern has really nothing to do with the letter because toUpperCase will only do something on a letter that is lower case.
@MattYamamoto what am I missing here?
Matt Yamamoto
@MattYamamoto
Oct 23 2015 04:48
@lacostenycoder it's just using regex to match each word. One could just match the first letter if lowercase with regex too I think
shoot, gotta run for the night... sorry! by the way, I would have just used split/join too. but it's fun to work on my regex matching
Lance Jordan
@lacostenycoder
Oct 23 2015 04:49
@MattYamamoto but again, why would you? toUpperCase() doesn't care if it's already upper
@MattYamamoto it's it's like using a can opener on a twist off bottle lol
DTing
@dting
Oct 23 2015 05:06
@lacostenycoder regex is significantly faster
for certain things
Thomson Muriyadan
@thedigitalmonk
Oct 23 2015 05:11
Why are you looking for a css wiz @lacostenycoder?
Laura Stephenson
@lauralstephenson
Oct 23 2015 05:17
Waypoint 44 give background color to an element can get the color but not give div element the class gray-background. The code is...
<div>

<div background>

<h2 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>
Tried putting it in a separate div. Boinging head into wall.
What am I doing horrifyingly wrong?
DJ
@qualitymanifest
Oct 23 2015 05:20
you need to assign the class to a div, not an h2
also your h2 element should be a p element
Laura Stephenson
@lauralstephenson
Oct 23 2015 05:20
The code farther up is...
.gray-background {
background-color: gray;
}
DJ
@qualitymanifest
Oct 23 2015 05:20
i mean... your closing tag there is </p>. why is the opening tag <h2>?
@lauralstephenson i would suggest resetting your code and starting over.
Laura Stephenson
@lauralstephenson
Oct 23 2015 05:28
I don't understand.
I get the gray background but don't understand how to give my div element the class gray-background. They only way I've been taught to do that is with an h2 element and a class=.
I reset my code and got the exact same outcome.
DJ
@qualitymanifest
Oct 23 2015 05:31
@lauralstephenson you give a class to a div element in the same way. <div class="someClass">your code wrapped in here</div>
@lauralstephenson did you hit the "reset" button under the green "run tests" button?
Laura Stephenson
@lauralstephenson
Oct 23 2015 05:38
Thanks, @qualitymanifest ! Why can't the directions just state that clearly?
CamperBot
@camperbot
Oct 23 2015 05:38
lauralstephenson sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 296 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
sandbhar
@sandbhar
Oct 23 2015 05:52
Give your body element the color property of green.
Your h1 element should inherit the color green from your body element.
not getting these
DJ
@qualitymanifest
Oct 23 2015 06:06
@sandbhar post your code
Laura Stephenson
@lauralstephenson
Oct 23 2015 06:11
Waypoint 46 Use ID to style an element my form element should have the background-color of green. The upper code is... #cat-photo-form green-background {
background-color: green;
}
and the lower code is ...<form action="/submit-cat-photo" id="cat-photo-form">
<background-color> class="green-background"></background-color>
<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 it as a div and an h2. What am I doing wrong?
Robert Richey
@0x0936
Oct 23 2015 06:14
fixing code format
#cat-photo-form green-background {
  background-color: green;
}
<form action="/submit-cat-photo" id="cat-photo-form">
  <background-color> class="green-background"></background-color>
  <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>
Laura Stephenson
@lauralstephenson
Oct 23 2015 06:18
Thanks, @0x0936 , do you spot my error(s)?
CamperBot
@camperbot
Oct 23 2015 06:18
lauralstephenson sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 308 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 23 2015 06:20
@lauralstephenson to style the form, use the id #cat-photo-form, which you did but also have green-background which should be removed. In the HTML, the entire line with a <background-color> tag should be deleted
it's worth pointing out that <background-color> is not a valid HTML tag
NELLISSERY
@NELLISSERY
Oct 23 2015 06:30
I am new in this field trying to learning coding. Kindly help me to solve the Waypoints pro 24 - that is nesting 'a' element in p element and creating 'View more' text - thank you...
CamperBot
@camperbot
Oct 23 2015 06:30
if you want to thank someone, put an @ before their name!
Oli Bullen
@d33con
Oct 23 2015 06:33
@NELLISSERY what is your code?
Laura Stephenson
@lauralstephenson
Oct 23 2015 06:35
@0x0936 Thanks!
Anton Bredl
@antonbr13
Oct 23 2015 06:35
starting on the jQuery stuff - may need a second pair of eyes on my code - i can't find the error
Robert Richey
@0x0936
Oct 23 2015 06:36
@NELLISSERY the paragraph element with the nested anchor tag should be the first paragraph in the HTML section of your code
@antonbr13 post your code please
Anton Bredl
@antonbr13
Oct 23 2015 06:37
<script>
$(document).ready(function() {
});
</script>

Instructions:
Create a script element.

Make sure your script element has a closing tag.

You should add $(document).ready(function() { to the beginning of your script element.

Close your $(document).ready(function() { function with });.

Robert Richey
@0x0936
Oct 23 2015 06:40
there's nothing wrong with the code you posted. try clicking the reset button and try again
Robert Richey
@0x0936
Oct 23 2015 06:46
@antonbr13 did it work?
Deep2322
@Deep2322
Oct 23 2015 06:48
can anyone explain me javascript code for pomodoro timer
Oli Bullen
@d33con
Oct 23 2015 06:48
has anybody here used or is using the code wars site?
Robert Richey
@0x0936
Oct 23 2015 06:49
@d33con yes, but I don't go there often
Anton Bredl
@antonbr13
Oct 23 2015 06:49
@0x0936 yeah i couldn't find anything bugs in my code - unfortunately it still didn't work!!
Robert Richey
@0x0936
Oct 23 2015 06:50
@antonbr13 copy paste all of the code from your waypoint. there may be a problem somewhere else in your code
Anton Bredl
@antonbr13
Oct 23 2015 06:51
unlikely because the task is only to write the script tags plus the first line of jQuery code
Oli Bullen
@d33con
Oct 23 2015 06:51
@0x0936 is it good practice alongside the challenges here? I have just finished intermediate algorithms but feel like i need some more practice to really understand it all
Anton Bredl
@antonbr13
Oct 23 2015 06:51

<script>
$(document).ready(function() { });
</script>

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

@d33con have you done any of the exercises on coderbyte?
Robert Richey
@0x0936
Oct 23 2015 06:52
@d33con yes, absolutely. more practice, wherever you can find it, will never hurt. there's also coderbyte and code euler to look into
Oli Bullen
@d33con
Oct 23 2015 06:53
@0x0936 @antonbr13 thanks!
CamperBot
@camperbot
Oct 23 2015 06:53
d33con sends brownie points to @0x0936 and @antonbr13 :sparkles: :thumbsup: :sparkles:
Robert Richey
@0x0936
Oct 23 2015 06:53
@antonbr13 I copy pasted your code into the waypoint and it works.
CamperBot
@camperbot
Oct 23 2015 06:53
:star: 111 | @antonbr13 | http://www.freecodecamp.com/antonbr13
:star: 310 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 23 2015 06:55
sorry, not code euler but project euler
I also like codecombat and codingame
Oli Bullen
@d33con
Oct 23 2015 06:58
thanks, i will check them out
CamperBot
@camperbot
Oct 23 2015 06:58
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Oct 23 2015 07:01
explain js res
Deep2322
@Deep2322
Oct 23 2015 07:04

function updateTimerLengths() {
if (sessionlength < 0) {
sessionlength = 0;
}

if (breaklength < 0) {
  breaklength = 0;
}
$('#session-length').html(sessionlength / 60);
$('#break-length').html(breaklength / 60);

}

can anyone tell why are we dividing session length and break length by 60
Abhisek Pattnaik
@abhisekp
Oct 23 2015 07:06
@d33con :point_up: October 23, 2015 12:31 PM
explain format
CamperBot
@camperbot
Oct 23 2015 07:06

: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 23 2015 07:06
@Deep2322 :point_up: October 23, 2015 12:36 PM
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:13

OK, I know I'm being obtuse, but I can't correct my own code. ...

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
pink-text-color: pink;
}
</style>

<h1>Hello World!
class="pink-text-color">
</h1>

Anton Bredl
@antonbr13
Oct 23 2015 07:13
@0x0936 project euler is pretty nuts
I would struggle with that level of math for sure
@0x0936 thanks for the suggestion tho!
CamperBot
@camperbot
Oct 23 2015 07:14
antonbr13 sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 311 | @0x0936 | http://www.freecodecamp.com/0x0936
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:14
Waypoint 56 prioritizing style
h4r1m4u
@h4r1m4u
Oct 23 2015 07:17
@lauralstephenson <h1 class="your-class-goes-here">heading text</h1>
@lauralstephenson also:
body {
 ....
}
.pink-text-color {
 ...
}
you don't nest classes within other style declarations
if you want to chain the selectors, you'd do so like this: body .pink-text-color {...}
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:20
still doesn't change my text to pink; I know I'm supposed to add something in h1 to do that. Please help, @h4r1m4u .
h4r1m4u
@h4r1m4u
Oct 23 2015 07:21
read my answers above again. all the hints are there. if you still can't figure it out, post your updated code
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:24

Still not pink. ...

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

<h1 class="pink-text-color">Hello World!
</h1>

And, even with the directions, can't get my stuff to paste into a pretty box. Feeling kinda stoopid today.
h4r1m4u
@h4r1m4u
Oct 23 2015 07:25

@lauralstephenson

body {
 ....
}
.pink-text-color {
 ...
}

you don't nest classes within other style declarations

see how the .pink-text-color declaration is outside of body {...}?
Brett
@TryinNotToPanic
Oct 23 2015 07:27
This message was deleted
h4r1m4u
@h4r1m4u
Oct 23 2015 07:28
@TryinNotToPanic it's not wrong. 'me' is the end of the string.
it's part of 'name'
it doesn't say the substring needs to be a separate word
Brett
@TryinNotToPanic
Oct 23 2015 07:28
Ahh, I’m very stupid.
Thanks.
CamperBot
@camperbot
Oct 23 2015 07:28
if you want to thank someone, put an @ before their name!
Deep2322
@Deep2322
Oct 23 2015 07:32
'''
CamperBot
@camperbot
Oct 23 2015 07:32
:bulb: to format code use backticks! ``` more info
Deep2322
@Deep2322
Oct 23 2015 07:32
'''
function setSwitchButton() {
if (isSession) {
$('#btn-switch-text').html('switch to break');
} else {
$('#btn-switch-text').html('switch to session');
}
}
'''
CamperBot
@camperbot
Oct 23 2015 07:32
:bulb: to format code use backticks! ``` more info
Aayush Kapoor
@xeoneux
Oct 23 2015 07:38
@Deep2322 Use backtick
@Deep2322 It'll be below the ESC key
Deep2322
@Deep2322
Oct 23 2015 07:39
oh sorry and thank u @xeoneux
CamperBot
@camperbot
Oct 23 2015 07:39
deep2322 sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 293 | @xeoneux | http://www.freecodecamp.com/xeoneux
h4r1m4u
@h4r1m4u
Oct 23 2015 07:39
@Deep2322 did you have a question about the code you posted?
Name234
@Name234
Oct 23 2015 07:47

<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
  }
</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">
  <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>
Challenge: Your form element should have the background-color of green.
@camperbot HI
Deep2322
@Deep2322
Oct 23 2015 07:49
hi
i was not able to enter
it was going to next line
Name234
@Name234
Oct 23 2015 07:50
ok
h4r1m4u
@h4r1m4u
Oct 23 2015 07:50
@Name234 you have a question?
Name234
@Name234
Oct 23 2015 07:51
@h4r1m4u yes :)
h4r1m4u
@h4r1m4u
Oct 23 2015 07:51
what's the question? :D
Name234
@Name234
Oct 23 2015 07:51

@h4r1m4u


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

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

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

<form action="/submit-cat-photo" id="cat-photo-form">
  <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>

Challenge: Your form element should have the background-color of green.

Challenge at the end.#
h4r1m4u
@h4r1m4u
Oct 23 2015 07:52
they want you to create a CSS rule that will give <form> green background
Name234
@Name234
Oct 23 2015 07:52
@h4r1m4u yes, and how does that workß
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:53
@h4r1m4u Thanks, but my text is still green. I'm still doing something wrong.
CamperBot
@camperbot
Oct 23 2015 07:53
lauralstephenson sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 288 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Name234
@Name234
Oct 23 2015 07:53
i wont bronze points i have nothng
xD
Uk
@ukchukx
Oct 23 2015 07:53
@Name234 You target the form element like you did the p tag, and apply the green colour.
Name234
@Name234
Oct 23 2015 07:53
;)
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:54

...

<style>
body {
background-color: black;
font-family: Monospace;
color: green;

}

.pink-text-color: {
pink;
}

</style>

<h1 class="pink-text-color">Hello World!
</h1>

h4r1m4u
@h4r1m4u
Oct 23 2015 07:54

@Name234 by now you should know how to create CSS rules for HTML elements and classes, but if

h2 {
 background-color: white;
}

is how you give <h2> white background, how would you give green background to <form>?

@lauralstephenson post the code please
Name234
@Name234
Oct 23 2015 07:55
code for <form> green?
ok i dont understand but hank you ;=
@h4r1m4u thanks ;)
CamperBot
@camperbot
Oct 23 2015 07:55
name234 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 289 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 07:55
@Name234 i'm asking laura to post her code as she has a question too. my hint to you is above
Uk
@ukchukx
Oct 23 2015 07:56
@Name234 You'll replace the element in the example @h4r1m4u posted (h2) with your element (form), and the colour (white) with your colour (green).
Name234
@Name234
Oct 23 2015 07:56
yes. No problem
thanks
CamperBot
@camperbot
Oct 23 2015 07:56
if you want to thank someone, put an @ before their name!
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:56

I did, but here it is again:...

<style>
body {
background-color: black;
font-family: Monospace;
color: green;

}

.pink-text-color: {
pink;
}

</style>

<h1 class="pink-text-color">Hello World!
</h1>

h4r1m4u
@h4r1m4u
Oct 23 2015 07:57

@lauralstephenson

.pink-text-color: {
 pink;
}

what's supposed to be pink? which property? color, border, background-color,...? :)

Name234
@Name234
Oct 23 2015 07:57
@lauralstephenson If you want to post codes pls write above ```
like this:
-your code-
at the end and the beginning
``*
``*
h4r1m4u
@h4r1m4u
Oct 23 2015 07:58
@lauralstephenson also, class declarations are not followed by ':'. so
.pink-text-color {...}
not
.pink-text-color: {...}
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:58

Waypoint 56 Let's see what happens when we create a class that makes text pink, then apply it to an element. Will our class override the body element's color: green; CSS property?

Create a CSS class called pink-text that gives an element the color pink.

Give your h1 element the class of pink-text.

Name234
@Name234
Oct 23 2015 07:59
@lauralstephenson KOREA?
h4r1m4u
@h4r1m4u
Oct 23 2015 07:59
@lauralstephenson "what's supposed to be pink? which property? color, border, background-color,...?" what i meant is that the property is missing in your style declaration. the browser doesn't know what you want to make pink
Laura Stephenson
@lauralstephenson
Oct 23 2015 07:59
@Name234 , yes, I'm an American college professor teaching in Busan, South Korea.
Name234
@Name234
Oct 23 2015 08:00
@Name234 ok :).
cool
Laura Stephenson
@lauralstephenson
Oct 23 2015 08:01

Okay, took out the colon, still got an H1 error, I think. New code ..*<style>
body {
background-color: black;
font-family: Monospace;
color: green;

}

.pink-text-color {
pink;
}

</style>

<h1 class="pink-text-color">Hello World!
</h1>..*

h4r1m4u
@h4r1m4u
Oct 23 2015 08:01
@lauralstephenson your .pink-text-color class is missing which property you want to make pink. you cannot just put 'pink' inside the class declaration
the browser won't know what you want to make pink
compare the declarations for body with .pink-text-color
see the difference?
Uk
@ukchukx
Oct 23 2015 08:08
@lauralstephenson From your style above, you should have the colon after the selector, and the pink in the braces is missing the part that should come before it (the directive).
@lauralstephenson Oops, this was relevant minutes ago, sorry. Had to change my connection.
Uk
@ukchukx
Oct 23 2015 08:14

@lauralstephenson CSS styles are made up of directive & values in the form:

directive : value;

So in your case you have a value, pink, and CSS can't understand it as it needs the directive to make sense of what you want it to do. So you need to supply the directive like so:

directive_to_make_colour_pink : pink;
Name234
@Name234
Oct 23 2015 08:19
@lauralstephenson whats the time in koreaß
?*
Here it is at 10 clock in the morning
Maria
@mariashifa
Oct 23 2015 08:26
hi guys
can anyone tell me the solution to Waypoint: Target HTML Elements with Selectors Using jQuery, JQuery seco
second* challenge on the map
h4r1m4u
@h4r1m4u
Oct 23 2015 08:28
@mariashifa i'm not going to tell you the solution, but i can help you figure it out if you show me what you have so far
Maria
@mariashifa
Oct 23 2015 08:30
<script>
  $(document).ready(function() {

  });
  $("button").addClass("animated bounce");
</script>
h4r1m4u
@h4r1m4u
Oct 23 2015 08:30
put $("button")... inside the document.ready function
Maria
@mariashifa
Oct 23 2015 08:31
u mean inside the bracket after function?
Laura Stephenson
@lauralstephenson
Oct 23 2015 08:31
Thanks @h4r1m4u
CamperBot
@camperbot
Oct 23 2015 08:31
lauralstephenson sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: lauralstephenson already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Oct 23 2015 08:31
yeah, inside the curly brackets {} where you have the empty line
@lauralstephenson you figured it out?
Laura Stephenson
@lauralstephenson
Oct 23 2015 08:32
@Name234 It is 5:24 PM please.
Maria
@mariashifa
Oct 23 2015 08:33
ohhhh okay!! i tried putting it in the() brackets too before..lol thanks @h4r1m4u
CamperBot
@camperbot
Oct 23 2015 08:33
mariashifa sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 290 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 08:34
@mariashifa you're welcome. using the document.ready is extremely common, so you'll see it very often. in a nutshell it guarantees that your javascript code starts executing only after the web page is fully rendered and the DOM elements can be safely manipulated.
in other words, the code you put inside it will execute only after the page is loaded
Maria
@mariashifa
Oct 23 2015 08:36
cool :D
Ankit Panwar
@coderNoob
Oct 23 2015 08:37

http://codepen.io/coderNoob/pen/xwXZdB?editors=101

I have got it pretty easy so far but I can't figure how do I reset the text field if somebody presses a button after clicking the "=" button. For example, I pressed "=" and got some result and now I press button "3", instead of appending the previous result I want the text field to show just "3".

@h4r1m4u Suggest.

h4r1m4u
@h4r1m4u
Oct 23 2015 08:42
@coderNoob track whether = was pressed in some variable. then check the state of this variable on user input (pressing a number). depending on its state, either you will append the pressed number to what is already on the screen (= wasn't pressed), or wipe the screen content and start from scratch (= was pressed)
@coderNoob nice work, btw. it's looking good
Name234
@Name234
Oct 23 2015 08:47
challenges: Create an h1 element.
Your h1 element should have the text Hello World.
Make sure your h1 element has a closing tag.
Give your body element the color property of green.
Give your body element the font-family property of Monospace.
Your h1 element should inherit the font Monospace from your body element.
Your h1 element should inherit the color green from your body element.

´´´

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

</style>
<
```

Francis Isberto
@icebert04
Oct 23 2015 08:48
Help! I'm stuck at Bonfire: Truncate a string. That is under Basic Algorithm Scripting.
CamperBot
@camperbot
Oct 23 2015 08:48
no wiki entry for: im stuck at bonfire truncate a string that is under basic algorithm scripting
:pencil: click here to create one now!after creating your page type update to reload it here
Name234
@Name234
Oct 23 2015 08:48
<style>
  body {
    background-color:blue;
  }

</style>
<
@icebert04 send code
and vhallenge
challenge*
Francis Isberto
@icebert04
Oct 23 2015 08:49

function truncate(str, num) {
// Clear out that junk in your trunk
return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

h4r1m4u
@h4r1m4u
Oct 23 2015 08:51
@icebert04 did you look at the function they recommend in the sidebar? String.slice()
Ankit Panwar
@coderNoob
Oct 23 2015 08:52
@h4r1m4u Can you take a look at it again. I figured out if the "=" was pressed or not but I'm confused as to how I clean the result and start it over if any of the number buttons are pressed.
Francis Isberto
@icebert04
Oct 23 2015 08:54
Here is my code but somehow it is still lacking: function truncate(str, num) {
var truncd = '';
if (str.length > num) {
truncd = str.slice(0,num-3) + '...';
return truncd;
}
return str;
}
h4r1m4u
@h4r1m4u
Oct 23 2015 08:54
@coderNoob did you just add this line $(this).data('clicked', true);?
Ankit Panwar
@coderNoob
Oct 23 2015 08:55
@h4r1m4u Yes and an if-else to check if anything other than the operators was pressed.
h4r1m4u
@h4r1m4u
Oct 23 2015 09:01
@icebert04 it's failing for this test truncate("A-", 1). the bonfire says: "If the length of the string is less than or equal to 3 characters, then the length of the three dots is not added to the string length.". so in this case, you need to truncate the 'A-' string and add '...' to it. your current code will run the first if branch (if (str.length > num) ) and perform this slice: str.slice(0, -2) which will not yield the right result.
you need to add another if branch that checks whether the string shorter than or equal to 3 characters and modify the result accordingly
Ankit Panwar
@coderNoob
Oct 23 2015 09:04
Thanks @h4r1m4u Figured it out. Need criticism now.
http://codepen.io/coderNoob/pen/xwXZdB?editors=101
CamperBot
@camperbot
Oct 23 2015 09:04
codernoob sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 291 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 09:05
@coderNoob good job! :clap: looks good to me.
@coderNoob my calculator has two reset buttons - CE (which wipes everything the user entered so far, the whole calculator memory) and C (which resets only the number he just entered on the display in case he made a mistake). i also have % button. you could potentially think about adding those, but i don't think it's required and you'll pass this zipline no problem
Francis Isberto
@icebert04
Oct 23 2015 09:17
@h4r1m4u Should I add another branch? How should i do it? Will I add another code like this to truncate the 'A-' string: truncd = str.slice(0,num-3) + '...';
h4r1m4u
@h4r1m4u
Oct 23 2015 09:21
@icebert04 i would probably do something along these lines:
if ( (str.length > num) && (str.length > 3)) {
  truncd = str.slice(0,num-3) + '...';
  return truncd;
} else if ( (str.length > num) && (str.length <= 3) ) {
 // do something differently for the short strings
} else {
  return str;
}
Michael Kebe
@michaelkebe
Oct 23 2015 09:28
@coderNoob The layout on small devices is broken.
NELLISSERY
@NELLISSERY
Oct 23 2015 09:29
How can you apply # symbol to href attribute? Please help
Michael Kebe
@michaelkebe
Oct 23 2015 09:31
@NELLISSERY I don't understand your problem. <a href="#">link</a>
Francis Isberto
@icebert04
Oct 23 2015 09:37
@h4r1m4u Still can't get it... Anyway thanks for your help. I really appreciate it. Will go back to the problem tomorrow. Thanks again!
CamperBot
@camperbot
Oct 23 2015 09:37
icebert04 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 292 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 09:38
@icebert04 no problem. hit me up with the updated code tomorrow if you're still struggling.
Francis Isberto
@icebert04
Oct 23 2015 09:38
@h4r1m4u Sure thing...
Ankit Panwar
@coderNoob
Oct 23 2015 09:43
This message was deleted
Manpreet Singh
@designviacode
Oct 23 2015 10:04
hey everyone .. i'm trying to solve Bonfire: piglatin..
i've figured 4 out of 5 test cases ..
but the trouble i'm having is with this one ..
translate("glove") should return "oveglay"
this is due to consonants ..
so my problem is ..
how could i check if a word is a consonant or not ..
my code uptil now is :
function translate(str) {
  var first = str.substr(1, 1),
      rest = str.substr(1,str.length),
      isVowel = /[aeiou]/.test(firstChar),
      pigLatin;

  if(isVowel) {
    return str = str + 'way';
  }else {
    pigLatin = rest + first + 'ay';
    return pigLatin;
  }
}
Ankit Panwar
@coderNoob
Oct 23 2015 10:12
@michaelkebe What do you mean? And how can I fix it?
h4r1m4u
@h4r1m4u
Oct 23 2015 10:15
@designviacode in pseudocode:
if firstletter is vowel:
  return str + way;
else:
 go over str character by char until i find vowel, // for loop may come handy here
 return string with the consonant cluster at the beginning moved to the end + ay;
now you just need to code it :)
Manpreet Singh
@designviacode
Oct 23 2015 10:15
okay i understand till the second last line..
but the main problem is ..
how do i detect a consonant cluster ..
?
@h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 10:18
you don't need to detect the consonant cluster. you just go over the string character by character until you find a vowel. then you can get the index position of the vowel in the string and cut off the beginning of the string until the vowel index. since you've gone over it character by character from the beginning and you know where the first vowel is, you know that everything before it is a consonant
@designviacode
Manpreet Singh
@designviacode
Oct 23 2015 10:19
ooooooooooohhhhhhhhhhhhhhhh...
thanksssss @h4r1m4u .. i've been trying to make sense of figuring this out ..
h4r1m4u
@h4r1m4u
Oct 23 2015 10:20
makes sense?
great!
Manpreet Singh
@designviacode
Oct 23 2015 10:20
it makes perfect sense now ..
thanks @h4r1m4u
CamperBot
@camperbot
Oct 23 2015 10:20
designviacode sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 293 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 10:20
you're welcome
Manpreet Singh
@designviacode
Oct 23 2015 10:22
:smile: :+1:
Nia
@shana399
Oct 23 2015 10:39
hi everyone, can anyone help me out on the size your image waypoint? i've used 100px but its not working??
h4r1m4u
@h4r1m4u
Oct 23 2015 10:40
post your code please @shana399
Nia
@shana399
Oct 23 2015 10:40
.smaller-image {
width: 100px;
}
@h4r1m4u not sure if i posted it correctly
h4r1m4u
@h4r1m4u
Oct 23 2015 10:42
that's fine. can you post the html part as well? (everything in your code pane)
Nia
@shana399
Oct 23 2015 10:42

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

h4r1m4u
@h4r1m4u
Oct 23 2015 10:43
that's all correct. must be a bug.
try to reset the code, reload the waypoint page, and put in the same code again
navin singh dalal
@dalalns
Oct 23 2015 10:43
yes it seems correct to me also
h4r1m4u
@h4r1m4u
Oct 23 2015 10:43
it should pass
Nia
@shana399
Oct 23 2015 10:43
@h4r1m4u and @dalalns thanks for the help
CamperBot
@camperbot
Oct 23 2015 10:43
shana399 sends brownie points to @h4r1m4u and @dalalns :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for dalalns
:star: 294 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
navin singh dalal
@dalalns
Oct 23 2015 10:44
@shana399 welcome
Jaxson
@JaxsonB
Oct 23 2015 11:46
I feel awfully dumb. I can't for the life of me figure out how to split strings
I've looked up a bunch of resources and it just makes me more confused

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

var array = string;

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

SparksMKII
@SparksMKII
Oct 23 2015 11:48
@JaxsonB look up the str.plit() function
str.split() even :p
h4r1m4u
@h4r1m4u
Oct 23 2015 11:49

@JaxsonB

var monthString = 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec';
var monthArray = monthString.split(',');

this will split the string with months into an array. the parameter of the split function, in this case comma (,), is the separator by which the split function splits the string

gregorysl
@gregorysl
Oct 23 2015 11:49
Can anyone help with Waypoint: Manage Packages with NPM ?
Michael Bomholt
@bomholtm
Oct 23 2015 11:49
@JaxsonB the code also depends on how you exactly want to split it
h4r1m4u
@h4r1m4u
Oct 23 2015 11:50
@JaxsonB in other words, you call the split() function on your string and the parameter decides by which character the string will be split
the monthArray in the code above will be: ['Jan', 'Feb', 'Mar', ..., 'Dec']
Jaxson
@JaxsonB
Oct 23 2015 11:54
Oh it totally just clicked for me just then. I just didn't understand how the parameters worked. Thanks guys!
CamperBot
@camperbot
Oct 23 2015 11:54
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Oct 23 2015 11:54
:sparkles:
Penko72
@Penko72
Oct 23 2015 11:59
Do i have to have installed java on my pc ? cuz i'm atm in http://freecodecamp.com/challenges/waypoint-comment-your-javascript-code# and when i press ctrl + enter nothing happends
Uk
@ukchukx
Oct 23 2015 12:02
@Penko72 No, you don't have to install Java.
Jason Wood
@catapixel
Oct 23 2015 12:02
@Penko72 FCC does not require Java anywhere ever
h4r1m4u
@h4r1m4u
Oct 23 2015 12:02
@Penko72 1) java does not equal javascript. two completely different languages. 2) no, you don't need anything special installed on your computer. javascript is support by all browsers
Uk
@ukchukx
Oct 23 2015 12:02
@Penko72 What message is being displayed?
Yannick
@yaniq90
Oct 23 2015 12:03
Hello :) I think I found a bug in waypoint 23. Its a really easy one but when I make a death link with my a element using # it doesnt complete the task. Anyone knows what is wrong?
h4r1m4u
@h4r1m4u
Oct 23 2015 12:03
@Penko72 you probably don't see anything happening because you didn't enter anything into the code pane?
Penko72
@Penko72
Oct 23 2015 12:03
@ukchukx Nothing, like i didn't even put any code in
my code pannel : // This is a comment.
/ Is this also a comment? /
alert ('comment not found');
Uk
@ukchukx
Oct 23 2015 12:03
@Penko72 The second comment is wrong.
Yannick
@yaniq90
Oct 23 2015 12:03
Hello :) I think I found a bug in waypoint 23. Its a really easy one but when I make a death link with my a element using # it doesnt complete the task. Anyone knows what is wrong? <p>Click here for <a #="http://www.freecatphotoapp.com">cat photos</a>.</p>
Penko72
@Penko72
Oct 23 2015 12:03
missing stars ?
Uk
@ukchukx
Oct 23 2015 12:04
@Penko72 You got it!
h4r1m4u
@h4r1m4u
Oct 23 2015 12:04
@Penko72 what @ukchukx says. also, you don't need to alert() anything
Penko72
@Penko72
Oct 23 2015 12:04
they are there ;)
h4r1m4u
@h4r1m4u
Oct 23 2015 12:04
then yeah, remove the alert() function. it should not be there
Penko72
@Penko72
Oct 23 2015 12:04
copy pasting in chat deleted them i guess
Uk
@ukchukx
Oct 23 2015 12:04
@yaniq90 The '#' is in the wrong place.
@yaniq90 That's an error, not a bug :smile:
h4r1m4u
@h4r1m4u
Oct 23 2015 12:05
@yaniq90 the # is supposed to substitute an actual URL. the href attribute in the <a> tag needs to be present
Penko72
@Penko72
Oct 23 2015 12:05
@h4r1m4u yeh its somthing i was trying in chrome terminal line :) but still nothing happens even when i delete that so you know its not problem in that
Yannick
@yaniq90
Oct 23 2015 12:05
@ukchukx Oke thanks, but It says I should replace it for href
CamperBot
@camperbot
Oct 23 2015 12:05
yaniq90 sends brownie points to @ukchukx :sparkles: :thumbsup: :sparkles:
:star: 205 | @ukchukx | http://www.freecodecamp.com/ukchukx
h4r1m4u
@h4r1m4u
Oct 23 2015 12:05
so <a href="somethign goes here">text</a>
Yannick
@yaniq90
Oct 23 2015 12:06
aah oke, thank you very much
CamperBot
@camperbot
Oct 23 2015 12:06
if you want to thank someone, put an @ before their name!
Uk
@ukchukx
Oct 23 2015 12:06
@yaniq90 That's what you should do
Yannick
@yaniq90
Oct 23 2015 12:06
Yes now it works... thank you very much
CamperBot
@camperbot
Oct 23 2015 12:06
if you want to thank someone, put an @ before their name!
Yannick
@yaniq90
Oct 23 2015 12:07
@ukchukx Thanks!
Uk
@ukchukx
Oct 23 2015 12:07
@yaniq90 :+1:
Penko72
@Penko72
Oct 23 2015 12:07
Back to my problem ? xd
h4r1m4u
@h4r1m4u
Oct 23 2015 12:07
@yaniq90 the description of that waypoint is confusing: "Replace your a element's href attribute with a #, also known as a hash symbol, to turn it into a dead link."
it should say "Replace your a element's href attribute's VALUE with a #, also known as a hash symbol, to turn it into a dead link."
Penko72
@Penko72
Oct 23 2015 12:08
gonan give you ss what it looks like :)
Jason Wood
@catapixel
Oct 23 2015 12:08
@h4r1m4u I agree that there could be language confusion but the failing test description makes it clear what to do. "Your a element should be a dead link with a href attribute set to "#"."
h4r1m4u
@h4r1m4u
Oct 23 2015 12:09
@catapixel hmm. you think that's clearer? i feel that can still be confusing to someone completely new to html
Yannick
@yaniq90
Oct 23 2015 12:09
@h4r1m4u Yes I think that would be a better discription!
Uk
@ukchukx
Oct 23 2015 12:10
@catapixel What's obvious to you might not be obvious to someone else e.g what's obvious to a rocket scientist might not be obvious to you... :smile:
Jason Wood
@catapixel
Oct 23 2015 12:11
@h4r1m4u maybe but by the time you get to that waypoint you should have some idea what a link looks like. I'm not saying it couldn't be clearer. Maybe adding a dead link example into the description would be the easiest way to straighten it out...
h4r1m4u
@h4r1m4u
Oct 23 2015 12:12
@catapixel i don't disagree. but i've seen numerous people struggling with this one and always doing the same thing: <a #="http://www....">
@Penko72 back to your issue. based on your screenshot, you should be able to pass the exercise. if you click on the 'Run Code' button, nothing happens?
Jason Wood
@catapixel
Oct 23 2015 12:13
@h4r1m4u then the answer is simple. Submit a pull request with a suggested improvement to github and let them update it if they agree.
Yannick
@yaniq90
Oct 23 2015 12:13
Well atleast I learnt how to ask help for the first time ^^ +1
h4r1m4u
@h4r1m4u
Oct 23 2015 12:13
@catapixel roger that. will do. thanks
CamperBot
@camperbot
Oct 23 2015 12:13
h4r1m4u sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 509 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Oct 23 2015 12:14
@yaniq90 You did great! Read, google, ask. There will be a lot of things as you go along that will not be clear and where you will need to follow that model. It is not a reflection on you that you did not understand what to do immediately.
Penko72
@Penko72
Oct 23 2015 12:15
@h4r1m4u yep nothing happends !! tryed even to go on other waypoint just to see and still nothing
Yannick
@yaniq90
Oct 23 2015 12:15
@catapixel Will do! Thanks for making me a better person ^^ I learn alot here
CamperBot
@camperbot
Oct 23 2015 12:15
yaniq90 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 510 | @catapixel | http://www.freecodecamp.com/catapixel
h4r1m4u
@h4r1m4u
Oct 23 2015 12:15
@Penko72 can you try to reset the code, reload the page and enter the same code again?
alternatively, can you try a different browser and see what happens then?
Penko72
@Penko72
Oct 23 2015 12:16
@h4r1m4u will do
Same thing with realoding , now going with firefox
Jason Wood
@catapixel
Oct 23 2015 12:17
@Penko72 In the flow I'm not sure what your issue is. Can you paste in the code for the waypoint you're working on/having trouble with?
h4r1m4u
@h4r1m4u
Oct 23 2015 12:18
@catapixel he's doing Waypoint: Comment your JavaScript Code and running the code doesn't do anything. his code, as seen in his screenshot here: http://prntscr.com/8uebe3, should pass
Penko72
@Penko72
Oct 23 2015 12:18
@catapixel Looks like its problem in the browser ! @h4r1m4u Helped me out and turns that in firefox it works :) idk how to send this cupcakes but you deserve whole truck of it ;)
h4r1m4u
@h4r1m4u
Oct 23 2015 12:18
@Penko72 lol, nice, glad to hear that :)
what was the original browser?
Penko72
@Penko72
Oct 23 2015 12:19
Chrome
h4r1m4u
@h4r1m4u
Oct 23 2015 12:19
that's bizarre. that should work
just a thought, do you have javascript blocked/disabled in the settings?
Penko72
@Penko72
Oct 23 2015 12:20
Probably cuz i was fixing youtube (html5 vs flash) , and i have bunch of plugins and scripts running
Jason Wood
@catapixel
Oct 23 2015 12:21
@Penko72 your code is working for me in every major browser including Chrome.
Bob Moree
@bmoree
Oct 23 2015 12:21

Hi, there's something wrong with this loop, but I don't know what. Can anyone figure it out?
function smallestCommons(arr) {
arr.sort(function(a,b) {
return a-b;
});
var newArr = []
for(var i=arr[0];i<=arr[1];i++) {
newArr.push(i);
}
var ans = arr[0] * arr[1];
var isDiv = true;
var length = newArr.length;
// check all in newArr if isDiv

loops: while(true) {
for(var j=0;j<length;j++){
var div = newArr[j];
if(ans%div !== 0){
isDiv = false;
}
// if !isDiv add arr[1] and redo loop
if(!isDiv) {
ans = ans+arr[1];
j = 0;
continue loops;
} else if(j===length-1 && isDiv===true) {
return ans;
}
}
break;
}
}

smallestCommons([1,5]);

Hi, there's something wrong with this loop, but I don't know what. Can anyone figure it out?
function smallestCommons(arr) {
  arr.sort(function(a,b) {
    return a-b;
  });
  var newArr = []
  for(var i=arr[0];i<=arr[1];i++) {
    newArr.push(i);
  }
  var ans = arr[0] * arr[1];
  var isDiv = true;
  var length = newArr.length;
  // check all in newArr if isDiv

  loops: while(true) {
    for(var j=0;j<length;j++){
      var div = newArr[j];
     if(ans%div !== 0){
       isDiv = false;
     }
     // if !isDiv add arr[1] and redo loop
      if(!isDiv) {
        ans = ans+arr[1];
        j = 0;
        continue loops;
      } else if(j===length-1 && isDiv===true) {
        return ans;
      }
    }
    break;
  }
}

smallestCommons([1,5]);
h4r1m4u
@h4r1m4u
Oct 23 2015 12:22
@Penko72 you can check according to these instructions: https://productforums.google.com/forum/#!topic/chrome/BYOQskiuGU0. i use chrome almost exclusively and have had no issues with FCC
Bob Moree
@bmoree
Oct 23 2015 12:22
that's better ;-)
h4r1m4u
@h4r1m4u
Oct 23 2015 12:23
@bmoree isn't that an infinite loop? while(true) will run forever as the value of true never changes
Bob Moree
@bmoree
Oct 23 2015 12:25
@h4r1m4u yup, but I'm breaking it if the loop runs all the way, so it should return ans befor that if the for ans is divisable by all of newArr
@h4r1m4u I hope that's not too nonsensical a sentence ;-)
Penko72
@Penko72
Oct 23 2015 12:26
@h4r1m4u is by defould to run all java scripts on all pages
pong324
@pong324
Oct 23 2015 12:27
Hi guys wanna ask something which language is indemand today
h4r1m4u
@h4r1m4u
Oct 23 2015 12:28
@pong324 for what, specifically?
Penko72
@Penko72
Oct 23 2015 12:29
Man its rly hard for me to understand :3 i'm having hard time understanding what do they want from me.. i'm from Croatia and some words are familiar with me but idk what to do still
h4r1m4u
@h4r1m4u
Oct 23 2015 12:29
@bmoree something with that loop is wrong and it runs indefinitely. it crashes my browser
Bob Moree
@bmoree
Oct 23 2015 12:29
@h4r1m4u I know, but i can't figure out what... :-s
Laura Stephenson
@lauralstephenson
Oct 23 2015 12:43
I am on Waypoint 57 and can get my H1 to have a pink-text, but cannot Your h1 element should have the class blue-text.
Your h1 element should be blue. The idea is to put both pink-text and blue-text in the code, and have the blue-text win. My code is..*
h4r1m4u
@h4r1m4u
Oct 23 2015 12:43
@bmoree i figured out what the issue is
Laura Stephenson
@lauralstephenson
Oct 23 2015 12:43

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

.blue-text {
color: pink;
}

</style>

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

..*
h4r1m4u
@h4r1m4u
Oct 23 2015 12:43
@bmoree you still here?
Bob Moree
@bmoree
Oct 23 2015 12:44
@h4r1m4u yup! and eager to learn ;-0-
h4r1m4u
@h4r1m4u
Oct 23 2015 12:46

@bmoree ok, here we go:

  loops: while(true) {
    for(var j=0;j<length;j++){
      var div = newArr[j];
     if(ans%div !== 0){
       isDiv = false;
     }
     // if !isDiv add arr[1] and redo loop
      if(!isDiv) {
        ans = ans+arr[1];
        j = 0;
        continue loops;
      } else if(j===length-1 && isDiv===true) {
        return ans;
      }
    }
    x++;
    break;
  }

on line 5, you set isDiv to false if the ans is not divisible by div without remainder. then you continue and check if(!isDiv). if it's false, you increase ans, reset j and continue loops. but you never reset isDiv. it's now always false and never changes to true

add isDiv = true just above continue loops; and you're golden
Bob Moree
@bmoree
Oct 23 2015 12:47
@h4r1m4u Thanks so much! what a headache
CamperBot
@camperbot
Oct 23 2015 12:47
bmoree sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 295 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 12:47
:)
you see what the issue is, yeah?
Aleksander Gębicki
@Takumar
Oct 23 2015 12:48
@lauralstephenson format your code with backticks so they look better.
Second you have error in your code: h1 class="pink-text" class="blue=-text">Hello World!</h1>
, put both classes in one place: h1 class="pink-text blue-text">Hello World!</h1>
@lauralstephenson write the name of the waypoint you are working on now.
Bob Moree
@bmoree
Oct 23 2015 12:54
@h4r1m4u I thought I did, but I'm still unsure how to fix it..
zakkabakka
@zakkabakka
Oct 23 2015 12:54
hello
h4r1m4u
@h4r1m4u
Oct 23 2015 12:55
@bmoree add isDiv = true; just on the line above continue loops;
zakkabakka
@zakkabakka
Oct 23 2015 12:56
I did not understand what I should do :

var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};

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

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

};

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

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();};

The method getSpeed of myBike should be accessible outside the object.
myBike.speed should be undefined.
Bob Moree
@bmoree
Oct 23 2015 12:58
@h4r1m4u I did, it doesn't work in FCC (although I have no problems in repl.it
Penko72
@Penko72
Oct 23 2015 12:59
What is wrong/missing? ? http://prntscr.com/8ueut1
Aleksander Gębicki
@Takumar
Oct 23 2015 13:00
@zakkabakka hi. "The method getSpeed of myBike should be accessible outside the object." means that method getSpeed() should be public.
"myBike.speed should be undefined." on the other side "speed" should be private property of object.
When you write: this.speed = 100; you declare this property as public, remove this. and it will become private.
For second problem, compare how two methods: getGear() and getSpeed() are defined, it should help you.
h4r1m4u
@h4r1m4u
Oct 23 2015 13:01
@bmoree my suggestions fixes the problem with the infinite loop. i didn't run the code in FCC, so i'm not sure if it passes the exercise. it's possible there's some issue in the logic of your code and it doesn't work for all the test cases.
but it works correctly with the [5,1] array and returns 60
Bob Moree
@bmoree
Oct 23 2015 13:02
no it returns undefined..
Laura Stephenson
@lauralstephenson
Oct 23 2015 13:03
Thanks @h4r1m4u !
CamperBot
@camperbot
Oct 23 2015 13:03
lauralstephenson sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 296 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Bob Moree
@bmoree
Oct 23 2015 13:03
@h4r1m4u weird, it's working now...
h4r1m4u
@h4r1m4u
Oct 23 2015 13:03
nice :)
Zaheer Abbas
@aimfrontenddeveloper
Oct 23 2015 13:09
Hello World!
CamperBot
@camperbot
Oct 23 2015 13:09

welcome to FreeCodeCamp @aimfrontenddeveloper!

Aleksander Gębicki
@Takumar
Oct 23 2015 13:14
@aimfrontenddeveloper welcome to FCC community.
Daniel Robinson
@danielrob
Oct 23 2015 13:18
My Pomodoro Timer Bonfire: http://codepen.io/danielrob/pen/WQdVxN - I'm wondering whether I should make it more object oriented to prevent checks against global variables all the time? E.g. Timer.start(), if (Timer.paused) {}, if (Timer.onBreak){}.... any thoughts?
CamperBot
@camperbot
Oct 23 2015 13:31
no wiki entry for: httpprntscrcom8uf86o
:pencil: click here to create one now!after creating your page type update to reload it here
Penko72
@Penko72
Oct 23 2015 13:35
nvm was beeing stupid :3
zakkabakka
@zakkabakka
Oct 23 2015 13:37
@Takumar thank you so mush
CamperBot
@camperbot
Oct 23 2015 13:37
zakkabakka sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 541 | @takumar | http://www.freecodecamp.com/takumar
Robert Richey
@0x0936
Oct 23 2015 13:43
@danielrob looks great! my only critique is that when adding or subtracting session length, it doesn't reset and update the timer
Laura Stephenson
@lauralstephenson
Oct 23 2015 13:44
I am on Waypoint 77 and don't get where or possibly how to put in my div container-fluid element. Here's my code:..*
pong324
@pong324
Oct 23 2015 13:44
@h4r1m4u for business
Laura Stephenson
@lauralstephenson
Oct 23 2015 13:44

<div>
<h2 class=container-fluid</h2>
</div>

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

The entire code is ...*<div>
<h2 class=container-fluid</h2>
</div>

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

<p>Things cats love:</p>

<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

<p>Top 3 things cats hate:</p>

<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

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

Robert Richey
@0x0936
Oct 23 2015 13:47

@lauralstephenson please wrap your code in triple backticks

```
// your code here
```

Laura Stephenson
@lauralstephenson
Oct 23 2015 13:47
OK
Do you see my issue?
Robert Richey
@0x0936
Oct 23 2015 13:48
I saw a couple problems
the h2 opening tag is not properly closed and the class name needs to be quoted. I'll have to look at the waypoint to see what all needs to be done. It's odd to have an h2 element and no text being displayed with it
<h2 class="container-fluid"></h2>
@lauralstephenson can you please post a link to the waypoint? I can't easily find it.
Laura Stephenson
@lauralstephenson
Oct 23 2015 13:53
Thanks, @0x0936 ! It should be <div class="container-fluid">
</div>. Got it!
CamperBot
@camperbot
Oct 23 2015 13:53
lauralstephenson sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 312 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 23 2015 13:53
@lauralstephenson great!
h4r1m4u
@h4r1m4u
Oct 23 2015 13:59
@pong324 what business, lol? selling shoes, making car repairs, developing the next facebook? you have to be more specific if you want a solid answer
Phil Andy
@philandy
Oct 23 2015 14:11
I need help with the 'Basic Algorithm Scripting' 15 bonfire.
CamperBot
@camperbot
Oct 23 2015 14:11
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Hans van Riet
@hansinla
Oct 23 2015 14:13
@philandy What is your question?
Phil Andy
@philandy
Oct 23 2015 14:16

How do I access all of the arguments of the function?

function destroyer(arr) {
  return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);

Returns[1,2,3,1,2,3]

Avishay
@avishayshushan
Oct 23 2015 14:17
@philandy
arguments[0]
arguments[1]...
Hans van Riet
@hansinla
Oct 23 2015 14:18
@philandy There’s a global variable called arguments. it’s an array with all arguments passed to a function. In this case arguments[0] is arr, the other arguments are arguments[1]…arguments[2]… etc.
Phil Andy
@philandy
Oct 23 2015 14:19
@hansinla thank you!
CamperBot
@camperbot
Oct 23 2015 14:19
philandy sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 551 | @hansinla | http://www.freecodecamp.com/hansinla
Phil Andy
@philandy
Oct 23 2015 14:23
@hansinla i also notice there's a bonfires channel. will ask there for the other bonfires.
21igor
@21igor
Oct 23 2015 14:26
Hi all!
I've got stuck with the Waypoint: Use a CSS Class to Style an Element. I don't see any bugs but the code doesn't work properly. It's very simple code just at the beginning. Is there some kind of answers?
Avishay
@avishayshushan
Oct 23 2015 14:27
insert code
Hans van Riet
@hansinla
Oct 23 2015 14:28
@21igor Can you post your code here?
Daniel Robinson
@danielrob
Oct 23 2015 14:32
@0x0936 that's how the original timer worked. If you pause the timer and update the session time it will reset and update the timer.
pong324
@pong324
Oct 23 2015 14:35
@h4r1m4u for job
Im too sick of my job right now
Hans van Riet
@hansinla
Oct 23 2015 14:36
@pong324 Wrong chat room
pong324
@pong324
Oct 23 2015 14:37
@hansinla why
Robert Richey
@0x0936
Oct 23 2015 14:37
@danielrob you're right. It's confusing as a user that I can add or subtract time, while the timer is going, and nothing happens. I made my timer reset and update whether it was paused or running - but, not necessary it seems.
21igor
@21igor
Oct 23 2015 14:38

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

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

Hans van Riet
@hansinla
Oct 23 2015 14:38
@pong324 We’re here to help people with their code. Not to listen to whining about your job. Try Facebook.
@21igor That looks good. Copy your code, reset the code with the blue button and paste your code. See if that helps. if not, you may need to delete your browser cache and try again.
21igor
@21igor
Oct 23 2015 14:40
Thanks!
CamperBot
@camperbot
Oct 23 2015 14:40
if you want to thank someone, put an @ before their name!
21igor
@21igor
Oct 23 2015 14:41
ok!
@camperbot
@hansinla
Sawredjet
@sawredjet
Oct 23 2015 14:47
how can you make an image smaller? I made a CSS class called smaller image, but I am not sure to actually use it to change the width of my image.
Hans van Riet
@hansinla
Oct 23 2015 14:51
@sawredjet Can you paste your code so we can take a look?
Daniel Robinson
@danielrob
Oct 23 2015 14:59
@0x0936 yes good point, I found that true too. I was intending to add a hard reset button in fact.
@sawredjet so in your html you have <img class="smaller-image" src="(url)"></img> then in css you can .smaller-image { width: 50px; height: 50px; } or something like that?
@camperbot thanks!
CamperBot
@camperbot
Oct 23 2015 15:02
danielrob sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 399 | @camperbot | http://www.freecodecamp.com/camperbot
RecodeExistance
@RecodeExistance
Oct 23 2015 15:11
Hi, wonder if anyone could help please. I'm on Waypoint: Make Object Properties Private, and i'm pretty clueless on how to start this one.
h4r1m4u
@h4r1m4u
Oct 23 2015 15:23
@RecodeExistance what do you have so far?
RecodeExistance
@RecodeExistance
Oct 23 2015 15:23
@h4r1m4u I got it eventually, but still don't completely understand how it worked. :/
h4r1m4u
@h4r1m4u
Oct 23 2015 15:24
do you have any questions? perhaps i can shed some light on it?
RecodeExistance
@RecodeExistance
Oct 23 2015 15:25
one second i'll go back to that page and reset it again so i can remember what confused me :)
h4r1m4u
@h4r1m4u
Oct 23 2015 15:25
:+1:
Amy Cotlow
@acotlow
Oct 23 2015 15:25
Hi! I'm wondering if anyone can help me with Waypoint: Make Instances of Objects with a Constructor Function
```
h4r1m4u
@h4r1m4u
Oct 23 2015 15:26
what do you need @acotlow ?
Amy Cotlow
@acotlow
Oct 23 2015 15:27
var Car = function() {
   this.wheels = 4;
};

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

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


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Jaykishan Kacha
@jaykishan10
Oct 23 2015 15:28
how can i replace white space from string using string.replce(); ?\
ex.string = "rece car" becomes "racecar"
Amy Cotlow
@acotlow
Oct 23 2015 15:28
my error says "The property engines of myCar should be a number"
RecodeExistance
@RecodeExistance
Oct 23 2015 15:28
Okay, i think my confusion started when i couldn't see anything of the names shown in the task list. and then i got lost trying to figure out what to actually make private (i think i understood how to make it private (by removing this) , but then got a bit jumbled with what was going on.
Jaykishan Kacha
@jaykishan10
Oct 23 2015 15:28
use myCar.engines=1;
h4r1m4u
@h4r1m4u
Oct 23 2015 15:29
@acotlow
// Only change code below this line.
var myCar = new Car();{
  this.engines = 1;
};
this bit is wrong. the {} bit doesn't do anything
you give values to object properties like @jaykishan10 says above
after you've created the object with the object constructor (new Cart())
so if i wanted to track the color of the car, i could write:
myCar.color = 'red';
Amy Cotlow
@acotlow
Oct 23 2015 15:30
fantastic. i think i need a book, heh
RecodeExistance
@RecodeExistance
Oct 23 2015 15:31
in relation to that question @h4r1m4u , what then is the different between using this and literal notation? ex mycar.color ?
Amy Cotlow
@acotlow
Oct 23 2015 15:31
thanks @h4r1m4u thanks @jaykishan10
CamperBot
@camperbot
Oct 23 2015 15:31
acotlow sends brownie points to @h4r1m4u and @jaykishan10 :sparkles: :thumbsup: :sparkles:
:star: 183 | @jaykishan10 | http://www.freecodecamp.com/jaykishan10
:star: 297 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 15:31
you're welcome, @acotlow
Amy Cotlow
@acotlow
Oct 23 2015 15:31
yeah! im with @RecodeExistance on that question
h4r1m4u
@h4r1m4u
Oct 23 2015 15:31
one second @RecodeExistance , i'm gonna write the explanation
RecodeExistance
@RecodeExistance
Oct 23 2015 15:32
heh, ty. sorry to bug, but i feel like the explanations on the waypoints are becoming a little more vague lol !
Amy Cotlow
@acotlow
Oct 23 2015 15:32
i agree!
RecodeExistance
@RecodeExistance
Oct 23 2015 15:34
Glad I'm not alone on that opinion. It feels like it's gone from "this is what your looking at, here's an example, now you try" , to "this is what this is, go for it!" :D
h4r1m4u
@h4r1m4u
Oct 23 2015 15:36
var Bike = function() {
  var licensePlate = 'XYZ 123';  
  function addColor(value) {
    return value + "is beautiful";
  } 
  this.getLicensePlate = function () {
    return licensePlate;
  };
};
in the example above, both the licensePlate var and the function addColor are private, they cannot be accessed from outside the object. when you use the word 'this', which refers to the object you're creating, that function or property will be accessible from outside the object and you can use it elsewhere in your program
Hans van Riet
@hansinla
Oct 23 2015 15:36
@RecodeExistance this is when the current scope is the Object.
h4r1m4u
@h4r1m4u
Oct 23 2015 15:37
for example, if i now wrote console.log(Bike.licensePlate), it won't return any value because the property is private. but if i write Bike.getLicensePlate() it will return 'XYZ 123'
RecodeExistance
@RecodeExistance
Oct 23 2015 15:37
@h4r1m4u , @hansinla , is it akin to global vs local scope variables?
h4r1m4u
@h4r1m4u
Oct 23 2015 15:37
the getLicensePlate() function is public and hence i can call it from the outside
it's a bit similar, you could say that
RecodeExistance
@RecodeExistance
Oct 23 2015 15:38
@h4r1m4u okay thanks, that makes things a little clearer. also, how do i display the code screen like you did in your example? i'd like to show on with some of my own comments in so i can let you see my understanding/confusion lol
CamperBot
@camperbot
Oct 23 2015 15:38
recodeexistance sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 298 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
RecodeExistance
@RecodeExistance
Oct 23 2015 15:39
also, thanks @hansinla :)
h4r1m4u
@h4r1m4u
Oct 23 2015 15:39
wiki format
CamperBot
@camperbot
Oct 23 2015 15:39

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

h4r1m4u
@h4r1m4u
Oct 23 2015 15:39
use the backticks ` (the key under escape)
Jaykishan Kacha
@jaykishan10
Oct 23 2015 15:42

function palindrome(str) {

str = str.replace(" ","");
str = str.toLowerCase();

var str1 = str.split('');
str1 = str1.reverse();
str1 = str1.join("");

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

}

RecodeExistance
@RecodeExistance
Oct 23 2015 15:43
var Bike = function() {
  // Only change code below this line.
  this.speed = 100;  //Changing this line to speed = 100; will make it private?
  function addUnit(value) {  //Not quite sure of whether this is private or public
    return value + "KM/H";
  }

  getSpeed = function () {    //This exercise wants getspeed to be public, which it is already?
    return addUnit(speed);
  };
Amy Cotlow
@acotlow
Oct 23 2015 15:43
@h4r1m4u and anyone else - do you have any online video recommendations or otherwise for how to get this information and the terms down? I'm having a particularly hard time remembering what is what for Object Oriented and Functional Programming
RecodeExistance
@RecodeExistance
Oct 23 2015 15:44
@acotlow I did some of this content on the CodeAcademy javascript course, but i found i still need more work to learn it properly.
h4r1m4u
@h4r1m4u
Oct 23 2015 15:44
@acotlow i'm not i'm afraid. but bit of googling around should yield some good tutorials
RecodeExistance
@RecodeExistance
Oct 23 2015 15:45
also @acotlow , youtube "thenewboston javascript" he has some great video tutorials
Shannon Anderson
@shannonanderson77
Oct 23 2015 15:51

function findLongestWord(str) {
var longestWord = 0;
var newStr = str.split(' ');
for (i = 0; i < newStr.length - 1; i += 1) {
if(longestWord < newStr[i].length) {
longestWord = newStr[i].length;
}
}
return longestWord;
}

findLongestWord("The quick brown fox jumped over the lazy dog");

@HermanFassett I didn't realize this is where campers go for help
Herman Fassett
@HermanFassett
Oct 23 2015 15:54
Yeah @shannonanderson77 also you'll want to format your code
help format
CamperBot
@camperbot
Oct 23 2015 15:54

: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

Herman Fassett
@HermanFassett
Oct 23 2015 15:54
Your code looks pretty much correct to me except one part

When you call your for loop like

for (i = 0; i < newStr.length - 1; i += 1)

You don't need that - 1

Should just be newStr.length
Jaykishan Kacha
@jaykishan10
Oct 23 2015 15:55

function palindrome(str) {
var ex = /[^a-zA-Z\d\s:]/g;
str = str.replace(ex,"");
str = str.toLowerCase();

var str1 = str.split('');
str1 = str1.reverse();
str1 = str1.join("");

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

}

is it true?
Shannon Anderson
@shannonanderson77
Oct 23 2015 15:57
Fantastic @HermanFassett! I've been working on this for days. Now I need to spend some time with the wiki's so that I can ask for help more often!
Juan Martínez
@justinian336
Oct 23 2015 15:58
Hey guys! Can anyone help me to set up my cloud9 account for the basejumps?
Joseph Botros
@josephwasily
Oct 23 2015 15:59
@justinian336 yes sure, where did you stop?
Juan Martínez
@justinian336
Oct 23 2015 15:59
I can't run grunt serve, I encounter all kinds of errors
I was following the indications in the waypoint "Get Set for Basejumps", but I found out that they don't work
Joshua
@JBressi
Oct 23 2015 16:02
Hi guys im new to coding and im stuck on .smaller-image code and was wondering if i might be placing it wrong or what im doing to were it wont worok
Hans van Riet
@hansinla
Oct 23 2015 16:03
@JBressi Yes, paste your code here and we’ll take a look
Joseph Botros
@josephwasily
Oct 23 2015 16:03
did you first setup environment inside c9?
Joshua
@JBressi
Oct 23 2015 16:03
<style> .smaller-image { width: 100px; } </style>
Juan Martínez
@justinian336
Oct 23 2015 16:04
Yeah, I created a node.js environment
Then, I followed the indications in the waypoint, but according to this discussion, the indications are outdated and it is necessary to update node to version 0.12
FreeCodeCamp/FreeCodeCamp#2722
Hans van Riet
@hansinla
Oct 23 2015 16:06
@JBressi So far, so code, but you’ll need to show all of your code. If you’re convinced that the rest is correct, it may help to reset the code with the blue button and try again.
Joshua
@JBressi
Oct 23 2015 16:06
@hansinla how would i copy the code screen to share with you?
Joseph Botros
@josephwasily
Oct 23 2015 16:06
@justinian336 you can download node.js from the website and install it
Juan Martínez
@justinian336
Oct 23 2015 16:06
I followed the indications by Skmsoumya in that issue, but when I get to the "grunt serve" part, it encounters all kinds of errors
Hans van Riet
@hansinla
Oct 23 2015 16:07
@JBressi wiki format
wiki format
CamperBot
@camperbot
Oct 23 2015 16:07

: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

Juan Martínez
@justinian336
Oct 23 2015 16:07
Yeah @josephwasily , I dealt with the version issue, and everything got installed without errors
Abhishek
@Abhi493
Oct 23 2015 16:08
bonfire arguments optional
CamperBot
@camperbot
Oct 23 2015 16:08

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);

Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.

more info:  bf details | bf links | hint

Abhishek
@Abhi493
Oct 23 2015 16:08
Bonfire: Arguments Optional
CamperBot
@camperbot
Oct 23 2015 16:08

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);

Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.

more info:  bf details | bf links | hint

Joseph Botros
@josephwasily
Oct 23 2015 16:08
@justinian336 I think i will not be able to help now, hope you find a solution
Juan Martínez
@justinian336
Oct 23 2015 16:09
Thanks anyway @josephwasily !
CamperBot
@camperbot
Oct 23 2015 16:09
justinian336 sends brownie points to @josephwasily :sparkles: :thumbsup: :sparkles:
:star: 242 | @josephwasily | http://www.freecodecamp.com/josephwasily
Abhishek
@Abhi493
Oct 23 2015 16:09
bf links
Joshua
@JBressi
Oct 23 2015 16:11
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>



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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
```
Hans van Riet
@hansinla
Oct 23 2015 16:11
@JBressi Great, but that doesn’t have your .smaller-image class.
Joshua
@JBressi
Oct 23 2015 16:12
@hansinla sorry was working on it and removed it i had it in the style code area above red-text
Hans van Riet
@hansinla
Oct 23 2015 16:13
@JBressi I understand, but ‘m trying to get your code working and now I have no way of knowing if you included the smaller-image class in your <img> tag.
Abhishek
@Abhi493
Oct 23 2015 16:14
function add() {
  if(arguments.length === 2)
  return arguments[0] + arguments[1];

else if(arguments.length === 1)
  {
    var k = function(){

    };
  }
else
  return undefined;
}
add(2,3);
How to write the function for 1 argument , bf arguments optional?
Joshua
@JBressi
Oct 23 2015 16:14
@hansinla
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>



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

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

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

@hansinla ```

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

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

.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}
</style>

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

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

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

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

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

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

  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>



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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
```
there we go sorry like i said completely new
Hans van Riet
@hansinla
Oct 23 2015 16:17
@JBressi See how your <h2> tag has class=“red-text”? In the same way you have to add the class smaller-image to your <img> tag
Colter Joles
@Co6alt
Oct 23 2015 16:20

Hey guys I'm hoping there's someone here who might be able to help, been staring at this thing for a while. I'm on the Waypoint "Make Instances of Objects with a Constructor Function".

trying to figure out how to do what it's asking me, I'm sure I'm just missing something totally obvious.

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

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

//Add the property "engines" to myCar, and make it a number.
Is the var myCar = new Car(); line creating the new instance?
if so then how do I add a property to that without overwriting the properties already in place
Joshua
@JBressi
Oct 23 2015 16:40
@hansinla thanks i got it now im stuck on href code :/ where would i place the # to make a dead link?
CamperBot
@camperbot
Oct 23 2015 16:40
jbressi sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 552 | @hansinla | http://www.freecodecamp.com/hansinla
Abhishek
@Abhi493
Oct 23 2015 16:43
@JBressi put your # tag in quotes like <a href="#">jbressi</a>
h4r1m4u
@h4r1m4u
Oct 23 2015 16:43

@Co6alt yes, that line is creating a new instance of the object and saving it into myCar variable. you add new property to the object like so:

myCar.color = 'red';

if the object doesn't have a property called color yet, it will simply be added. if it does, it'll overwrite the existing value (e.g. if the car had color blue)

Joshua
@JBressi
Oct 23 2015 16:44
@Abhi493 so remove the link? or space it like you would in adding multiple classes?
Abhishek
@Abhi493
Oct 23 2015 16:45
@JBressi r u talking about link tag or anchor tag, can u share your code?
sorry sorry'
u should add spaces to include multiple classes
Joshua
@JBressi
Oct 23 2015 16:46
```
<p>Click here for <a href="http://www.freecatphotoapp.com">cat photos</a>.</p>
```
Abhishek
@Abhi493
Oct 23 2015 16:47
it should work
Joshua
@JBressi
Oct 23 2015 16:47
would i add # before http?
Abhishek
@Abhi493
Oct 23 2015 16:48

is written when you dont have anything to write in href tag, but here u already have link then y to add #?

is for dummy links

Joshua
@JBressi
Oct 23 2015 16:49
im doing the code camp class and this is what its telling me to do. Replace your a element's href attribute with a #, also known as a hash symbol, to turn it into a dead link.
h4r1m4u
@h4r1m4u
Oct 23 2015 16:50
@JBressi <a href="#">link text</a>
Abhishek
@Abhi493
Oct 23 2015 16:50
exactly remove everything and replace it with #
between quotes
and that link will be dead.
:smile:
Joshua
@JBressi
Oct 23 2015 16:51
@Abhi493 Thanks
CamperBot
@camperbot
Oct 23 2015 16:51
jbressi sends brownie points to @abhi493 :sparkles: :thumbsup: :sparkles:
:star: 243 | @abhi493 | http://www.freecodecamp.com/abhi493
h4r1m4u
@h4r1m4u
Oct 23 2015 16:51
as @Abhi493 wrote above
Abhishek
@Abhi493
Oct 23 2015 16:51
you are murderer you killed a link , congrats @JBressi
:stuck_out_tongue:
Joshua
@JBressi
Oct 23 2015 16:51
:) lol i know such a noob :p
@h4r1m4u thanks
CamperBot
@camperbot
Oct 23 2015 16:51
jbressi sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 299 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Abhishek
@Abhi493
Oct 23 2015 16:52
@h4r1m4u
now you can claim your front end certificate?
h4r1m4u
@h4r1m4u
Oct 23 2015 16:53
@Abhi493 i think two or three more ziplines
Joshua
@JBressi
Oct 23 2015 16:53
i think is break time! making stupid mistakes XD
Abhishek
@Abhi493
Oct 23 2015 16:53
you r real fast @
@h4r1m4u
m still stucked on that pomodora clock zipline
Joel
@jsmittyfitness
Oct 23 2015 17:17
Can anyone help me with this lesson? Waypoint: Use a CSS Class to Style an Element
Joshua
@JBressi
Oct 23 2015 17:17
@jsmittyfitness what do yu need help with?
Joel
@jsmittyfitness
Oct 23 2015 17:17
IDK if Im just misunderstanding what they are asking but I can't seem to get this one correct. Tried a bunch of different ways

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

<h2>CatPhotoApp</h2>

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

Create a CSS class called red-text and apply it to your h2 element.
Evan
@evanpizzolato
Oct 23 2015 17:19
hey could someone give me a hand with Waypoint: Use Conditional Logic with If and Else Statements? I dont really understand how to add "heads" and "tails" to the statement
i understand how if else statements works but am having a hard time executing them
Joshua
@JBressi
Oct 23 2015 17:20
@jsmittyfitness in The h2 you have to add <h2 class="red-text">CatPhotoApp</h2>
you have to let it know where the class has to go
or where you want the class to be that is
Joel
@jsmittyfitness
Oct 23 2015 17:22
Am I adding that whole line you wrote or is it replacing something?
ahhh i got it
Joshua
@JBressi
Oct 23 2015 17:23
do you see in your <h2>catphotoapp</h2>
Joel
@jsmittyfitness
Oct 23 2015 17:23
I see now
Joshua
@JBressi
Oct 23 2015 17:24
that is where you replace <h2> with <h2 class="the class you want">
dont wory i got stuck there also
Harrison Brock
@hbrock
Oct 23 2015 17:30

what is wrong with this (.thick-green-border):

<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;
board-style:solid;
}
</style>

Evan
@evanpizzolato
Oct 23 2015 17:31
nvm problem solved...kinda lol
Joshua
@JBressi
Oct 23 2015 17:31
@hbrock you are missing some spaces
@evanpizzolato sorry even i wish i could have helped but im not that far into the code camp yet
Harrison Brock
@hbrock
Oct 23 2015 17:32
you do not need the spaces. It does not work if I put the spaces in
Joshua
@JBressi
Oct 23 2015 17:33
@hbrock did you add the class to your a element?
should look like this <img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
Harrison Brock
@hbrock
Oct 23 2015 17:34
Yes, the errors are "Give your image a border width of 10px" and "Give your image a border style of solid"
Riko
@RMWHIRL
Oct 23 2015 17:35
Hey does anyone know the correct syntax for regular expressions?
Bill
@kirah1314
Oct 23 2015 17:35
@hbrock many people have that error/issue and it had to do with your screen display, you have to zoom in or out to 100%
Harrison Brock
@hbrock
Oct 23 2015 17:35
@RMWHIRL I do for C++ and Java
Riko
@RMWHIRL
Oct 23 2015 17:36
Ok. @hbrock I'm in Java right now and I can't seem to figure it out.
Joshua
@JBressi
Oct 23 2015 17:37
ok in the code border-style: solid you miss spelled it and for the 10px retry adding the spaces as follows border-color: green; border-width: 10px; border-style: solid;
Riko
@RMWHIRL
Oct 23 2015 17:37
@hbrock Do you only write "/teststring/i;"?
I'm getting a message that the expression is not defined.
Joshua
@JBressi
Oct 23 2015 17:38
@hbrock what waypoint are you working on?
Harrison Brock
@hbrock
Oct 23 2015 17:38
@RMWHIRL this link might help http://www.w3schools.com/js/js_regexp.asp
Riko
@RMWHIRL
Oct 23 2015 17:39
@hbrock Yeah I was just there.
Harrison Brock
@hbrock
Oct 23 2015 17:40
@JBressi the spelling was the only problem. I guess using visual studio has hurt me some..because the IDE would have picked that up
Joshua
@JBressi
Oct 23 2015 17:41
@hbrock did the spelling solve your error code?
Harrison Brock
@hbrock
Oct 23 2015 17:41
@RMWHIRL I'm not sure which lesson your on. What are you trying to do with Rexg
@JBressi Yes. Thanks
CamperBot
@camperbot
Oct 23 2015 17:42
hbrock sends brownie points to @jbressi :sparkles: :thumbsup: :sparkles:
:star: 36 | @jbressi | http://www.freecodecamp.com/jbressi
Riko
@RMWHIRL
Oct 23 2015 17:45
@hbrock I'm on Waypoint 33 in basic java
Joshua
@JBressi
Oct 23 2015 17:45
Im haveing an issue here is my code error: Make sure your form has an action attribute which is set to /submit-cat-photo. and this is how i have my code written:
<form action="submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>
```
lol never mind i forgot the /
i got it XD
saifcoding
@saifcoding
Oct 23 2015 17:48
what is target attribute?
Harrison Brock
@hbrock
Oct 23 2015 17:49
@RMWHIRL are you searching for the word "and"
Riko
@RMWHIRL
Oct 23 2015 17:51
@hbrock Yes.
Bill
@kirah1314
Oct 23 2015 17:51
@RMWHIRL what have you tried so far?
Harrison Brock
@hbrock
Oct 23 2015 17:51
@RMWHIRL try var expression = /and/gi;
Riko
@RMWHIRL
Oct 23 2015 17:52
@kirah1314 var expressionToGetAnd = /and/gi;
@hbrock Will do.
Joseph Botros
@josephwasily
Oct 23 2015 17:53
help zipline
CamperBot
@camperbot
Oct 23 2015 17:53

:point_right: zipline use the twitchtv json api [wiki]

If you're trying to tackle this challenge with jQuery's $.getJSON() method, chances are you'll get an error message concerning Cross-Origin Resource Sharing (CORS).

The easiest way to resolve this is to use jQuery's JSONP capabilities. From the Twitch API's readme page:

All API methods support JSON-P by providing a callback parameter with the request.

Also the jQuery documentation states:

If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead.

Here's an example call to fetch Free Code Camp's Twitch channel data:

$.getJSON('https://api.twitch.tv/kraken/streams/freecodecamp?callback=?', function(data) {
  console.log(data);
});

JSONP is considered insecure according to Wikipedia, but should be sufficient for our purposes. For a detailed discussion on Twitch's CORS restriction, please read justintv/Twitch-API#133 on the Twitch-API repository.
:pencil: read more about zipline use the twitchtv json api on the FCC Wiki

Bill
@kirah1314
Oct 23 2015 17:53
@RMWHIRL if you change the var then you have to change update this return testString.match(expressionToGetAnd).length;
Joseph Botros
@josephwasily
Oct 23 2015 17:53
wiki zipline
CamperBot
@camperbot
Oct 23 2015 17:53

:point_right: zipline use the twitchtv json api [wiki]

If you're trying to tackle this challenge with jQuery's $.getJSON() method, chances are you'll get an error message concerning Cross-Origin Resource Sharing (CORS).

The easiest way to resolve this is to use jQuery's JSONP capabilities. From the Twitch API's readme page:

All API methods support JSON-P by providing a callback parameter with the request.

Also the jQuery documentation states:

If the URL includes the string "callback=?" (or similar, as defined by the server-side API), the request is treated as JSONP instead.

Here's an example call to fetch Free Code Camp's Twitch channel data:

$.getJSON('https://api.twitch.tv/kraken/streams/freecodecamp?callback=?', function(data) {
  console.log(data);
});

JSONP is considered insecure according to Wikipedia, but should be sufficient for our purposes. For a detailed discussion on Twitch's CORS restriction, please read justintv/Twitch-API#133 on the Twitch-API repository.
:pencil: read more about zipline use the twitchtv json api on the FCC Wiki

Riko
@RMWHIRL
Oct 23 2015 17:54
thanks @hbrock I guess that worked. FCC must've wanted specific wording.
CamperBot
@camperbot
Oct 23 2015 17:54
rmwhirl sends brownie points to @hbrock :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for hbrock
Riko
@RMWHIRL
Oct 23 2015 17:55
@kirah1314 Ok cool. Looks like I made it through the waypount
*waypoing
*waypoint
Abhishek
@Abhi493
Oct 23 2015 18:14
@camperbot thanks
CamperBot
@camperbot
Oct 23 2015 18:14
abhi493 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 402 | @camperbot | http://www.freecodecamp.com/camperbot
Daniel Robinson
@danielrob
Oct 23 2015 19:18
General question: In small programs (e.g. the pomodoro timer) it is easy to store state in global variables, e.g. var isPaused = true at the top level, then perform checks against that elsewhere in the script. I know an alternative is to use Objects, and store data associated with the timer, with a 'var timerInstance = new Timer(), (or I forget, statically: Timer.start() also works right?)', but what about other approaches - where does state go in larger programs? Do I create a state object e.g. var timerState = { paused: true, onBreak: false }, and pass that around? What's the best way to manage the fact that essentially there are a global variables (i.e. states that many parts of the program want to access) - but give some more manageability than actually putting them on the global object?
Wally
@wallybtwallace
Oct 23 2015 19:23
Hello all. I appear to have forgotten how to create a class element in h1. Any advice?
"Create a CSS class called pink-text that gives an element the color pink."
h4r1m4u
@h4r1m4u
Oct 23 2015 19:25
@wallybtwallace <div class="this-is-my-div-class"></div>
Wally
@wallybtwallace
Oct 23 2015 19:25
thank you!
CamperBot
@camperbot
Oct 23 2015 19:25
if you want to thank someone, put an @ before their name!
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 19:25
@wallybtwallace <style> .h1 { text-color: pink; } </style> or inline: <h1 class="myclassname"></h1>
Wally
@wallybtwallace
Oct 23 2015 19:25
CamperBot
@camperbot
Oct 23 2015 19:25
if you want to thank someone, put an @ before their name!
Wally
@wallybtwallace
Oct 23 2015 19:26
*thank you @trandnash
CamperBot
@camperbot
Oct 23 2015 19:26
wallybtwallace sends brownie points to @trandnash :sparkles: :thumbsup: :sparkles:
:star: 198 | @trandnash | http://www.freecodecamp.com/trandnash
Joel
@jsmittyfitness
Oct 23 2015 19:26
<style> .smaller-image { width: 100px; } </style> where am I supposed to put this? Im finding it difficult to understand where these elements go from the directions
h4r1m4u
@h4r1m4u
Oct 23 2015 19:26
@trandnash that's actually incorrect. that makes every h1 pink. it does not create a .pink-text class that is then applied to selected elements
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 19:26
you're right @h4r1m4u --apologies.
h4r1m4u
@h4r1m4u
Oct 23 2015 19:27
no problem
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 19:27
i misread the issue
h4r1m4u
@h4r1m4u
Oct 23 2015 19:27
@jsmittyfitness that's your CSS class definition. you now need to apply the class to your HTML element, like so: <img class="some-class-goes-here" src="http://...">
Matt Yamamoto
@MattYamamoto
Oct 23 2015 19:28
@danielrob I've wondered the same thing. . . hoping somebody in here has a good answer (or can point to one).
Mistereo
@Mistereo
Oct 23 2015 19:29
@danielrob not sure that I understand you correctly... but in complex apps you probably will use some framework/library, I personally like redux (https://github.com/rackt/redux).
Wally
@wallybtwallace
Oct 23 2015 19:30
I'm sorry @h4r1m4u and @trandnash but I am still a little stuck
How do I rreate a CSS class called pink-text that gives an element the color pink.
h4r1m4u
@h4r1m4u
Oct 23 2015 19:31
@wallybtwallace you define CSS classes like this:
<style>
.my-class {
  color: white;
}
</style>
Mistereo
@Mistereo
Oct 23 2015 19:31
@h4r1m4u actually not, it makes a class called h1, the selector was .h1 not just h1 :)
h4r1m4u
@h4r1m4u
Oct 23 2015 19:31
@Mistereo shoot, i missed the . :D
Wally
@wallybtwallace
Oct 23 2015 19:33

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

</style>

<h1 class= color: pink; >Hello World!</h1>

This is what I have @h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 19:35
@wallybtwallace please have a look at my previous answers. all you need is there. check how you create a class in CSS (not just assign style to HTML elements like <h1>) and how you then apply the class to your HTML elements. you can figure it out
Joel
@jsmittyfitness
Oct 23 2015 19:35
what am I missing here? <img class .smaller-image {width:100px;} img src="https://bit.ly/fcc-relaxing-cat">
h4r1m4u
@h4r1m4u
Oct 23 2015 19:35
@jsmittyfitness you're putting your class definition as part of the HTML element instead of defining it in your stylesheet (in between <style> and </style> tags).
Levyian
@levyian
Oct 23 2015 19:36
@jsmittyfitness class="smaller-img" and define smaller-img in css
Michael Bomholt
@bomholtm
Oct 23 2015 19:36
@jsmittyfitness <img class="smaller-image" img src="https://bit.ly/fcc-relaxing-cat"> + .smaller-image {width:100px;}
is the html + css
dont mix them up ;)
Joel
@jsmittyfitness
Oct 23 2015 19:41
bomholt insert what you wrote in there? Im still not getting it
h4r1m4u
@h4r1m4u
Oct 23 2015 19:43
@jsmittyfitness it's confusing the way he wrote it:
<style>
/* this is your CSS */
.my-class {
 color: white;
}
</style>

<!-- here's your HTML -->
<div class="my-class"></div>
now tweak this for your case
in the above, i create a class called .my-class and make the text white. then i apply it to a <div> element
you need to create a class .smaller-image which has 100px width and then apply it to a <img> element
Wally
@wallybtwallace
Oct 23 2015 19:46
@h4r1m4u I am still very stuck here
I see this <div class="this-is-my-div-class"></div>
but how does that make the text pink
I tried <div class="color-pink"> </div> but that was not correct
h4r1m4u
@h4r1m4u
Oct 23 2015 19:48
@wallybtwallace it doesn't. that bit is only a <div> element with "this-is-my-div-class" applied. making the text pink would be part of the CSS.
see my example for @jsmittyfitness above?
it's very close to what you need
but instead of calling the class .pink-text, i have a .my-class. and instead of making the text pink, i make it white
can you modify the above and change .my-class to .pink-text and make its text pink instead of white?
what you wrote, <div class="color-pink"> </div>, gives the <div> element class called color-pink
Joel
@jsmittyfitness
Oct 23 2015 19:51
@h4r1m4u thanks, I figured out the class now whats missing here
CamperBot
@camperbot
Oct 23 2015 19:51
jsmittyfitness sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 300 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Joel
@jsmittyfitness
Oct 23 2015 19:51

<img class=.smaller-image

</style>

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

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

<img class=.smaller-image{width: 100px}

h4r1m4u
@h4r1m4u
Oct 23 2015 19:52
@jsmittyfitness
1) <img class=.smaller-image is not how you create a CSS class
2) you have two <img> elements now: a) the relaxing-cat one which was provided to you, and b) one that you created yourself and which is incorrect
please have a look at my example above where i create the .my-class and then assign it to a div
it's the same for <img>. all that's different will be the class name (in you case it needs to be .smaller-image) and the fact that you will assign it to <img> instead of <div>
Wally
@wallybtwallace
Oct 23 2015 19:54
@h4r1m4u where does the <div class="pink-text"> </div> go?
h4r1m4u
@h4r1m4u
Oct 23 2015 19:55
@wallybtwallace that's just an example. i give a <div> HTML element pink-text CSS class. for your waypoint, you're supposed to be assigning the class to a <h1> tag, right?
not to a <div>
i'm intentionally not giving you guys the exact solution, but rather hints, so that you can figure it out for yourself. it's a way better learning experience than if i wrote it down for you
Wally
@wallybtwallace
Oct 23 2015 19:58
finally got it. thank you @h4r1m4u
CamperBot
@camperbot
Oct 23 2015 19:58
wallybtwallace sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 301 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Oct 23 2015 19:58
great work!
does it now make sense how you create the CSS classes and then assign them to HTML elements?
Michael Bomholt
@bomholtm
Oct 23 2015 20:01
hey guys is there a way to give a README.md larger whitespace in some lines..? kinda like tab in text editors
Nick Barry
@nickbarry
Oct 23 2015 20:03

Hey, I'm having trouble with the How To NPM waypoint. Can anyone help out? Specifically, I'm having trouble with the Publish step. When I run the "npm publish" command, I get a bunch of errors:
npm ERR! Linux 3.14.13-c9
npm ERR! argv "node" "/home/ubuntu/.nvm/v0.10.35/bin/npm" "publish"
npm ERR! node v0.10.35
npm ERR! npm v3.3.8
npm ERR! code ENEEDAUTH

npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using npm adduser

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/workspace/learning-npm/npm-debug.log

h4r1m4u
@h4r1m4u
Oct 23 2015 20:03
?
Dharmang Hansaliya
@hansaliyad1
Oct 23 2015 20:06
Can anyone help me with How to make instances of object with a constructor function
?
h4r1m4u
@h4r1m4u
Oct 23 2015 20:07
what do you have so far @hansaliyad1 ?
Sean Campbell
@natac13
Oct 23 2015 20:08
@hansaliyad1 by putting a new before the call to the function will create an object and bing this to that object
Mistereo
@Mistereo
Oct 23 2015 20:08
@hansaliyad1
function SomeClass() {
  //...
}
var instanceOfSomeClass = new SomeClass();
having troulbe with making the size bigger
Im pretty sure it is suppose to be in the <style> part i wasnt sure if it sould be on line 5 and 16 respectfully.
I tried adding it after the red-text {}
DJ
@qualitymanifest
Oct 23 2015 20:14
@EskimoBurd you have CSS in your HTML.
@EskimoBurd get rid of the second <style> element and put your font-size in your first style element
VeeShostak
@VeeShostak
Oct 23 2015 20:14
@EskimoBurd use 1 style tag
Matt Burd
@EskimoBurd
Oct 23 2015 20:15
yes but i didnt think it was suppose to be added in the <p class> area
Joel
@jsmittyfitness
Oct 23 2015 20:16
@h4r1m4u <img class="smaller-image"></img>
<style>
smaller-image {width:100px}
VeeShostak
@VeeShostak
Oct 23 2015 20:18
@EskimoBurd it needs to be declared in your red-text Class. Inside the {} of the .red-text classes
Matt Burd
@EskimoBurd
Oct 23 2015 20:18
ah ok ty, lemme try it out
fixed it, see sometimes the wording in the lessons are great, sometime it throws me off my first instinct
so close with this one
VeeShostak
@VeeShostak
Oct 23 2015 20:32
@EskimoBurd paste the call to Google (the snippet) in your html. then your font of "lobster" will become available. then set your h2 to that font.
Matt Burd
@EskimoBurd
Oct 23 2015 20:32
i kept the monospace font the same, but feel like i seperated it too much
and my html is what section exaclty lol
VeeShostak
@VeeShostak
Oct 23 2015 20:33
the text editor just does not show it. But it is everything outside the style tag in this case
Byron Lagrone
@byronic
Oct 23 2015 20:42
ok peeps, I'm having some serious issues with the top navigation bar in my Zipline portfolio assignment.
I have:
<div id="top-bar" class="navbar navbar-inverse navbar-fixed-top">
  <div class="container">

    <button class="navbar-toggle" data-toggle="collapse" data-target="#customCollapseID">
      <i class="icon-bar"></i><i class="icon-bar"></i><i class="icon-bar"></i>
    </button>
    <a href="#" class="navbar-brand border-sides">Hello world.</a>
    <div class="collapse navbar-collapse" id="customCollapseID">
      <ul class="nav navbar-nav navbar-right border-sides">
        <li><a href="#">Home</a></li>
        <li><a href="#">Link</a></li>
      </ul>
    </div>
  </div>
</div>
and when I re-size the screen, the collapse happens as I expect, I see the button with three bars, but when I click the button to expand the menu, it appears between "Hello Word" and the button, and is left-aligned. I expect it to appear right-aligned and underneath the button. :(
Has anyone experienced that? Am I just crazy?
deaninous
@deaninous
Oct 23 2015 20:52
I collected a bit of code that I do not fully understand. Anyone has a second to give pointers or direct me to some resources?
function isPrime(n, primes) {
    var pi = 1, // Skip checking if divisible by 2.
        prime = primes[pi];
    while (prime < n) {
      if (!(n % primes[pi])) return false;
      prime = primes[++pi]
    }
    return true
my problem is what primes[pi] does
Rex Schrader
@SaintPeter
Oct 23 2015 20:58
@deaninous Without knowing what primes is supposed to contain, I'm not sure either.
@deaninous I'm pretty sure what is going on is that it's dividing each number by every odd number between 1 and the number being tested (which is called prime)
@deaninous Do you have the whole code in context?
deaninous
@deaninous
Oct 23 2015 21:00
I see now.that primes is finally an array.
and this here checks if any of the nubers in the array is divisble by 1?
Byron Lagrone
@byronic
Oct 23 2015 21:08
@deaninous Actually, the if (!(n % primes[pi])) statement checks for a remainder using the modulus (%) operator. By which I mean, it divides n by primes[pi] and calculates any remainder
The other part that is funky is that it's using a shortcut:
if(0) is always false; if(!0) is always true
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:11
Ive tried several ways to double class.. but no luck .. anyone have any pointers This code has to be classed with font red and size 16px .
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Marcus R
@SilentViking
Oct 23 2015 21:11
@byronic After messing with your navbar -- You're missing a navbar-header class enclosing your button and brand link.
Byron Lagrone
@byronic
Oct 23 2015 21:11
so if there is no remainder (in other words, primes[pi] is divisible by n) the if statement evaluates to true
@SilentViking I'll go give that a shot and report back. I had one in there earlier but removed it (memory says it was wrecking the placement of the Home/Link on the right).
@c0d9x Adding additional classes to any html tag:
<div class="class1 class2 class3"> ...</div>
Marcus R
@SilentViking
Oct 23 2015 21:13
That is true. It forces them over to the left side.
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:16
@byronic ive tried that. this is what it looks like now..
<style>
  .red-text {
    color: red;
    font-size: 16px;
  }
</style>

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

<div class="red-text font-size">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</div>
Byron Lagrone
@byronic
Oct 23 2015 21:17
@c0d9x So you're calling the font-size class there in your div, but there's no .font-size class definition in your CSS <style>
I would suggest (for the purposes of this assignment) separating your CSS declarations into two classes, .red-text and .font-size
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:17
@byronic dang it. i forgot about that.. thank you!
CamperBot
@camperbot
Oct 23 2015 21:17
c0d9x sends brownie points to @byronic :sparkles: :thumbsup: :sparkles:
:star: 205 | @byronic | http://www.freecodecamp.com/byronic
Byron Lagrone
@byronic
Oct 23 2015 21:17
the HTML is already set to call both classes
@SilentViking Maybe I'm being thick on this, but my goal (a.k.a. the assignment) is to have the functionality mimic the portfolio at http://codepen.io/ThiagoFerreir4/full/eNMxEp
and I'm trying not to cheat by peeking into that code, lol
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:19
still not working.
```
  .red-text {
    color: red;
      }
  .font-size {
    font-size: 16px;
  }
</style>

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

<div class="red-text font-size">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</div>
Marcus R
@SilentViking
Oct 23 2015 21:22
@byronic This is what I got, it appears to be working the same. Links being expanded on the left, directly under brand.
<div id="top-bar" class="navbar navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
        <div class="navbar-header">
                <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#customCollapseID">
                        <i class="icon-bar"></i>
                        <i class="icon-bar"></i>
                        <i class="icon-bar"></i>
                </button>
                <a href="#" class="navbar-brand border-sides">Hello world.</a>
            </div>
                <div class="collapse navbar-collapse" id="customCollapseID">
                        <ul class="nav navbar-nav nav-right border-sides">
                                <li><a href="#">Home</a></li>
                                <li><a href="#">Link</a></li>
                        </ul>
                </div>
        </div>
</div>
Byron Lagrone
@byronic
Oct 23 2015 21:23
@c0d9x for those assignments I believe it wants you to use p elements instead of div
*tags, not elements
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:23
but dont i have to use div to divide the classes in p. could i use both. i been trying to search it but with little luck.
Byron Lagrone
@byronic
Oct 23 2015 21:23
what's the assignment name?
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:23
@byronic
Byron Lagrone
@byronic
Oct 23 2015 21:24
@SilentViking I will compare and see where I'm messing up
Michael Bomholt
@bomholtm
Oct 23 2015 21:32
@h4r1m4u i had to leave i will look into it thanks
CamperBot
@camperbot
Oct 23 2015 21:32
bomholt sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 302 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
xcadaverx
@xcadaverx
Oct 23 2015 21:34
This message was deleted
This message was deleted
bonfire make object properties private
CamperBot
@camperbot
Oct 23 2015 21:36
Sorry, can't find a bonfire called make object properties private. [ Check the map? ]
xcadaverx
@xcadaverx
Oct 23 2015 21:36
This message was deleted
bonfire Waypoint: Make Object Properties Private
CamperBot
@camperbot
Oct 23 2015 21:36
Sorry, can't find a bonfire called waypoint make object properties private. [ Check the map? ]
xcadaverx
@xcadaverx
Oct 23 2015 21:37
oh i'm dumb, thats not a bonfire
lol
Ashraf Patel
@AshrafPatel
Oct 23 2015 21:38
Hello could anyone help me on Waypoint Use the boot strap Grid to Element side by side

<div class="row">

<div class="col-xs-4">

Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 21:39
a little help would be great. On the bonfire for capitalize first letter of all words and can't seem to see why my code is not working
CamperBot
@camperbot
Oct 23 2015 21:39
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 21:39
...
'''
CamperBot
@camperbot
Oct 23 2015 21:39
:bulb: to format code use backticks! ``` more info
Ashraf Patel
@AshrafPatel
Oct 23 2015 21:40
how to nest div elements?
Sorry got it nvm
TheC0mposer
@TheC0mposer
Oct 23 2015 21:41
Screen Shot 2015-10-23 at 5.40.51 PM.png
can someone explain to me whats wrong with my code
Ryder Timberlake
@SherSpock
Oct 23 2015 21:41
@trandnash Can you give a little more info or post your code?
Byron Lagrone
@byronic
Oct 23 2015 21:42
Thank you, thank you, thank you, @SilentViking . I was missing the collapsed class on my button (note that your ul class declaration should have navbar-right instead of nav-right) and that got it
CamperBot
@camperbot
Oct 23 2015 21:42
byronic sends brownie points to @silentviking :sparkles: :thumbsup: :sparkles:
:star: 201 | @silentviking | http://www.freecodecamp.com/silentviking
Byron Lagrone
@byronic
Oct 23 2015 21:43
Not quite as good-looking as it was before the changes but now the collapsing part works and has things in the right place! huzzah!
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 21:43
function titleCase(str) {
  splitArr = str.toLowerCase().split(" "); //lower case all letters and turn into array of words
  for(i=0; i < splitArr.length; i++) {
    splitArr[i].charAt(0).toUpperCase(); //grab the first letter of each word and capitalize
  }
  newStr = splitArr.join(" "); //join words with first letter capitalized back into a string
  return newStr;
}

titleCase("I'm a little tea pot");
Rex Schrader
@SaintPeter
Oct 23 2015 21:44
@trandnash The issue is that in Javascript, strings are immutable. You can't uppercase a letter in a string, you need to create a new string where the letter is already upercased.
@trandnash You can do that by assigning back to splitArr[i]
@trandnash But you'll need the whole word, not just the first letter.
@trandnash Otherwise, looks good.
@trandnash I encourage you to use http://repl.it to test your code. You can put console.log statements all over and easily see when something is not working.
Sarai Flowers
@MadreDeLobos
Oct 23 2015 21:45
its telling me i dont have 2 elements..
<style>
  .red-text {
    color: red;
  }
    .font-size {
      font-size: 16px;
    }
</style>

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

<p class="red-text font-size"> Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff 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>
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:46
hey guys
Rex Schrader
@SaintPeter
Oct 23 2015 21:46
hey hey
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:46
help me 1 quetions
CamperBot
@camperbot
Oct 23 2015 21:46
no wiki entry for: me 1 quetions
:pencil: click here to create one now!after creating your page type update to reload it here
Michael Omodele
@meriwon
Oct 23 2015 21:46
Can someone help please. Can't see how to nest this i element within a button element in Add Font Awesome Icons to our Buttons.
Rex Schrader
@SaintPeter
Oct 23 2015 21:46
@meriwon <i class="whatever"></i> inside the button declaration
@EdwilsonCruz Sure, lay it on us
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:50
Waypoint: Make Object Properties Private...
Thomas Rand-Nash, PhD
@trandnash
Oct 23 2015 21:50
thank you @SaintPeter ! these under the hood things are exactly what i need to learn!
CamperBot
@camperbot
Oct 23 2015 21:50
trandnash sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1168 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 23 2015 21:50
@trandnash :D
@EdwilsonCruz Is there a specific question you have about that?
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:50
haha, whts send img here
Rex Schrader
@SaintPeter
Oct 23 2015 21:51
@EdwilsonCruz Don't. Paste your code instead:
wiki format
CamperBot
@camperbot
Oct 23 2015 21:51

: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

Rex Schrader
@SaintPeter
Oct 23 2015 21:51
@EdwilsonCruz If you MUST paste an image, just use the paste command (ctrl-v)
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:52

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

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

};
'''

CamperBot
@camperbot
Oct 23 2015 21:52
:bulb: to format code use backticks! ``` more info
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:52
--'
Rex Schrader
@SaintPeter
Oct 23 2015 21:53
@EdwilsonCruz Backticks, near the 1 key
@EdwilsonCruz Anyway, what's the trouble? Do you know how to make a private variable?
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:53
yes
Rex Schrader
@SaintPeter
Oct 23 2015 21:54
@EdwilsonCruz Ok, so you need to redeclare speed as private, right?
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:54
myBike.speed for undefined =,)
Rex Schrader
@SaintPeter
Oct 23 2015 21:54
@EdwilsonCruz in order to make it private, when you declare it is becomes var speed
@EdwilsonCruz and then all subequent references become just speed
Edwilson Cruz
@EdwilsonCruz
Oct 23 2015 21:55
ok.
Francisco Pena
@daiky00
Oct 23 2015 22:04
anybody wants to help me on open source project? here si the link please help: https://github.com/animecenter/animecenter