These are chat archives for FreeCodeCamp/Help

20th
Jan 2016
Brian
@sludge256
Jan 20 2016 00:01
there's a new popup that auto formats code anyways
Glen Roberts
@ZeroAccess
Jan 20 2016 00:01
Really?
When was that implemented? cool
Brian
@sludge256
Jan 20 2016 00:02
go into the code editor and select some code
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:02

Is this kosher?

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

Brian
@sludge256
Jan 20 2016 00:02
a day or two at least now
Andrew Kemp
@andrewtkemp1
Jan 20 2016 00:02

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

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

<p><a href="http://freecatphotoapp.com">cat photos</a></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>

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

I apologize if I didn't format correctly.
Brian
@sludge256
Jan 20 2016 00:02
@DrewBahamaBreeze as long as you apply red-text to both your p elements
Glen Roberts
@ZeroAccess
Jan 20 2016 00:03
all good, no worries you can try again if you'd like but let's take a look
Brian
@sludge256
Jan 20 2016 00:03
it might pass regardless but there is an open issue about updating the tests
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:04

Everything else is red, except for my last paragraph function:

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

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

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

<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Nevermind!
I forgot to add the class function in the second paragraph
Glen Roberts
@ZeroAccess
Jan 20 2016 00:05
oh lol saw his and was like whoa I'm lost aight one sec lol
@andrewtkemp1 what #/subject are ya doing..wanna check the instructions
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:06
Sorry
Andrew Kemp
@andrewtkemp1
Jan 20 2016 00:06
@ZeroAccess Link to External Pages with Anchor Elements
Blauelf
@Blauelf
Jan 20 2016 00:07
Maybe is missing some text around the link?
Glen Roberts
@ZeroAccess
Jan 20 2016 00:07
ah I see
reset your code @andrewtkemp1
Andrew Kemp
@andrewtkemp1
Jan 20 2016 00:08
@ZeroAccess Ok, done.
Blauelf
@Blauelf
Jan 20 2016 00:08
Oh, the extra text is in the next waypoint. No p element here around the a element.
Glen Roberts
@ZeroAccess
Jan 20 2016 00:09
Yea, go back and add just the link and not touch the other stuff. I got lazy and just did it to the h2 element that was already there.
Andrew Kemp
@andrewtkemp1
Jan 20 2016 00:09
Alright, sounds good.
Glen Roberts
@ZeroAccess
Jan 20 2016 00:09
@andrewtkemp1 so basically <h2 class="red-text">CatPhotoApp</h2> just change that to cat photos for the text and throw what you already had above and it should work
It doesn't really matter it passes rather it's a paragraph or not but honestly I couldn't see where you were wrong. So unless my brain isn't working thought this would be easier for ya.
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:11

@ZeroAccess @sludge256

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<!--What Do I do here!? The instruction states: Give elements with the p tag a font-size of 16px.')-->
<p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Glen Roberts
@ZeroAccess
Jan 20 2016 00:11
@DrewBahamaBreeze Yes Sir?
OH , I see it's in your thing 1 sec lol
AH ok, that's easy in your <style> tags you need to create one for paragraphs and give it the attribute of font-size 16px
So you already see how to do the font-size because of the .red-text right?
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:12
So what does that look like for font-size?
Glen Roberts
@ZeroAccess
Jan 20 2016 00:13
It's already there. They assigned .red-text a font-size of 16px
Do you see how they provided that for you?
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:13
Yes, I see it in the style function
Glen Roberts
@ZeroAccess
Jan 20 2016 00:13
Style isn't a function. We'll worry about that later but just don't want you to confuse yourself later.
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:13
however, I don't know how to translate that to my <p> </p> tags
Axhon
@axhon
Jan 20 2016 00:14

hi everyone, i'm currently on the diff two arrays challenge and need some help. here is my code:

function diff(arr1, arr2) {
  var newArr = [];
  // Same, same; but different.
  var temp = arr1.filter( function(fIndex) {
    return arr2.some(function(sIndex) {
      console.log(fIndex);
      return fIndex.indexOf(sIndex) == -1;
    });
  });
  newArr = temp;
  return newArr;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);

my current output is: a TypeError, i assume because fIndex isn't being recognized as an array. how would i move forward from here? Thank you !

Matias Pereira
@sieb7e
Jan 20 2016 00:14
blob
Glen Roberts
@ZeroAccess
Jan 20 2016 00:14
Ok, so let's say that ALL paragraphs are known as a class of "p" (no quotes) how would you refer to that if .red-text is also a class?
Matias Pereira
@sieb7e
Jan 20 2016 00:14
blob
Glen Roberts
@ZeroAccess
Jan 20 2016 00:15
@axhon , one sec
Matias Pereira
@sieb7e
Jan 20 2016 00:15
blob

function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for(i=0; i < arr.length; i++){
for (j=0; j < arr[i].length; j++){
product *= arr[i][j];
}
}

