These are chat archives for FreeCodeCamp/Help

22nd
Oct 2015
Herlou
@herloub
Oct 22 2015 00:02
Still can't get it.
Andy Lacroce
@andylacroce
Oct 22 2015 00:04
@herloub try deleting <!--Delete--> from the code you posted above
@herloub can you provide a link to the waypoint you are working on?
Herlou
@herloub
Oct 22 2015 00:06
I tried deleting the first line but didn't work @andylacroce
alfa0
@alfa0
Oct 22 2015 00:06
@herloub delete also the last one
Andy Lacroce
@andylacroce
Oct 22 2015 00:07
@herloub the way i interpret "delete trailing comments" is to remove anything surrounded by "<!-- -->" trailing the code
Ian Barker
@IanBarkerDev
Oct 22 2015 00:08
How do I get a function to wait a second before running?
Herlou
@herloub
Oct 22 2015 00:08
I did @andylacroce
Didn't work @andylacroce
Herman Fassett
@HermanFassett
Oct 22 2015 00:09
@Malical
setTimeout(functionName, 1000); // 1000 is 1 second
Andy Lacroce
@andylacroce
Oct 22 2015 00:09
@herloub reset the waypoint. with the original code, you need to remove the comment code surrounding the block
alfa0
@alfa0
Oct 22 2015 00:09
@herloub refresh you page and then remove them all
Ian Barker
@IanBarkerDev
Oct 22 2015 00:10
@HermanFassett Yeah I tried that. It just runs through instantly. I must be messing up somewhere else.
alfa0
@alfa0
Oct 22 2015 00:10
1st the above one & then the bottom one's
Andy Lacroce
@andylacroce
Oct 22 2015 00:10
@herloub so you remove the top line and the bottom line. that allows the code to execute instead of being treated like the contents of a comment
Herman Fassett
@HermanFassett
Oct 22 2015 00:10
That's odd Malical, might want to share more code
alfa0
@alfa0
Oct 22 2015 00:11
@herloub best of luck!!
Ian Barker
@IanBarkerDev
Oct 22 2015 00:12
@HermanFassett So if I set an alert after the wait period it goes down one tick at a time, but it's jus waiting like a millisecond instead of a whole second.
setTimeout(timer(), 1000);
Herman Fassett
@HermanFassett
Oct 22 2015 00:12
You can't have ()
just use timer
Herlou
@herloub
Oct 22 2015 00:13
@andylacroce I'm so stupid. I reset it, removed the Delete comment.
Ian Barker
@IanBarkerDev
Oct 22 2015 00:14
Hehe. Well that fixed that. So thank you. But now apparently I have an infinite loop somewhere.
CamperBot
@camperbot
Oct 22 2015 00:14
if you want to thank someone, put an @ before their name!
Andy Lacroce
@andylacroce
Oct 22 2015 00:14
@herloub not stupid. just learning :)
Herlou
@herloub
Oct 22 2015 00:14
thank you @andylacroce but still can't resolve it haha
CamperBot
@camperbot
Oct 22 2015 00:14
herloub sends brownie points to @andylacroce :sparkles: :thumbsup: :sparkles:
:star: 293 | @andylacroce | http://www.freecodecamp.com/andylacroce
Andy Lacroce
@andylacroce
Oct 22 2015 00:15
@herloub some additional helpful instructions for html comments: http://www.w3schools.com/html/html_comments.asp
Herman Fassett
@HermanFassett
Oct 22 2015 00:15
If you need a parameter I think you can do it like
setTimeout(new function() {funcName("hello")}, 1000);
Ian Barker
@IanBarkerDev
Oct 22 2015 00:21
Yay. Debugging time!
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:39
Hi Guys i am stuck and would appreciate some help--I am doing a challenge that requires me to generate a random number (integer and i a stuck)
alfa0
@alfa0
Oct 22 2015 00:40
@OrinEdghill pleas provide link? or code?
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:41

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

return Math.random();
Math.floor(Math.random() * (max - min + 1)) + min
}

I am newbie and my first time here--tell me if i posted code correctly--thanks
CamperBot
@camperbot
Oct 22 2015 00:42
if you want to thank someone, put an @ before their name!
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:43
@OrinEdghill
Hans van Riet
@hansinla
Oct 22 2015 00:43

@OrinEdghill

// Returns a random number between 0 (inclusive) and 1 (exclusive)
function getRandom() {
  return Math.random();
}

and

// Returns a random number between min (inclusive) and max (exclusive)
function getRandomArbitrary(min, max) {
  return Math.random() * (max - min) + min;
}

Does that help?
To get an integer from that result, you would use Math.floor()

Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:43
say thanks @marcbaetica and i will help you :smile:
CamperBot
@camperbot
Oct 22 2015 00:43
sorry marcbaetica, you can't send brownie points to yourself! :sparkles: :sparkles:
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:45
var min = 0;
var max = 9;
function myFunction() {
// Make myFunction return a random number between min and max values instead of a decimal
// Only change code below this line.
return Math.floor((max-min)*Math.random()+min);
}
@OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill @OrinEdghill !!!
he must have a bathroom emergency or something
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:48
@marcbaetica
it worked whoa and i was stuck
@marcbaetica
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:50
@OrinEdghill say "thanks @marcbaetica"
CamperBot
@camperbot
Oct 22 2015 00:50
marcbaetica sends brownie points to @orinedghill and @ :sparkles: :thumbsup: :sparkles:
:star: 158 | @orinedghill | http://www.freecodecamp.com/orinedghill
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:51
lol
i want my brownies
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:52
sorry i think my browser hung on me just now
@marcbaetica
but u deserve them
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:54
@OrinEdghill you must be a very hard headed guy
PLEASE say "thanks @marcbaetica" SO I CAN GET MY BROWNIES!!!!
CamperBot
@camperbot
Oct 22 2015 00:55
sorry marcbaetica, you can't send brownie points to yourself! :sparkles: :sparkles:
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:56
thanks@@marcbaetica
CamperBot
@camperbot
Oct 22 2015 00:56
orinedghill sends brownie points to @marcbaetica :sparkles: :thumbsup: :sparkles:
:star: 59 | @marcbaetica | http://www.freecodecamp.com/marcbaetica
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:56
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:56
yeeeeee! you're a true gangster @OrinEdghill
thank you :P
CamperBot
@camperbot
Oct 22 2015 00:56
if you want to thank someone, put an @ before their name!
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:57
CamperBot
@camperbot
Oct 22 2015 00:57
if you want to thank someone, put an @ before their name!
Orin Edghilll
@OrinEdghill
Oct 22 2015 00:57
lol
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 00:58
:P
Lewis Hey
@JorgiLaFord
Oct 22 2015 01:18
This message was deleted
This message was deleted
This message was deleted
This message was deleted
CamperBot
@camperbot
Oct 22 2015 01:18

:fire:Bonfire: Chunky Monkey :link:

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

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

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

more info:  bf details | bf links | hint

Lewis Hey
@JorgiLaFord
Oct 22 2015 01:23
Can someone explain the logic behind this? Math.floor(Math.random() * (1 - 0 + 1)) + 0; I don't understand how that generates a random number between a certain range...
Anyone?
Herman Fassett
@HermanFassett
Oct 22 2015 01:30
I have to go but it has to do with max and min
Lewis Hey
@JorgiLaFord
Oct 22 2015 01:30
They don't explain the logic though, just how to do it
I've googled already...
ronaldrdguez
@ronaldrdguez
Oct 22 2015 01:31
@JorgiLaFord
As an example:
Suppose you need a random number between 3, and 7 inclusive. There are 5 numbers total in that range (3, 4, 5, 6, 7), you compute this as (7 -3 + 1). Now random will only give you a random float between 0 and 1. You multiply this random decimal by the amount of numbers (5) and will yield a number between 0 and 4. So now you need to translate it to your range by adding the first number again (3).
Lewis Hey
@JorgiLaFord
Oct 22 2015 01:32
Why does (7-3+1) get you a range between 3 and 7? doesn't that just equal out to 5?
VeeShostak
@VeeShostak
Oct 22 2015 01:35

Math.random returns a floating-point number between 0 and 1.

Returns a floating-point, pseudo-random number in the range [0, 1) that is, from 0 (inclusive) up to but not including 1 (exclusive), which you can then scale to your desired range.
Multiplying this by n gives a floating point number between 0 (inclusive) and n (exclusive).

Math.floor is then used to convert this floating point number to an integer between 0 and n - 1 (inclusive).

ronaldrdguez
@ronaldrdguez
Oct 22 2015 01:35
@JorgiLaFord 7 - 3 + 1 is the "size" of the range.
Lewis Hey
@JorgiLaFord
Oct 22 2015 01:36
@ronaldrdguez why do you not just use (5)? Or am I completely missing what you mean?
Can I get an example maybe?
rbunz
@rbunz08
Oct 22 2015 01:43
@JorgiLaFord If you just subtract 7 - 3 you are forgetting to include the 3 in the range. So 7 - 3 is 4 but there are actually 5 numbers in between 3 and 7. From what I understand, we do not just use 5 because essentially we could substitute variables in the equation so that it works no matter what numbers we call.
@JorgiLaFord So eventually you would use Math.random() * (a - b + 1) and then you can assign a and b to whatever you like such as a number or maybe another formula.
Lewis Hey
@JorgiLaFord
Oct 22 2015 01:49
@rbunz08 So doing Math.floor(Math.random() * (1 - 0 + 1)) + 0; Sets a range of 2, starting at 0? I don't get how multiplying the result of Math.random() by 2 make the range 2? I get why it would start it at 0 (or whatever number you choose) but surely that would make it just multiple whatever the result is by 2, right? Not set a range?
Oh wait
rbunz
@rbunz08
Oct 22 2015 01:50
@JorgiLaFord that uses a range from 0 to 1 which is 2 numbers
Lewis Hey
@JorgiLaFord
Oct 22 2015 01:50
I can't grasp this
i'm coming back tomorrow
thanks @rbunz08
CamperBot
@camperbot
Oct 22 2015 01:50
jorgilaford sends brownie points to @rbunz08 :sparkles: :thumbsup: :sparkles:
:star: 243 | @rbunz08 | http://www.freecodecamp.com/rbunz08
rbunz
@rbunz08
Oct 22 2015 01:51
@JorgiLaFord Ill try and see if I can write up a good explanation and message you privately
Rex Schrader
@SaintPeter
Oct 22 2015 01:58
@navyvel Awesome, way to go!
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 01:59
@SaintPeter maybe you could help me with this?
var each = function(message, callback) {
    if(Array.isArray(message)){
        for(var i = 0; i < message.length; i++){
            callback(message[i]);
        }
    }
    else{
        for(var key in message){
            callback(message[key]);
            }
    }
};
trying to invoke my function I made but with no cigar
Herman Fassett
@HermanFassett
Oct 22 2015 02:00
How're you trying?
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 02:00
each([1,2,3], callback)
says callback is not defined
bascially if my message is an array.. it will print it out.. if its an object it will print it out
Herman Fassett
@HermanFassett
Oct 22 2015 02:01
what is this for
?
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 02:02
just learning and practiing callback functions
Herman Fassett
@HermanFassett
Oct 22 2015 02:02
well callback sent in like that isn't defined...
Rex Schrader
@SaintPeter
Oct 22 2015 02:02
@Dueldrawer8 Where is your callback function definition?
@Dueldrawer8 Rather, when you call/invoke each, what is your second parameter?
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 02:04
@SaintPeter i thought the function i created means whenever i pass in an object it will print out all the values, if its a array it print all the elements
so callback(message[i]) works like console.log
Rex Schrader
@SaintPeter
Oct 22 2015 02:04
@Dueldrawer8 Nope - a "callback" is specifically a function definition that you pass in to another function. Let me write a quick and dirty example.
@Dueldrawer8
function exampleCallback(someVariable) {
    console.log(someVariable);
}