// Only change code above this line
return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);

Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:15
<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>
?
Glen Roberts
@ZeroAccess
Jan 20 2016 00:16
@DrewBahamaBreeze look at just the style area (don't worry about anything else).
Andrew Kemp
@andrewtkemp1
Jan 20 2016 00:16
@ZeroAccess I ended up having to clear out everything and re login. Everything ended up working when I reentered the code. Thanks for the help!
CamperBot
@camperbot
Jan 20 2016 00:16
andrewtkemp1 sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 311 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:16
@DrewBahamaBreeze think about it this way. the style red-text is a class correct? If i were to tell you that paragraphs are known as a class of p how would you use that (again ONLY look at the style area for right now).
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:17
This message was deleted
Glen Roberts
@ZeroAccess
Jan 20 2016 00:17
@andrewtkemp1 not a problem, sometimes there's errors unfortunately glad it worked for you. Most the time I just reset the code and retype or I reload the page. Whatever works but glad it worked.
Andrew Kemp
@andrewtkemp1
Jan 20 2016 00:17
Yeah, all part of the journey.
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:17

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

Is that it?

Glen Roberts
@ZeroAccess
Jan 20 2016 00:18
@axhon what assignment are you doing? I'm trying to figure out what you're doing. Sorry guys I got the flu and a massive headache taking me forever to think things through tonight.
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:18
@ZeroAccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:18
@DrewBahamaBreeze nope, sorry let's back up a second
go back to what you had for style please and paste it here
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:18

@ZeroAccess

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

Glen Roberts
@ZeroAccess
Jan 20 2016 00:19
Yep, so do you know how to have multiple classes in your style err area yet?
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:19
No idea @ZeroAccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:19
Ok, I'll give you an example then
<style>
.red-text {
color: red;
font-size: 16px;
}
.green-text {
color:green;
font-size:200px;
}
Axhon
@axhon
Jan 20 2016 00:20

@ZeroAccess i'm on this one: http://www.freecodecamp.com/challenges/diff-two-arrays
I'm just grateful for the help no need to rush yourself :D

My current thinking is that i only push objects into the array if they are unique to to either array

Glen Roberts
@ZeroAccess
Jan 20 2016 00:20
OH add a closing </style> to that! my bad!
@axhon I haven't done this one yet, may take me a few but let me see if I can knock it out. You're smarter than I am :|
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:22
@ZeroAccess Does that mean the second style refers to the second paragraph?
Glen Roberts
@ZeroAccess
Jan 20 2016 00:22
@DrewBahamaBreeze that was just a made up example for you. It has nothing to do with the order of anything. In the CSS you're doing right now order isn't important.
So basically red-text and green-text are two different classes. Just like red-text and p (for paragraph) are two different classes. Does that help?
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:24
@ZeroAccess OH wait!
Let me write this out first and send it to you
Glen Roberts
@ZeroAccess
Jan 20 2016 00:24
No problem
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:26

@ZeroAccess

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

Axhon
@axhon
Jan 20 2016 00:26
@ZeroAccess XD thanks.
CamperBot
@camperbot
Jan 20 2016 00:26
axhon sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
Glen Roberts
@ZeroAccess
Jan 20 2016 00:26
@axhon just looking at the instructions for this (haven't done it yet) what you need to do is get each element from the array and compare it to the next array. If it's the same then get rid of it and only keep items that are different. I can already tell yours doesn't go through each array and compare them. Break this up into a few different easier instructions. Basically first thing you need to do is go through each array and strip the values out. Then compare them and if same ...drop. If no comparison then add them to another array.
CamperBot
@camperbot
Jan 20 2016 00:26
:star: 312 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:26
@DrewBahamaBreeze looks good to me, give it a shot. As a suggestion for now try and follow the formatting they give you. It'll make it easier to read later when you're running into issues.
Axhon
@axhon
Jan 20 2016 00:27
@ZeroAccess okay. I'll give that a try, i like the way you broke that down
lavieb33
@lavieb33
Jan 20 2016 00:27
thanks @Rafase282 for your help with Checkpoint: Word Blanks
CamperBot
@camperbot
Jan 20 2016 00:27
lavieb33 sends brownie points to @rafase282 :sparkles: :thumbsup: :sparkles:
:star: 886 | @rafase282 | http://www.freecodecamp.com/rafase282
Glen Roberts
@ZeroAccess
Jan 20 2016 00:27
@axhon that's the way I'm gonna try and do it. Hell I may be wrong but it makes sense to my brain at the moment
I always do things like this in my IDE and then transfer the code over. It's easier for me to console.log things out and see what I'm doing. Others may benefit from that as well.
Jake Marcus
@jake-marcus
Jan 20 2016 00:29
can someone help me change the font of an h2 with an imported font from google
Glen Roberts
@ZeroAccess
Jan 20 2016 00:29
@jake-marcus please paste your current code and what you're thinking is going on. We'll take a look
Jake Marcus
@jake-marcus
Jan 20 2016 00:29

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

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

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

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

it says to put the link of the imported font at the top so i'll do that then what
Eric Turner
@ericturn203
Jan 20 2016 00:30
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
put that at the top. and thats it
Glen Roberts
@ZeroAccess
Jan 20 2016 00:31
don't do that
Just giving the answer isn't going to help anyone
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 00:31
@ZeroAccess Thanks! Will do
CamperBot
@camperbot
Jan 20 2016 00:31
drewbahamabreeze sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 313 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Eric Turner
@ericturn203
Jan 20 2016 00:31
my bad
Glen Roberts
@ZeroAccess
Jan 20 2016 00:32
All good, people may disagree with me but I try very hard to never give anyone the answer because honestly that's what was done for me and it hurt me big time.
Jake Marcus
@jake-marcus
Jan 20 2016 00:32
@ZeroAccess do you know a way to help me then
Glen Roberts
@ZeroAccess
Jan 20 2016 00:32
@jake-marcus Yea, what @ericturn203 said is correct. I read over the instructions it actually tells you that part in the instructions so my bad to @ericturn203 .
@jake-marcus first thing is follow the instructions so apply that portion to the top like it says.
Eric Turner
@ericturn203
Jan 20 2016 00:33
Oh I agree with you, yeah I wouldn't usually just come right out with it, if it wasn't just a copy paste instruction. But yeah all good
Glen Roberts
@ZeroAccess
Jan 20 2016 00:33
you need to do that before the <style> portion so hit enter and on line 1 paste what they have and then we'll go from there
Jake Marcus
@jake-marcus
Jan 20 2016 00:33
@ZeroAccess yeah I did that
Glen Roberts
@ZeroAccess
Jan 20 2016 00:33
@ericturn203 yea you're right for a split second I thought ya said the whole thing so I jumped the gun :( ..sorry about that
Anek jain
@Anekjain
Jan 20 2016 00:34
NEED HELP
  • Need Regular Expression for removing all Non Aplhanumeric chrarcters except the last Period in a string.
  • my Regular expreesion looks like this string.replace(/(\W)|[0-9]+/gi, ' ')
Glen Roberts
@ZeroAccess
Jan 20 2016 00:34
Ok @jake-marcus so now you have a font that's being imported do you see where the name the family of the font in the link you pasted?
Jake Marcus
@jake-marcus
Jan 20 2016 00:34
the name of the font is Lobster
Glen Roberts
@ZeroAccess
Jan 20 2016 00:35
Good deal, ok so you need to create an h2 class in your style area, do you know how to do that?
Daniel
@lazarodaniel83
Jan 20 2016 00:35
good Night my freinds
Glen Roberts
@ZeroAccess
Jan 20 2016 00:35
@lazarodaniel83 night
@ericturn203 sorry again and ya deserve a Thanks for helping!
CamperBot
@camperbot
Jan 20 2016 00:36
zeroaccess sends brownie points to @ericturn203 :sparkles: :thumbsup: :sparkles:
:star: 45 | @ericturn203 | http://www.freecodecamp.com/ericturn203
Jake Marcus
@jake-marcus
Jan 20 2016 00:36
is that start like class="font-family" @ZeroAccess
Daniel
@lazarodaniel83
Jan 20 2016 00:36
do you ask about font size
Glen Roberts
@ZeroAccess
Jan 20 2016 00:36
No, this is in your style area. So do you see where they have a .red-text and a p class already?
Daniel
@lazarodaniel83
Jan 20 2016 00:36
ok
Jake Marcus
@jake-marcus
Jan 20 2016 00:36
yes @ZeroAccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:37
It's basically the same way you added a p class in a previous lesson so you would just need to add an h2 class
Now in order to change the font you use font-family: <name of font> ; so with that information you should be able to alter the font-family of the h2 class
Jake Marcus
@jake-marcus
Jan 20 2016 00:37
oh so I do something like h2 {font-family link} @ZeroAccess
Daniel
@lazarodaniel83
Jan 20 2016 00:38
sorry my english
Glen Roberts
@ZeroAccess
Jan 20 2016 00:38
No you don't need to put the link in the style sheet because you already imported the Lobster font via the import on line 1.
That font is now known as "Lobster"
Jake Marcus
@jake-marcus
Jan 20 2016 00:38
okay i'll try @ZeroAccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:38
No worries, report back
Jake Marcus
@jake-marcus
Jan 20 2016 00:40
@ZeroAccess this is what I have but not working
Glen Roberts
@ZeroAccess
Jan 20 2016 00:42
@jake-marcus let's take a look
Eric Turner
@ericturn203
Jan 20 2016 00:45
stuck on Use an ID Attribute to Style an Element -
Give your form element the id of cat-photo-form.
Your form element should have the background-color of green.
Make sure your form element has an id attribute.
Do not give your form any class or style attributes.
<form action="/submit-cat-photo" id="cat-photo-form">
Chris Moore
@dooglus
Jan 20 2016 00:46
@ZeroAccess "p" and "h2" aren't classes. I think you may be confusing him a bit
Glen Roberts
@ZeroAccess
Jan 20 2016 00:46
there elements but don't they use the word classes for red-text?
Kinda was trying to rethink the way I wrote that
Jake Marcus
@jake-marcus
Jan 20 2016 00:46
@ZeroAccess hey I got it to work thanks for helping i'm kinda new to this
CamperBot
@camperbot
Jan 20 2016 00:46
jake-marcus sends brownie points to @zeroaccess :sparkles: :thumbsup: :sparkles:
:star: 315 | @zeroaccess | http://www.freecodecamp.com/zeroaccess
Glen Roberts
@ZeroAccess
Jan 20 2016 00:48
@jake-marcus no problem
@dooglus you're probably right though I'll just explain that an element and class are somewhat similar just worried it's like throwing an extra thing in there for people to try and figure out. I'd hate to mess someone up later down the road though.
Chris Moore
@dooglus
Jan 20 2016 00:53
I don't know what you call the different "xxx { yyy: zzz; }" things in a style sheet. are they all elements? declarations?
Thomas Schmidt
@sittingpilgrim
Jan 20 2016 00:55
xxx is a selector
Glen Roberts
@ZeroAccess
Jan 20 2016 00:55
Selectors
but a .dhdj is a class a #asdhjg is an id and anything basic html is an element
Elements can have multiple classes and id's as well though
Chris Moore
@dooglus
Jan 20 2016 00:55
xxx is a selector, but what's the whole thing I put in double-quotes?
Thomas Schmidt
@sittingpilgrim
Jan 20 2016 00:56
I think that is simply a style
maxeber
@maxeber
Jan 20 2016 00:56
Why does the window text editor window keeps moving when I try to highlight!! Any one having similar problem ? So frustrating xD
Chris Moore
@dooglus
Jan 20 2016 00:56
ok
so they needed to add a new style for h2, like the existing style they had for p...
Glen Roberts
@ZeroAccess
Jan 20 2016 00:56
Yea, I didn't know tried to Google it and w3 basically just says styles
Bon
@OriBon
Jan 20 2016 00:57
They are properties and values, not just "styles".
One {two: three;} One is a selector. Two is a property. Three is a value.
Glen Roberts
@ZeroAccess
Jan 20 2016 00:57
@OriBon what do you call the combination of all 3?
Thomas Schmidt
@sittingpilgrim
Jan 20 2016 00:57
The whole thing together is a style declaration
Bon
@OriBon
Jan 20 2016 00:58
^^ that
Glen Roberts
@ZeroAccess
Jan 20 2016 00:58
Ah then there ya go! smarter everyday
Thanks @sittingpilgrim @OriBon
CamperBot
@camperbot
Jan 20 2016 00:58
zeroaccess sends brownie points to @sittingpilgrim and @oribon :sparkles: :thumbsup: :sparkles:
:star: 534 | @oribon | http://www.freecodecamp.com/oribon
:star: 121 | @sittingpilgrim | http://www.freecodecamp.com/sittingpilgrim
Thomas Schmidt
@sittingpilgrim
Jan 20 2016 01:02
Hmm...I was wrong - that whole unit is called a 'rule set' -- see http://reference.sitepoint.com/css/rulesets
Glen Roberts
@ZeroAccess
Jan 20 2016 01:03
Ah I see it looks like declaration is the part within the curly braces. So you have multiple declarations per ruleset?
you can have*
Thomas Schmidt
@sittingpilgrim
Jan 20 2016 01:04
right
the ruleset is the whole thing, the declaration block is the {...}, the declarations are the things inside the curly braces
lavieb33
@lavieb33
Jan 20 2016 01:06
Access MultiDimensional Arrays With Indexesvar arr = [
[1,2,3],
[4,5,6],
[7,8,9],
[[10,11,12], 13, 14]
];
arr[0]; // equals [1,2,3]
arr[1][2]; // equals 6
arr[3]0; // equals 11
how do you get value 6 and 11 here please
Chris Moore
@dooglus
Jan 20 2016 01:08
@lavieb33 don't forget we count from 0
@lavieb33 arr[1] is [4,5,6] and so arr[1][2] is 6
read it like (arr[1])[2]
arr[1][2] means "the 3rd element of the 2nd element of arr"
Hancheng Wu
@spockmaster
Jan 20 2016 01:13

Is there a way to use an "if" statement to check if the value is non-alphanumeric?

For the Caesar bonfire, I'm using:

if(str[i]===" " || str[i]==="!" || str[i]==="?" || str[i]===".")

but it feels kind of like cheating since I deliberately checked the tests and put those punctuation there.

Chris Moore
@dooglus
Jan 20 2016 01:14
@spockmaster you can use a regular expression: if (!str[i].match(/[A-Z0-9]/i)) (where the i means to ignore case, so it matches a-z too)
Andrew Kang
@DrewBahamaBreeze
Jan 20 2016 01:19
This message was deleted
lavieb33
@lavieb33
Jan 20 2016 01:20
@dooglus and how will you read this or meaning:arr[3]0; // equals 11
Chris Moore
@dooglus
Jan 20 2016 01:20
@lavieb33 I think that's a formatting error. try with backquotes around it
Hancheng Wu
@spockmaster
Jan 20 2016 01:21
@dooglus Lemme try that out, thanks
CamperBot
@camperbot
Jan 20 2016 01:21
spockmaster sends brownie points to @dooglus :sparkles: :thumbsup: :sparkles:
:star: 271 | @dooglus | http://www.freecodecamp.com/dooglus
Chris Moore
@dooglus
Jan 20 2016 01:21
@lavieb33 but the only 11 is the 2nd element of the 1st element of the 4th element of the array, so I guess it must be arr[3][0][1]
This message was deleted
arr[1][2]; // equals 6
arr[3][0][1]; // equals 11
Hancheng Wu
@spockmaster
Jan 20 2016 01:22
@dooglus worked perfectly
Chris Moore
@dooglus
Jan 20 2016 01:25
@spockmaster I PM'ed you my solution. possible spoiler alert
explain format
CamperBot
@camperbot
Jan 20 2016 01:28

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<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

Ben
@bbeale
Jan 20 2016 01:32
Hey guys
In theComparisons with the Logical Or Operator lesson, is there an error?
Brian
@sludge256
Jan 20 2016 01:33
Don't return undefined as a string
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:34
@bbeale Probably not.. What are you seeing?
Erin
@Black25225
Jan 20 2016 01:35
can anyone help me with this?
Your a element should be a dead link with a href attribute set to "#".
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:35
@Black25225 Literally that. <a href="#">
Erin
@Black25225
Jan 20 2016 01:36
oh~ i get it now, thanks
Ben
@bbeale
Jan 20 2016 01:36
@DevPoetsSociety https://jsbin.com/manolipume/edit?js,console here is my code
21 should return inside, test case says outside
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:36
Let me check
Ben
@bbeale
Jan 20 2016 01:37
Okay let me know if you need anything else
I would give lesson number but they did away with those
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:38
They repeated anyway. Looks like it's supposed to be inclusive?
Ben
@bbeale
Jan 20 2016 01:39
What do you mean?
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:40
"one statement which returns "Outside" if val is not between 10 and 20, inclusive."
You're going up to 25
Ben
@bbeale
Jan 20 2016 01:41
Right
21 should return Inside, right?
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:42
myTest(21) should return "Outside"
Bon
@OriBon
Jan 20 2016 01:42
returns "Outside" if val is not between 10 and 20, inclusive.
Eric Turner
@ericturn203
Jan 20 2016 01:44

<style>

body {
background-color: black;
font-family: Monospace;
color: green;
}

orange-text {

color: orange;

}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
<h1 style="color: green">

</style>

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

your H1 element should be white. What am I doing wrong?
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:45
<h1 style="color: green">
Eric Turner
@ericturn203
Jan 20 2016 01:45
yeah that was a typo. It doesn't change it green either
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:46
It should. May need a ; after it
Eric Turner
@ericturn203
Jan 20 2016 01:47
nope that didn't do it either. been stuck on this for awhile. Seems pretty straight forward. but im mising something
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:47
Try refreshing your window
JuanFer253
@juanfer25
Jan 20 2016 01:49
heey i need help
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:49
Just ask @juanfer25
Eric Turner
@ericturn203
Jan 20 2016 01:50
I hadn't refreshed, but that didn't work either. Does the code look right to you beyond NOT WORKING lol
Ben
@bbeale
Jan 20 2016 01:50
@DevPoetsSociety @OriBon I'm sorry but I'm just not seeing it. I have the logic for 25 or greater, as well as the logic for under 10, so 21 should fire the first conditional and return outside since 21 is less than or equal to 25
I am so confused
JuanFer253
@juanfer25
Jan 20 2016 01:50
how make a dead link en html?
Bon
@OriBon
Jan 20 2016 01:50
@bbeale Youre not supposed to be using 25 or greater. The directions literally tell you what numbers to use.
JuanFer253
@juanfer25
Jan 20 2016 01:50
with the hash symbol
Gianna Goethe
@giannagoethe
Jan 20 2016 01:51
@juanfer25 <a href="#"></a>
Eric Turner
@ericturn203
Jan 20 2016 01:51
make sure your # is in quotes "#" @juanfer25
JuanFer253
@juanfer25
Jan 20 2016 01:51
ohh thanks
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:52
@bbeale "... which returns "Outside" if val is not between 10 and 20, inclusive. "
JuanFer253
@juanfer25
Jan 20 2016 01:53
heey you´re my teachers i´m from Guatemala
Eric Turner
@ericturn203
Jan 20 2016 01:54
figured out my issue. Line 17: <h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
I didn't have the style="color:white"
JuanFer253
@juanfer25
Jan 20 2016 01:54
thank you
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 01:55
No, you had green.
Jonathan Thompson
@Jon-thomps
Jan 20 2016 01:59
help topics
CamperBot
@camperbot
Jan 20 2016 01:59
no wiki entry for: topics
Jonathan Thompson
@Jon-thomps
Jan 20 2016 02:00
topics
:/
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 02:05
help
CamperBot
@camperbot
Jan 20 2016 02:05

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 02:05
@Jon-thomps ^
Jonathan Thompson
@Jon-thomps
Jan 20 2016 02:06
thanks @DevPoetsSociety !
CamperBot
@camperbot
Jan 20 2016 02:06
jon-thomps sends brownie points to @devpoetssociety :sparkles: :thumbsup: :sparkles:
:star: 402 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
JuanFer253
@juanfer25
Jan 20 2016 02:17
where going this?<input type="text">
thaanks
cannelflow
@cannelflow
Jan 20 2016 02:18
@juanfer25 ?
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 02:19
@juanfer25 Which exercise?
JuanFer253
@juanfer25
Jan 20 2016 02:22
it´s ready thanks
hernc
@hernc
Jan 20 2016 02:22
Thanks @sxmxc @Rafase282 @anuragaryan @hallaathrad for your help with Bonfire: Mutations you guys rock!!
CamperBot
@camperbot
Jan 20 2016 02:22
hernc sends brownie points to @sxmxc and @rafase282 and @anuragaryan and @hallaathrad :sparkles: :thumbsup: :sparkles:
:star: 422 | @hallaathrad | http://www.freecodecamp.com/hallaathrad
:star: 888 | @rafase282 | http://www.freecodecamp.com/rafase282
:star: 283 | @anuragaryan | http://www.freecodecamp.com/anuragaryan
:star: 216 | @sxmxc | http://www.freecodecamp.com/sxmxc
Justin Richardsson
@hallaathrad
Jan 20 2016 02:23
:+1:
JuanFer253
@juanfer25
Jan 20 2016 02:25
where going this=<form action="/submit-cat-photo"></form>??
exersice numbeerr 35
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 02:25
@juanfer25 What's the title of the challenge you're on?
JuanFer253
@juanfer25
Jan 20 2016 02:26
create a form element
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 02:27
Nest your text field in a form element means put the form part around the text field
JuanFer253
@juanfer25
Jan 20 2016 02:27
ohh thanks
cannelflow
@cannelflow
Jan 20 2016 02:27
@juanfer25 Nest your text field in a form element means input tag that has type as text
Timmy
@timbertrand
Jan 20 2016 02:32
hi
Max Gardner
@maxgardner
Jan 20 2016 02:33
Hey all...so this isn't a specific question, but between HTML and jQuery, it seems like there are so many ways you can create elements and override them. Is FreeCodeCamp going to get into why we need all these ways? I'm not sure I immediately understand the purpose of being able to replace an HTML element's content using jQuery if I have access to the document and can simply change the element in the HTML itself. I'm sure there's something I'm not considering, but can someone help me out with understanding this/
Mohamed Fahadh
@fahadh14
Jan 20 2016 02:34
hey guys
i need help with Escaping Literal Quotes in Strings
this is the quotes
"I am a "double quoted" string inside "double quotes""
DevPoetsSociety
@DevPoetsSociety
Jan 20 2016 02:36
@maxgardner You'll need to later, esp. with the projects.
Like, building a tic-tac-toe game
@fahadh14 You get how escaping characters works?
Tarun
@tkc3vp
Jan 20 2016 02:37
How do I do this?

Add the animated class to all elements with type button.

Add the shake class to all the buttons with class .btn.

Add the btn-primary class to the button with id #target1.

Max Gardner
@maxgardner
Jan 20 2016 02:38
@DevPoetsSociety OK awesome, I'm sure I'll understand it more once I have to apply it. I just wanted to be sure it's something I'll put into practice. Thank you!
CamperBot
@camperbot
Jan 20 2016 02:38
maxgardner sends brownie points to @devpoetssociety :sparkles: :thumbsup: :sparkles:
:star: 403 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
Alexander Køpke
@alexanderkopke
Jan 20 2016 02:38
@maxgardner jQuery is javascript.. just easier to use. So if you click on a button you can use jQuery to decide what happens. Just as you could with js. For example on click you could change the text, alter the text, show next image, play sound, etc
lavieb33
@lavieb33
Jan 20 2016 02:38
@dooglus thanks
CamperBot
@camperbot
Jan 20 2016 02:38
lavieb33 sends brownie points to @dooglus :sparkles: :thumbsup: :sparkles:
:star: 274 | @dooglus | http://www.freecodecamp.com/dooglus
Tarun
@tkc3vp
Jan 20 2016 02:38
Only add one class with each of your three selectors.
Max Gardner
@maxgardner
Jan 20 2016 02:40
@alexanderkopke Ah, that makes sense. I was mostly thinking in the scope of the challenges I've gotten through so far, and they were pretty simple. OK, I'll keep pushing on. Thanks!
CamperBot
@camperbot
Jan 20 2016 02:40
maxgardner sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 441 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Jan 20 2016 02:40
@maxgardner I promise you you will love jQuery later on. :)
Brandon Mellus
@mels065
Jan 20 2016 02:43

Hey, everyone. So, I'm on the "Make It Modular" challenge of Learn You Node. The output is apparently correct, but I keep getting this error:

Error
ERROR: There was a problem printing the solution files: testing

Here's my code for both mymodule.js and program.js.

mymodule.js:

module.exports = function (dirName, fileExt, callback) {
    var fs = require('fs');
    var path = require('path');
    fs.readdir(dirName, function(err, data) {
        if (err) {
            callback(err, list);
        }
        var list = data.filter(function(file) {
            return path.extname(file) === '.' + fileExt;
        });

        callback(null, list);
    });
};

program.js:

var mymodule = require('./mymodule.js');
mymodule(process.argv[2], process.argv[3], function(err, data) {
    if (err) {
        console.log(err);
    } else {
        for (var i = 0; i < data.length; i++) {
            console.log(data[i]);
        }
    }
});
Max Gardner
@maxgardner
Jan 20 2016 02:44

@tarun1207 follow the formula they gave you just before that. So you have the dollar sign to start it, then the selector to indicate which element/class/id you're manipulating, then the command of how you want to alter it. For example:

Add the animated class to all elements with type button.

becomes

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

And you'd create three of those individually, one after the other, to fulfill each aspect of what they're asking.

dabmen87
@dabmen87
Jan 20 2016 02:49

in this code my H1 element should inherit the atributes from the body element. please help, what am i doing wrong?: <style>
body{
background-color: green;
font-family:monospace;
}

</style>

<body>
<h1>Hello World</h1>
</body>

<style>
body{
background-color: green;
font-family:monospace;
}

</style>

<body>
<h1>Hello World</h1>
</body>

Brandon Mellus
@mels065
Jan 20 2016 02:51
Never mind. I figured it out.
I had to return the callback call.
Gabriel
@gdedi001
Jan 20 2016 02:51
Hey guys, im currently on the wikipedia viewer challenge and im kinda stuck on the wikipedia API sandbox page. Does anyone have an idea of which query to use on the action?
dabmen87
@dabmen87
Jan 20 2016 02:53

please help. in this code my H1 element should inherit the atributes from the body element. please help, what am i doing wrong?
@dabmen87
in this code my H1 element should inherit the atributes from the body element. please help, what am i doing wrong?: <style>
<style>
body {
background-color: green;
font-family:monospace;
}
</style>

<body>
<h1>Hello World</h1>
</body>

cannelflow
@cannelflow
Jan 20 2016 02:54
@dabmen87 which exercise
dabmen87
@dabmen87
Jan 20 2016 02:56
@cannelflow this one from "Style the HTML Body Element " from the front-end development cert
cannelflow
@cannelflow
Jan 20 2016 02:58
@dabmen87 exercise has two tash 1.Give your body element the background-color of black
@dabmen87 2.Make sure your CSS rule is properly formatted with both opening and closing curly brackets
Alexander Køpke
@alexanderkopke
Jan 20 2016 02:58
@dabmen87 is it from: Inherit Styles from the Body Element?
@dabmen87 background-color should be black. color should be green
cannelflow
@cannelflow
Jan 20 2016 02:59
@dabmen87 add color:green in your style in body
@dabmen87 black sry
Alexander Køpke
@alexanderkopke
Jan 20 2016 03:01
<style>
  body {
    background-color: black;
    color:green;
    font-family:Monospace;
  }
 </style>
<body><h1>Hello World</h1></body>
cannelflow
@cannelflow
Jan 20 2016 03:02
@alexanderkopke just give time to learn then tell answer
Ken
@Kparelius
Jan 20 2016 03:03
I'm guessing this has been asked several times. I'm a bit lost with "accessing nested arrays in JSON" The formatting in the example is different than the formatting in the exercise, and is almost nonsensical to me. Any input on accessing the values?
cannelflow
@cannelflow
Jan 20 2016 03:04
@dabmen87 you told it is Style the HTML Body Element but exercise looks from Inherit Styles from the Body Element
Alexander Køpke
@alexanderkopke
Jan 20 2016 03:05
@Kparelius JSONs are objects.. accessed with syntax obj.key or obj['key'].. if key is in form of variable use obj[variable]
@Kparelius so if you see an array as a value in an object.. you use the normal way to access arrays with index
Ken
@Kparelius
Jan 20 2016 03:06
Ah nevermind. it's an array of objects
I'm not a smart man. :D
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:06
Good Morning Guys :)
Ken
@Kparelius
Jan 20 2016 03:06
aye @alexanderkopke thanks much. You had the idea.
CamperBot
@camperbot
Jan 20 2016 03:06
kparelius sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 442 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Jan 20 2016 03:06
@Kparelius Yes you are smart.. you're learning programming
cannelflow
@cannelflow
Jan 20 2016 03:07
@pranavdoshi GM :smile:
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:07
wat u working on
ecrausch
@ecrausch
Jan 20 2016 03:07
hey, im very new to a of this and im having problems changing my text color to red
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:07
@ecrausch use css color declaration
to change color
cannelflow
@cannelflow
Jan 20 2016 03:09
@ecrausch if you want to change color of h2 then it is like h2{ color:red}
@dabmen87 worked ?
ecrausch
@ecrausch
Jan 20 2016 03:11
nope
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:12
@ecrausch wat happen?
cannelflow
@cannelflow
Jan 20 2016 03:12
@ecrausch ?
ecrausch
@ecrausch
Jan 20 2016 03:15
im not sure i was sure im following the steps but i guess im doing osmwthing wrong
cannelflow
@cannelflow
Jan 20 2016 03:15
@ecrausch show your code
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:16
@ecrausch post ur code here within the back ticks
aka formatting
ecrausch
@ecrausch
Jan 20 2016 03:16
<h2> style="color:red"CatPhotoApp</h2>
cannelflow
@cannelflow
Jan 20 2016 03:18
@ecrausch it should be <h2 style="color:red"> CatPhotoApp</h2> but you have to paste your code between <style></style> tag
akschoeck
@akschoeck
Jan 20 2016 03:19
help markup
CamperBot
@camperbot
Jan 20 2016 03:19
no wiki entry for: markup
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:19
@ecrausch the style is a attribute it will come under html tag h1
akschoeck
@akschoeck
Jan 20 2016 03:19
help markdown
CamperBot
@camperbot
Jan 20 2016 03:19
no wiki entry for: markdown
akschoeck
@akschoeck
Jan 20 2016 03:19
help
CamperBot
@camperbot
Jan 20 2016 03:19

Hi, I'm CamperBot! I can help you in this chatroom :smile:

Basic Commands:

  • find TOPIC find all entries about topic. ex: find js
  • wiki TOPIC show contents of topic page
  • thanks @username send brownie points to another user
  • about @username shows info on that user
  • bonfire BONFIRENAME info on a bonfire

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

ecrausch
@ecrausch
Jan 20 2016 03:19
got it! thank you!!
cannelflow
@cannelflow
Jan 20 2016 03:19

```

<style>
h2{
write here
}
</style>

<h2>xyz</h2>
``` @ecrausch

Pranav Doshi
@pranavdoshi
Jan 20 2016 03:19
@akschoeck wat are finding
@ecrausch search abt the html and css basic syntax on w3schools or mdn
akschoeck
@akschoeck
Jan 20 2016 03:20
How to format stuff in here to post code properly
Thought I saw someone do one of those two help topics when I was in here before. Guess it wasn't those :)
Kezmondo
@Kezmondo
Jan 20 2016 03:21
For making dead links do you replace <a href= with <a #+ ?
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:21
yeah will show u add ur code within
backticks
@akschoeck
akschoeck
@akschoeck
Jan 20 2016 03:21
<a href="#">
Kezmondo
@Kezmondo
Jan 20 2016 03:21
ahhhh
cheers
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:21
@Kezmondo #
or js has void function
chriscchristensen
@chriscchristensen
Jan 20 2016 03:23

Capture.PNG

could someone help me on this one.

I am not understanding what it's asking me to do.
akschoeck
@akschoeck
Jan 20 2016 03:23
@pranavdoshi I think he's still on the HTML/CSS part of the courses
dontloasesleep
@dontloasesleep
Jan 20 2016 03:23
I was doing well until I hit the Title Case a Sentence challenge and it looks like I'm returning the right string, but I still have all red X's Here is my code:
akschoeck
@akschoeck
Jan 20 2016 03:24
Just above that on the left scroll bar it gives some codes for inputting those items inside of double quotes
dontloasesleep
@dontloasesleep
Jan 20 2016 03:24
function titleCase(str) {
 var lowerStr = str.toLowerCase();
 var strArray = lowerStr.split(" ");
 var finalStr = "";

  for (var i = 0 ; i < strArray.length; i++)  {
    var capStr = strArray[i].charAt(0).toUpperCase() + strArray[i].slice(1);

  finalStr = finalStr + " " + capStr;
  }
 console.log("The answer =  " + finalStr);
   return finalStr;
}
akschoeck
@akschoeck
Jan 20 2016 03:24
Use that chart to input those items separated by spaces
dontloasesleep
@dontloasesleep
Jan 20 2016 03:24
is there something wrong?
akschoeck
@akschoeck
Jan 20 2016 03:25
@chriscchristensen So for instance for a backslash, you need \ inside of the " " for one \ to appear. For the tabs you need \t
Elifaz Filho
@Elifaz
Jan 20 2016 03:25
well…
It worked, will try to perfect it
function translate(str) {
  var vowels = /[^aeiou]+\w/g, 
      result = "",
      cutOutFromStr = vowels.exec(str);

    if (cutOutFromStr[0].length <= 2)
        result = str.substr(1) + str[0] + "ay";

    if (cutOutFromStr[0].length > 2) 
        result = str.substr(2) + str[0] + str[1] + "ay";

    if (str.indexOf(cutOutFromStr) > 0)
        result = str + "way";

  return result;

}

translate("california"); //should return "aliforniacay".
translate("paragraphs"); //should return "aragraphspay".
translate("glove"); //should return "oveglay".
translate("algorithm"); //should return "algorithmway".
translate("eight"); //should return "eightway".
chriscchristensen
@chriscchristensen
Jan 20 2016 03:26
somthing like var myStr = \"\ \t \r \n";
akschoeck
@akschoeck
Jan 20 2016 03:26
@chriscchristensen var myStr = "\ \t \r \n";
It does ask for two tabs though
chriscchristensen
@chriscchristensen
Jan 20 2016 03:27
oh I was adding both \ for the first part in the quotes the first time I did it.
akschoeck
@akschoeck
Jan 20 2016 03:27
sorry, var myStr = "\ \t \r \n"
hm
It should have 2 \ right after the open quotes
DJ
@qualitymanifest
Jan 20 2016 03:28
@chriscchristensen yeah you don't need to escape the first quotation mark, since it's not part of the string yet, just the beginning of the string
chriscchristensen
@chriscchristensen
Jan 20 2016 03:28
var myStr = "\ \t \t \r \n"; was it!
DJ
@qualitymanifest
Jan 20 2016 03:28
@akschoeck you can prevent them from escaping in chat by formatting \\
chriscchristensen
@chriscchristensen
Jan 20 2016 03:28
Thanks for the help @akschoeck !
CamperBot
@camperbot
Jan 20 2016 03:28
chriscchristensen sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:star: 177 | @akschoeck | http://www.freecodecamp.com/akschoeck
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:30
@dontloasesleep the code is working
akschoeck
@akschoeck
Jan 20 2016 03:31

Can anyone help me with the the Local Scope and Function (176) one?

function myFunction() {
  'use strict';
  var myVar = 'myVar';

  console.log(myVar);
}
myFunction();

// run and check the console 
// myVar is not defined outside of myFunction
//console.log(myVar);

// now remove the console log line to pass the test

I understand the difference between local and global scope just fine, I'm just not sure why it's not passing. It says I need to not have a global myVar variable, but I don't.