// Using your function definition above
each([1,2,3,4], exampleCallback);
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 02:06
ok
ah
basically i was trying to write the method each from scratch
what the "under the hood" of the each method does
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 02:08
@SaintPeter dont you mean
Array.prototype.forEach.call([1,2,3,4], yourCallbackFunction);
lol
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 02:08
kind of.. i mean like the underscore method each
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:09
Hey there! Anyone here available to help with a bit of CSS?
Rex Schrader
@SaintPeter
Oct 22 2015 02:09
@marcbaetica I'm using @Dueldrawer8 's function definition from just above.
@JelaniThompson You bettcha!
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:10
Awesome, thanks!
CamperBot
@camperbot
Oct 22 2015 02:10
if you want to thank someone, put an @ before their name!
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 02:10
ah kk i didnt see that :P
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:10
So I'm working on a sidebar menu since I really want to improve my front-end skills
Right now I have this
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 02:10
@JelaniThompson it's spelled SKILLZ
Randy Goldsmith
@Dueldrawer8
Oct 22 2015 02:10
ack.. im getting some food.. ill be back later
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:10
@marcbaetica lol
Marc-Alexandru Baetica
@marcbaetica
Oct 22 2015 02:10
:)
@Dueldrawer8 see ya
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:11
How would I be able to add some space in between the icons and their titles?
I've tried stuff like this
#comment_image::after { content: " "; }
But that didn't work, lol
Rex Schrader
@SaintPeter
Oct 22 2015 02:12
@JelaniThompson You can add margin-left: 10px; (or whatever value you liketo each of your::after` values.
@JelaniThompson Now . . . to be honest, I'm not sure that I would use CSS to do content - that seems like a bit of an anti-pattern
@JelaniThompson Why not put the text inline with the icons? You could wrap it in a span or whatever and give it its own class.
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:14
Yeah I tried that, but the hover element wouldn't display at a block level when I did that
Just only where the text is
Rex Schrader
@SaintPeter
Oct 22 2015 02:15

@JelaniThompson

<li id="dashboard">
      <span id="dash_image" class="fa fa-tachometer"></span>
      <span class="menu_item">Dashboard</span>
      </li>

and

#dashboard::hover {
    /* whatever you need here */
}
.menu_item {
   margin-left: 5px;
}
@JelaniThompson Give the hover element to the <li> not the text.
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:16
Oh ok
I'll try implementing that gimme a sec :D
SaintPeter @SaintPeter taps his fingers impatiently
Rex Schrader
@SaintPeter
Oct 22 2015 02:17
(j/k ;) )
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:17
lol
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:23
Lol is it just me or does the "Dashboard" look like it has a thicker font than the other two?
Rex Schrader
@SaintPeter
Oct 22 2015 02:24
@JelaniThompson It does - I suspect that you have a font defintion somewhere for <li> elements. Use your dev console and do inspect element to see the font name
@JelaniThompson Of course, once you have converted the rest of the items to the same method, they'll be the same font.
Abhisek Pattnaik
@abhisekp
Oct 22 2015 02:30
@SaintPeter Up for a challege? :point_right: October 22, 2015 7:31 AM
Rex Schrader
@SaintPeter
Oct 22 2015 02:31
@abhisekp I'll pass, thank you
CamperBot
@camperbot
Oct 22 2015 02:31
saintpeter sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 634 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 22 2015 02:31
@SaintPeter lol. Did you check?
Rex Schrader
@SaintPeter
Oct 22 2015 02:31
@abhisekp Yup
Abhisek Pattnaik
@abhisekp
Oct 22 2015 02:31
:(
Rex Schrader
@SaintPeter
Oct 22 2015 02:31
@abhisekp I saw it when you first posted it
Abhisek Pattnaik
@abhisekp
Oct 22 2015 02:32
@SaintPeter but you just passed it...? Shouldn't you find a reason? Maybe we should ask the creator!
Andy Lacroce
@andylacroce
Oct 22 2015 02:37
anyone know how to get Waypoint: Get Set for Basejumps working? the instructions and all of the alternative methods i tried from the issues discussions aren't getting me anywhere.
Jelani Thompson
@JelaniThompson
Oct 22 2015 02:38
@SaintPeter I ended up getting it sorted out :D Thanks again for the help :D
CamperBot
@camperbot
Oct 22 2015 02:38
jelanithompson sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1129 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 22 2015 02:38
@JelaniThompson You bettcha :D
0x0936 @0x0936 consults the oracle of all things coffee and scripts - why do strings not have a built in reverse function? chants chants
Herman Fassett
@HermanFassett
Oct 22 2015 02:49
'cause strings, immutable
Still
abhisekp @abhisekp wonders why does strings have to be immutable in the first place?
Performance or Memory leaks? :confused:
Abhisek Pattnaik
@abhisekp
Oct 22 2015 02:58
@matthew02 seems it's for both Perf. and Mem. leaks aka security!
thanks @matthew02
CamperBot
@camperbot
Oct 22 2015 02:59
abhisekp sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 353 | @matthew02 | http://www.freecodecamp.com/matthew02
James Smith
@matthew02
Oct 22 2015 02:59
@abhisekp Yep, that's how I took it. Also for code simplicity.
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:05
@matthew02 i would like to do this ;)
var string = 'my lovely string';
string[0] = 'My changed string';
console.log(string); // 'My lovely string'
Elle
@Gargoyelle
Oct 22 2015 03:07
I'm working on a weather app now, and I was wondering what was the best way to get my user's location. HTML5 Geolocation?
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:10
@Gargoyelle IP, Web RTC, Geolocation API, browser Timezone
Elle
@Gargoyelle
Oct 22 2015 03:11
Awesome I'll check those out!
thanks @abhisekp
CamperBot
@camperbot
Oct 22 2015 03:11
gargoyelle sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 636 | @abhisekp | http://www.freecodecamp.com/abhisekp
James Smith
@matthew02
Oct 22 2015 03:12
@abhisekp So you would be changing the character at index 0 of string to match the character at index 0 of the replacement string? I would say that is sure seems like mutable strings would certainly simplify some things, but I don't know much about programming language development. I imagine it's something that one eventually learns to live with doesn't even think about.
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:14
@matthew02 like in C programming lang. but it comes with it's own shortcomings resulting in security issues. :(
James Smith
@matthew02
Oct 22 2015 03:17
@abhisekp Very true about C.
@abhisekp JavaScript isn't alone, though. Python has a lot of immutable types (including strings) and functional languages are all about immutability.
Henry Erickson
@henryed86
Oct 22 2015 03:29
Hey guys I started learning Rust to learn more about programming , Am I crazy??
btw I'm a newbie
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:31
@henryed86 Rust as in Iron rust? :P
Herman Fassett
@HermanFassett
Oct 22 2015 03:31
The game?
Henry Erickson
@henryed86
Oct 22 2015 03:33
nope
:smile:
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:33
lol
Henry Erickson
@henryed86
Oct 22 2015 03:33
Some very hard to learn language
altowering
@altowering
Oct 22 2015 03:35
Hi I literally just created my account today and I'm currently stuck at level "Waypoint :Size your Images" could anyone help me? Or am I not understanding how help here works?
Herman Fassett
@HermanFassett
Oct 22 2015 03:35
Well, post some code you've tried
help code format
CamperBot
@camperbot
Oct 22 2015 03:35

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Henry Erickson
@henryed86
Oct 22 2015 03:37
Rust is a programming language like C or C++
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:37
@henryed86 don't use it then!
Herman Fassett
@HermanFassett
Oct 22 2015 03:37
Oh come now
I C D :fearful:
Having to wrap assembly code in C in class :P
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:38
@henryed86 does it have mutable strings?
@henryed86 :point_up: October 22, 2015 8:35 AM
James Smith
@matthew02
Oct 22 2015 03:39
@abhisekp :laughing:
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:39
yeah lol
Herlou
@herloub
Oct 22 2015 03:39
need some help here, how to add image?
Herman Fassett
@HermanFassett
Oct 22 2015 03:39
In what?
html?
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:39
@herloub
<img src="my-lovely-cat-pic.jpg">
Henry Erickson
@henryed86
Oct 22 2015 03:39
I think not
:S
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:40
@henryed86 dump the lang.
Learn JS
just kidding :D
Herman Fassett
@HermanFassett
Oct 22 2015 03:40
Learn C# :D
C# FTW
The Best Of ALL WORLDS!!!
:P
altowering
@altowering
Oct 22 2015 03:40
This message was deleted
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:40
explain format
CamperBot
@camperbot
Oct 22 2015 03:40

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:40
@altowering :point_up: October 22, 2015 9:10 AM
Henry Erickson
@henryed86
Oct 22 2015 03:41
@abhisekp It has the option for mutability
Im just not sure how it works
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:41
hmm.... leave JS. Let's learn Rust
Henry Erickson
@henryed86
Oct 22 2015 03:42
It like a type
lol , I will never leave JS
altowering
@altowering
Oct 22 2015 03:42
<style>
  .smaller-image {
    width:100px;}
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Herlou
@herloub
Oct 22 2015 03:42
@abhisekp thank you, next prob is how to have src attribute?
CamperBot
@camperbot
Oct 22 2015 03:42
herloub sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 637 | @abhisekp | http://www.freecodecamp.com/abhisekp
Henry Erickson
@henryed86
Oct 22 2015 03:43
  • It has a < mut> type , that is a mutable variable
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:43
@herloub a space in between!
@herloub you're using class smaller.image but defined in the style as smaller-image.
altowering
@altowering
Oct 22 2015 03:46
Thank you so much @abhisekp
CamperBot
@camperbot
Oct 22 2015 03:46
altowering sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 638 | @abhisekp | http://www.freecodecamp.com/abhisekp
Herlou
@herloub
Oct 22 2015 03:46
@abhisekp I just copied and pasted what you gave me, it has space already.
Abhisek Pattnaik
@abhisekp
Oct 22 2015 03:47

@herloub

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

NOT

<img class="smaller.image"src="https://bit.ly/fcc-relaxing-cat">
Herlou
@herloub
Oct 22 2015 03:51
thank you! got it! :) @abhisekp
CamperBot
@camperbot
Oct 22 2015 03:51
herloub sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: herloub already gave abhisekp points
HayleeNeal
@HayleeNeal
Oct 22 2015 04:02

//
var myCar = new Car() {
this.engines = 1;
};
//

Make Instances of Objects with a Constructor Function . Idk what I'm doing wrong.

got it. Sorry
Abhisek Pattnaik
@abhisekp
Oct 22 2015 04:04
@HayleeNeal :point_up: October 22, 2015 9:10 AM
HayleeNeal
@HayleeNeal
Oct 22 2015 04:04
It seems like as soon as I ask the question I end up figuring it out, even if I've been stuck on it for an hour lol
Abhisek Pattnaik
@abhisekp
Oct 22 2015 04:05
@HayleeNeal that's called Rubber Duck Debugging
Herman Fassett
@HermanFassett
Oct 22 2015 04:05
Then ask sooner! We'll be the ducks
here
HayleeNeal
@HayleeNeal
Oct 22 2015 04:06
:)
I didn't know rubber duck debugging was a thing
I should get a rubber duck haha
Wally
@wallybtwallace
Oct 22 2015 04:19
Beginner here having a little trouble
Herman Fassett
@HermanFassett
Oct 22 2015 04:20
Bring it on @wallybtwallace
Wally
@wallybtwallace
Oct 22 2015 04:20
I'm on Waypoint: Use a CSS Class to Style an Element
Your h2 element should have the class red-text.

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

<h2>CatPhotoApp</h2>

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

Herman Fassett
@HermanFassett
Oct 22 2015 04:21
Yeah so now you need to add the class to your h2 tag @wallybtwallace
Wally
@wallybtwallace
Oct 22 2015 04:21
I'm not sure what I'm missing
Herman Fassett
@HermanFassett
Oct 22 2015 04:22
So like <h2 class="classname">...
Wally
@wallybtwallace
Oct 22 2015 04:23
it worked!
thank you
CamperBot
@camperbot
Oct 22 2015 04:23
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Oct 22 2015 04:23
Yep
HayleeNeal
@HayleeNeal
Oct 22 2015 04:48
Can anyone explain the factorial bonfire to me?
YI JIANG
@meet999
Oct 22 2015 04:50
is this book useful?
i feel bored reading this book
Abhishek
@Abhi493
Oct 22 2015 04:50
@HayleeNeal you want to know what is factorial?
HayleeNeal
@HayleeNeal
Oct 22 2015 04:52
I don't understand where to find the code, the links that they listed in the explanation are of zero help to me and I can't find much about it on Stack Overflow/ google
Abhishek
@Abhi493
Oct 22 2015 04:52
factorial example is 5! =54321
=120
write the code urself
first get cleared what does factorial means and then start coding, i will help you with it
5!=5x4x3x2x1
HayleeNeal
@HayleeNeal
Oct 22 2015 04:55
Maybe I'm too tired for this. It's 1am and nothing about this is making sense today
Jacob Brown
@jab5
Oct 22 2015 04:55

Hello everyone. I'm stuck on Waypoint: Call out Optional Actions with Button Info " Both of your Bootstrap buttons should have the btn and btn-block classes." This is my code:

<button class="button">Info</button>
<button class="btn-info">Like</button>
<button class="btn">Like</button>
<button class="btn-block">Like</button>

Hans van Riet
@hansinla
Oct 22 2015 04:57
@jab5 You have four buttons there. If an element has more than one class you can combine them like this: class=“className1 className2”
Abhishek
@Abhi493
Oct 22 2015 04:57
@jab5 u can have two or more classes for one element, add classes by separating with a space
HayleeNeal
@HayleeNeal
Oct 22 2015 04:57

<button class =" btn btn-block"Info</button>
<button class=" btn btn-block"> Like</button>

you don't need a separate line for each class, put them in the same quotations such as " class=" classname1 classname2">

Abhishek
@Abhi493
Oct 22 2015 04:58
@jab5 exact same way @hansinla & @HayleeNeal wrote
HayleeNeal
@HayleeNeal
Oct 22 2015 04:58
I forgot to close that first Info button
Robert Richey
@0x0936
Oct 22 2015 04:58
I'm a bit late to respond, in regards to why strings don't have a reverse function. I'm aware they are immutable; that doesn't prevent them from returning a new string that is a reverse of the calling string.
String.prototype.reverse = function() {
  return this.split('').reverse().join('');
}

var str = "apple";

str = str.reverse(); // "elppa"
HayleeNeal
@HayleeNeal
Oct 22 2015 04:59
<button class=" btn btn-block">Info</button>
Abhisek Pattnaik
@abhisekp
Oct 22 2015 04:59
@jab5 adding more button tags adds more buttons on the pg
@0x0936 it's a bad bad world!!! :P
Abhishek
@Abhi493
Oct 22 2015 05:00
hi javsacript NINJA @abhisekp :smile:
javascript*
HayleeNeal
@HayleeNeal
Oct 22 2015 05:00
: @0x0936 I could have used that like half an hour ago :)
Jacob Brown
@jab5
Oct 22 2015 05:01

@Abhi493 @HayleeNeal @hansinla Thanks. I got it to work with :

<button class="btn-info btn btn-block">Info</button>

CamperBot
@camperbot
Oct 22 2015 05:01
jab5 sends brownie points to @abhi493 and @hayleeneal and @hansinla :sparkles: :thumbsup: :sparkles:
:star: 237 | @abhi493 | http://www.freecodecamp.com/abhi493
:star: 216 | @hayleeneal | http://www.freecodecamp.com/hayleeneal
:star: 550 | @hansinla | http://www.freecodecamp.com/hansinla
Abhisek Pattnaik
@abhisekp
Oct 22 2015 05:02
@Abhi493 hi :D
Abhishek
@Abhi493
Oct 22 2015 05:02
i did my codeacedemy again
now what next? @abhisekp
academy*
Abhisek Pattnaik
@abhisekp
Oct 22 2015 05:03
@Abhi493 try the FCC bonfires (again?) or http://exercism.io
Abhishek
@Abhi493
Oct 22 2015 05:05
going for exercism bonfires are boring :worried:
@hansinla Congrats for your front-end dev certification !
@abhisekp which book you advised to read on ECMAScript?
Abhisek Pattnaik
@abhisekp
Oct 22 2015 05:08
explain js res
Abhisek Pattnaik
@abhisekp
Oct 22 2015 05:08
@Abhi493 :point_up: October 22, 2015 10:38 AM
Abhishek
@Abhi493
Oct 22 2015 05:09
Speaking or exploring, which sounds better??
Abhisek Pattnaik
@abhisekp
Oct 22 2015 05:10
@Abhi493 Speaking or Eloquent
Whcever you comfortable with.
Hans van Riet
@hansinla
Oct 22 2015 05:11
@Abhi493 THanks
CamperBot
@camperbot
Oct 22 2015 05:11
hansinla sends brownie points to @abhi493 :sparkles: :thumbsup: :sparkles:
:star: 238 | @abhi493 | http://www.freecodecamp.com/abhi493
Abhishek
@Abhi493
Oct 22 2015 05:11
okay thanks again @abhisekp
HayleeNeal
@HayleeNeal
Oct 22 2015 05:12
finally past that bonfire. I'm going to have to research more into it though. Didn't make much sense.
How often do you guys factorialize in web dev? lol
Abhishek
@Abhi493
Oct 22 2015 05:12
thats isnt that tricky @HayleeNeal
HayleeNeal
@HayleeNeal
Oct 22 2015 05:13
For some reason it made little sense. JavaScript is hard for me :(
YI JIANG
@meet999
Oct 22 2015 05:21
so I'm not the only people feel js is hard
HayleeNeal
@HayleeNeal
Oct 22 2015 05:22
nope you're not alone
Some parts are easy but the math stuff makes almost no sense
YI JIANG
@meet999
Oct 22 2015 05:48
expression and statement?is it same thing?
Thomas Thuya Aung
@thomasthuyaaung
Oct 22 2015 06:09
Is there anyway to change the code preview from an Iphone to something else? like a browser ?
Qadir Pervez
@qadirpervez
Oct 22 2015 06:33
@Abhi493
Abhishek
@Abhi493
Oct 22 2015 06:33
yes boss @qadirpervez
Name234
@Name234
Oct 22 2015 07:03
help :(
CamperBot
@camperbot
Oct 22 2015 07:03

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

Michael Bomholt
@bomholtm
Oct 22 2015 07:05
@Name234 whats your problem?
Name234
@Name234
Oct 22 2015 07:06
@bomholt I can't solve this task :( I need help
@bomholt I can't solve this task :worried: I need help
Michael Bomholt
@bomholtm
Oct 22 2015 07:06
@Name234 where exactly is your problem
Name234
@Name234
Oct 22 2015 07:07
@bomholt to input the a element
Herlou
@herloub
Oct 22 2015 07:07
hello everyone! I'm on linking external pages with anchor elements. How to have anchor text of cat photos on my a element? I need help.
Michael Bomholt
@bomholtm
Oct 22 2015 07:08
@Name234 there is a example
Name234
@Name234
Oct 22 2015 07:08
it would be great if you could help me @bomholt
Michael Bomholt
@bomholtm
Oct 22 2015 07:09
@Name234 do you would like a solution
or do you want to get there by yourself?
Name234
@Name234
Oct 22 2015 07:09
@bomholt yes :) thats would be great
solution
Michael Bomholt
@bomholtm
Oct 22 2015 07:10
i feel just posting the solution wouldnt help that much ^^
did you put the <a> tag inside of <p></p>
?
Name234
@Name234
Oct 22 2015 07:10
@bomholt yes i know but I am too stupid x)
Michael Bomholt
@bomholtm
Oct 22 2015 07:11
no you are not =) dont think of yourself like that
yould you post the line of code you allready have?
Name234
@Name234
Oct 22 2015 07:11
@bomholt Thanks :)
CamperBot
@camperbot
Oct 22 2015 07:11
name234 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:star: 383 | @bomholt | http://www.freecodecamp.com/bomholt
Name234
@Name234
Oct 22 2015 07:12
yes
wait

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

Qadir Pervez
@qadirpervez
Oct 22 2015 07:12
how to remove identical elements from an array
Name234
@Name234
Oct 22 2015 07:13
delete
Michael Bomholt
@bomholtm
Oct 22 2015 07:13
so you havent added anything yet? @Name234
Name234
@Name234
Oct 22 2015 07:13
no
Michael Bomholt
@bomholtm
Oct 22 2015 07:13
did you saw the example? Here's an example: <p>Here's a <a href="http://freecodecamp.com"> link to Free Code Camp</a> for you to follow.</p>.
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:13
@qadirpervez use filter and indexOf
Qadir Pervez
@qadirpervez
Oct 22 2015 07:14
okay
@samosale thanks
CamperBot
@camperbot
Oct 22 2015 07:14
qadirpervez sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 422 | @samosale | http://www.freecodecamp.com/samosale
Name234
@Name234
Oct 22 2015 07:14
@bomholt Yes thank you <3. But where should i use it?
CamperBot
@camperbot
Oct 22 2015 07:14
name234 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:warning: name234 already gave bomholt points
Michael Bomholt
@bomholtm
Oct 22 2015 07:14
@Name234 put that between <img class.... and <p class...
Name234
@Name234
Oct 22 2015 07:14
@bomholt ok i try it :D
Michael Bomholt
@bomholtm
Oct 22 2015 07:15
for example i think it also would work elsewhere like last line or something :)
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:16
@qadirpervez
filter(function(val,index,arr){
return arr.indexOf(val) === index;
});
Qadir Pervez
@qadirpervez
Oct 22 2015 07:17
got u.. and thanks again @samosale
CamperBot
@camperbot
Oct 22 2015 07:17
qadirpervez sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:warning: qadirpervez already gave samosale points
Name234
@Name234
Oct 22 2015 07:18
@Name234 It works thank you. 2/3 are already correct. But I need 3/3. Third challenge: Your a element should have the anchor text of "cat photos"
CamperBot
@camperbot
Oct 22 2015 07:18
sorry name234, you can't send brownie points to yourself! :sparkles: :sparkles:
Name234
@Name234
Oct 22 2015 07:19
so i put cat photos in the code? alright?
Michael Bomholt
@bomholtm
Oct 22 2015 07:20
@Name234 cat photos should be the text
Name234
@Name234
Oct 22 2015 07:20
@bomholt Thanks . It works. Great that you are here and help other people. Thank you :+1: :)
CamperBot
@camperbot
Oct 22 2015 07:20
name234 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:warning: name234 already gave bomholt points
Michael Bomholt
@bomholtm
Oct 22 2015 07:20
instead of link to fcc...
Name234
@Name234
Oct 22 2015 07:21
@bomholt I know ;D
@bomholt Thanks <3
CamperBot
@camperbot
Oct 22 2015 07:21
name234 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:warning: name234 already gave bomholt points
Michael Bomholt
@bomholtm
Oct 22 2015 07:21
@Name234 no problem :) glad i could help
Name234
@Name234
Oct 22 2015 07:22
@bomholt yes, thank you :)
CamperBot
@camperbot
Oct 22 2015 07:22
name234 sends brownie points to @bomholt :sparkles: :thumbsup: :sparkles:
:warning: name234 already gave bomholt points
Roy
@CruelCoin
Oct 22 2015 07:37
Hi guys,
Anyone tell me what is wrong with this code? I think i have the logic correct?
function sumAll(arr)
{
  var returnValue = 0;

  for (var i = Math.min(arr); i < Math.max(arr); i++)
  {
    returnValue += arr[i];
  }

  return returnValue;
}

sumAll([1, 4]);
shamsher10
@shamsher10
Oct 22 2015 07:45
hello
Qadir Pervez
@qadirpervez
Oct 22 2015 07:45
waah re sheru
shamsher10
@shamsher10
Oct 22 2015 07:45
are pagla tum
Qadir Pervez
@qadirpervez
Oct 22 2015 07:45
no hindi here..
shamsher10
@shamsher10
Oct 22 2015 07:46
waah re sheru konsa english tha
now what to do
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:46
@CruelCoin i === Math.max(arr);'
or i <= Math.max(arr);
Abhisek Pattnaik
@abhisekp
Oct 22 2015 07:47
@shamsher10 @qadirpervez pls don't make this chat room another Little India :P
shamsher10
@shamsher10
Oct 22 2015 07:48
ok
how i start my learning
Name234
@Name234
Oct 22 2015 07:49
@Name234
Your a element should be nested within your new p element. : <p>View more <a href="http://freecatphotoapp.com.com"> cat photos</a> for you to follow.</p>.
?
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:49
@CruelCoin actually you need to do this :
Math.max.apply(null, arr[0]);
Name234
@Name234
Oct 22 2015 07:50
Your a element should be nested within your new p element. : <p>View more <a href="http://freecatphotoapp.com.com"> cat photos</a> for you to follow.</p>.
?
shamsher10
@shamsher10
Oct 22 2015 07:50
hello
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:51
@Name234 try to put code at the top of editor
Name234
@Name234
Oct 22 2015 07:51
ok thanks
CamperBot
@camperbot
Oct 22 2015 07:51
if you want to thank someone, put an @ before their name!
Roy
@CruelCoin
Oct 22 2015 07:51
function sumAll(arr)
{
  var returnValue = 0;

  for (var i = Math.min.apply(null, arr); i <= Math.max.apply(null, arr); i++)
  {
    returnValue += arr[i];
  }

  return returnValue;
}

sumAll([1, 4]);
Like so? Now returning null
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:52
@CruelCoin arr[0] instead of arr and arr[1] also
Name234
@Name234
Oct 22 2015 07:52
in the first line? @samosale
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:53
@Name234 yes
Name234
@Name234
Oct 22 2015 07:53
doesnt work
@samosale
This message was deleted
Abhisek Pattnaik
@abhisekp
Oct 22 2015 07:54
explain format
CamperBot
@camperbot
Oct 22 2015 07:54

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 22 2015 07:55
@Name234 :point_up: October 22, 2015 1:24 PM
explain edit
CamperBot
@camperbot
Oct 22 2015 07:55

:point_right: edit or delete message [wiki]

Editing or Deleting a previous message within 10 mins. of posting

How to delete message
:pencil: read more about edit or delete message on the FCC Wiki

Abhisek Pattnaik
@abhisekp
Oct 22 2015 07:55
@Name234 :point_up: October 22, 2015 1:25 PM
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:55
@CruelCoin
returnValue += arr[i];
should be
returnValue += i;
shamsher10
@shamsher10
Oct 22 2015 07:56
hmko v bta
Aleksandar B.
@aleksandar-b
Oct 22 2015 07:56
@Name234 lots of people report a bug on that exercise. just skip it all is fine
Name234
@Name234
Oct 22 2015 07:57
```
<p>View more <a href="http://freecatphotoapp.com.com"> cat photos</a> for you to follow.</p>.
<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>

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

<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
```
so?
is this correct?
sry if did something wrong :(
? hello?
Avishay
@avishayshushan
Oct 22 2015 08:00
@Name234 what it should do?
Name234
@Name234
Oct 22 2015 08:01
"Your a element should be nested within your new p element."
Avishay
@avishayshushan
Oct 22 2015 08:01
ohhh this thing i don't remeber what they want there
i think it's an English challenge
:smile:
Name234
@Name234
Oct 22 2015 08:02
yes :)
Avishay
@avishayshushan
Oct 22 2015 08:02
which one is the new p?
Name234
@Name234
Oct 22 2015 08:03
in the first line
James Wilkinson
@trs4ece
Oct 22 2015 08:03
How can I write output to console for debugging? Doing the reverse a string bonfire.
Name234
@Name234
Oct 22 2015 08:03
i add it. But the place is not correct so i have to done: "Your a element should be nested within your new p element."
Avishay
@avishayshushan
Oct 22 2015 08:04
you have the same a twice?
James Wilkinson
@trs4ece
Oct 22 2015 08:04
Nevermind. Opening the console window helps :)
Name234
@Name234
Oct 22 2015 08:05
@trs4ece bug report under the "run test!
James Wilkinson
@trs4ece
Oct 22 2015 08:05
Hm? Should I bug report that? I guess they never explicitly told us how to do it.
Name234
@Name234
Oct 22 2015 08:06
of course
Roy
@CruelCoin
Oct 22 2015 08:06
Hi guys
I have got it working, but i'm not sure how i would apply Array.reduce() to this.
From what i can see from the documentation, Array.reduce() finds the values in an array if you know all of those values e.g: arr[1,2,3,4,5].
I don't know how you get it to work with an array like so: arr[1, 4]
function sumAll(arr)
{
  var max = Math.max.apply(null, arr);
  var min = Math.min.apply(null, arr);

  var returnValue = 0;

  for (var i = min; i <= max; i++)
  {
    returnValue += i;
  }

  return returnValue;
}

sumAll([1, 4]);
Name234
@Name234
Oct 22 2015 08:07
@trs4ece of course* they tell you about it in the start tutorial
Avishay
@avishayshushan
Oct 22 2015 08:08
@Name234
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<h2 class="red-text">CatPhotoApp</h2>
<p>View more
<a href="http://www.freecatphotoapp.com">cat photos</a>
</p>
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Name234
@Name234
Oct 22 2015 08:08
@CruelCoin Your a element should be nested within your new p element.
´´´
Avishay
@avishayshushan
Oct 22 2015 08:08
@Name234 works for me
Name234
@Name234
Oct 22 2015 08:08
send me the code pls+
@avishayshushan
Avishay
@avishayshushan
Oct 22 2015 08:11
Its above
Aleksandar B.
@aleksandar-b
Oct 22 2015 08:14
@CruelCoin with reduce the solution is different. You make an array and push in it i in the for loop. So you replace returnValue += i; with newArr.push( i); Then just call reduce on that newArr and add previous with current
Name234
@Name234
Oct 22 2015 08:39

Your a element should be a dead link with a href attribute set to "#".

´´´

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

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

´´´

@avishayshushan how can i send my code? like your imageß
image*?
Aleksander Gębicki
@Takumar
Oct 22 2015 08:41
@Name234 please edit your code using backicks: `
Such code take less place in Gitter window.
Name234
@Name234
Oct 22 2015 08:42
@Takumar yes. i try it but i don't know how?
Aleksander Gębicki
@Takumar
Oct 22 2015 08:42
Backticks are on the keyboard to the left of number 1
Name234
@Name234
Oct 22 2015 08:43
give me example. Im not so good in englisch :)
Aleksander Gębicki
@Takumar
Oct 22 2015 08:43
I see you have german keyboard layout.
Name234
@Name234
Oct 22 2015 08:43
yes xD. Im german
I'm from germany. The very cold land :D
Aleksander Gębicki
@Takumar
Oct 22 2015 08:44
german-keyboard-layout.png
Use shift, I mean "Strg"
Name234
@Name234
Oct 22 2015 08:44
´´´´´´
this?
`
like this?
yes
Aleksander Gębicki
@Takumar
Oct 22 2015 08:45
Yes, :clap:
Name234
@Name234
Oct 22 2015 08:45
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
OMG. I done it. Thank you <3. Here are a lot of nice people. :) thanks
CamperBot
@camperbot
Oct 22 2015 08:46
if you want to thank someone, put an @ before their name!
Name234
@Name234
Oct 22 2015 08:47
@Takumar Thank you <3 :)
@Takumar
Aleksander Gębicki
@Takumar
Oct 22 2015 08:47
@Name234 so your problem is: Your a element should be a dead link with a href attribute set to "#".?
Name234
@Name234
Oct 22 2015 08:48
@Takumar yes
Aleksander Gębicki
@Takumar
Oct 22 2015 08:48
So you should have <a href="#"> instead of <a href="http://www.freecatphotoapp.com">
You have to remove current link and replace it with hash.
But remove two hashes that are around your <a></a> tags.
Name234
@Name234
Oct 22 2015 08:48
@Takumar ohh, ok i try it
@Takumar It works. Thank you :D
CamperBot
@camperbot
Oct 22 2015 08:50
name234 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 530 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 22 2015 08:50
Very good, you're welcome.
Name234
@Name234
Oct 22 2015 08:50
@Takumar thanks
CamperBot
@camperbot
Oct 22 2015 08:50
name234 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: name234 already gave takumar points
Name234
@Name234
Oct 22 2015 08:51
:)
andreivn2
@andreivn2
Oct 22 2015 09:02
Hi
i need some help here
when i run this

function palindrome(str) {
return str;
}

palindrome("0_0 (: /-\ :) 0-0");

it returns me this

function palindrome(str) {
return str;
}

palindrome("0_0 (: /-\ :) 0-0");

wtf
Aleksander Gębicki
@Takumar
Oct 22 2015 09:04
@andreivn2 You have to create body for your palindrome() function, now it just returns parameter it gets.
Name234
@Name234
Oct 22 2015 09:11
can i change the language of this website to german?
Aleksander Gębicki
@Takumar
Oct 22 2015 09:13
@Name234 I'm afraid not.
mrmgarcia
@mrmgarcia
Oct 22 2015 09:19
Hi, i have a question how i declare the rgb color i get an error since element wont go black
Blauelf
@Blauelf
Oct 22 2015 09:19
@Name234 Most times the English website is more useful than a poorly translated German website. Remember we Germans have complicated grammar an English native speaker won't prepare their software for. There is however a no longer official German chatroom, the website will stay English, though.
mrmgarcia
@mrmgarcia
Oct 22 2015 09:19
<style>
body {
color: rgb(0, 0, 0);
}
</style>
Blauelf
@Blauelf
Oct 22 2015 09:20
Which element is supposed to be black?
mrmgarcia
@mrmgarcia
Oct 22 2015 09:20
the body
Blauelf
@Blauelf
Oct 22 2015 09:20
Or did you confuse color and background-color?
mrmgarcia
@mrmgarcia
Oct 22 2015 09:21
I supossed to do this;Use rgb to give your body element the background-color of black. For example body { color: rgb(0, 0, 0); }.
Blauelf
@Blauelf
Oct 22 2015 09:21
Change color to background-color
Name234
@Name234
Oct 22 2015 09:22
Nest your text input element within a form element.
mrmgarcia
@mrmgarcia
Oct 22 2015 09:22
thanks Blauelf
CamperBot
@camperbot
Oct 22 2015 09:22
if you want to thank someone, put an @ before their name!
Name234
@Name234
Oct 22 2015 09:22
```
```
mrmgarcia
@mrmgarcia
Oct 22 2015 09:22
@Blauelf thanks for your help
CamperBot
@camperbot
Oct 22 2015 09:22
mrmgarcia sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 393 | @blauelf | http://www.freecodecamp.com/blauelf
Name234
@Name234
Oct 22 2015 09:23
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<input type="text" placeholder="cat photo URL">
<form action="/submit-cat-photo"></form>
QUESTION: Nest your text input element within a form element.
Blauelf
@Blauelf
Oct 22 2015 09:23
@Name234 ``` on its own won't do much :P
Name234
@Name234
Oct 22 2015 09:23
:)
pls help me .d
:D*
Blauelf
@Blauelf
Oct 22 2015 09:23
@Name234 Put the input element between <form...> and </form>
That's called nesting. Putting things inside other things. Like arrays into arrays. Or elements into elements.
Name234
@Name234
Oct 22 2015 09:24
you mean "action="/submit-cat-photo"></form>
@Blauelf bist du deutsch?
Blauelf
@Blauelf
Oct 22 2015 09:25
<form ...> opens the form element, </form> closes it. Put that input in between and it feels like it's part of that form :)
Name234
@Name234
Oct 22 2015 09:25