dontloasesleep
@dontloasesleep
Jan 20 2016 03:32
The console.log line shows me I have the right answer, but why are the tests still red?
akschoeck
@akschoeck
Jan 20 2016 03:33
![alt](http://i.imgur.com/w6DgIzL.png)
Well that didn't work
Eric Turner
@ericturn203
Jan 20 2016 03:33
how do you post your code like that? so it doesn't come up as a sloppy text?
Herman Fassett
@HermanFassett
Jan 20 2016 03:33
@akschoeck :P no code format needed for that
Kyle Roach
@iRoachie
Jan 20 2016 03:33
@akschoeck you have to remove the line console.log
akschoeck
@akschoeck
Jan 20 2016 03:34
I've tried removing both of them, and it still doesn't work
@ericturn203 include 3 backticks (`) above and below your code
Kyle Roach
@iRoachie
Jan 20 2016 03:34
help formatting
CamperBot
@camperbot
Jan 20 2016 03:34

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<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

Kyle Roach
@iRoachie
Jan 20 2016 03:36
@akschoeck can you send me your url?
paste it here
Eric Turner
@ericturn203
Jan 20 2016 03:36
@akschoeck thanks!
CamperBot
@camperbot
Jan 20 2016 03:36
ericturn203 sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:star: 178 | @akschoeck | http://www.freecodecamp.com/akschoeck
:thumbsup:
Kyle Roach
@iRoachie
Jan 20 2016 03:36
@akschoeck Hey it works for me. Try refreshing your page
akschoeck
@akschoeck
Jan 20 2016 03:37
Ah, that worked. How silly, lol
Thanks :)
How to send brownie points?
Herman Fassett
@HermanFassett
Jan 20 2016 03:37
wiki brownie points
CamperBot
@camperbot
Jan 20 2016 03:37

:point_right: brownie points [wiki]

The number beside your picture on Free Code Camp tells you how many Brownie Points you have.

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

  1. Complete challenges - you get one point per challenge you complete
  2. Post relevant links on Camper News - you get 1 point for posting a link, and another point for each upvote your link gets
  3. Help other campers in chat - each time you help another camper and they thank you (by typing "thanks @yourname"), you will get a point

Brownie Points help you look like the kind of person who codes a lot, shares relevant links, and helps people.

They also add to your Streak.
:pencil: read more about brownie points on the FCC Wiki

Eric Turner
@ericturn203
Jan 20 2016 03:38
@akschoeck just @ the person and say thanks! is what I just did
CamperBot
@camperbot
Jan 20 2016 03:38
ericturn203 sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:warning: ericturn203 already gave akschoeck points
akschoeck
@akschoeck
Jan 20 2016 03:38
thanks @iRoachie
CamperBot
@camperbot
Jan 20 2016 03:38
akschoeck sends brownie points to @iroachie :sparkles: :thumbsup: :sparkles:
:star: 328 | @iroachie | http://www.freecodecamp.com/iroachie
akschoeck
@akschoeck
Jan 20 2016 03:38
huzzah!
Eric Turner
@ericturn203
Jan 20 2016 03:39
This message was deleted

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

.smaller-image {
width: 100px;
}

.gray-background {
background-color: gray;
}
#cat-photo-element {
background-color: green;
}
</style>

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

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

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

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

<form action="/submit-cat-photo" id="cat-photo-form cat-photo-element">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>``` My problem is on line 56, need help making the background green using #cat-photo-element

akschoeck
@akschoeck
Jan 20 2016 03:41
Not sure which line is 56.
cannelflow
@cannelflow
Jan 20 2016 03:42
@akschoeck which exercise ?
Eric Turner
@ericturn203
Jan 20 2016 03:42
Use an ID Attribute to Style an Element
I am having trouble on the <form line
akschoeck
@akschoeck
Jan 20 2016 03:43
Gotcha
Eric Turner
@ericturn203
Jan 20 2016 03:43
cant get that pretty formatting to work either lol
akschoeck
@akschoeck
Jan 20 2016 03:43
Ah
It doesn't want you to use the ID. It wants you to use the form selector
Pranav Doshi
@pranavdoshi
Jan 20 2016 03:43
@dontloasesleep post ur waypoint link
DJ
@qualitymanifest
Jan 20 2016 03:44
@ericturn203 they want you to use #cat-photo-form
akschoeck
@akschoeck
Jan 20 2016 03:44
use form { background: green; } instead
DJ
@qualitymanifest
Jan 20 2016 03:44
@ericturn203 so your code is fine just change the id name in your style, and get rid of the cat-photo-element id in your HTML
Eric Turner
@ericturn203
Jan 20 2016 03:46
oh I think I get it. thanks @qualitymanifest and aks
CamperBot
@camperbot
Jan 20 2016 03:46
ericturn203 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 821 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
please suggest any feedback
cannelflow
@cannelflow
Jan 20 2016 03:52
@sukumarkutagulla its going good looks like freecodecamp on your desktop lol
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:00
omg @cannelflow thanks bro
CamperBot
@camperbot
Jan 20 2016 04:00
sukumarkutagulla sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 458 | @cannelflow | http://www.freecodecamp.com/cannelflow
Ben
@bbeale
Jan 20 2016 04:02
@OriBon @DevPoetsSociety I don't know why the hell I was trying to use 25. I just reread the problem again. I guess smoking weed and programming don't always go so well
@OriBon @DevPoetsSociety thank you for the help
CamperBot
@camperbot
Jan 20 2016 04:02
bbeale sends brownie points to @oribon and @devpoetssociety :sparkles: :thumbsup: :sparkles:
:star: 539 | @oribon | http://www.freecodecamp.com/oribon
:star: 405 | @devpoetssociety | http://www.freecodecamp.com/devpoetssociety
Askhat Bikmetov
@askhat
Jan 20 2016 04:25

Sup crew, I'm working on Caesar's Cipher and encountered few issues. They are not actual problems, tests run well. They're rather warnings. So my code is:

function rot13(input) { // LBH QVQ VG!
  function move(pos, i, shift, end) {
    return String.fromCharCode(
      pos.charCodeAt(i)+shift > end
      ? pos.charCodeAt(i)-shift // Line 5
      : pos.charCodeAt(i)+shift);
  }
  var output = '';
  for (var i=0; i < input.length; i++) {
    var shift = 13;
    if (/[A-Z]/.test(input[i])) {
      var end = 'Z'.charCodeAt();
      output += move(input, i, shift, end);
    } else if (/[a-z]/.test(input[i])) {
      var end = 'z'.charCodeAt(); // Line 15
      output += move(input, i, shift, end);
    } else {
      output += input[i];
    }
  }
  return output;
}

// Change the inputs below to test
rot13("SERR PBQR PNZC");

On line 5 editor gives: Bad line breaking before '?'. How to break it right?
On line 15: 'end' already defined. So how to deal with variable redefinition?

sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:28
This message was deleted
Askhat Bikmetov
@askhat
Jan 20 2016 04:29
@sukumarkutagulla but isn't it'll break the ternary operator?
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:29
yea yea
sorry
Askhat Bikmetov
@askhat
Jan 20 2016 04:29
Hey aren't we were on this function together in Screenhero?
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:30
yea
i got it
Askhat Bikmetov
@askhat
Jan 20 2016 04:31
Nice to see ya. So I've done it. As for me it is perfect, except for aforementioned issues
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:31
ok
me too
DJ
@qualitymanifest
Jan 20 2016 04:32
@ubermonkey you could initialize var end; up at the top and then just do end = blahblah when you need it
@ubermonkey that'll get rid of that error. as for the other one... i think it's just yelling at you because it expected to see the whole ternary operator on one line?
Askhat Bikmetov
@askhat
Jan 20 2016 04:33
@qualitymanifest splendid thankyou
DJ
@qualitymanifest
Jan 20 2016 04:34
np
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:35
suggest me any improvement needed in my profile
This message was deleted
Askhat Bikmetov
@askhat
Jan 20 2016 04:35
@qualitymanifest so it is exclusively editor issue? 'cause as I recall my desktop editor allows me to break ternaries without linter hollering
CamperBot
@camperbot
Jan 20 2016 04:35
holler back!
Askhat Bikmetov
@askhat
Jan 20 2016 04:37
@sukumarkutagulla try to use .img-responsive on <img> and put bottom buttons into .row
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 04:37
@ubermonkey yea i need set them still
i used img-responsive but its not executing properly when we run pen
Askhat Bikmetov
@askhat
Jan 20 2016 04:39
@sukumarkutagulla also I see a bunch of typos there, try run your markup in w3c validator It'll give you clues on improvements as well
Melanie
@melto4519
Jan 20 2016 04:41
I'm stuck in a bootstrap well...any help?
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="well col-xs-6">
</div>
<div class="well col-xs-6">
</div>
</div>
</div>
akschoeck
@akschoeck
Jan 20 2016 04:41
What exercise are you on?
Melanie
@melto4519
Jan 20 2016 04:42
96
akschoeck
@akschoeck
Jan 20 2016 04:42
What's the name of it?
Melanie
@melto4519
Jan 20 2016 04:43
Create Bootstrap Well
Askhat Bikmetov
@askhat
Jan 20 2016 04:44
@melto4519 and what exactly your issue is?
Melanie
@melto4519
Jan 20 2016 04:44
I think it's fine, but tests are failing.
akschoeck
@akschoeck
Jan 20 2016 04:45
So you have two divs with the class "col-xs-6". It wants you to add a div nested inside each of those divs with the class well
You added the class of "well" to the existing div
Askhat Bikmetov
@askhat
Jan 20 2016 04:45
@melto4519 I think you should put another div.well inside .col-* rahther then giving .well to .col-*
rahulcode22
@rahulcode22
Jan 20 2016 04:49
Heyy everyone help me out. I got stuck on exercise 34.
Charlie
@charliechazz
Jan 20 2016 04:49
how conI do a dead link?
can I
Melanie
@melto4519
Jan 20 2016 04:49
@ubermonkey @akschoeck Thanks!
rahulcode22
@rahulcode22
Jan 20 2016 04:50
@charliechazz just write <a href="#">
akschoeck
@akschoeck
Jan 20 2016 04:50
@rahulcode22 What's the name of the exercise? Or give the link
Xanthony89X
@Xanthony89X
Jan 20 2016 04:53
i need some help
anyone?
rahulcode22
@rahulcode22
Jan 20 2016 04:54
@akschoeck "create a set of check boxes"
Xanthony89X
@Xanthony89X
Jan 20 2016 04:55
@xanthony89X
rahulcode22
@rahulcode22
Jan 20 2016 04:55
yeah tell me @Xanthony89X
akschoeck
@akschoeck
Jan 20 2016 04:55
@rahulcode22 I don't see one by that name. Can you copy and paste the URL?
Nvm, got it. Checkboxes was 1 word.
rahulcode22
@rahulcode22
Jan 20 2016 04:56
http://www.freecodecamp.com/challenges/create-a-set-of-checkboxes#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20alt%3D%22A%20cute%20orange%20cat%20lying%20on%20its%20back%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%3Cul%3E%0A%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%3C%2Ful%3E%0A%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%3Col%3E%0A%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%3C%2Fol%3E%0A%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Indoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3Eloving%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22checkbox%22name%3D%22personality%22%3Ecaring%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22checkbox%22name%3D%22personality%22%3Esweet%3C%2Flabel%3E%0A%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%0A%3C%2Fform%3E%0A
Xanthony89X
@Xanthony89X
Jan 20 2016 04:56
i started a project
akschoeck
@akschoeck
Jan 20 2016 04:57
You're missing your opening label tags
If it's highlighting something in red like that, it means something is missing. Down near the bottom.
Xanthony89X
@Xanthony89X
Jan 20 2016 04:57
i dont see anything
rahulcode22
@rahulcode22
Jan 20 2016 04:57
okayy ok i got it... thanks @akschoeck
CamperBot
@camperbot
Jan 20 2016 04:57
rahulcode22 sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:star: 200 | @akschoeck | http://www.freecodecamp.com/akschoeck
Charlie
@charliechazz
Jan 20 2016 04:57
how can I do a dead link?
<p>Click here for <a href="http://www.freecatphotoapp.com">cat photos</a>.</p>
akschoeck
@akschoeck
Jan 20 2016 04:58
<a href="#">text</a>
Xanthony89X
@Xanthony89X
Jan 20 2016 04:58
this is bigger than github
Charlie
@charliechazz
Jan 20 2016 04:58
thank you @akschoeck
CamperBot
@camperbot
Jan 20 2016 04:58
charliechazz sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:star: 201 | @akschoeck | http://www.freecodecamp.com/akschoeck
cannelflow
@cannelflow
Jan 20 2016 04:58
@charliechazz HREF="#"
Xanthony89X
@Xanthony89X
Jan 20 2016 04:59
#
im confused as shit
i built an app and i need to config it
maybe a platform
MADUABUCHI
@Maduflavins
Jan 20 2016 05:02
Hi
Goodmorning who is here
akschoeck
@akschoeck
Jan 20 2016 05:02
Hi there
MADUABUCHI
@Maduflavins
Jan 20 2016 05:03
Please help me out I am confused don't understand what am expected to do here
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.
akschoeck
@akschoeck
Jan 20 2016 05:04
Can you copy and paste the URL here so we can see what you've got and what it is looking for?
cannelflow
@cannelflow
Jan 20 2016 05:04
@Maduflavins WHICH EXERCISE ?
MADUABUCHI
@Maduflavins
Jan 20 2016 05:04

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

</style>

<h1>Hello World</h1>
Here is my code but doesn't seem to work

cannelflow
@cannelflow
Jan 20 2016 05:04
@Maduflavins in your <style>body{ color:xyz;font-family:xyz}</style>
MADUABUCHI
@Maduflavins
Jan 20 2016 05:05
@cannelflow it's CSS
cannelflow
@cannelflow
Jan 20 2016 05:05
@Maduflavins what in CSS
MADUABUCHI
@Maduflavins
Jan 20 2016 05:06
@cannelflow then my code should work
cannelflow
@cannelflow
Jan 20 2016 05:06
yes
Charlie
@charliechazz
Jan 20 2016 05:06
how can I Nest the existing img element within an a element.
cannelflow
@cannelflow
Jan 20 2016 05:06
which exercise are you in
@charliechazz <div><img></div> img nested inside div
MADUABUCHI
@Maduflavins
Jan 20 2016 05:07
@cannelflow Inherit Styles from the Body Element
cannelflow
@cannelflow
Jan 20 2016 05:08
@Maduflavins
 body {
    background-color: black;
    color:green;
    font-family:Monospace;
  }
akschoeck
@akschoeck
Jan 20 2016 05:08
Are you missing the background color it's looking for? @Maduflavins
cannelflow
@cannelflow
Jan 20 2016 05:09
@charliechazz worked?
akschoeck
@akschoeck
Jan 20 2016 05:09
@Maduflavins your code works for me on that page. Try refreshing.
MADUABUCHI
@Maduflavins
Jan 20 2016 05:09
I have tried with the background color first it did not work then I attempted without it Same issue
akschoeck
@akschoeck
Jan 20 2016 05:10
Try refreshing the page and submitting again
cannelflow
@cannelflow
Jan 20 2016 05:10
@Maduflavins try refreshing can you paste your code now
MADUABUCHI
@Maduflavins
Jan 20 2016 05:13
@cannelflow thanks and everybody here thanks it worked
CamperBot
@camperbot
Jan 20 2016 05:13
maduflavins sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 459 | @cannelflow | http://www.freecodecamp.com/cannelflow
Md. Adib Ibne Yousuf
@adib10mist
Jan 20 2016 05:16
use hex code to color elements? TIA.
akschoeck
@akschoeck
Jan 20 2016 05:16
TIA?
Md. Adib Ibne Yousuf
@adib10mist
Jan 20 2016 05:17
Is there any link or tools to know How to use Hex code to color elements? Thanks in Advance. @akschoeck
CamperBot
@camperbot
Jan 20 2016 05:17
adib10mist sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:star: 202 | @akschoeck | http://www.freecodecamp.com/akschoeck
akschoeck
@akschoeck
Jan 20 2016 05:18
http://www.colorpicker.com/ is pretty handy
Herman Fassett
@HermanFassett
Jan 20 2016 05:18
@adib10mist weren't there some lessons on hex codes for color?
If I'm just looking for ideas I use https://coolors.co/app
Md. Adib Ibne Yousuf
@adib10mist
Jan 20 2016 05:19
@HermanFassett Yes. Lessons are available here. But with this instruction I just come to know few colors. So, I need more color to know. Thanks @akschoeck
CamperBot
@camperbot
Jan 20 2016 05:19
adib10mist sends brownie points to @hermanfassett and @akschoeck :sparkles: :thumbsup: :sparkles:
:warning: adib10mist already gave akschoeck points
:star: 1399 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Gabriel
@gdedi001
Jan 20 2016 05:32
Does anyone know how to avoid this: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 05:48
@melto4519 how can we help you??
Jason Lee
@JsonLitz
Jan 20 2016 05:52
Quick question: I'm trying to nest "Like, Info and Delete" buttons side by side in a grid
 <div class="row Like Infor Delete">
  <button class="btn btn-block btn-primary">Like</button>
  <button class="btn btn-block btn-info">Info</button>
  <button class="btn btn-block btn-danger">Delete</button>
Can someone give me a hint as to what that should look like?
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 05:54
just in css make a statement like display: inline; @JsonLitz
in inline style, class="display: inline"
;
Mario Mitchell
@undergroundfx
Jan 20 2016 05:55

I made this a 2 player game successfully, now how to make it a 1 player game vs the computer??

http://codepen.io/mariomitchell/pen/eNybyY

Jason Lee
@JsonLitz
Jan 20 2016 05:56
asd
Kezmondo
@Kezmondo
Jan 20 2016 06:04

How do i nest a form action in this;

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

I'm an idiot, never mind :)
Munish Tayal
@munishtayal
Jan 20 2016 06:10
@Kezmondo <form><input></form>
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:20

So in my codepen here

http://codepen.io/CodingDucky/pen/JGOOEm

How do I get 'CodingDucky's Web Design in between my name and the buttons on the nav bar? As in I want it on the lighter colored part of it.

Fred
@FredBMe
Jan 20 2016 06:29
@undergroundfx if you just want a random AI I would make a function that will populate the available options to an array and and take the floor of a random number of 0 to the array length for it's selections.
If you want a smart AI, it'll take a lot more checks
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:30
This message was deleted

So in my codepen here

http://codepen.io/CodingDucky/pen/JGOOEm

How do I get 'CodingDucky's Web Design' in between my name and the buttons on the nav bar? As in I want it on the lighter colored part of it.

Ankit Panwar
@coderNoob
Jan 20 2016 06:31
We use $('some-element').hasClass('this-class');. What if I want to check if it doesn't have that class?
Fred
@FredBMe
Jan 20 2016 06:35
@CodingDucky are you trying to put your name on a row, then Coding Ducky's.... on a row then the 3 buttons on a row below it?
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:35
Will do.
@FredBMe It worked, thank you
CamperBot
@camperbot
Jan 20 2016 06:37
codingducky sends brownie points to @fredbme :sparkles: :thumbsup: :sparkles:
:star: 267 | @fredbme | http://www.freecodecamp.com/fredbme
Mario Mitchell
@undergroundfx
Jan 20 2016 06:37
thanks @FredBMe I think I'll go for the dumb AI for now and make it better later :)
CamperBot
@camperbot
Jan 20 2016 06:37
undergroundfx sends brownie points to @fredbme :sparkles: :thumbsup: :sparkles:
:star: 268 | @fredbme | http://www.freecodecamp.com/fredbme
sukumarkutagulla
@sukumarkutagulla
Jan 20 2016 06:39
Fred
@FredBMe
Jan 20 2016 06:40
@CodingDucky Sweet!
@undergroundfx yeah I hear you :)
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:46
@sukumarkutagulla If you want us to help you, you gotta tell us what you want
New nav bar. IMO it looks really pretty
WAIT THAT's NOT WHAT IT'S SUPPOSED TO LOOK LIKE
The hell?
I think you gotta full screen it
Take 2
Take two is a fail
akschoeck
@akschoeck
Jan 20 2016 06:50
I would recommend not using a ul for the whole bar. A div would be better suited. And just use list elements to list the navigation items
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:51
Why?
akschoeck
@akschoeck
Jan 20 2016 06:51
Well the name and the title aren't really part of a list
And technically that entire red bar is a header, not a nav. The nav specifically are the items off to the right
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:52
True, but they fit on the line neatly
akschoeck
@akschoeck
Jan 20 2016 06:52
This is strictly speaking from a more standard way of doing things. This obviously will work
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:52
And it would be kinda troublesome to rearrange
Thanks though @akschoeck
CamperBot
@camperbot
Jan 20 2016 06:52
codingducky sends brownie points to @akschoeck :sparkles: :thumbsup: :sparkles:
:star: 203 | @akschoeck | http://www.freecodecamp.com/akschoeck
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:52
Bootstrap magic works!
Herman Fassett
@HermanFassett
Jan 20 2016 06:53
Looking good @CodingDucky
DJ
@qualitymanifest
Jan 20 2016 06:54
@CodingDucky it's always good to try resizing the window to see what happens. it looks good when i open the page but as i make it smaller the navli buttons step down one at a time
maxeber
@maxeber
Jan 20 2016 06:58
wiki js
CamperBot
@camperbot
Jan 20 2016 06:58

:point_right: how jsonp is different from json [wiki]

JSONP is just JSON wrapped in a callback function.

JSONP is useful for making cross domain requests, which are often otherwise forbidden by browsers for security reasons.

 // an example of JSON
 {"weapon":"nunchucks","headband":"yellow"}

 // an example of JSONP
 myCallback({"weapon":"nunchucks","headband":"yellow"});

Then to access the data stored in your JSONP, you define the callback function:

myCallback = function(data){
  alert(data.weapon);
};

:pencil: read more about how jsonp is different from json on the FCC Wiki

Jose Dzireh Chong
@CodingDucky
Jan 20 2016 06:59

So my page just became a giant mess.

http://codepen.io/CodingDucky/pen/JGOOEm

I just added bootstrap to make it device universal, and it seems to have broken. Why?

maxeber
@maxeber
Jan 20 2016 07:01
@CodingDucky Did you add a row?
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 07:01
I did not
All I did was replace my margins and padding with col-md-4s and things like that
maxeber
@maxeber
Jan 20 2016 07:03
For bootstrap you need a row
Pea
@Peajaycodes78
Jan 20 2016 07:05
This message was deleted
maxeber
@maxeber
Jan 20 2016 07:06
wiki bootstrap
CamperBot
@camperbot
Jan 20 2016 07:06

:point_right: bootstrap [wiki]

A frontend CSS framework.

You can find out more here

related: css, frameworks

:pencil: read more about bootstrap on the FCC Wiki

Jose Dzireh Chong
@CodingDucky
Jan 20 2016 07:06
@MartyrZz Thanks man
CamperBot
@camperbot
Jan 20 2016 07:06
codingducky sends brownie points to @martyrzz :sparkles: :thumbsup: :sparkles:
:star: 201 | @martyrzz | http://www.freecodecamp.com/martyrzz
Jose Dzireh Chong
@CodingDucky
Jan 20 2016 07:08

Also, what's up with the spaces between my buttons on the left?

http://codepen.io/CodingDucky/pen/JGOOEm

maxeber
@maxeber
Jan 20 2016 07:25
@CodingDucky http://codepen.io/anon/pen/rxYEqK
You want this?
jeevitha
@jeevithajeev
Jan 20 2016 07:26
can anyone help me with :style text inputs as form controls
maxeber
@maxeber
Jan 20 2016 07:26
What is it?
jeevitha
@jeevithajeev
Jan 20 2016 07:26
style text inputs as form controls
maxeber
@maxeber
Jan 20 2016 07:27
wiki form
CamperBot
@camperbot
Jan 20 2016 07:27

:point_right: free code camp is an open source community distributed across many platforms [wiki]

Free Code Camp is an open source community. We have a free, self-paced web development curriculum located at http://freecodecamp.com, but we are much larger than just that.

We leverage the power of these existing platforms to connect with one another and learn to code together:

GitHub - for collaborating on open source projects and improving FreeCodeCamp.com
Gitter - for real time chatting and getting immediate help on our challenges
Camper News - for sharing coding resources
Facebook Campsites - for meeting campers in your city and coordinating events
Medium - for publishing your long-form content
Twitch - for live-streaming coding
YouTube - for publishing instructional videos
:pencil: read more about free code camp is an open source community distributed across many platforms on the FCC Wiki

jeevitha
@jeevithajeev
Jan 20 2016 07:27
bootstrap
Ankit Panwar
@coderNoob
Jan 20 2016 07:27
If you click fast, the AI doesn't fill the box. Can any one tell me why? But if you go really slow, it works fine. This is a dumb AI so far.
http://codepen.io/coderNoob/pen/vLmyWN
maxeber
@maxeber
Jan 20 2016 07:28
Link me the page you have trouble with @jeevithajeev
jeevitha
@jeevithajeev
Jan 20 2016 07:29

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

<style>
h2 {
font-family: Lobster, Monospace;
}

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

</style>

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></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">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label>
</div>
</div>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit<i class="fa fa-paper-plane"></i></button>

</form>
</div>

maxeber
@maxeber
Jan 20 2016 07:31
@coderNoob What if you addClass("innactive") with .innactive { pointer-events: none;}
Ankit Panwar
@coderNoob
Jan 20 2016 07:32
@MartyrZz I don't see the point for that.
@MartyrZz I added class clicked so that the user or the AI can't fill the box that has already been filled.
maxeber
@maxeber
Jan 20 2016 07:33
@coderNoob Up until the Ai didn't finish his turn the whole game is unclickable for you so you can't play before him and break the game lol
Ankit Panwar
@coderNoob
Jan 20 2016 07:34
@MartyrZz hmm
@MartyrZz You mean I should make it unclickable with the innactive class and css you suggested?
cannelflow
@cannelflow
Jan 20 2016 07:35
@jeevithajeev what is the problem ?
maxeber
@maxeber
Jan 20 2016 07:36
@coderNoob Yeah and when the Ai finish his turn, you removeClass("innactive");
jeevitha
@jeevithajeev
Jan 20 2016 07:36
@cannelflow style text inputs as form controls
Ankit Panwar
@coderNoob
Jan 20 2016 07:37
@MartyrZz Great suggestion. But how did you know the AI isn't finished? I thought it's all supposed to work in split seconds.
cannelflow
@cannelflow
Jan 20 2016 07:37
@jeevithajeev what error you are getting?
maxeber
@maxeber
Jan 20 2016 07:37
@jeevithajeev Can you tell me what # of exercise you're on?
cannelflow
@cannelflow
Jan 20 2016 07:38
@cannelflow this is your input field <input type="text" placeholder="cat photo URL" required> give it class form-control
@jeevithajeev
jeevitha
@jeevithajeev
Jan 20 2016 07:39
@cannelflow i dont know where to give the submit button the classes btn and btn-primary
cannelflow
@cannelflow
Jan 20 2016 07:40
@jeevithajeev like this form>
</div>
maxeber
@maxeber
Jan 20 2016 07:40
@coderNoob The click event trigger even if the portion of the code isn't finished. I guess it would be after the program give a X or 0 to the Npc
This message was deleted
cannelflow
@cannelflow
Jan 20 2016 07:41
@jeevithajeev <button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
Ankit Panwar
@coderNoob
Jan 20 2016 07:44
@MartyrZz I would need to add the inactive class to the whole board right?
jeevitha
@jeevithajeev
Jan 20 2016 07:44
@cannelflow ok i got the above one but where to give form-control?
cannelflow
@cannelflow
Jan 20 2016 07:45
@jeevithajeev <button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Su
maxeber
@maxeber
Jan 20 2016 07:47
@coderNoob Yeah, it's simpler. Or you could add it to each "div" or tags having an click event on
Ankit Panwar
@coderNoob
Jan 20 2016 07:47
@MartyrZz Added it to the divs but it doesn't seem to go away and I'm stuck after making a single click.
cannelflow
@cannelflow
Jan 20 2016 07:48
@jeevithajeev worked ?
Ankit Panwar
@coderNoob
Jan 20 2016 07:48
I removedClass after the the AI's turn
@MartyrZz
maxeber
@maxeber
Jan 20 2016 07:48
@coderNoob Are you sure you've placed it at the right place?
Ankit Panwar
@coderNoob
Jan 20 2016 07:49
@MartyrZz I doubt it too.
jeevitha
@jeevithajeev
Jan 20 2016 07:49
@cannelflow no
Ankit Panwar
@coderNoob
Jan 20 2016 07:49
@MartyrZz I removed class at the end of the AI turn function.
cannelflow
@cannelflow
Jan 20 2016 07:50
@jeevithajeev show your whole code
maxeber
@maxeber
Jan 20 2016 07:50
@coderNoob Might need to check your code :/
Ankit Panwar
@coderNoob
Jan 20 2016 07:50
jeevitha
@jeevithajeev
Jan 20 2016 07:51
  <div class="col-xs-6">
    <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  </div>
  <div class="col-xs-6">
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  </div>
</div>
<div class="row">
  <div class="col-xs-4">
    <label><input type="checkbox" name="personality"> Loving</label>
  </div>
  <div class="col-xs-4">
    <label><input type="checkbox" name="personality"> Lazy</label>
  </div>
  <div class="col-xs-4">
    <label><input type="checkbox" name="personality"> Crazy</label>
  </div>
</div>
<input type="text" placeholder="cat photo URL"required>
<button type="submit"class="btn btn-primary">Submit<i class="fa fa-paper-plane"></i></button>
</form>
</div>
cannelflow
@cannelflow
Jan 20 2016 07:52
@jeevithajeev
 <button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
  </form>
</div>
Ankit Panwar
@coderNoob
Jan 20 2016 07:52
@MartyrZz Also, I try to write code for humans. Does it look good enough?
jeevitha
@jeevithajeev
Jan 20 2016 07:52

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

<style>
h2 {
font-family: Lobster, Monospace;
}

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

</style>

<div class="container-fluid">
<div class="row">
<div class="col-xs-8">
<h2 class="text-primary text-center">CatPhotoApp</h2>
</div>
<div class="col-xs-4">
<a href="#"><img class="img-responsive thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
</div>
</div>
<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<div class="row">
<div class="col-xs-4">
<button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button>
</div>
<div class="col-xs-4">
<button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button>
</div>
</div>
<p>Things cats <span class="text-danger">love:</span></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">
<div class="row">
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
</div>
<div class="col-xs-6">
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
</div>
</div>
<div class="row">
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Loving</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Lazy</label>
</div>
<div class="col-xs-4">
<label><input type="checkbox" name="personality"> Crazy</label>
</div>
</div>
<input type="text" placeholder="cat photo URL"required>
<button type="submit"class="btn btn-primary">Submit<i class="fa fa-paper-plane"></i></button>

</form>
</div>

cannelflow
@cannelflow
Jan 20 2016 07:53
@jeevithajeev <input type="text" placeholder="cat photo URL" required class="form-control">
<button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
jeevitha
@jeevithajeev
Jan 20 2016 07:55
@cannelflow it worked................thank you
Ankit Panwar
@coderNoob
Jan 20 2016 08:00
@MartyrZz Okay I found the right place and fixed it. But the AI still seems to skip sometimes if you click really fast !
maxeber
@maxeber
Jan 20 2016 08:01
@coderNoob Ouch, can I see where you placed it ?
Ankit Panwar
@coderNoob
Jan 20 2016 08:05

@MartyrZz

var userTurn = function(pos) {
  if ($("#b" + pos).hasClass("clicked")) {
    //do nothing
  } else {
    takeTurn(pos, userSign); //Make the user's move 
    $(".square").addClass("inactive"); //Make it inactive till the AI is finished
    aiTurn(); //Switch to AI to take it's turn    
  }
}

and I removed it like this

var aiTurn = function() {
  var square ;
  var rand = function(){
    square = Math.floor(Math.random() * 9);
  }
  rand();
  while($("#b"+square).hasClass("clicked")){
    rand();
  }
  takeTurn(square, aiSign);
  $(".square").removeClass("inactive"); // Make the boxes clickable after finishing
}
Ryan
@ryanforever
Jan 20 2016 08:07
every time i highlight code to copy and paste into the browser console (where i experiment), a little icon pops up asking me how i want to copy it...does anyone happen to know how to disable that?
Chris Moore
@dooglus
Jan 20 2016 08:08
@ryanforever yes it happens to me, and I wish it wouldn't happen - it always appears over the text I'm trying to edit!
but I'm a noob, so maybe it's possible to disable it. If so, I'd love to know how!
also, how do you edit the wiki? I've found a typo I'd like to fix
Ryan
@ryanforever
Jan 20 2016 08:10
i am assuming it's even possible, haha. it is annoying me to no end.
maxeber
@maxeber
Jan 20 2016 08:10
@dooglus @ryanforever Ahah I hate it too
@coderNoob Can't seem to make it work :/ Glad you worked your way out LOL
Ankit Panwar
@coderNoob
Jan 20 2016 08:11
@MartyrZz No I haven't. The AI still skips sometimes if you click really fast. :worried:
Bon
@OriBon
Jan 20 2016 08:15
@ryanforever At this time we are not able to hide it. However, the creators are already working on a fix which will change this. Instead of it popping up every time we highlight it, it will instead only pop ip when he hold Ctrl and highlight it.
Ryan
@ryanforever
Jan 20 2016 08:19
@dooglus apparently they do it just like a git hub code branch...though i am new to all this i can't help but find that clever
@OriBon that sounds great
this is such a cool site
Vincent von Enzber
@fashon98
Jan 20 2016 08:25
are capital letters in style CSS relevant?
for example can i write times-new-roman instead of Times-New-Roman????
maxeber
@maxeber
Jan 20 2016 08:28
@fashon98 CSS is case insensitive in all matters under its control... Font-family name and color like "red" or "BLUE" isn't.
01kapils
@01kapils
Jan 20 2016 08:34

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

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

Your h2 element should be blue
??
maxeber
@maxeber
Jan 20 2016 08:47
@01kapils CatPhotoApp shouldn't be in the bracket style
<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>
...
Mohit Nehru
@MohitNehru
Jan 20 2016 09:00
Read the values of the properties hat and shirt of testObj using dot notation.
var hatValue = testObj; 
{
  hatValue: "ballcap";
}
testObj.hatValue;
var shirtValue = testObj;    // Change this line
{
  shirtValue: "jersey";
}
testObj.shirtValue;
Accessing Objects Properties with the Dot Operator
i am not able to understand
where i am going on wrong
or what i need to do
jayaram
@JayaramKollipakula
Jan 20 2016 09:15
@MohitNehru is this in javascript?
Mohit Nehru
@MohitNehru
Jan 20 2016 09:16
yes
@JayaramKollipakula
its javaScript
Selection_013.jpg
jayaram
@JayaramKollipakula
Jan 20 2016 09:19
which exercise it is
Mohit Nehru
@MohitNehru
Jan 20 2016 09:20
Accessing Objects Properties with the Dot Operator
jayaram
@JayaramKollipakula
Jan 20 2016 09:24

@MohitNehru just simply use Dot operator bro...```js
var testObj = {
"hat": "ballcap",
"shirt": "jersey",
"shoes": "cleats"
};

// Only change code below this line

var hatValue = testObj.hat; // Change this line
var shirtValue = testObj.shirt; // Change this line

```

try and let me know bro... @MohitNehru
Mohit Nehru
@MohitNehru
Jan 20 2016 09:25
@JayaramKollipakula thanks
CamperBot
@camperbot
Jan 20 2016 09:25
mohitnehru sends brownie points to @jayaramkollipakula :sparkles: :thumbsup: :sparkles:
:star: 30 | @jayaramkollipakula | http://www.freecodecamp.com/jayaramkollipakula
Mohit Nehru
@MohitNehru
Jan 20 2016 09:25
it worked
jayaram
@JayaramKollipakula
Jan 20 2016 09:25
np
Mohit Nehru
@MohitNehru
Jan 20 2016 09:25
could you let know it asked to use string
maxeber
@maxeber
Jan 20 2016 09:25
@coderNoob Check this out memory game. This was the project I implemented the point-event: inactive;
Mohit Nehru
@MohitNehru
Jan 20 2016 09:26
but we just refer object
is the concept like string object
is it something else
jayaram
@JayaramKollipakula
Jan 20 2016 09:27
yeah...it is something like associative arrays
Mohit Nehru
@MohitNehru
Jan 20 2016 09:29
@JayaramKollipakula ok Thanks for let me know
CamperBot
@camperbot
Jan 20 2016 09:29
mohitnehru sends brownie points to @jayaramkollipakula :sparkles: :thumbsup: :sparkles:
:warning: mohitnehru already gave jayaramkollipakula points
Aman Agarwal
@amanagarwal1993
Jan 20 2016 09:37
@soleynik thanks I'll try it... I was trying to push the chars into it though
Viqar
@Viqar
Jan 20 2016 09:37
Hi All...
need some help on html. where can i get.
...
I am new to this community.
@Viqar check this bro...all the best
Viqar
@Viqar
Jan 20 2016 09:41
Thanks a ton.
niharranjanroy
@niharranjanroy
Jan 20 2016 09:42
Viqar
@Viqar
Jan 20 2016 09:42
Vo
@niharranjanroy
Hemei de Wreede
@HemeiW
Jan 20 2016 09:45
lost with Introducing JavaScript Object Notation JSON
var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1993,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }

  {

    "artist": "Muse",
    "title": "Drones",
    "release_year": 2015,
    "formats": ["CD",
    "LP"]

  }
];
what is wrong with this?
jayaram
@JayaramKollipakula
Jan 20 2016 09:46
@HemeiW may I know in which section it is?
Hemei de Wreede
@HemeiW
Jan 20 2016 09:47
Introducing JavaScript Object Notation JSON
Nigel
@nigeljoy
Jan 20 2016 09:48
@HemeiW i think you missed a comma , after first }
Hemei de Wreede
@HemeiW
Jan 20 2016 09:48
instructions are :
Add a new album to the myMusic JSON object. Add artist and title strings, release_year number, and a formats array of strings.
@nigeljoy where do i miss the comma? I can't find it :worried:
kirbyedy
@kirbyedy
Jan 20 2016 09:53
after the first array
},
{ second artist...
Hemei de Wreede
@HemeiW
Jan 20 2016 09:54
oh thank you :)
Nigel
@nigeljoy
Jan 20 2016 09:55
@HemeiW lol..time to wear glasses :P
Hemei de Wreede
@HemeiW
Jan 20 2016 09:56
@nigeljoy actually I already wear glasses for 10 years or something
Nigel
@nigeljoy
Jan 20 2016 09:59
@HemeiW lol...i guess you then haven't really developed your coding eyes yet..spend more time making mistakes :+1:
Hemei de Wreede
@HemeiW
Jan 20 2016 10:00
@nigeljoy no not really I just started recently to code and to be honest it is quite hard and a lot to learn but very interesting
Ankit Panwar
@coderNoob
Jan 20 2016 10:01
@MartyrZz Seems like slow or fast clicking has got nothing to do with it. It just simply doesn't fill the box. :|
elrix
@A19
Jan 20 2016 10:12
sir how to input widh in img <img> if <img class="#"> can?
maxeber
@maxeber
Jan 20 2016 10:12
Ankit Panwar
@coderNoob
Jan 20 2016 10:14
@MartyrZz I don't see the difference ?!
kirbyedy
@kirbyedy
Jan 20 2016 10:24
@MartyrZz how is this working ?
Screen Shot 2016-01-20 at 12.24.14.png
maxeber
@maxeber
Jan 20 2016 10:25
@kirbyedy @coderNoob Forget it :/ Seems it's harder then it should.
Saw code with .off(...) instead of addClass("inactive")
Never tried it though
cannelflow
@cannelflow
Jan 20 2016 10:31
@A19 which ex?
Utkarsh Bhimte
@Utkarshbhimte
Jan 20 2016 10:55
Im having problem putting the Tweet Button in the Quote Gen Pen
How to put stuff in a variable to be inside a href?
I could not see a Tweet Button in the sample
shiva bhardwaj
@bhardwaj-g
Jan 20 2016 10:58
hello world
CamperBot
@camperbot
Jan 20 2016 10:58

welcome to FreeCodeCamp @bhardwaj-g!

shiva bhardwaj
@bhardwaj-g
Jan 20 2016 11:01
here i am new so, from where will i start @camperbot
cannelflow
@cannelflow
Jan 20 2016 11:02
@bhardwaj-g welcome
Lumsor
@Lumsor
Jan 20 2016 11:02
hello world
CamperBot
@camperbot
Jan 20 2016 11:02

welcome to FreeCodeCamp @Lumsor!

cannelflow
@cannelflow
Jan 20 2016 11:02
@Lumsor welcome
Aleksander Gębicki
@Takumar
Jan 20 2016 11:03
@bhardwaj-g and @Lumsor hello and welcome to FCC community - Happy Coding! :-)
cannelflow
@cannelflow
Jan 20 2016 11:03
@Utkarshbhimte use glyphicon
@Utkarshbhimte Glyphicons
@Utkarshbhimte or you can use font awesome icon
@Utkarshbhimte <i class="fa fa-twitter-square"></i>
MADUABUCHI
@Maduflavins
Jan 20 2016 11:11
Your h1 element should be pink.
cannelflow
@cannelflow
Jan 20 2016 11:11
@Maduflavins ?
MADUABUCHI
@Maduflavins
Jan 20 2016 11:13