```
You can build web forms that actually submit data to a server using nothing more than pure HTML. You can do this by specifying an action on your form element.

For example: <form action="/url-where-you-want-to-submit-form-data"></form>.

Nest your text field in a form element. Add the action="/submit-cat-photo" attribute to this form element.

```
Blauelf
@Blauelf
Oct 22 2015 09:26
@Name234 Ja, der Chat ist aber auf Englisch, daher bevorzuge ich das :)
Name234
@Name234
Oct 22 2015 09:26
@Blauelf Ja ich auch. Hier schreiben 99% der Leute ja nur Englisch :D
Blauelf
@Blauelf
Oct 22 2015 09:26
Soweit ist ja auch alles richtig, nur das <input> muss zwischen <form> und </form>.
Name234
@Name234
Oct 22 2015 09:26
ok ich probier´s
<form action="/submit-cat-photo"></form>.Das have ich jetzt schon soweit bearbeitet. Wo soll ich jetzt <input> eintragen?
habe*
@Blauelf
Blauelf
@Blauelf
Oct 22 2015 09:29
Das input-Element kommt so wie es ist zwischen das öffnende und das schließende form-Tag
Name234
@Name234
Oct 22 2015 09:29
schreib in chat. Pls
tinkerhead
@tinkerhead
Oct 22 2015 09:30