.pink-text {
color: pink !important;
}
.blue-text {
color: blue;
}
h1{
color: pink;
}
</style>

<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
I did something like this but it's not working

cannelflow
@cannelflow
Jan 20 2016 11:13
@Maduflavins which exercise ?
MADUABUCHI
@Maduflavins
Jan 20 2016 11:14
The h1{color:pink;}was added out of I have tried and am tired
Mohamed Fahadh
@fahadh14
Jan 20 2016 11:14
hey guys need help with Quoting Strings with Single Quotes exercise
cannelflow
@cannelflow
Jan 20 2016 11:15
@fahadh14 what you tried?
Mohamed Fahadh
@fahadh14
Jan 20 2016 11:15
'This string has "double quotes" in it. And "probably" lots of them.'
my answer is this var myStr = 'This string has "double quotes" in it. And "probably" lots of them.';
but there is a last portion which says Only remove the backslashes \ used to escape quotes.
first part says remove all backlashes ;/
so i dont know where i went wrong
@cannelflow there's that
cannelflow
@cannelflow
Jan 20 2016 11:16
@fahadh14 but exercise asked you to remove it from var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";
Mohamed Fahadh
@fahadh14
Jan 20 2016 11:17
ogosh
thanks alot
cannelflow
@cannelflow
Jan 20 2016 11:17
@fahadh14 you have to remove "" from var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";
Mohamed Fahadh
@fahadh14
Jan 20 2016 11:18
thanks @cannelflow
CamperBot
@camperbot
Jan 20 2016 11:18
fahadh14 sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 462 | @cannelflow | http://www.freecodecamp.com/cannelflow
cannelflow
@cannelflow
Jan 20 2016 11:18
@fahadh14 remove outer "" and make it '' after that remove \
@Maduflavins which exercise ?
MADUABUCHI
@Maduflavins
Jan 20 2016 11:19

@cannelflowYay! We just proved that in-line styles will override all the CSS declarations in your style element.

But wait. There's one last way to override CSS. This is the most powerful method of all. But before we do it, let's talk about why you would ever want to override CSS.

In many situations, you will use CSS libraries. These may accidentally override your own CSS. So when you absolutely need to be sure that an element has specific CSS, you can use !important

Let's go all the way back to our pink-text class declaration. Remember that our pink-text class was overridden by subsequent class declarations, id declarations, and in-line styles.

Let's add the keyword !important to your pink-text element's color declaration to make 100% sure that your h1 element will be pink.

An example of how to do this is:

color: red !important;

Aleksander Gębicki
@Takumar
Jan 20 2016 11:20
@Maduflavins you don't have to add The h1{color:pink;} because, header <h1> has already applied .pink-text to it.
You want to add only modifier !important which you did in your code, as I see.
Jamela
@Jamela08
Jan 20 2016 11:21
i have a question
Im at this Target HTML Elements with Selectors Using jQuery
Aleksander Gębicki
@Takumar
Jan 20 2016 11:21
@Maduflavins you are missing <style> tag at the beginning of your code.
cannelflow
@cannelflow
Jan 20 2016 11:22
@Maduflavins i think you need to remove h1{
color: pink;
}
Jamela
@Jamela08
Jan 20 2016 11:22
<script>
$(document).ready(function($("button").addClass("animated bounce");) {

});
</script>
I got syntax error unexpected token
Aleksander Gębicki
@Takumar
Jan 20 2016 11:23
@Jamela08 this line: $("button").addClass("animated bounce"); should be put between braces (you have empty line for that in your code).
Jamela
@Jamela08
Jan 20 2016 11:24
thanks @Takumar
CamperBot
@camperbot
Jan 20 2016 11:24
jamela08 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1796 | @takumar | http://www.freecodecamp.com/takumar
cannelflow
@cannelflow
Jan 20 2016 11:24
@Jamela08 you need to put $("button").addClass("animated bounce") in {}
Jamela
@Jamela08
Jan 20 2016 11:24
i tried doing that before dunno why it dont work eh
cannelflow
@cannelflow
Jan 20 2016 11:24
:smile:
Jamela
@Jamela08
Jan 20 2016 11:24
anyway thanks a lot @Takumar and @cannelflow
CamperBot
@camperbot
Jan 20 2016 11:24
jamela08 sends brownie points to @takumar and @cannelflow :sparkles: :thumbsup: :sparkles:
:warning: jamela08 already gave takumar points
:star: 463 | @cannelflow | http://www.freecodecamp.com/cannelflow
Moritz
@Flamesolid
Jan 20 2016 11:29
Hey what is a bootstrap button ?
cannelflow
@cannelflow
Jan 20 2016 11:30
@Flamesolid it is a simple button
Moritz
@Flamesolid
Jan 20 2016 11:30
thx :D
MADUABUCHI
@Maduflavins
Jan 20 2016 11:39
It's not working

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

orange-text {

color: orange;

}
.pink-text {
color: pink !important;
}
.blue-text {
color: blue;
}

</style>

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

Aleksander Gębicki
@Takumar
Jan 20 2016 11:44
@Maduflavins is this waypoint: "Override All Other Styles by using Important"?
If so, your code is correct. Try to refresh your browser.
pat
@sinosipat
Jan 20 2016 11:44
help please "Give the text input in your form the class form-control."
CamperBot
@camperbot
Jan 20 2016 11:44
no wiki entry for: please give the text input in your form the class form-control
Victor
@Evaderei
Jan 20 2016 11:44
@Blazephoenix Gotta watchout for trapdoors in the closet
:D
Font looks a little bit fuzzy for me that's the only complaint i got, you're also quite the story teller. @Blazephoenix
MADUABUCHI
@Maduflavins
Jan 20 2016 11:46
The nonsense still is not working is there any way I can go to the next topic cos it's not working I have refreshed
Blaze
@Blazephoenix
Jan 20 2016 11:48
@Evaderei Thanks :) Yeah, I'm on the lookout for better cursive fonts
That was just a random story I picked up to go with the code haha
CamperBot
@camperbot
Jan 20 2016 11:48
blazephoenix sends brownie points to @evaderei :sparkles: :thumbsup: :sparkles:
:star: 365 | @evaderei | http://www.freecodecamp.com/evaderei
Victor
@Evaderei
Jan 20 2016 11:49
@Blazephoenix Sweet, check this out
FCC used it for one of their ziplines
Blaze
@Blazephoenix
Jan 20 2016 11:50
@Evaderei But I am actually using pacifico for the paragraphs
Victor
@Evaderei
Jan 20 2016 11:52
Crap i don't think you can smooth them out =.=
No anti-aliasing for web developers?
Anti-aliasing makes your text smooth and stuff
MADUABUCHI
@Maduflavins
Jan 20 2016 11:53
So am gonna be stuck here for like ever?
Blaze
@Blazephoenix
Jan 20 2016 11:54
you should add a '.' before orange-text
@Maduflavins
@Maduflavins No wait, its an id
add a '#' instead
Did it work?
MADUABUCHI
@Maduflavins
Jan 20 2016 11:59
Nope
It's rili discouraging
Blaze
@Blazephoenix
Jan 20 2016 12:01
@Maduflavins What waypoint is it?
MADUABUCHI
@Maduflavins
Jan 20 2016 12:04
Override all style by using important
spacejump13891312
@spacejump13891312
Jan 20 2016 12:04
What is the difference(other then size) between <h> elements and <p> element??
Blaze
@Blazephoenix
Jan 20 2016 12:07
<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink !important;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>
@Maduflavins This was my code for the same
@spacejump13891312 They are used specifically to separate a heading from a paragraph
spacejump13891312
@spacejump13891312
Jan 20 2016 12:09
Much thanks @Blazephoenix
CamperBot
@camperbot
Jan 20 2016 12:09
spacejump13891312 sends brownie points to @blazephoenix :sparkles: :thumbsup: :sparkles:
:star: 295 | @blazephoenix | http://www.freecodecamp.com/blazephoenix
MADUABUCHI
@Maduflavins
Jan 20 2016 12:11
@Blazephoenix your code is not complete please can I see the complete code?
Blaze
@Blazephoenix
Jan 20 2016 12:11
@Maduflavins That is the complete code
@spacejump13891312 :)
Aleksander Gębicki
@Takumar
Jan 20 2016 12:16

@Maduflavins if your code is still not passing, try to use "Reset" button (below "Run tests") to clear your code, and then modify only one line: color: pink; change it to:

    color: pink !important;

You don't have to do anything else. If that won't work, try another web browser. Which are you using by the way? Firefox, Chrome?

spacejump13891312
@spacejump13891312
Jan 20 2016 12:17
What is the problem?
Davide
@DavOnGit
Jan 20 2016 12:18
dt = now - (time || now);
Hi guys, i need help with this. How it works?
Minhazul Islam
@Minhazul-islam
Jan 20 2016 12:26
what is camperbot?
Aleksander Gębicki
@Takumar
Jan 20 2016 12:27
@Minhazul-islam it's our R2D2 camper robot, it answers for less difficult questions, gives hints.
i.e.
wiki format
CamperBot
@camperbot
Jan 20 2016 12:28

:point_right: code formatting [wiki]

Inline code

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

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<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

Aleksander Gębicki
@Takumar
Jan 20 2016 12:28
about @Minhazul-islam
CamperBot
@camperbot
Jan 20 2016 12:28
:star: 55 | @minhazul-islam | http://www.freecodecamp.com/minhazul-islam
Markus Kiili
@Masd925
Jan 20 2016 12:30
@DavOnGit Binary logical operations in JS can accept truthy and falsy values (any value converts to true/false). The operation returns the value that stopped the process. A||B returns the first operand if it is truthy. Otherwise the second one is returned.
Davide
@DavOnGit
Jan 20 2016 12:31
@Masd925 Thanks :)
CamperBot
@camperbot
Jan 20 2016 12:31
davongit sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 746 | @masd925 | http://www.freecodecamp.com/masd925
MADUABUCHI
@Maduflavins
Jan 20 2016 12:32
Please someone should tell me how I can go to the next cos this is not working
I have tried everything thing
Markus Kiili
@Masd925
Jan 20 2016 12:32
@DavOnGit A&&B returns A if it is falsy. Otherwise B is returned.
ILHAMIDEAZ
@ILHAMIDEAZ
Jan 20 2016 12:42
Why $(document).ready(function(){
$("target4").text("<i>#target4</i>")
}); on challennge 118 did not working?
Blauelf
@Blauelf
Jan 20 2016 12:48
$("#target4"), you are missing #
Hemei de Wreede
@HemeiW
Jan 20 2016 12:49
what is wrong with this?
var oldArray = [1,2,3,4,5,6,7,8,9,10];
var newArray = [];

// Only change code below this line.

 oldArray = oldArray.filter(function(val) {return val <= 5;});
You should have removed all the values from the array that are greater than 5.
cannelflow
@cannelflow
Jan 20 2016 12:50
@ILHAMIDEAZ should be ("#target")
Hemei de Wreede
@HemeiW
Jan 20 2016 12:50
waypoint
Filter Arrays with filter
Mohit Nehru
@MohitNehru
Jan 20 2016 12:53
Guys i need help with this.Its bit confusing looks like i am somewhere unable to follow in last step.
// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
  switch(val) {
    case "alpha": 
      result = "Adams";
      break;
    case "bravo": 
      result = "Boston";
      break;
    case "charlie": 
      result = "Chicago";
      break;
    case "delta": 
      result = "Denver";
      break;
    case "echo": 
      result = "Easy";
      break;
    case "foxtrot": 
      result = "Frank";
      break;
    case "":
      result = undefined;
  }

  // Only change code above this line
  return result;
}

// Change this value to test

phoneticLookup("alpha") ;
phoneticLookup("bravo") ;
phoneticLookup("charlie");
phoneticLookup("delta");
phoneticLookup("echo") ;
phoneticLookup("foxtrot");
phoneticLookup("");

var lookup={
  "alpha":"adams",
  "bravo":"Boston",
  "charlie":"Chicago",
  "delta":"Denver",
  "foxtrot":"Frank",
  "echo":"Easy",



};
var lookup=alpha;
alpha[lookup];
avaScript - Using Objects for Lookups
Convert the switch statement into a lookup table called lookup. Use it to lookup val and return the associated string.
i am having trouble with understand of var lookup
part
cannelflow
@cannelflow
Jan 20 2016 12:53
@HemeiW put your vale in newArray here oldArray = oldArray.filter(function(val) {return val <= 5;});
@HemeiW then return statement
Hemei de Wreede
@HemeiW
Jan 20 2016 12:55
@cannelflow I got it :O)
ILHAMIDEAZ
@ILHAMIDEAZ
Jan 20 2016 12:55
@cannelflow thanks but there was error "Make sure the text is otherwise unchanged."
CamperBot
@camperbot
Jan 20 2016 12:55
ilhamideaz sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 466 | @cannelflow | http://www.freecodecamp.com/cannelflow
cannelflow
@cannelflow
Jan 20 2016 12:56
@MohitNehru Convert the switch statement into a lookup table called lookup. Use it to lookup val and return the associated string
@ILHAMIDEAZ :smile:
@MohitNehru so remove switch
@MohitNehru then assign value to result then return it
GangsterGrisen
@GangsterGrisen
Jan 20 2016 12:58
How do I complete level 17?
cannelflow
@cannelflow
Jan 20 2016 12:58
@GangsterGrisen which exercise ? what you tried so far ?
GangsterGrisen
@GangsterGrisen
Jan 20 2016 12:59
I cant finish the ''Give elements with the p tag a font-size of 16px.')'', nothing works
cannelflow
@cannelflow
Jan 20 2016 13:00
@GangsterGrisen in your style p{font-size:16px; }
@MohitNehru worked ?
GangsterGrisen
@GangsterGrisen
Jan 20 2016 13:01
Im working on it
Mohit Nehru
@MohitNehru
Jan 20 2016 13:01
@cannelflow working
cannelflow
@cannelflow
Jan 20 2016 13:01
@MohitNehru :smile:
Mohit Nehru
@MohitNehru
Jan 20 2016 13:04

@cannelflow ```js
// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
switch(lookup) {
case "alpha":
result = "Adams";
break;
case "bravo":
result = "Boston";
break;
case "charlie":
result = "Chicago";
break;
case "delta":
result = "Denver";
break;
case "echo":
result = "Easy";
break;
case "foxtrot":
result = "Frank";
break;
case "":
result = undefined;
}

// Only change code above this line
return result;
}

// Change this value to test

phoneticLookup("alpha") ;
phoneticLookup("bravo") ;
phoneticLookup("charlie");
phoneticLookup("delta");
phoneticLookup("echo") ;
phoneticLookup("foxtrot");
phoneticLookup("");

var lookup={
"alpha":"adams",
"bravo":"Boston",
"charlie":"Chicago",
"delta":"Denver",
"foxtrot":"Frank",
"echo":"Easy",

};
lookup[val];
```

// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line
  switch(lookup) {
    case "alpha": 
      result = "Adams";
      break;
    case "bravo": 
      result = "Boston";
      break;
    case "charlie": 
      result = "Chicago";
      break;
    case "delta": 
      result = "Denver";
      break;
    case "echo": 
      result = "Easy";
      break;
    case "foxtrot": 
      result = "Frank";
      break;
    case "":
      result = undefined;
  }

  // Only change code above this line
  return result;
}

// Change this value to test

phoneticLookup("alpha") ;
phoneticLookup("bravo") ;
phoneticLookup("charlie");
phoneticLookup("delta");
phoneticLookup("echo") ;
phoneticLookup("foxtrot");
phoneticLookup("");

var lookup={
  "alpha":"adams",
  "bravo":"Boston",
  "charlie":"Chicago",
  "delta":"Denver",
  "foxtrot":"Frank",
  "echo":"Easy",



};
lookup[val];
is this what ypu are trying to refer
@cannelflow
cannelflow
@cannelflow
Jan 20 2016 13:06
@MohitNehru first assign value to reasult which is result=lookup[val];
Aleksander Gębicki
@Takumar
Jan 20 2016 13:06
@MohitNehru you can edit your posts, no need to put it here twice :-)
GangsterGrisen
@GangsterGrisen
Jan 20 2016 13:06
When im done with this first programming thing. Will i be able to download it in some way?
Mohamed Fahadh
@fahadh14
Jan 20 2016 13:06
anyone can help with Global Scope and Functions
?
Mohit Nehru
@MohitNehru
Jan 20 2016 13:06
@Takumar Thanks pal, will take care of it next time
CamperBot
@camperbot
Jan 20 2016 13:06
mohitnehru sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Mohamed Fahadh
@fahadh14
Jan 20 2016 13:06
idk where i went wrong :/
CamperBot
@camperbot
Jan 20 2016 13:06
:star: 1798 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Jan 20 2016 13:06
@MohitNehru you can use Edit option after pressing three dots to the right.
How_to_edit.jpg
CamperBot
@camperbot
Jan 20 2016 13:07
no wiki entry for: with this httpwwwfreecodecampcomchallengesglobal-scope-and-functionssolution2f2f20declare20your20variable20here0avar20myglobal203d20103b0a0afunction20fun1207b0a20oppsglobal203d2053b202f2f20assign20520to20oopsglobal20here0a20200a200a20200a7d0a0a2f2f20only20change20code20above20this20line0afunction20fun2207b0a2020var20output203d2022223b0a2020if20typeof20myglobal203d2022undefined22207b0a20202020output202b3d2022myglobal3a2022202b20myglobal3b0a20207d0a2020if20typeof20oopsglobal203d2022undefined22207b0a20202020output202b3d202220oopsglobal3a2022202b20oopsglobal3b0a20207d0a2020consolelogoutput3b0a7d0a
Munish Tayal
@munishtayal
Jan 20 2016 13:08
@fahadh14 paste your code here
Aleksander Gębicki
@Takumar
Jan 20 2016 13:08
@fahadh14 you mistyped name of variable, it should be: oopsGlobal you typed: "oppsGlobal"
cannelflow
@cannelflow
Jan 20 2016 13:09
@fahadh14 refresh the page and try everything looks good their
Mohit Nehru
@MohitNehru
Jan 20 2016 13:09
Selection_016.jpg
@cannelflow @Takumar i think i messed up here something
cannelflow
@cannelflow
Jan 20 2016 13:10
@Takumar is coorect it should be oopsGlobal
Aleksander Gębicki
@Takumar
Jan 20 2016 13:10
@MohitNehru you should return result; but assign value to it above comment: result = lookup[val];
cannelflow
@cannelflow
Jan 20 2016 13:11
@MohitNehru first assign result =lookup[val] then return result
Matias Pereira
@sieb7e
Jan 20 2016 13:12