What are we supposed to do in 'Waypoint: Fill in the Blank with Placeholder Text'.
1)I did replace the text b/w the p tags with 'kitty ipsum text'. It was not accepted [IWNA]

2) I did replace the text b/w the p tags with 'Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.' [IWNA]

Name234
@Name234
Oct 22 2015 09:30
@Blauelf Vorlage: <form action="/submit-cat-photo"></form>
Blauelf
@Blauelf
Oct 22 2015 09:30
Also im Prinzip
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
</form>
Name234
@Name234
Oct 22 2015 09:30
TheGermanGuy. Schreib deine Frage mal auf deutsch rein bitte ;)
Riko
@RMWHIRL
Oct 22 2015 09:31
Is anyone else in the "Inherit Styles from the Body" waypoint?
Blauelf
@Blauelf
Oct 22 2015 09:31
@TheGermanGuy Please link the waypoint, so we don't have to search it on the map
Name234
@Name234
Oct 22 2015 09:31
@Blauelf Cool danke, hat funktioniert :D
:+1:
Riko
@RMWHIRL
Oct 22 2015 09:33
Does anyone know why the body wouldn't be inheriting the CSS in this waypoint: http://freecodecamp.com/challenges/waypoint-inherit-styles-from-the-body-element
Blauelf
@Blauelf
Oct 22 2015 09:34
@TheGermanGuy I replaced the text of the p element with the kitty ipsum text (that is Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.), and it worked.
Danny
@zealox
Oct 22 2015 09:34
'''TEST'''
CamperBot
@camperbot
Oct 22 2015 09:34
:bulb: to format code use backticks! ``` more info
Danny
@zealox
Oct 22 2015 09:34
TEST
Blauelf
@Blauelf
Oct 22 2015 09:35
@RMWHIRL What's the code you use?
idanceicode
@idanceicode
Oct 22 2015 09:35
Hi all, hope everyone is well. Quick question. I am unsure if this is a bug or if I'm missing something in the mark up. This is what I have: <p>View more <a href="http://freecatphotoapp.com>cat photos.</a></p>. Looks right but I am getting these two messages and cannot move forward: 1)our a element should be nested within your new p element. AND 2)"Your p element should have the text "View more " (with a space after it)."
Blauelf
@Blauelf
Oct 22 2015 09:35
Short enough to post it here, surrounded by ``` lines...
Riko
@RMWHIRL
Oct 22 2015 09:35
How do I clip code like you did? I'll show you.
ok.
Wait...I think I might have just figured out what I did... lol
Blauelf
@Blauelf
Oct 22 2015 09:36
@idanceicode You are missing a closing " ending the URL, is that right?
Riko
@RMWHIRL
Oct 22 2015 09:37
@Blauelf Got it on my own but thanks for being willing to help.
CamperBot
@camperbot
Oct 22 2015 09:37
rmwhirl sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 394 | @blauelf | http://www.freecodecamp.com/blauelf
idanceicode
@idanceicode
Oct 22 2015 09:37
@Blauelf My cut/paste missed it, I actually do have both " surrounding: <p>View more <a href="http://freecatphotoapp.com">cat photos.</a></p>
I am still unable to move forward
Roy
@CruelCoin
Oct 22 2015 09:38
@samosale Thanks.
I did some tinkering with it, and i reduced the amout of code needed to pass the test, while still using Array.reduce.
Creating a new array and pushing max+min to it, as in your solution is a bit redundant as the argument "arr" already holds these values.
function sumAll(arr)
{
  var max = Math.max.apply(null, arr);
  var min = Math.min.apply(null, arr);

  for (var i = min + 1; i <= max - 1; i++)
  {
    arr.push(i);
  }

  arr.sort();

  var returnValue = arr.reduce(function(a, b)
  {
    return a + b;
  });

  return returnValue;
}

sumAll([1, 4]);
CamperBot
@camperbot
Oct 22 2015 09:38
cruelcoin sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 423 | @samosale | http://www.freecodecamp.com/samosale
Blauelf
@Blauelf
Oct 22 2015 09:38
What's the waypoint's name?
idanceicode
@idanceicode
Oct 22 2015 09:39
@Blauelf "Nest an Anchor"
tinkerhead
@tinkerhead
Oct 22 2015 09:40
@Blauelf Danke
idanceicode
@idanceicode
Oct 22 2015 09:40
@Blauelf "Nest an Anchor Element within a Paragraph"
Blauelf
@Blauelf
Oct 22 2015 09:42
@idanceicode You removed the www. from the link :P
Test code tests for the link with www, so cannot find it.
Name234
@Name234
Oct 22 2015 09:43
Your form should have a button inside it. Was its gemeint? xD
ist+
ist*
Blauelf
@Blauelf
Oct 22 2015 09:44
Dasselbe wie mit dem Input-Element.
Name234
@Name234
Oct 22 2015 09:45
Ok. danke
+1
CamperBot
@camperbot
Oct 22 2015 09:45

:point_right: list of free code camp city based campsites [wiki]

Hundreds of cities around the world have Free Code Camp Facebook groups, called Campsites.

Campers at these Campsites share links, hang out together, and organize local Coffee-n-Code events.

If your city isn't listed here, you should [[create a Campsite for your city|How-to-create-a-Campsite-for-your-city]].

Aarhus
Abu Dhabi
Accra
Adelaide
Ahmedabad
Aichi
Alameda
Albany
Albuquerque
Algiers
Allahabad
Almeria
Americana
Ames
:pencil: read more about list of free code camp city based campsites on the FCC Wiki

Name234
@Name234
Oct 22 2015 09:45
:+1:
Blauelf
@Blauelf
Oct 22 2015 09:45
:+1:? :+1:!
Name234
@Name234
Oct 22 2015 09:46
wollte schreiben:,, Ok, danke :+1: !"
Mani
@maniprataprana
Oct 22 2015 09:46
hello friends
how did you started with
Basic Front End Development Projects
Name234
@Name234
Oct 22 2015 09:46
hello
Mani
@maniprataprana
Oct 22 2015 09:46
i mean before that all assignments I was able to to
Name234
@Name234
Oct 22 2015 09:46
font-family: Monospace
Mani
@maniprataprana
Oct 22 2015 09:47
but ever since I started, the basic project, I'm stuck
Name234
@Name234
Oct 22 2015 09:47
rasend me the question. and the challenge
Mani
@maniprataprana
Oct 22 2015 09:47
how should i begin with
Name234
@Name234
Oct 22 2015 09:47
send*
wait
idanceicode
@idanceicode
Oct 22 2015 09:48
@Blauelf HA! Thank you!!
CamperBot
@camperbot
Oct 22 2015 09:48
idanceicode sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 395 | @blauelf | http://www.freecodecamp.com/blauelf
ou mean this
idanceicode
@idanceicode
Oct 22 2015 09:48
@Blauelf now I just have the second error message: "Your p element should have the text "View more " (with a space after it)."
Mani
@maniprataprana
Oct 22 2015 09:48
@Name234 I mean
Basic Front End Development Projects
Name234
@Name234
Oct 22 2015 09:49
Blauelf ist blaue wie ein elf :)
Blauelf
@Blauelf
Oct 22 2015 09:49
@idanceicode Sometimes it's best to reset those waypoints and do it again when you get stuck, as you might have introduced additional code. Like that fullstop at the end of "View more cat photos".
Name234
@Name234
Oct 22 2015 09:49
try type 1
Blauelf
@Blauelf
Oct 22 2015 09:50
It's not meant to be a real sentence.
idanceicode
@idanceicode
Oct 22 2015 09:50
Thank you @Blauelf , I will try this
CamperBot
@camperbot
Oct 22 2015 09:50
idanceicode sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:warning: idanceicode already gave blauelf points
Name234
@Name234
Oct 22 2015 09:51
try it and done
idanceicode
@idanceicode
Oct 22 2015 09:51
hmmm, reset and still getting that error message...
Blauelf
@Blauelf
Oct 22 2015 09:51
@Name234 Der Name kommt aus einem play-by-eMail-RPG, wurde mir dort so verpasst :P
@idanceicode What's your code now?
Please format it for chat
help format
CamperBot
@camperbot
Oct 22 2015 09:52

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