var Car = function() {
// this is a private variable
var speed = 10;

// these are public methods
this.accelerate = function(change) {
speed += change;
};

this.decelerate = function() {
speed -= 5;
};

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

var Bike = function() {

// Only change code below this line.
var gear = 1;

this.getGear = function(){
return gear;
};

this.setGear = function(){
return gear += 3;
};

};

var myCar = new Car();

var myBike = new Bike();

Hemei de Wreede
@HemeiW
Jan 20 2016 13:12
its me again, what is wrong with this?
i can't accomplish
myBike.getGear() should return 4 after myBike.setGear(4).
Mohit Nehru
@MohitNehru
Jan 20 2016 13:12
@cannelflow so result = underdefind should be replaced result =lookup[val]
Hemei de Wreede
@HemeiW
Jan 20 2016 13:12
var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

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

var Bike = function() {

  // Only change code below this line.
var gear = 4;
  this.getGear = function() {
   return gear;

  };
  this.setGear = function() {
    speed += 4;
  };

};

var myCar = new Car();

var myBike = new Bike();
Matias Pereira
@sieb7e
Jan 20 2016 13:12
HemeiW change the return of setGear
@HemeiW change the return of set gear
cannelflow
@cannelflow
Jan 20 2016 13:13
@MohitNehru yes remove that whole case from their
Matias Pereira
@sieb7e
Jan 20 2016 13:13
for gear += 3
Mohit Nehru
@MohitNehru
Jan 20 2016 13:13
whole case what is that
@cannelflow
cannelflow
@cannelflow
Jan 20 2016 13:14
@MohitNehru case "":
result = undefined;
@HemeiW which exercise ?
Mohit Nehru
@MohitNehru
Jan 20 2016 13:15
  switch(lookup) {
    case "alpha": 
      result = "Adams";
      break;
    case "bravo": 
      result = "Boston";
      break;
    case "charlie": 
      result = "Chicago";
      break;
    case "delta": 
      result = "Denver";
      break;
    case "echo": 
      result = "Easy";
      break;
    case "foxtrot": 
      result = "Frank";




  // Only change code above this line
  return result = lookup[val];
}
@HemeiW Using Objects for Lookup
javascript
Hemei de Wreede
@HemeiW
Jan 20 2016 13:16
@cannelflow from Object Oriented and Functional Programming (2 hours) than Make Object Properties Private
Mohit Nehru
@MohitNehru
Jan 20 2016 13:16
@cannelflow is this what i should do?
Aleksander Gębicki
@Takumar
Jan 20 2016 13:16
@MohitNehru you showed earlier longer code, in the instruction you were told to create lookup variable, and you deleted it now :-(
You should remove switch() {} statement from your code.
Mohamed Fahadh
@fahadh14
Jan 20 2016 13:16
thanks @Takumar !
CamperBot
@camperbot
Jan 20 2016 13:16
fahadh14 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1799 | @takumar | http://www.freecodecamp.com/takumar
cannelflow
@cannelflow
Jan 20 2016 13:16
@MohitNehru first assign value to result by writing result=lookup[val]
then return result
Aleksander Gębicki
@Takumar
Jan 20 2016 13:17
@fahadh14 you are welcome.
Mohit Nehru
@MohitNehru
Jan 20 2016 13:18

@Takumar @cannelflow ```js
// Setup
function phoneticLookup(val) {
var result = "";

// Only change code below this line
switch(lookup) {
case "alpha":
result = "Adams";
break;
case "bravo":
result = "Boston";
break;
case "charlie":
result = "Chicago";
break;
case "delta":
result = "Denver";
break;
case "echo":
result = "Easy";
break;
case "foxtrot":
result = "Frank";
break;
case "":
result = lookup[val];
}

// Only change code above this line
return result;
}

// Change this value to test

phoneticLookup("alpha") ;
phoneticLookup("bravo") ;
phoneticLookup("charlie");
phoneticLookup("delta");
phoneticLookup("echo") ;
phoneticLookup("foxtrot");
phoneticLookup("");

var lookup={
"alpha":"adams",
"bravo":"Boston",
"charlie":"Chicago",
"delta":"Denver",
"foxtrot":"Frank",
"echo":"Easy",

};
lookup[val];

```

just have a look
Hemei de Wreede
@HemeiW
Jan 20 2016 13:18

@sieb7e ```js
var Car = function() {
// this is a private variable
var speed = 10;

// these are public methods
this.accelerate = function(change) {
speed += change;
};

this.decelerate = function() {
speed -= 5;
};

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

var Bike = function() {

// Only change code below this line.
var gear = 4;
this.getGear = function() {
gear += 3;

};
this.setGear = function() {
speed += 4;
};

};

var myCar = new Car();

var myBike = new Bike();

```

var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

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

var Bike = function() {

  // Only change code below this line.
var gear = 4;
  this.getGear = function() {
  gear += 3;

  };
  this.setGear = function() {
    speed += 4;
  };

};

var myCar = new Car();

var myBike = new Bike();
does not work unforunately :(
cannelflow
@cannelflow
Jan 20 2016 13:19
@HemeiW remove speed += 4; and return gear
Hemei de Wreede
@HemeiW
Jan 20 2016 13:20
like this?
var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

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

var Bike = function() {

  // Only change code below this line.
var gear = 4;
  this.getGear = function() {
  gear += 3;

  };
  this.setGear = function() {

  };

};

var myCar = new Car();

var myBike = new Bike();
cannelflow
@cannelflow
Jan 20 2016 13:20
also gear += 3;
Mohit Nehru
@MohitNehru
Jan 20 2016 13:20
this example is bit confusing
Hemei de Wreede
@HemeiW
Jan 20 2016 13:20
does still not allow me to proceed..
cannelflow
@cannelflow
Jan 20 2016 13:21
@HemeiW return gear also
@HemeiW remove gear += 3; and return gear
Hemei de Wreede
@HemeiW
Jan 20 2016 13:21
I did @cannelflow
var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

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

var Bike = function() {

  // Only change code below this line.
var gear = 4;
  this.getGear = function() {

      };
  this.setGear = function() {
     };

};

var myCar = new Car();

var myBike = new Bike();
cannelflow
@cannelflow
Jan 20 2016 13:22
@MohitNehru
// Setup
function phoneticLookup(val) {
  var result = "";

  // Only change code below this line

  var lookup={
   "alpha":"Adams",
  "bravo":"Boston",
  "charlie":"Chicago",
  "delta":"Denver",
  "echo":"Easy",
  "foxtrot":"Frank"
};

  // Only change code above this line
  result=lookup[val];
  return result;
}

// Change this value to test
phoneticLookup("charlie");
@HemeiW where is return gear ?
@HemeiW like this this.setGear = function(){
return gear;
};
Mohit Nehru
@MohitNehru
Jan 20 2016 13:25
@cannelflow thanks a lot, i messed up whole. i didn't thought i should do like
CamperBot
@camperbot
Jan 20 2016 13:25
mohitnehru sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 468 | @cannelflow | http://www.freecodecamp.com/cannelflow
Mohit Nehru
@MohitNehru
Jan 20 2016 13:25
let me understand it
Anek jain
@Anekjain
Jan 20 2016 13:25

Aim : Check For Palindrome.

Help Me In This Code Below
function palindrome(str) {
  str = str.replace(/(\W)||[0-9]+/gi, '');
  str = str.toLowerCase();
  var arr = [];
  var count = 0;
  arr = str.split("");
  var rev_arr = [];
  rev_arr =  str.split("");
  rev_arr = rev_arr.reverse();
  if(JSON.stringify(arr) === JSON.stringify(rev_arr)) 
  return true;
  else 
  return false;
}
palindrome("Race car.");

(Last Period Should be Included.)

cannelflow
@cannelflow
Jan 20 2016 13:25
@MohitNehru you should be more careful on reading instruction
:+1:
@HemeiW worked?
Hemei de Wreede
@HemeiW
Jan 20 2016 13:26
yes okay i have that now, what else do i need? because it won't allow me to proceed.. @cannelflow
Mohit Nehru
@MohitNehru
Jan 20 2016 13:26
@cannelflow i surely should but anyway tons of thanks
CamperBot
@camperbot
Jan 20 2016 13:26
mohitnehru sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:warning: mohitnehru already gave cannelflow points
cannelflow
@cannelflow
Jan 20 2016 13:26
can you show your code ?
@HemeiW
Hemei de Wreede
@HemeiW
Jan 20 2016 13:27
yes ofcourse
@cannelflow
var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

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

var Bike = function() {

  // Only change code below this line.
var gear = 4;
  this.getGear = function() {

      };
  this.setGear = function() {
    return gear;};

};

var myCar = new Car();

var myBike = new Bike();
cannelflow
@cannelflow
Jan 20 2016 13:27
@HemeiW you need to retun gear on first function also
Hemei de Wreede
@HemeiW
Jan 20 2016 13:28
thank you! :)
cannelflow
@cannelflow
Jan 20 2016 13:28
worked?
@HemeiW
Hemei de Wreede
@HemeiW
Jan 20 2016 13:29
yes :D i'm finished with that and will start with  Basic Algorithm Scripting (50 hours) thanks a lot
@cannelflow
Wesley Robertson
@adoptedmanatee
Jan 20 2016 13:30
Anyone have an idea why my third else if statement is not subtracting from count?
var count = 0;

function cc(card) {
  // Only change code below this line
  if (card >= 2 ||  card <=6){
    count += 1; 

        if (count % 2 === 0) { return count + " Bet";} 
        else {return count + " Hold";}

  } else if (card >=7 || card <= 9){
    count += 0;

        if (count % 2 === 0) { return count + " Bet";} 
        else {return count + " Hold";}

  } else if (card == 10, "J", "Q", "K", "A"){
    count -= 1;

        if (count % 2 === 0) { return count + " Bet";} 
        else {return count + " Hold";}
  } 


  else { 
    return "Change Me";
  }



  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('2');
to ellaborate, if i perform console.log on the last card initated it returns 3 Hold. Following the flow though, it should be 2..not three
cannelflow
@cannelflow
Jan 20 2016 13:32
@Anekjain first join your reverse array then compare
Anek jain
@Anekjain
Jan 20 2016 13:34
@cannelflow Please can you explain in detail.

Aim: To Check Palindrome.

(I should Get True as Result)

function palindrome(str) {
  str = str.replace(/(\W)||[0-9]+/gi, '');
  str = str.toLowerCase();
  var arr = [];
  var count = 0;
  arr = str.split("");
  var rev_arr = [];
  rev_arr =  str.split("");
  rev_arr = rev_arr.reverse();
  if(JSON.stringify(arr) === JSON.stringify(rev_arr)) 
  return true;
  else 
  return false;
}
palindrome("0_0 (: /-\ :) 0-0");
cannelflow
@cannelflow
Jan 20 2016 13:37
@Anekjain you can see here in output what each step is doing https://repl.it/BfRA
@Anekjain you can see here in output what each step is doing https://repl.it/BfRA
Anek jain
@Anekjain
Jan 20 2016 13:39
@cannelflow Thank You, Happy Coding. +1
CamperBot
@camperbot
Jan 20 2016 13:39
anekjain sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 469 | @cannelflow | http://www.freecodecamp.com/cannelflow
Aleksander Gębicki
@Takumar
Jan 20 2016 13:39
@adoptedmanatee I think you should use 'and' operator: && instead of 'or' || in your conditions.
cannelflow
@cannelflow
Jan 20 2016 13:39
@adoptedmanatee try like this its easier
 switch(card){
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 7:
    case 8:
    case 9:
      break;
    case 10:
    case "J":
    case "Q":
    case "K":
    case "A":
      count--;
      break;
  }
  if(count>0){
    return count+" Bet";
  }
  else {
    return count+" Hold";
  }
@Anekjain :+1:
Aleksander Gębicki
@Takumar
Jan 20 2016 13:40
@adoptedmanatee if (card >= 2 || card <=6){ means every card which value is greater than or equal to 2 or every card that is less than or equal to 6.
That means that i.e. 9 or 10 is also good for this condition.

@adoptedmanatee that condition:

       if (count % 2 === 0) { return count + " Bet";} 
        else {return count + " Hold";}

is also wrong. Instruction is not saying that you should return different messages for odd or even values, but for negative or positive values!

if (count < 0) {
  return something
}
else {
  return something else
}
Wesley Robertson
@adoptedmanatee
Jan 20 2016 13:43
ahh okay, that makes sense haha @Takumar thank you
CamperBot
@camperbot
Jan 20 2016 13:43
adoptedmanatee sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1801 | @takumar | http://www.freecodecamp.com/takumar
Wesley Robertson
@adoptedmanatee
Jan 20 2016 13:43
@cannelflow that is definitely a sure fire way. Forgot i could use switch for it. Thank you :)
CamperBot
@camperbot
Jan 20 2016 13:43
adoptedmanatee sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 470 | @cannelflow | http://www.freecodecamp.com/cannelflow
Aleksander Gębicki
@Takumar
Jan 20 2016 13:45
@adoptedmanatee you can solve this problem using if/else if/else statement and it is not difficult, try once again, and then try switch() method, and choose your favourite.

@adoptedmanatee I wanted to point out yet another problem:

 } else if (card == 10, "J", "Q", "K", "A"){

you cannot do such comparison, you have to work hard and compare values one by one :-(

else if(card === 10 || card === "J" || card === "Q" || ...
Wesley Robertson
@adoptedmanatee
Jan 20 2016 13:47
@Takumar do you mind explaining why?
Aleksander Gębicki
@Takumar
Jan 20 2016 13:51
@adoptedmanatee simply this construction works like that. You check if card is equal to 10 or equal to "J" or ... and so on.
You cannot compare to multiple values.
Wesley Robertson
@adoptedmanatee
Jan 20 2016 13:54
i see haha, sorry just starting to ramp up :)
but thank you for the patience in explaining
GangsterGrisen
@GangsterGrisen
Jan 20 2016 13:56
Can anyone help me with where im supposed to put the .thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
}
in level 23
chaitanya ashtekar
@chaitanyaashtekar
Jan 20 2016 13:57
@Takumar hey.wassup ?
Aleksander Gębicki
@Takumar
Jan 20 2016 13:58
@chaitanyaashtekar hi. Just walking on rooms :-)
chaitanya ashtekar
@chaitanyaashtekar
Jan 20 2016 13:58
okay
Aleksander Gębicki
@Takumar
Jan 20 2016 13:58
@GangsterGrisen you have to apply your class to your image tag.
<img class="thick-green-border">
GangsterGrisen
@GangsterGrisen
Jan 20 2016 13:59
Thanks
Aleksander Gębicki
@Takumar
Jan 20 2016 13:59
@GangsterGrisen oh, but if you ask where to put your CSS class, (fragment you showed us), put it between <style> and </style> tags.
GangsterGrisen
@GangsterGrisen
Jan 20 2016 14:00
Im completed the level, thanks for the help
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:09
hi there. I'm the jon snow of coding! need some help in tha java section. "Assignment with a Returned Value" I just don't know what I have to do :/
Aleksander Gębicki
@Takumar
Jan 20 2016 14:12
@BrunoRFViana you have declared processed variable. Later you have created function. At the end you should call your function with argument of 7 and assign returned value to processed variable.
var result = 0;
function giveMeNum(num) {
  return num;
}
result = giveMeNum(5);
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:12

I have done this:
var processed = 2;

function process (){
return ();

} @Takumar

the thing it's I just don't know how to assing returned value. and I guess I don't either know how to call an argument in a function @Takumar
Aleksander Gębicki
@Takumar
Jan 20 2016 14:13
@BrunoRFViana please check my example.
This message was deleted
@BrunoRFViana processed should have a value of 2
doesn't mean that you should assign number 2 to processed variable.
Your function should work in that way, that for argument 7 it should return 2, and you assign returned value to the processed variable.
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:17
@Takumar I'm trying. but it's not working. please tell how do I define the argument?
Aleksander Gębicki
@Takumar
Jan 20 2016 14:18
@BrunoRFViana in my example: num is parameter of function. When I call giveMeNum(5); number 5 is argument.
@BrunoRFViana ups, sorry, I have noticed I wrote you code with bug. Of course there should be: result = giveMeNum(5); last line of my code.
joel roshult
@joelamaro
Jan 20 2016 14:19
I dont know how to make the h2 closing tag
Aleksander Gębicki
@Takumar
Jan 20 2016 14:19
@joelamaro opening <h2> closing </h2>
joel roshult
@joelamaro
Jan 20 2016 14:20
Thanks
cannelflow
@cannelflow
Jan 20 2016 14:20
@joelamaro <h2>openclose</h2>
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:20
@Takumar like this: function process (num){
return (num) ;
}
processed = process(2);
Aleksander Gębicki
@Takumar
Jan 20 2016 14:21
@BrunoRFViana yes, very good.
But return (num) ; parentheses are not necessary, you can use them in more complex statements: return (2*(3+num)- res);
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:22
@Takumar so the argument is the last line. ok. and what about assingning a function to a var? how does that works?
Aleksander Gębicki
@Takumar
Jan 20 2016 14:23
@BrunoRFViana assignment is just storing value in a variable:
var a;
a = 3; // this is assignment
a = process(7); // this too
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:24
@Takumar so its the // var processed = 0; //part
Kirill Zharov
@KirillZharov
Jan 20 2016 14:24
Hi guys, how right?)
1) pay with phone
2) to pay from phone
3) pay by phone
or another option?
Aleksander Gębicki
@Takumar
Jan 20 2016 14:25
@BrunoRFViana this is declaration (using var keyword) with initialization of variable (setting starting/initial value) :-)
@BrunoRFViana but when you use "Reset" button, you will see that you have entire function written already, and you only have to add one line below comment: // Only change code below this line
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:27

@Takumar I've added all this var processed;

function process (num){
return (num -5) ;
}
processed = process(7);

@Takumar but it would have worked with just this? processed = process(7);
Aleksander Gębicki
@Takumar
Jan 20 2016 14:28
@BrunoRFViana yes this is enough. And original return statement was: return (num + 3) / 5;
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:29
@Takumar thank you very much for the precious help !
CamperBot
@camperbot
Jan 20 2016 14:29
brunorfviana sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 1803 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Jan 20 2016 14:29
@BrunoRFViana you are welcome :-)
Eric Whittaker Jr
@ericwhittakerjr
Jan 20 2016 14:29
okay what am I doing wrong here….
function reverseString(str) {
  newStr = str.split();

  revStr = newStr.reverse();

  outStr = revStr.join();

  outStr = str;

  return str;
}

reverseString("hello");
function reverseString(str) {
  str = str.split();

  str = str.reverse();

  str = str.join();

  return str;
}

reverseString("hello");
Bruno Viana
@BrunoRFViana
Jan 20 2016 14:30
@Takumar I just don't know the language used, and most of my problems are with stuff like whats the argument, and whats the assigning part. and I just don't know enough to google either :P thanks again !
CamperBot
@camperbot
Jan 20 2016 14:30
brunorfviana sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: brunorfviana already gave takumar points