idanceicode
@idanceicode
Oct 22 2015 09:52
"<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>"
Abe Coronado
@abe03
Oct 22 2015 09:53
Wondering why my code only returns the second passed arguments splitted, only ["h","e","y"]. I'm trying to lowercase and split the array elements into arrays of characters as of now :
function mutation(arr) {
  for (var i = 0; i < arr.length; i++) {
    var lowCase = arr[i].toLowerCase();
    var newArrays = lowCase.split("");
  }

  return newArrays;
}

mutation(["hello", "Hey"]);
Blauelf
@Blauelf
Oct 22 2015 09:54
@idanceicode Did you place that where only the a element was before? It has to replace it and be at the same place relative to the other paragraph elements.
idanceicode
@idanceicode
Oct 22 2015 09:55
yes. and I am so confused as to why this is not working so thank you for your time on this. I am also new here (just started about an hour ago) and this is my first time posting a question -
CamperBot
@camperbot
Oct 22 2015 09:55
if you want to thank someone, put an @ before their name!
idanceicode
@idanceicode
Oct 22 2015 09:56
@Blauelf yes. and I am so confused as to why this is not working so thank you for your time on this. I am also new here (just started about an hour ago) and this is my first time posting a question -
CamperBot
@camperbot
Oct 22 2015 09:56
idanceicode sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:warning: idanceicode already gave blauelf points
Blauelf
@Blauelf
Oct 22 2015 09:56
@abe03 Your assignment to newArrays replaces its former content, so only the last assignment counts. You might want
  var newArrays=[];
  for (var i = 0; i < arr.length; i++) {
    var lowCase = arr[i].toLowerCase();
    newArrays[i] = lowCase.split("");
  }
Not sure if that splitting actually helps, but it should not hurt much either.
Abe Coronado
@abe03
Oct 22 2015 10:03
ok, yea that works. I thought of creating an empty array first but couldn't think of why i would need to store anything there... Thank you @Blauelf
CamperBot
@camperbot
Oct 22 2015 10:03
abe03 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 396 | @blauelf | http://www.freecodecamp.com/blauelf
Name234
@Name234
Oct 22 2015 10:29
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL">
  <button type="submit">Submit</button>
</form>
Question: Your text input element should have the required attribute.
Blauelf
@Blauelf
Oct 22 2015 10:35
Which waypoint is that?
Nikhil Kumar
@nikhilkumar238
Oct 22 2015 10:36

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

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

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

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

how to do this?
Herlou
@herloub
Oct 22 2015 10:51
This message was deleted
Name234
@Name234
Oct 22 2015 11:02
@Blauelf habe schon fertig. Trotzdem danke für deine Hilfe. :)
:+1:
Blauelf
@Blauelf
Oct 22 2015 11:04
@nikhilkumar238 Copy that code, to have three lines, and have that 0 be 0 in the first line, 1, 2 in the others, and slotOne change accordingly.
Blauelf
@Blauelf
Oct 22 2015 11:17
I just found the one-line solution to the largest number in array bonfire. It is indeed ugly. And I still have to understand it :D
D/S
@dantesolis
Oct 22 2015 11:46
@haribol007 just saw the link you post it. Thanks man. Gonna try it for javascript. But won’t lie was hoping for something to use even with no internet connection. The only thing similar I can find is CodeRunner (GUI), but not free
CamperBot
@camperbot
Oct 22 2015 11:46
dantesolis sends brownie points to @haribol007 :sparkles: :thumbsup: :sparkles:
:star: 196 | @haribol007 | http://www.freecodecamp.com/haribol007
azaleas
@azaleas
Oct 22 2015 11:55

Hi fellow campers, I'm doing my Simon game and I've a problem here (or problem with the async concept):

      for(var z = 0; z < 3; z++){
       x = Math.floor(Math.random() * 4);
       turns.push(x);
       gamePlay(turns);
       }

and here's the gamePlay function:

function gamePlay(array){
    var duration = 1000;  //1000ms
    $.each(array, function(index, value){
      if(switcher == 1){
      setTimeout(function(){
        console.log(value);
              $("." + sounds[value]).trigger("play");
              $("#" + sounds[value]).fadeOut(100).fadeIn(100);
            }, index * duration);
      }
     });
}

I'm expecting this code to run as follows:

  1. turns array = x;
  2. play sound only once;
  3. turns array = x, x;
  4. play sound twice;
  5. turns array = x, x, x;
  6. play sound 3 times.

But, instead I get only the last condition. I guess it has something to do with setTimeout function. So guide would be appreciated here.

Blauelf
@Blauelf
Oct 22 2015 12:01
Do you really ony get the last condition, or do you get the last condition multiple times?
Blauelf
@Blauelf
Oct 22 2015 12:31
I think I got it. You are scheduling the first function to run four times after one second, the second function three times after two seconds, 3rd 2 times after 3s, 4th once after 4s :) Maybe you want to wait after playing one sequence? While I know similar games, I do not know the rules of this one.
Ihab Baghdadi
@ijb87
Oct 22 2015 12:48
Bonfire: Return Largest Numbers in Arrays: any tips?
function largestOfFour(arr) {
  for (var i = 0; i <= arr.length; i++) {
  var a = arr[i];
  var largest = a[i];
  var numbersLargest = [];
  for (var i = 0; i < a.length; i++) {
    if (a[i] > largest) {
       largest = a[i];


    }
       numbersLargest.push(largest);
  }

}
  return numbersLargest;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
CamperBot
@camperbot
Oct 22 2015 12:48
Sorry, can't find a bonfire called return largest numbers in arrays any tipsjsfunction largestoffourarr for var i 0 i arrlength i var a arri var largest ai var numberslargest for var i 0 i alength i if ai largest largest ai numberslargestpushlargest return numberslargestlargestoffour4 5 1 3 13 27 18 26 32 35 37 39 1000 1001 857 1. [ Check the map? ]
Ihab Baghdadi
@ijb87
Oct 22 2015 12:49
[4,5,5,5]
Blauelf
@Blauelf
Oct 22 2015 12:53
@ijb87
  1. move numbersLargest declaration and initializing outside your outer loop (somewhere in front of your first for).
  2. It should be a[0], not i, as this is always the first element, and if i is a.length or greater, your code will break
  3. You might want to use separate variables for inner and outer loop. var defines a variable function-scope, so when you change your inner i, you change outer i, which is not what you want.
Mrs. B.
@jazzydelta99
Oct 22 2015 12:54

Hello! I just got started on HTML and I'm having a problem with adding the Lobster font. Can someone please tell on where I went wrong?
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

h2 {
font-family: Lobster;
}

Ihab Baghdadi
@ijb87
Oct 22 2015 12:55
post your code, maybe we could help
@jazzydelta99
Blauelf
@Blauelf
Oct 22 2015 12:56
Do you have <style></style> around your css code?
Mrs. B.
@jazzydelta99
Oct 22 2015 12:56
yes
The monospace font family works for my p tag
Jason Wood
@catapixel
Oct 22 2015 12:57
@jazzydelta99 this line <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"> needs to be at the top of your code BEFORE your <style> element on its own line.
Blauelf
@Blauelf
Oct 22 2015 12:58
@jazzydelta99 Your link element is at the top?
Jason Wood
@catapixel
Oct 22 2015 12:58
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
your styles
</style>
Mrs. B.
@jazzydelta99
Oct 22 2015 12:58
That worked! I had it inside the style tags! Thanks everyone!!
CamperBot
@camperbot
Oct 22 2015 12:58
if you want to thank someone, put an @ before their name!
Abhishek Kumar
@iamkumarabhishek
Oct 22 2015 13:32
Waypoint: Learn how Script Tags and Document Ready Work
help me for this waypoint
Waypoint: Learn how Script Tags and Document Ready Work http://freecodecamp.com/challenges/waypoint-learn-how-script-tags-and-document-ready-work#?solution=%3Cscript%20%24(document).ready(function(%20)%7B%20%7D)%3Efcces%0A%0A%3C!--%20You%20shouldn't%20need%20to%20modify%20code%20below%20this%20line%20--%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch3%20class%3D%22text-primary%20text-center%22%3EjQuery%20Playground%3C%2Fh3%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23left-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22left-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target1%22%3E%23target1%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target2%22%3E%23target2%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target3%22%3E%23target3%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-6%22%3E%0A%20%20%20%20%20%20%3Ch4%3E%23right-well%3C%2Fh4%3E%0A%20%20%20%20%20%20%3Cdiv%20class%3D%22well%22%20id%3D%22right-well%22%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target4%22%3E%23target4%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target5%22%3E%23target5%3C%2Fbutton%3E%0A%20%20%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-default%20target%22%20id%3D%22target6%22%3E%23target6%3C%2Fbutton%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A
CamperBot
@camperbot
Oct 22 2015 13:32
no wiki entry for: me for this waypoint waypoint learn how script tags and document ready work httpfreecodecampcomchallengeswaypoint-learn-how-script-tags-and-document-ready-worksolution3cscript2024documentreadyfunction207b207d3efcces0a0a3c--20you20shouldnt20need20to20modify20code20below20this20line20--3e0a0a3cdiv20class3d22container-fluid223e0a20203ch320class3d22text-primary20text-center223ejquery20playground3c2fh33e0a20203cdiv20class3d22row223e0a202020203cdiv20class3d22col-xs-6223e0a2020202020203ch43e23left-well3c2fh43e0a2020202020203cdiv20class3d22well2220id3d22left-well223e0a20202020202020203cbutton20class3d22btn20btn-default20target2220id3d22target1223e23target13c2fbutton3e0a20202020202020203cbutton20class3d22btn20btn-default20target2220id3d22target2223e23target23c2fbutton3e0a20202020202020203cbutton20class3d22btn20btn-default20target2220id3d22target3223e23target33c2fbutton3e0a2020202020203c2fdiv3e0a202020203c2fdiv3e0a202020203cdiv20class3d22col-xs-6223e0a2020202020203ch43e23right-well3c2fh43e0a2020202020203cdiv20class3d22well2220id3d22right-well223e0a20202020202020203cbutton20class3d22btn20btn-default20target2220id3d22target4223e23target43c2fbutton3e0a20202020202020203cbutton20class3d22btn20btn-default20target2220id3d22target5223e23target53c2fbutton3e0a20202020202020203cbutton20class3d22btn20btn-default20target2220id3d22target6223e23target63c2fbutton3e0a2020202020203c2fdiv3e0a202020203c2fdiv3e0a20203c2fdiv3e0a3c2fdiv3e0a
:pencil: click here to create one now!after creating your page type update to reload it here
Moisés Man
@moigithub
Oct 22 2015 13:33
wiki format
CamperBot
@camperbot
Oct 22 2015 13:33

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Eraldo
@eraldohama
Oct 22 2015 13:38
'''
codehere
'''
CamperBot
@camperbot
Oct 22 2015 13:38
:bulb: to format code use backticks! ``` more info
Mrs-Jones
@Mrs-Jones
Oct 22 2015 13:44

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

.pink-text
{
color:pink;
}

</style>

<h1 >Hello World!</h1>

i want hello world to be pink
<h1 style=pink-text >Hello World!</h1> i s this correct ???
Eraldo
@eraldohama
Oct 22 2015 13:46
its: <h1 class="pink-text"> Hello World! </h1>
Mrs-Jones
@Mrs-Jones
Oct 22 2015 13:49
fantastic thank you very much eraldohama
CamperBot
@camperbot
Oct 22 2015 13:49
if you want to thank someone, put an @ before their name!
Mrs-Jones
@Mrs-Jones
Oct 22 2015 13:49
@eraldohama thanks again
CamperBot
@camperbot
Oct 22 2015 13:49
mrs-jones sends brownie points to @eraldohama :sparkles: :thumbsup: :sparkles:
:star: 10 | @eraldohama | http://www.freecodecamp.com/eraldohama
Jaykishan Kacha
@jaykishan10
Oct 22 2015 13:52
<script>
function runSlots(){
var slotOne;
var slotTwo;
var slotThree;

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

// Only change code below this line.

Math.floor(Math.random() * (3 - 1 + 1)) + 1;
// Only change code above this line.

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

if(slotOne !== undefined && slotTwo !== undefined && slotThree !== undefined){
$(".logger").html(slotOne + " " + slotTwo + " " + slotThree);
}
return [slotOne, slotTwo, slotThree];
}

$(document).ready(function(){
$(".go").click(function(){
runSlots();
});
});
</script>
how can i add random in slot1 slot2 and slot2?
random number
between 1 to 3
Jaykishan Kacha
@jaykishan10
Oct 22 2015 14:00
anyone??
Moisés Man
@moigithub
Oct 22 2015 14:01
do u know what this does ?? Math.floor
and this one Math.random
Jaykishan Kacha
@jaykishan10
Oct 22 2015 14:01
yep
math.random() generates any random number
Moisés Man
@moigithub
Oct 22 2015 14:02
then.. u know what this line does too... Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Jaykishan Kacha
@jaykishan10
Oct 22 2015 14:02
yes, it generates numbers between 1 nd 3
Moisés Man
@moigithub
Oct 22 2015 14:02
yep
Jaykishan Kacha
@jaykishan10
Oct 22 2015 14:03
but it doesn't work
Moisés Man
@moigithub
Oct 22 2015 14:03
some functions (like Math.floor) returns results
Jaykishan Kacha
@jaykishan10
Oct 22 2015 14:03
ok
Moisés Man
@moigithub
Oct 22 2015 14:03
then u can do something with that result.. like store /put in a variable
var num = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Jaykishan Kacha
@jaykishan10
Oct 22 2015 14:04
hmm...okkk
Moisés Man
@moigithub
Oct 22 2015 14:04
on the exercise.. it have above declared 3 variables
slot1 slot2 and slot3
and the exercise is asking u generate 3 random numbers and store on those variables
so u should have....
slot1 = ....
slot2 = ....
slot3 = .....
Deep2322
@Deep2322
Oct 22 2015 14:35
<header class="clearfix">
<div class="session-wrappers">
<div class="col-lg-6 controls text-center">
<h5>break length</h5>
<ul class="list-unstyled list-inline controls">
<button onclick="decrementVal();" class="btn btn-primary inc">-</li>
</button><input type="text" id="inc" value="0"></input></li>
<button onclick="incrementVal();" class="inc btn btn-primary">+</button>
</ul>
</div>
<div class="col-lg-6 controls text-center">
<h5>session length</h5>
<ul class="list-unstyled list-inline controls">
<button onclick="decrementVal();" class="btn btn-primary inc">-</li>
</button><input type="text" id="bnc" value="0"></input></li>
<button onclick="incrementVal();" class="inc btn btn-primary">+</button>
</ul>
</div>
</div>
</header>
Uk
@ukchukx
Oct 22 2015 14:35
Currently stuck at waypoint 114. The next waypoint refuses to load (on Chrome, Firefox...and even Edge).
Deep2322
@Deep2322
Oct 22 2015 14:35

var i = 0;

function incrementVal(){
i++;
document.getElementById('inc').value = i;
}

function decrementVal(){
i--;
document.getElementById('inc').value = i;
}

if click on second increment button + the value is changing in first input box
how to have same onclick event on diffrent elements
vere perrot
@perrot
Oct 22 2015 14:39
basejump
find basejump
Javed Khan
@JavedKhan1588
Oct 22 2015 14:59
How to add script tag in html document??
hello
Aleksander Gębicki
@Takumar
Oct 22 2015 15:01
@JavedKhan1588 just by <script> </script>
Ian Hyndman
@ian-splintercell-splinter
Oct 22 2015 15:01
Hello all may i ask a question about ; ''myMotorBike should have a engines attribute set to a number.''
Waypoint: Construct JavaScript Objects with Functions
im stuck
Javed Khan
@JavedKhan1588
Oct 22 2015 15:06
thanks @Takumar Takumar
CamperBot
@camperbot
Oct 22 2015 15:06
javedkhan1588 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 533 | @takumar | http://www.freecodecamp.com/takumar
ARodz
@AromaR
Oct 22 2015 15:13
hey people
has anyone completed use the javascript console?
can't figure out what to do in there
Ariel
@ArielLeslie
Oct 22 2015 15:19
@AromaR What browser are you on?
Rex Schrader
@SaintPeter
Oct 22 2015 15:23
@AromaR For developing code, I use http://repl.it
@AromaR But as for the "what to do in there" - it's basically the output for all JS errors and console.log statements.
@AromaR You don't generally "do" much there - it's more that it's an output to check your work.
Aleksandar B.
@aleksandar-b
Oct 22 2015 15:33
@ian-splintercell-splinter myMotorBike.engines = 5;
@Deep2322 document.getElementById('bnc').value = i;
Sauryha
@WonderWoman182
Oct 22 2015 15:41
hey I'm having trouble setting a class declaration for my html. can anyone help?
suryabhan
@keyoya
Oct 22 2015 15:42
hi all
Rex Schrader
@SaintPeter
Oct 22 2015 15:45
@WonderWoman182 Sure
@WonderWoman182 Which waypoint?
suryabhan
@keyoya
Oct 22 2015 15:45
hi i am stuck will any one help me ?

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

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

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

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

Jason
@Skiippa
Oct 22 2015 15:46
Logged on this morning, and found out my bonfire code is gone >.< luckily its not too much i lost
@keyoya use ``` at the start and end of code :)
suryabhan
@keyoya
Oct 22 2015 15:48
ok @Skiippa
Kevin Vansylyvong
@kansylyvong
Oct 22 2015 15:48
Anyone complete the twitch.tv zipline and can help me with a question?
Rex Schrader
@SaintPeter
Oct 22 2015 15:49
@kansylyvong Sure, although the /HelpZiplines channel is better for it
Kevin Vansylyvong
@kansylyvong
Oct 22 2015 15:50
@SaintPeter Didn't realize that was a thing. It's been a while...Anyway, when I first made the app I didn't register it with twitch.tv The app seemed to work fine. Now it will not display any of the users in any of the tabs. Wondering if I should be focusing on the code or simply registering the app
Jason
@Skiippa
Oct 22 2015 15:50
This sucks, i forgot how i did the bofire ><
bonfire*
CamperBot
@camperbot
Oct 22 2015 15:51
we're talking about bonfire :fire: Bonfire: Seek and Destroy
Rex Schrader
@SaintPeter
Oct 22 2015 15:54
@kansylyvong I do think you need to get an API key, but I can't recall specifically
Kevin Vansylyvong
@kansylyvong
Oct 22 2015 15:55
@SaintPeter Okay, can you think of a reason why it would let me make API calls initially but eventually stop?
Rex Schrader
@SaintPeter
Oct 22 2015 15:56
@kansylyvong It probably allows for a limited number of non-API Key calls
Kevin Vansylyvong
@kansylyvong
Oct 22 2015 15:56
@SaintPeter, ahh, okay. Should hopefully be an easy fix then. Thanks!
CamperBot
@camperbot
Oct 22 2015 15:56
kansylyvong sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1134 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jason
@Skiippa
Oct 22 2015 16:05
What do i need to change to make this work?
function factorialize(num) {
  var sum = 1 
  for (var i = 1;i < sum + 1; i++){
    sum = sum * i;
  }
  return num;
}

factorialize(5);
Rex Schrader
@SaintPeter
Oct 22 2015 16:06
@Skiippa return sum, not num
Aleksandar B.
@aleksandar-b
Oct 22 2015 16:06
@Skiippa return sum, i guess
Jason
@Skiippa
Oct 22 2015 16:06
.-.
I think i broke it
function factorialize(num) {
  var sum = 1 
  for (var i = 1;i < sum + 1; i++){
    sum = num * i;
  }
  return sum;
}

factorialize(5);
nvm i switched num and sum
Rex Schrader
@SaintPeter
Oct 22 2015 16:09
@Skiippa No, don't change any other code, JUST change the return statement
@Skiippa
function factorialize(num) {
  var sum = 1 
  for (var i = 1;i < sum + 1; i++){
    sum = sum * i;
  }
  return num;  // This is the only line that is wrong
}

factorialize(5);
Jason
@Skiippa
Oct 22 2015 16:11
Yea @SaintPeter i got it thanks
CamperBot
@camperbot
Oct 22 2015 16:11
skiippa sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1136 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jason
@Skiippa
Oct 22 2015 16:12
Can someone explain simply to me string.replace() ? I looked on the wiki but didn't really understand their explanation
Rex Schrader
@SaintPeter
Oct 22 2015 16:12
@Skiippa Sure
@Skiippa There are several ways that string.replace can work, but there are two main ones:
string replace matches either a string or a regular expression and replacees it with whatevevr you say
@Skiippa So:
var stringToSearch = "This is a long string";
var newString = stringToSearch.replace('is', 'was');
// "This was a long string"
@Skiippa or
var stringToSearch = "This is a long string";
var newString = stringToSearch.replace(/a/, '4');
// "This w4s 4 long string"
Jason
@Skiippa
Oct 22 2015 16:17
Alright thanks again SaintPeter
CamperBot
@camperbot
Oct 22 2015 16:17
if you want to thank someone, put an @ before their name!
Jason
@Skiippa
Oct 22 2015 16:20
What is it asking for me to do on "Bonfire: Check for Palindromes"?
Rex Schrader
@SaintPeter
Oct 22 2015 16:21
@Skiippa You need to see if the string is the same forward and backwards . . . but you need to remove all non-alphanumeric characters to do the comparison.
Jason
@Skiippa
Oct 22 2015 16:22
Ok... im sure there was a way of removing all the non-alphanumeric characters ill have to check ze wiki
Rex Schrader
@SaintPeter
Oct 22 2015 16:22
@Skiippa Yes, use a regular expression. Use this site: http://regex101.com to develop it
Jason
@Skiippa
Oct 22 2015 16:34
What was the method called that reverses strings?
Aleksander Gębicki
@Takumar
Oct 22 2015 16:35
@Skiippa you have to create your own method for reversing strings. There is method reverse() for reversing arrays.
Xavier Sumba
@cuent
Oct 22 2015 16:35
You can use array.reverse()
Karen Smith
@oneplainjane
Oct 22 2015 16:38
Just starting out here. What am I doing wrong?

<style>

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

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

Aleksander Gębicki
@Takumar
Oct 22 2015 16:39
@oneplainjane you declare class: blue-text and then you use class red-text. Your blue-text class is colouring text to red.
Karen Smith
@oneplainjane
Oct 22 2015 16:39
::Slaps forehead:: DUH! takumar
@Takumar Thanks!
CamperBot
@camperbot
Oct 22 2015 16:39
oneplainjane sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 534 | @takumar | http://www.freecodecamp.com/takumar
Jason
@Skiippa
Oct 22 2015 16:40
@oneplainjane Dont worry its gonna happen often
dfigueroad
@dfigueroad
Oct 22 2015 16:46
hey guys
Rex Schrader
@SaintPeter
Oct 22 2015 16:47
hey hey
Jason
@Skiippa
Oct 22 2015 16:47
Hey
dfigueroad
@dfigueroad
Oct 22 2015 16:48

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

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

//Add the property "engines" to myCar, and make it a number.
var myCar = function()

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

woops
i dont know how to make it look like code
Jason
@Skiippa
Oct 22 2015 16:48
help format
CamperBot
@camperbot
Oct 22 2015 16:48

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Jason
@Skiippa
Oct 22 2015 16:49
How come it doesnt return true for palindromes?
function palindrome(str) {
  var newString = ('str');

  if (newString === newString.split(',').reverse().toLowerCase){
    return true;
  }
  else {
    return false
  }
}



palindrome("eye");
also i added "." to .split method
Abhishek
@Abhi493
Oct 22 2015 16:50
y var newString = "str";
?
Rex Schrader
@SaintPeter
Oct 22 2015 16:51
@Skiippa You need to turn your array back into a string with join
@Skiippa Also, toLowerCase is a function - you're not calling it
dfigueroad
@dfigueroad
Oct 22 2015 16:51
var Car = function() {
   this.wheels = 4;
};

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


//Add the property "engines" to myCar, and make it a number.
var myCar = function()


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Bryan Wegman
@bwyan
Oct 22 2015 16:52
@Skiippa, you also dont’ want to split(‘,’), you should split(‘’)
Xavier Sumba
@cuent
Oct 22 2015 16:52
myCar.engines = 2;
dfigueroad
@dfigueroad
Oct 22 2015 16:52
I just need to add a property to myCar but somehow i forgot how to, anyone remember?
hey thanks! :)
CamperBot
@camperbot
Oct 22 2015 16:53
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 22 2015 16:53
@dfigueroad myCar.property = "someValue";
dfigueroad
@dfigueroad
Oct 22 2015 16:53
thanks @cuent @SaintPeter
CamperBot
@camperbot
Oct 22 2015 16:53
dfigueroad sends brownie points to @cuent and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1140 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 184 | @cuent | http://www.freecodecamp.com/cuent
dfigueroad
@dfigueroad
Oct 22 2015 16:54
I'll just put the value to 1 though I haven't got a car with 2 engines yet :p
Xavier Sumba
@cuent
Oct 22 2015 16:55
Thats coolest part of js. Dont worry..
I start learning too...
Traci Thompson
@Traci7822
Oct 22 2015 16:57

Working through a codeschool problem and can’t figure out what’s not right. ```var numSheep = 4;
var monthsToPrint = 12;

for (var monthNumber = 1; monthNumber <= monthsToPrint; monthNumber++) {

if (monthNumber % 4 == 0 && numSheep < 10000) {
var sheepToRemove = numSheep .75;
console.log("Removing " + sheepToRemove + " sheep from the population.");
numSheep = numSheep - sheepToRemove;
}
else if (numSheep > 10000) {
var sheepToRemove = numSheep
.5;
console.log("Removing " + sheepToRemove + " sheep from the population.");
numSheep = numSheep - sheepToRemove;
}
{

numSheep *= 4;
console.log("There will be " + numSheep + " sheep after " + monthNumber + " month(s)!");
}
} ``` and the error message I keep getting is "The first time there are more than 10000 sheep, you should log the message 'Removing 8192 sheep from the population.’"

Abhishek
@Abhi493
Oct 22 2015 16:57
@SaintPeter , which book to follow and learn js deeply?
understanding it completely
Traci Thompson
@Traci7822
Oct 22 2015 16:58
sorry that didn’t post correctly
dfigueroad
@dfigueroad
Oct 22 2015 16:58
I've been doing at least a couple hours of this everyday along with Harvard's CD50 from edx and another course in spanish
Jason
@Skiippa
Oct 22 2015 16:58
(newString === newString.split(' ').reverse().toLowerCase().join())
tells me " newString.spli(...).reverse(...).toLowerCase(...) is not a function"
Rex Schrader
@SaintPeter
Oct 22 2015 16:58
dfigueroad
@dfigueroad
Oct 22 2015 16:58
its great feels like I'm starting to learn how to speak to my computer
Abhishek
@Abhi493
Oct 22 2015 16:58
@SaintPeter what do you read?
YEAH! @dfigueroad , keep on learning
Rex Schrader
@SaintPeter
Oct 22 2015 16:59
@Abhi493 But I think it's wrong to think that a book can give you a deep understanding. I have never read any books. I can't stand them, they put me to sleep. I've just tried to solve real problems. When I don't know how to do sometihng I google it and try to understand it. I just learn as I go.
@Abhi493 The best way to learn to code, I think, is to ABC - Always Be Coding.
Abhishek
@Abhi493
Oct 22 2015 16:59
@SaintPeter dynamic learner :smile:
Rex Schrader
@SaintPeter
Oct 22 2015 16:59
@Abhi493 :D
@Abhi493 Smart and lazy, maybe?
Abhishek
@Abhi493
Oct 22 2015 17:00
I like reading so will try that book
Rex Schrader
@SaintPeter
Oct 22 2015 17:00
@Abhi493 I've heard it's a bit of a slow read, but good.
@Abhi493 Really, though, you can learn a lot just by playing around
@Abhi493 http://repl.it
@Abhi493 Are you on the Bonfires yet?
Abhishek
@Abhi493
Oct 22 2015 17:01
@SaintPeter you are playing around for so long , then y don't you claim your certifications?
yes i am
Rex Schrader
@SaintPeter
Oct 22 2015 17:02
@Abhi493 Well, I have to go back and finish up the two new ziplines and . . well . . I'm busy.
Abhishek
@Abhi493
Oct 22 2015 17:02
yeah busy helping us
thanks @SaintPeter
CamperBot
@camperbot
Oct 22 2015 17:02
abhi493 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1141 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 22 2015 17:02
@Abhi493 Between my job, evening meetings, my 2nd grader and, yes, time spent on the help rooms . . .
Abhishek
@Abhi493
Oct 22 2015 17:03
do you work as a web dev? @SaintPeter
Jason
@Skiippa
Oct 22 2015 17:03
function palindrome(str) {
  var newString = (str.toLowerCase);
    var R = newString.split('').reverse().join('');

  if (newString === R){
    return true;
  }
  else {
    return false
  }
}



palindrome("eye");
Gives me newString.split is not a function
Jorge Rodriguez
@rodri0315
Oct 22 2015 17:03
Hello! someone that can explain me an exercise I just did and its correct but I want someone to explain me why?
Maria
@mariashifa
Oct 22 2015 17:03
OK people, I'm stuck on a challenge .. how to add "i element" to the like button?
Rex Schrader
@SaintPeter
Oct 22 2015 17:03
@Abhi493 Nope, I'm an electrical engineer - I just have dull meetings sometimes
@Skiippa Remove the parantheses from var newString = (str.toLowerCase); it should be: var newString = str.toLowerCase();
Abhishek
@Abhi493
Oct 22 2015 17:04
@Skiippa
yes exactly @SaintPeter corrected you , before me.
Jason
@Skiippa
Oct 22 2015 17:05
facepalm
Abhishek
@Abhi493
Oct 22 2015 17:06
i element i tag for italics @mariashifa ?
share the name of the challenge
Jorge Rodriguez
@rodri0315
Oct 22 2015 17:07

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

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

//Add the property "engines" to myCar, and make it a number.
myCar.engines = 1; //WHY IS THIS WORKING AND HOW?

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

Jason
@Skiippa
Oct 22 2015 17:08
Now its saying "My age is 0, 0 si ega ym." is false because of the period at the end
Rex Schrader
@SaintPeter
Oct 22 2015 17:09
@Skiippa It says in the problem description: You must remove all non-alphanumeric characters. A regex is great for that, try http://regex101.com to help you develop it.
@rodri0315 What is the question?
Maria
@mariashifa
Oct 22 2015 17:09
okay i got it done @Abhi493 lol.. but i dont understand what "i"stands for.. is it "italics"?
Waypoint: Add Font Awesome Icons to our Buttons
Jorge Rodriguez
@rodri0315
Oct 22 2015 17:09

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

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

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

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

Abhishek
@Abhi493
Oct 22 2015 17:09
@rodri0315 i suggest you to the js course on codeacademy and you will be more comfortable with js
Jorge Rodriguez
@rodri0315
Oct 22 2015 17:10
Add an engines property with a number value to the myCar instance.
Abhishek
@Abhi493
Oct 22 2015 17:10
to do*
Rex Schrader
@SaintPeter
Oct 22 2015 17:10
@rodri0315 You know that myCar is an instance of Car . . . and you can add a property to an object by going someObject.newProperty = "someValue"
Jason
@Skiippa
Oct 22 2015 17:11
@SaintPeter Yes, but i dont know the expression to take out any ' . ' ...
And im not sure how the regex works
Rex Schrader
@SaintPeter
Oct 22 2015 17:12
@Skiippa A great way to do it is to think backwards: do an invese character class.
@Skiippa Did you try the website: http://regex101.com ?
Jason
@Skiippa
Oct 22 2015 17:12
Im there right now ... so is it just used to explain expressions?
Rex Schrader
@SaintPeter
Oct 22 2015 17:13
@Skiippa Well, you can write sample text to test in the lower window
@Skiippa and write your regex in the top bar
@Skiippa and on the right it explains what is going on
@Skiippa You should have completed the Regex waypoints, right?
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:14
guy can you all help me im stack in Waypoint: Style Text Inputs as Form Controls
Jorge Rodriguez
@rodri0315
Oct 22 2015 17:14
@SaintPeter Okay, does wheels property in Car is also a property of myCar? is that what var "myCar = new Car();" does??
Rex Schrader
@SaintPeter
Oct 22 2015 17:14
@rodri0315 Yes - that is creating a new instance of the Car object
@Reinhardcpn sure
Jason
@Skiippa
Oct 22 2015 17:15
@SaintPeter I've completed all the waypoints to the Basic Algorythm scripting
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:15
@SaintPeter im stack in qustion "Give the text input in your form the class form-control."
Rex Schrader
@SaintPeter
Oct 22 2015 17:16
Jason
@Skiippa
Oct 22 2015 17:16
Im there right now Bonfire 4
Ok
Caleb Odeyemi
@odeyemisc
Oct 22 2015 17:16
I dont know what I did wrong
Rex Schrader
@SaintPeter
Oct 22 2015 17:16
@Reinhardcpn ok, do you know where your submit button is?
Jorge Rodriguez
@rodri0315
Oct 22 2015 17:17
Okay, thank you @SaintPeter it is a little more clear to me now.
CamperBot
@camperbot
Oct 22 2015 17:17
rodri0315 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1142 | @saintpeter | http://www.freecodecamp.com/saintpeter
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:17
@SaintPeter yup bro i just stack in one this question, i think this bug question
Rex Schrader
@SaintPeter
Oct 22 2015 17:18
@Reinhardcpn ok, do you know how to add a class attribute to an HTML element?
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:18
@SaintPeter yup i know bro
Rex Schrader
@SaintPeter
Oct 22 2015 17:18
@Reinhardcpn ok, so it's asking you to add the class form-control to your text input
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:19
@SaintPeter this my code <button class="btn btn-primary" type="submit"><i class="fa fa-paper-plane"></i>Submit</button>
Rex Schrader
@SaintPeter
Oct 22 2015 17:20
@Reinhardcpn Not your submit button, your <input type="text"> field
@Reinhardcpn This:
<input type="text" placeholder="cat photo URL" required>
@Reinhardcpn Add the class they're talking about to it
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:23
@SaintPeter omg-- wkwkwkwkw thanks bro
CamperBot
@camperbot
Oct 22 2015 17:23
:star: 1143 | @saintpeter | http://www.freecodecamp.com/saintpeter
reinhardcpn sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
Butterfly313
@Butterfly313
Oct 22 2015 17:23
This message was deleted
Rex Schrader
@SaintPeter
Oct 22 2015 17:23
@Reinhardcpn :D
@Reinhardcpn What does "wk" mean?
Butterfly313
@Butterfly313
Oct 22 2015 17:24
This message was deleted
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:25
@SaintPeter my be like laughter or LOL hahahaha
Rex Schrader
@SaintPeter
Oct 22 2015 17:25
@Reinhardcpn Ah, ok . . . I know Costa Ricans says jajajaja
@Reinhardcpn Where does wkwkwk come from?
@Butterfly313 (You can totally talk here, you don't need to be perfect ;) )
sandbhar
@sandbhar
Oct 22 2015 17:26
Your a element should be nested within your new p element.
Your p element should have the text "View more " (with a space after it).
not able get these
Rex Schrader
@SaintPeter
Oct 22 2015 17:27
@sandbhar The new p element has to be the first p element in the problem text.
@sandbhar I mean in your HTML
Butterfly313
@Butterfly313
Oct 22 2015 17:27
Good Afternoon, I'm trying to override my h1 text element of pink and blue to give it an id attribute of orange-text but its not working. Here is the code I'm using...<h1 class="pink-text blue-text"><h1 id="orange-text">Hello World!</h1>
Rex Schrader
@SaintPeter
Oct 22 2015 17:28
@sandbhar Even if you got it perfect, if you put it at the end of the list of p elements, it will fail
sandbhar
@sandbhar
Oct 22 2015 17:28
thanks @SaintPeter
CamperBot
@camperbot
Oct 22 2015 17:28
sandbhar sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1144 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 22 2015 17:28
@Butterfly313 You need to use a style attribute, I think.
@Butterfly313 But I'm not sure why you have 2 h1 elements
@Butterfly313 Which specific waypoint are you on?
sandbhar
@sandbhar
Oct 22 2015 17:29
Your a element should be nested within your new p element.
<p>View more <a> href=""</a></p>
but it's not working
Butterfly313
@Butterfly313
Oct 22 2015 17:30
@SaintPeter ...Here is the style element that I used...#orange-text {
color: orange
Rex Schrader
@SaintPeter
Oct 22 2015 17:30
@sandbhar You can't close your a tag before href - href is an attribute of a
Butterfly313
@Butterfly313
Oct 22 2015 17:30
@SaintPeter ...I'm on #53
Rex Schrader
@SaintPeter
Oct 22 2015 17:30
@sandbhar <p>View more <a href=""></a></p>
sandbhar
@sandbhar
Oct 22 2015 17:30
tried it as well
Rex Schrader
@SaintPeter
Oct 22 2015 17:31
@Butterfly313 ok, you need to use the !important flag.
@sandbhar ok, it looks like you got rid of some important things
Mateo Pool
@IAmMyself
Oct 22 2015 17:33
Bonfire: Binary Agents, how can I convert the binary to Unicode?
CamperBot
@camperbot
Oct 22 2015 17:33
Sorry, can't find a bonfire called binary agentshttpfreecodecampcomchallengesbonfire-binary-agents how can i convert the binary to unicode. [ Check the map? ]
Rex Schrader
@SaintPeter
Oct 22 2015 17:33
@sandbhar I suggest you reset your code
@sandbhar You need to just wrap the existing anchor with <p> tags, as described
@sandbhar This is the starting point:
<a href="http://www.freecatphotoapp.com">cat photos</a>
sandbhar
@sandbhar
Oct 22 2015 17:34
<p>View more <a></a></p>
Rex Schrader
@SaintPeter
Oct 22 2015 17:34
@sandbhar No. You must keep the existing anchor. You are removing stuff from it.
@sandbhar Look at the existing anchor:
<a href="http://www.freecatphotoapp.com">cat photos</a>
@sandbhar That must appear, in its entirety, within your <p> tags
@sandbhar I suggest you reset your code, because it looks like you got rid of the anchor tag
sandbhar
@sandbhar
Oct 22 2015 17:35
thanks saintpeter it's working
CamperBot
@camperbot
Oct 22 2015 17:35
if you want to thank someone, put an @ before their name!
sandbhar
@sandbhar
Oct 22 2015 17:35
thanks @SaintPeter saintpeter it's working
CamperBot
@camperbot
Oct 22 2015 17:35
sandbhar sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: sandbhar already gave saintpeter points
Butterfly313
@Butterfly313
Oct 22 2015 17:36
@Saintpeter I'm still getting the following errors: Your h1 element should be orange, Give your h1 element the id of orange-text.
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:37
@SaintPeter hahahah iknow jajajaj, you from costa rica? im from indonesian. nice to meet you bro
Mateo Pool
@IAmMyself
Oct 22 2015 17:37
How can I convert binary to Unicode?
Rex Schrader
@SaintPeter
Oct 22 2015 17:37
@Reinhardcpn Nope, I work with a bunch of engineers from Costa Rica, though :D
@IAmMyself I don't know about unicode, but you can convert binary to decimal like this: var dec = parseInt('1010101', 2);
@IAmMyself And then you cna probably convert that to Ascii/unicode
Mateo Pool
@IAmMyself
Oct 22 2015 17:40
@SaintPeter thanks!
CamperBot
@camperbot
Oct 22 2015 17:40
iammyself sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1145 | @saintpeter | http://www.freecodecamp.com/saintpeter
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:40
@SaintPeter wow , what your field bro?
Rex Schrader
@SaintPeter
Oct 22 2015 17:41
@Reinhardcpn I'm an electrical engineer for the moment. Looking to maybe switch career tracks to web dev
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:43
@SaintPeter wahahahah same to me bro im web dev, why you switch your career? did you want visit me and my team web? koding.website
@SaintPeter did you want to join?
Byron Lagrone
@byronic
Oct 22 2015 17:44
@Butterfly313 If you need to add an id to an existing element (here we'll add the id my-element to h2):
<h2 id="my-element"> Some text... </h2>
Does that help?
Rex Schrader
@SaintPeter
Oct 22 2015 17:44
@Reinhardcpn Appreciate the invitation, but I've got a bunch of projects already
@Reinhardcpn Also . . a house, wife, kid, etc.
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:49
@SaintPeter what do you mean bro?
Rex Schrader
@SaintPeter
Oct 22 2015 17:50
@Reinhardcpn I think I misunderstood
Byron Lagrone
@byronic
Oct 22 2015 17:50

There may not be a 'right answer' to this, but I have a question. Working on Zipline: Build a Personal Portfolio webpage, and I'm doing it by-hand instead of importing existing work/templates. On the top navigation bar, #tb-right, I've added a series of links with the Bootstrap button class:

<div id="tb-right" class="btn-group" role="group">
      <a href="#" class="btn btn-default">Home</a>
      <a href="#" class="btn btn-default">About</a>
      <a href="#" class="btn btn-default">Portfolio</a>
      <a href="#" class="btn btn-default">Contact</a>
    </div>

The Bootstrap fixed-navbar they are nested in is 50 px high, and the buttons end up at ~34px high. To vertical-center the buttons within the navbar, I added the following CSS:

#tb-right
{
  /* I worry this is a bad practice */
  margin: 8px 0 -8px 0;
}

but as my comment mentions, I worry this is a bad practice or maybe there's another, "better" way to do this. The end-result is that the navbar stays the same height, and the buttons have exactly 8px on either vertical side, so it looks right. So maybe the second part of my question is: Am I overthinking it? Is there no 'right way' to do this?

Rex Schrader
@SaintPeter
Oct 22 2015 17:51
@byronic I think the "better" solution is to use line-height: 34px (or maybe 50px)
Reinhard Christopher
@Reinhardcpn
Oct 22 2015 17:52
@SaintPeter hahahaha bro do you know kickstart? i like that
Byron Lagrone
@byronic
Oct 22 2015 17:53
omg, that looks like exactly what I need @SaintPeter
but when I replace #tb-right's CSS with the call to line-height my buttons end up back up top :(
Did I misunderstand where that needs to go?
(follow-up: I did remove the margin: line prior to testing that)
Butterfly313
@Butterfly313
Oct 22 2015 17:54
@byronic that didn't help ;-(
Byron Lagrone
@byronic
Oct 22 2015 17:54
@Butterfly313 let's see the code, my friend
Rex Schrader
@SaintPeter
Oct 22 2015 17:54
@byronic All I can say definitively is that vertical centering can be a bit challenging :D But you knew that already.
Byron Lagrone
@byronic
Oct 22 2015 17:54
@SaintPeter thanks much, I will continue to bang on this and report back
CamperBot
@camperbot
Oct 22 2015 17:54
byronic sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1147 | @saintpeter | http://www.freecodecamp.com/saintpeter
Butterfly313
@Butterfly313
Oct 22 2015 17:56

@byronic {
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}

orange-text {

color: orange 

}
</style>

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

Byron Lagrone
@byronic
Oct 22 2015 17:57
You're going to hate me for saying this, @Butterfly313 but I think the issue might be a missing semi-colon after color: orange in the CSS
Robert Richey
@0x0936
Oct 22 2015 17:57
vertical centering? margin: 0 auto then rotate my head along the z axis 90 degrees
Rex Schrader
@SaintPeter
Oct 22 2015 17:58
@0x0936 Oh, you mean: head: rotate deg(90);
Aleksandar B.
@aleksandar-b
Oct 22 2015 17:58
@Butterfly313 you did not put # before orange-text
Rex Schrader
@SaintPeter
Oct 22 2015 17:59
@samosale They did, but it was eaten by markup, which is why orange-text is huge, above.
Byron Lagrone
@byronic
Oct 22 2015 17:59
^
the missing semi-colon after color: orange is the culprit
CSS is picky
Butterfly313
@Butterfly313
Oct 22 2015 18:00
@byronic I added the semi- colon and I'm still getting the same message. Could the error be in my h1 code
Aleksandar B.
@aleksandar-b
Oct 22 2015 18:00
@byronic also has unecessary { at the top
Jason
@Skiippa
Oct 22 2015 18:00
function palindrome(str) {
  var newString = str.replace(/\w/g,'').toLowerCase();
    var R = newString.split(' ').reverse().join(' ');

      if (newString === R){
    return true;
  }
  else {
    return false;
  }
}



palindrome("eye");
Still not returning "My age is 0, 0 si ega ym." true
Byron Lagrone
@byronic
Oct 22 2015 18:01
good catch @samosale
Robert Richey
@0x0936
Oct 22 2015 18:01
@Skiippa first thing I notice is your regex. What do you think \w does?
Bill
@kirah1314
Oct 22 2015 18:01
@Butterfly313 you also have to combine the 2 <h1> into 1 like this <h1 class="pink-text blue-text" id="orange-text">
Jason
@Skiippa
Oct 22 2015 18:02
@0x0936 Finds non alphanumeric characters?
Robert Richey
@0x0936
Oct 22 2015 18:02
@Skiippa not when w is lower case
Jason
@Skiippa
Oct 22 2015 18:03
So i'd have to make it capital?
Zach
@Clenners
Oct 22 2015 18:04
Hi guys, Im going over waypoints again and it's a bit annoying that i have to press reset every time i go to the next waypoint. is there any way i can make it so waypoints are automatically reset every time i open one?
Robert Richey
@0x0936
Oct 22 2015 18:04
/\w/ is equivalent to /[a-zA-Z0-9]/
/\W/ is equivalent to /[^a-zA-Z0-9]/
Rex Schrader
@SaintPeter
Oct 22 2015 18:05
@Skiippa You might want to try it over at http://regex101.com - then you'll know for sure
Anton Bredl
@antonbr13
Oct 22 2015 18:05
Hey there!
Rex Schrader
@SaintPeter
Oct 22 2015 18:05
@antonbr13 hey hey
Anton Bredl
@antonbr13
Oct 22 2015 18:05
I'm stuck on Waypoint: Add Images to your Website
it should be pretty simple - i think there may be a bug
Rex Schrader
@SaintPeter
Oct 22 2015 18:06
@antonbr13 There is not.
Anton Bredl
@antonbr13
Oct 22 2015 18:06
<img src="https://bit.ly/fcc-relaxing-cat">

You can add images to your website by using the img element, and point to a specific image's URL using the src attribute.

An example of this would be <img src="http://www.your-image-source.com/your-image.jpg">. Note that in most cases, img elements are self-closing.

Try it with this image: https://bit.ly/fcc-relaxing-cat.

Jason
@Skiippa
Oct 22 2015 18:06
@SaintPeter I did but it apparently doesnt exist in regex101
Martin Delille
@MartinDelille
Oct 22 2015 18:06
Hey there! I'm new to freecodecamp and would be glad to help!
Jason
@Skiippa
Oct 22 2015 18:06
hello @MartinDelille
Anton Bredl
@antonbr13
Oct 22 2015 18:07
i have tried various variations of the <img> tag and none seem to work to get me past this simple level
jtyler09
@jtyler09
Oct 22 2015 18:07
@antonbr13 what have you tried?
Rex Schrader
@SaintPeter
Oct 22 2015 18:07
@antonbr13 Humm, I just tried that and it worked just fine
Anton Bredl
@antonbr13
Oct 22 2015 18:07
<img src="https://bit.ly/fcc-relaxing-cat">
Rex Schrader
@SaintPeter
Oct 22 2015 18:08
@antonbr13 Where did you put it on the page?
Anton Bredl
@antonbr13
Oct 22 2015 18:08
<img src="https://bit.ly/fcc-relaxing-cat.jpg">
Butterfly313
@Butterfly313
Oct 22 2015 18:08
@kirah1314 I have that I'm not understanding why I'm getting the errors
Rex Schrader
@SaintPeter
Oct 22 2015 18:08
@antonbr13 There is no .jpg at the end
@antonbr13 What you have here is correct:
<img src="https://bit.ly/fcc-relaxing-cat">
Anton Bredl
@antonbr13
Oct 22 2015 18:08
i know i was trying a variety of different urls
Rex Schrader
@SaintPeter
Oct 22 2015 18:08
@antonbr13 Where on the page did you put it?
Anton Bredl
@antonbr13
Oct 22 2015 18:09
between my h2 and p tags
idk it seems to have worked now
Rex Schrader
@SaintPeter
Oct 22 2015 18:09
@antonbr13 Well, there ya go
Anton Bredl
@antonbr13
Oct 22 2015 18:09
patience wins out in the end!
thanks for the help!
CamperBot
@camperbot
Oct 22 2015 18:09
if you want to thank someone, put an @ before their name!
Jason
@Skiippa
Oct 22 2015 18:09
I think there is a typo... "0_0 (: /-\ :) 0-0" should return false since its NOT a palindrome
Bill
@kirah1314
Oct 22 2015 18:10

@Butterfly313 you had this
<h1 class="pink-text blue-text"><h1 id="orange-text">Hello World!</h1>

and I'm saying you need this
<h1 class="pink-text blue-text" id="orange-text">

Jason
@Skiippa
Oct 22 2015 18:10
And also this is still not working for "My age is 0, 0 si ega ym."
function palindrome(str) {
  var newString = str.replace(/[^a-zA-Z0-9]/,'').toLowerCase();
    var R = newString.split(' ').reverse().join(' ');

      if (newString === R){
    return true;
  }
  else {
    return false;
  }
}

palindrome("eye");
Robert Richey
@0x0936
Oct 22 2015 18:11
@Skiippa your regex needs to also match underscores
Jason
@Skiippa
Oct 22 2015 18:12
@0x0936 But wouldnt that be a non-alphanumeric character?
Byron Lagrone
@byronic
Oct 22 2015 18:13

@SaintPeter regarding my vertical stabilization / centering within Bootstrap + CSS; Bootstrap provides a class "navbar-btn" that performs the centering I needed within the navbar. It's described http://getbootstrap.com/components/#navbar-buttons

I'm going to halt research on line-height for the time being since Bootstrap was kind enough to provide a class that captures the functionality I wanted.
<a href="#home" class="btn btn-default navbar-btn">Home</a> is the final markup for the links.

Rex Schrader
@SaintPeter
Oct 22 2015 18:14
@byronic Awesome - although it might be interesting to learn how the bootstrap button code works.
Robert Richey
@0x0936
Oct 22 2015 18:14
@Skiippa ah, yeah. your regex is right, but you now need the global flag, so that it finds all matching characters and replaces them with the empty string
Byron Lagrone
@byronic
Oct 22 2015 18:15
@SaintPeter True. But for now, I'm trying to hammer my way into this Zipline portfolio, so things that don't advance me towards that goal are being shunted aside for the time being lest I fall into 'distraction hell'
Jason
@Skiippa
Oct 22 2015 18:15
@0x0936 how do you suggest doing that?
Robert Richey
@0x0936
Oct 22 2015 18:15
/[^a-zA-Z0-9]/g
Jason
@Skiippa
Oct 22 2015 18:16
facepalm
"almostomla, nope, and not a palindrome" are all returning true ?
Robert Richey
@0x0936
Oct 22 2015 18:18
@Skiippa what does reverse() do, exactly?
Robert Richey
@0x0936
Oct 22 2015 18:19
I'm asking if you understand it - I don't need the link
Jason
@Skiippa
Oct 22 2015 18:20
I might of thought of it the wrong way
Im pretty sure that it reverses the words around from first to last
But it might not revers the letters
Robert Richey
@0x0936
Oct 22 2015 18:21
what I'm trying to get you to say is that it reverses the elements of an array in place. the first element becomes the last and the last becomes the first.
your split method is splitting with a space delimiter, but newString doesn't have any spaces
so you end up with an array of one element
Jason
@Skiippa
Oct 22 2015 18:23
hmmm
Robert Richey
@0x0936
Oct 22 2015 18:23
["bacon"].reverse() === ["bacon"]
Jason
@Skiippa
Oct 22 2015 18:24
yea i can see what your getting at
Robert Richey
@0x0936
Oct 22 2015 18:24
what you want are the characters of newstring as elements of an array, which can then be reversed
["b", "a", "c", "o", "n"].reverse() === ["n", "o", "c", "a", "b"]`
Jason
@Skiippa
Oct 22 2015 18:26
So i'd have to split by each letter ?
Robert Richey
@0x0936
Oct 22 2015 18:27
yes. How would you do that?
Jason
@Skiippa
Oct 22 2015 18:27
Using a regex [a-zA-Z0-9] as the limiter
Robert Richey
@0x0936
Oct 22 2015 18:29

from String.prototype.split()

If separator is an empty string, str is converted to an array of characters.

"bacon".split("") === ["b", "a", "c", "o", "n"]
MThomasBenjamin
@MThomasBenjamin
Oct 22 2015 18:30
I am at the start of the jQuery course. have the good code but with entering, nothing happens

<script>
$(document).ready(function() {

});
</script>

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

Anyone? :)
Jason Wood
@catapixel
Oct 22 2015 18:31
@MThomasBenjamin I'll take a quick look for you...
MThomasBenjamin
@MThomasBenjamin
Oct 22 2015 18:31
thank you!
CamperBot
@camperbot
Oct 22 2015 18:31
if you want to thank someone, put an @ before their name!
Jason
@Skiippa
Oct 22 2015 18:31
if i change it to that, all the things that are meant to be false and the things that are true turn false and if i dont do it then itll be reverse of what i said ;/
Robert Richey
@0x0936
Oct 22 2015 18:32
@Skiippa there are a few problems with the code you posted. I'm addressing them in order, one at a time.
Jason Wood
@catapixel
Oct 22 2015 18:33
@MThomasBenjamin I think your code looks good if you're on the first waypoint for jQuery. My suggestion is to copy your code between the <script> tags, reset the waypoint using the button, paste your code back in, and resubmit. My guess is it's just a "glitch"
Jason
@Skiippa
Oct 22 2015 18:33
@0x0936 Okay thanks
CamperBot
@camperbot
Oct 22 2015 18:33
skiippa sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 304 | @0x0936 | http://www.freecodecamp.com/0x0936
Robert Richey
@0x0936
Oct 22 2015 18:33
@Skiippa what does your code look like right now?
Jason
@Skiippa
Oct 22 2015 18:34
function palindrome(str) {
  var newString = str.replace(/[^a-zA-Z0-9]/g,'').toLowerCase();
    var R = newString.split('').reverse().join(' ');

      if (newString === R){
    return true;
  }
  else {
    return false;
  }
}



palindrome("eye");
Aayush Kapoor
@xeoneux
Oct 22 2015 18:34
@Skiippa And remember! There's no secret ingredient.
Jason
@Skiippa
Oct 22 2015 18:35
indeed
Robert Richey
@0x0936
Oct 22 2015 18:36
@Skiippa the last problem to address is with .join(). As with split, your delimiter is a space, but should be an empty string, because you want to join the characters back into an array without any separation between them
Jason Wood
@catapixel
Oct 22 2015 18:37
@Skiippa another thing to realize just as a hint is that your regex for your replace() method is not comprehensive enough. You need to replace all non-word characters along with the underscore character _ to successfully pass all of the tests.
Jeanne Erickson Cooley
@JeanneEricksonCooley
Oct 22 2015 18:37
This message was deleted