These are chat archives for FreeCodeCamp/Help

9th
Nov 2015
Scott
@Gangezilla
Nov 09 2015 00:03
I got it! Thanks @SaintPeter and @Mendurim, you guys are the best.
CamperBot
@camperbot
Nov 09 2015 00:03
gangezilla sends brownie points to @saintpeter and @mendurim :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for mendurim
:star: 1468 | @saintpeter | http://www.freecodecamp.com/saintpeter
Jeremy Roe
@jeremyroe
Nov 09 2015 00:13
Anyone have any thoughts on how to accomplish a percent counter in my pomodoro - I’m trying to animate my CSS based on percent complete but my brain is just not clicking with the right logic today http://codepen.io/jeremyroe/pen/dYKdve?editors=001
Stephanie
@stephyli
Nov 09 2015 00:17
Hi all does anyone know why codecamp is allowing me to advance when the code isn't returning the answer? I didn't run the test on this one yet. Thanks!

Waypoint: Use Bracket Notation to Find the Nth Character in a String
You can also use bracket notation to get the character at other positions within a string.

Remember that computers start counting at 0, so the first character is actually the zeroth character.

Let's try to set thirdLetterOfLastName to equal the third letter of the lastName variable.

Try looking at the secondLetterOfFirstName variable declaration if you get stuck.

Can someone write out the answer so I can compare to what I have done in the past? Codecamp says correct but the code wasn't returning anything. Thanks!!!
CamperBot
@camperbot
Nov 09 2015 00:18
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Nov 09 2015 00:20
@stephyli how about you post the code you wrote
so we can give input. better than giving you an answer
CoreyThomas
@CoreyThomas
Nov 09 2015 00:21
You can look on another campers profile and see what answer they have for that particular question. Just to understand though.
Or what @qualitymanifest said
Krista Handel
@meloncatty
Nov 09 2015 00:23
My code is returning all elements that are not greater than 5 yet it's not accepting it as correct
var newArray = oldArray;
newArray = oldArray.filter(function(val) {
  return val < 5;
});
Waypoint: Filter Arrays with filter
Nicole F.
@gitasong
Nov 09 2015 00:25
Hey, guys--I have another question.
DJ
@qualitymanifest
Nov 09 2015 00:26
@meloncatty hmm... that should work...
Krista Handel
@meloncatty
Nov 09 2015 00:26
:(
I'll try refreshing
nothing... does it want my return statement to be different?
is there a different way to make that statement
DJ
@qualitymanifest
Nov 09 2015 00:27
@meloncatty wait. no. i see it now
Krista Handel
@meloncatty
Nov 09 2015 00:27
'o'
mendurim
@Mendurim
Nov 09 2015 00:27
@meloncatty
var array = [1,2,3,4,5,6,7,8,9,10];
  // Only change code below this line.
array = array.filter(function(val) {
  return val <= 5;
});
DJ
@qualitymanifest
Nov 09 2015 00:27
@meloncatty you need to keep 5
Krista Handel
@meloncatty
Nov 09 2015 00:28
oh jeeze
makes sense, thanks @qualitymanifest
CamperBot
@camperbot
Nov 09 2015 00:28
meloncatty sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 345 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
mendurim
@Mendurim
Nov 09 2015 00:28
@qualitymanifest yep
Nicole F.
@gitasong
Nov 09 2015 00:29
Waypoint #188: Make Instances of Objects with a Constructor Function. I've tried every syntax variation we've been shown so far for "wheels" and "engines" (including dropping out "wheels" entirely in the "myCar" function, since it's inherited from the "Car" function), and it still keeps telling me "The property engines of myCar should be a number." Tell, me, what about 1 and 3 aren't numbers? :p
DJ
@qualitymanifest
Nov 09 2015 00:29
@gitasong post your code
Nicole F.
@gitasong
Nov 09 2015 00:29
Okay. What are the keystrokes for formatting it again?
DJ
@qualitymanifest
Nov 09 2015 00:30
help format
CamperBot
@camperbot
Nov 09 2015 00:30

:point_right: code format [wiki]

Inline code

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

How to Code

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

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

Nicole F.
@gitasong
Nov 09 2015 00:30
Okay; thanks, @qualitymanifest . :)
CamperBot
@camperbot
Nov 09 2015 00:30
gitasong sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 346 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
mendurim
@Mendurim
Nov 09 2015 00:31
@gitasong
var Car = function() {
   this.wheels = 4;
};

// New instance of Car object.
var myCar = new Car();

//Add the property "engines" to myCar, and make it a number.
myCar.engines = 1;
Nicole F.
@gitasong
Nov 09 2015 00:33
I can't get the code snippet thing to work.
I get the concepts, @Mendurim . It's telling me the property of engines has to be a number, when I've given it both 1 and 3. It seems to think neither is a number. :/
@Mendurim : I have to call it myCar.engines?
Jason Wood
@catapixel
Nov 09 2015 00:34
@gitasong you need to use the backtick which is above the Tab key on the left of your keyboard. One backtick before and after for inline code. You can do three before and after for multiple lines. In the case of multiple the three backticks need to be on their own line or it won't format the code
DJ
@qualitymanifest
Nov 09 2015 00:34
@gitasong have you been putting the numbers in quotation marks?
mendurim
@Mendurim
Nov 09 2015 00:34
@gitasong could you post the code, there might be a small typo?
Nicole F.
@gitasong
Nov 09 2015 00:35
@catapixel I did that; no dice.
@qualitymanifest Nope.
Jason Wood
@catapixel
Nov 09 2015 00:35
Try again and let me see what you pasted in...
Nicole F.
@gitasong
Nov 09 2015 00:35

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

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

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

DJ
@qualitymanifest
Nov 09 2015 00:36
@gitasong needs to be myCar.engines
Nicole F.
@gitasong
Nov 09 2015 00:36
var Car = function() {
   this.wheels = 4;
};

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



// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
mendurim
@Mendurim
Nov 09 2015 00:36
This message was deleted
Matt Leonard
@matty22
Nov 09 2015 00:36
myCar.engines = 1;
Nicole F.
@gitasong
Nov 09 2015 00:37
Ohhhh!! It doesn't say that you have to toggle the little keyboard icon in the upper right corner before you hit the final Enter!
Jason Wood
@catapixel
Nov 09 2015 00:37
@matty22 has the code you need ^
Nicole F.
@gitasong
Nov 09 2015 00:37
@matty22 Psssh!! Another case of not explaining the required syntax; we're just supposed to intuit it from the universe!!
Jason Wood
@catapixel
Nov 09 2015 00:37
@gitasong you only have to do the toggle if you don't start typing text first.
Nicole F.
@gitasong
Nov 09 2015 00:38
This is really starting to annoy me. :p
Jason Wood
@catapixel
Nov 09 2015 00:38
lol. You're doing great
Nicole F.
@gitasong
Nov 09 2015 00:38
@catapixel I cut and pasted. Is that a problem.
?
Jason Wood
@catapixel
Nov 09 2015 00:38
The snippet or the answer?
Nicole F.
@gitasong
Nov 09 2015 00:39
This stuff pisses me off--the not explaining things. It's like this on every. single. coding. bootcamp.
It's unbelievably annoying. No grade school or college teacher would be able to get away with teaching this way. You have to explain things step by step.
Jason Wood
@catapixel
Nov 09 2015 00:39
It's getting better and this is open source so you're more than welcome to contribute/improve as we go. That's far different than most every bootcamp.
Nicole F.
@gitasong
Nov 09 2015 00:40
Well, I would if I actually knew anything. But I don't; I just know what makes for good teaching and what doesn't.
And it's really poor teaching to expect students to read minds. :p
Okay; rant over. :p
Jason Wood
@catapixel
Nov 09 2015 00:41
If you can't make the code changes you can still use the "bug" button to suggest improvements to make it better once you figure it out. Others will review and apply your changes if they agree
Nicole F.
@gitasong
Nov 09 2015 00:41
Okay; will do. :)
Jason Wood
@catapixel
Nov 09 2015 00:42
:thumbsup:
Nicole F.
@gitasong
Nov 09 2015 00:42
Thanks @catapixel . :)
CamperBot
@camperbot
Nov 09 2015 00:42
gitasong sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 568 | @catapixel | http://www.freecodecamp.com/catapixel
Nicole F.
@gitasong
Nov 09 2015 00:47

Registered my bug report. Looks like this one's been open for a while:

FreeCodeCamp/FreeCodeCamp#2984

Aaaaand--It still thinks 1 is not a number.
var Car = function() {
   this.wheels = 4;
};

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



// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
So what about this is a problem?
Never mind; now suddenly it works.
Matt Leonard
@matty22
Nov 09 2015 00:51
I actually prefer that they don't explain everything. I got to a point where I stopped learning things by having my hand held. I like that FCC just says "Make this work. Here are some articles that might be helpful." It places the onus me you to teach myself, not be spoon fed the answers and not retain anything.
have you tried this.engines = 1;
DJ
@qualitymanifest
Nov 09 2015 00:51
@matty22 100% agreed
Herman Fassett
@HermanFassett
Nov 09 2015 00:52
why this.engines... you're supposed to do it for the instance, not the object
Matt Leonard
@matty22
Nov 09 2015 00:53
Dunno, just giving suggestions. The example above is using this.
Herman Fassett
@HermanFassett
Nov 09 2015 00:54
I think that waypoint you have to do it for the instance
f00b
@mjakefranklin
Nov 09 2015 00:54
I just did that one a few minutes ago, I believe it's for the instance
Matt Leonard
@matty22
Nov 09 2015 00:55
myCar.engines = 1; works for me. Which browser are you using @gitasong ?
Nicole F.
@gitasong
Nov 09 2015 00:55
Yes, but @matty22, you were coding for how long before that happened? That's not the least bit helpful in one's first week. If that were an ideal way to teach, every instructor would simply hand out a book and say, "Come back for the final," or simply "Google it." But still, you have to have someone to write the books and/or the Google articles. Sorry, but there has to be some real teaching somewhere.
Herman Fassett
@HermanFassett
Nov 09 2015 00:55

@matty22

Never mind; now suddenly it works.

Nicole F.
@gitasong
Nov 09 2015 00:56
@matty22 I'm on Firefox. Yeah--it finally worked, after not working a couple of times. Go figure.
f00b
@mjakefranklin
Nov 09 2015 00:56
so long as it works now!
that's technology for you. Sometimes you try to figure out why it wasn't working before, and sometimes you just move on :)
Nicole F.
@gitasong
Nov 09 2015 00:57
Yeah; I'm not trying to figure out why. I just want it to work when it's supposed to, otherwise I think it's me!
Matt Leonard
@matty22
Nov 09 2015 00:58
Well it doesn't matter how long I've been coding. We just get stuck in different places. I sailed past the waypoints because of my prior coding experience, but when I got to the bonfires, I got stuck many times and spent hours staring at the screen. I still prefer not to have it explained to me, and would rather figure it out myself.
Herman Fassett
@HermanFassett
Nov 09 2015 00:58
Yeah, learning on your own I think helps solidify to a point
MirkaG
@MirkaG
Nov 09 2015 00:58
Hey all, how do I reverse arrays with reverse?
Herman Fassett
@HermanFassett
Nov 09 2015 00:58
Just call the reverse function
arr = arr.reverse();
Nicole F.
@gitasong
Nov 09 2015 00:59
Well, that's nice if that works for you, but it's not going to work for everybody. That kind of approach is great if you already have a background, but for beginners, it's an excuse for poor teaching.
MirkaG
@MirkaG
Nov 09 2015 00:59
@HermanFassett thanks!
CamperBot
@camperbot
Nov 09 2015 00:59
mirkag sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 550 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
Matt Leonard
@matty22
Nov 09 2015 01:00
Well I disagree. I feel I've learned more with FCC than I did with any other MOOC who held my hand and just told me what they wanted me to type in.
Nicole F.
@gitasong
Nov 09 2015 01:00
Also, it's quite possible to spell things out step by step in the teaching examples, and then give progressively harder and harder problems to solve so that the students really have to use their heads. You can't do that if you skip steps, because students will get stuck with the easy stuff, and not even be able to begin with the hard stuff.
Well, again, that's you. That certainly won't be true for everybody, and it's a poor way to design a teaching platform.
Herman Fassett
@HermanFassett
Nov 09 2015 01:01
I think helping to a point is good, some beginning bonfires with more help might be useful, but at some point, you need to walk on your own
CamperBot
@camperbot
Nov 09 2015 01:01
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Nicole F.
@gitasong
Nov 09 2015 01:01
Like I said, if that were best practices for good teaching, no one would ever have to go to school. We'd all be at home, cobbling everything together on our own.
@HermanFassett : Does "at some point" mean in your first week of coding??
That's very much a "sink or swim" attitude, don't you think?
Herman Fassett
@HermanFassett
Nov 09 2015 01:03
The first set of bonfires is supposed to take 50 hours... I think they could start out helping, and then progress into doing it on your own...
Then again, I wouldn't know much about first week of coding like that
I had prior experience too
Nicole F.
@gitasong
Nov 09 2015 01:03
@HermanFassett : This is the Waypoints, where they're supposed to be explaining stuff step by step.
Well, if you've had prior experience, then please don't weigh in on what the teaching should be like for newbies. It's not comparable.
Herman Fassett
@HermanFassett
Nov 09 2015 01:04
Ah waypoints... We all were newbies once
Fun name btw
Nicole F.
@gitasong
Nov 09 2015 01:05
You can't come in with two years of coding experience and say to a total newbie, "But I have no problem figuring things out for myself!"
Yes, fun name.
Herman Fassett
@HermanFassett
Nov 09 2015 01:05
:P I had more years
Nicole F.
@gitasong
Nov 09 2015 01:06
(I'm actually not a total newbie, but I run into this same problem in every. single. bootcamp. No one ever explains things fully, so I just keep running up against the same darn problems over and over again.)
Herman Fassett
@HermanFassett
Nov 09 2015 01:06
That's what this chat is for I suppose...
Nicole F.
@gitasong
Nov 09 2015 01:07
@HermanFassett : Well, then you're even less qualified to tell a (relative or total newbie) to "figure it out on your own." :)
Felicia Anne Platzke
@Twobitsdesign
Nov 09 2015 01:07
Hi all - just working through Waypoint: Make Object Properties Private, and a not sure how to make myBike.speed undefined. A little help?
Herman Fassett
@HermanFassett
Nov 09 2015 01:07
Figure it out on your own meaning Read-Search-Ask
Nicole F.
@gitasong
Nov 09 2015 01:07
No--it's simply an indicator of poor teaching. I've had some truly excellent teachers and teaching, and trust me--this isn't it.
Matt Leonard
@matty22
Nov 09 2015 01:07
Even in traditional education, the students who excel are the ones who are proactive and put forth more effort in figuring things out in a way that makes sense for them. We don't hold students' hands throughout primary, middle, and high school.
Nicole F.
@gitasong
Nov 09 2015 01:08
Again, there's a difference between doing that ONCE YOU'VE RECEIVED an excellent education, and doing that IN PLACE OF ONE.
Herman Fassett
@HermanFassett
Nov 09 2015 01:08
@Twobitsdesign you're not supposed to explicitly set the bike speed to undefined, just make it private so when accessed outside of the object it returns undefined
Matt Leonard
@matty22
Nov 09 2015 01:09
Online education and classroom education are two different beasts and expecting them to operate the same way seems self-defeating.
Nicole F.
@gitasong
Nov 09 2015 01:10
That's total B.S. Good teaching is good teaching, online or off, and poor teaching is poor teaching, online or off.
Those are just excuses that poor teachers hide behind.
Felicia Anne Platzke
@Twobitsdesign
Nov 09 2015 01:10
@HermanFassett So....I'm just supposed to declare myBike.speed within the constructor, right?
Herman Fassett
@HermanFassett
Nov 09 2015 01:11
There's a reason you can contribute to the site @gitasong it's not perfect
;) have a go
Matt Leonard
@matty22
Nov 09 2015 01:11
If you want a MOOC that's going to hold your hand, try Treehouse. That's where I started. It taught me enough to get my current job in web design. They will hold your hand through the entire course and you won't retain anything.
Nicole F.
@gitasong
Nov 09 2015 01:11
I am and I will; thank you. :)
CamperBot
@camperbot
Nov 09 2015 01:11
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Nov 09 2015 01:11
@Twobitsdesign you don't declare myBike speed, you just need to make the Bike() object speed private
Matt Leonard
@matty22
Nov 09 2015 01:11
It's fantastic for beginners. But after I'd spent months there, I sat down at a blank text editor, and didn't know what to do.
Herman Fassett
@HermanFassett
Nov 09 2015 01:12
Remember @Twobitsdesign that you use this keyword to reference public properties and public methods
Nicole F.
@gitasong
Nov 09 2015 01:12
I started the iOS course on Treehouse, and it was excellent. The only reason I "didn't retain anything" was because there weren't enough problem sets and examples, not because they spelled out all the steps. Geez.
(Also, I only did about two days' worth.)
Herman Fassett
@HermanFassett
Nov 09 2015 01:12
Frankly helping people here in chat has helped me retain the most
Nicole F.
@gitasong
Nov 09 2015 01:13
That's good, too! They always say you learn best by teaching.
Matt Leonard
@matty22
Nov 09 2015 01:13
And here there are enough problem sets to last you 9-12 months. You will learn and retain things if you complete this program. But you're going to have to get yourself through it.
@HermanFassett I've also found that to be true.
Nicole F.
@gitasong
Nov 09 2015 01:13
Well, of course.
But it's total B.S. to say you didn't retain anything because they walked you through all the steps. You were either lazy and didn't put out the effort to retain anything, or you didn't practice enough.
Besides, if a teacher does explain things step by step, you can STILL go off on your own and innovate and teach yourself new things. The students who need a logical structure and things spelled out for them can't.
Matt Leonard
@matty22
Nov 09 2015 01:15
No, I didn't retain anything because I was never asked to figure anything out there. I was just shown exactly how to do everything and told to just type along. I wasn't learning, I was just copying along as that's what they expect of you.
Nicole F.
@gitasong
Nov 09 2015 01:15
So basically, you've eliminated the vast majority of students when you say good teaching = "figure it out on your own."
Well, then that's stupid. "Monkey see, monkey do" is not teaching, either; it's parroting.
Matt Leonard
@matty22
Nov 09 2015 01:16
No, I think the vast majority of students, who aren't lazy and want things handed to them on a silver platter, will figure it out.
Nicole F.
@gitasong
Nov 09 2015 01:16
All right; I'm done here.
f00b
@mjakefranklin
Nov 09 2015 01:16
this seems quite heated for a help oriented chat room
Herman Fassett
@HermanFassett
Nov 09 2015 01:17
:P
Matt Leonard
@matty22
Nov 09 2015 01:17
:D
Herman Fassett
@HermanFassett
Nov 09 2015 01:17
Just a little. I think everyone has valid points
f00b
@mjakefranklin
Nov 09 2015 01:17
yeah
this stuff is really tough at first
and although awesome, it's still not instructor led
it's just different
I started in IT though, so I'm a patient man :)
Matt Leonard
@matty22
Nov 09 2015 01:18
You must be!
karakarapw
@karakarapw
Nov 09 2015 01:19
@mjakefranklin I agree. It has been an excellent way for me to test my intrinsic motivation though — I really have to have the desire to learn because the answers aren’t just waiting for me.
Matt Leonard
@matty22
Nov 09 2015 01:19
I agree so hard @karakarapw
f00b
@mjakefranklin
Nov 09 2015 01:21
@karakarapw Absolutely! That's a good skill to learn on it's own though. It's what carries you through the WTF scenarious
Elizabeth Ferdman
@eferdman
Nov 09 2015 01:25
hi everyone :) I've been doing stuff on FCC for around a month and I love it :))) ! However I didn't come to FCC as a "total newbie" I've done a lot of stuff on Codecademy, Udacity, Zed Shaw's tutorials, etc etc and most importantly Stanford's CS106A (Programming Fundamentals in Java) available on Youtube! There is no one course that will teach EVERYTHING. Without that background I would not be able to do the beginner + intermediate algorithm scripting. Even with the background knowledge it was still challenging, but I learned alot. MDN rocks!
Herman Fassett
@HermanFassett
Nov 09 2015 01:26
Ikr
Good to have you in chat @eferdman
Matt Leonard
@matty22
Nov 09 2015 01:26
Yeah, I 've just finished the basic bonfires recently and they were definitely difficult.
Elizabeth Ferdman
@eferdman
Nov 09 2015 01:27
@HermanFassett thanks. I had to look up that acronym for a second there haha
CamperBot
@camperbot
Nov 09 2015 01:27
eferdman sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 554 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
mendurim
@Mendurim
Nov 09 2015 01:27
@eferdman MDN rocks, lots of info
Herman Fassett
@HermanFassett
Nov 09 2015 01:27
Lol sorry, I know too many acronyms
MDN is a life saver
sometimes w3 too
Elizabeth Ferdman
@eferdman
Nov 09 2015 01:28
lol "lmao" is now deprecated in favor of "killing myself of laughter" or some crap like that.
Herman Fassett
@HermanFassett
Nov 09 2015 01:28
Ah
Elizabeth Ferdman
@eferdman
Nov 09 2015 01:28
i am completely behind on acronyms. But glad to be part of this chat I hope to get up to speed!
mendurim
@Mendurim
Nov 09 2015 01:29
Anyone doing teamtreehouse front-end courses?
karakarapw
@karakarapw
Nov 09 2015 01:30
@eferdman Don’t feel bad — I just had to look up “IKR"
Craig Morrison
@frogmorton
Nov 09 2015 01:31
@karakarapw me too! ha ha
Herman Fassett
@HermanFassett
Nov 09 2015 01:31
IKR
:P smh
Elizabeth Ferdman
@eferdman
Nov 09 2015 01:32
oh great, another one
Herman Fassett
@HermanFassett
Nov 09 2015 01:32
:neutral_face:
Craig Morrison
@frogmorton
Nov 09 2015 01:32
wtf, Ha ha
<shaking my head> I knew that one
Herman Fassett
@HermanFassett
Nov 09 2015 01:32
lol btw no disrespect
:)
Matt Leonard
@matty22
Nov 09 2015 01:33
I did some of them @Mendurim
Elizabeth Ferdman
@eferdman
Nov 09 2015 01:33
why am i so resistant to accepting new acronyms... need to stop LITP
Craig Morrison
@frogmorton
Nov 09 2015 01:33
brb, smh isn't offensive, imho
Herman Fassett
@HermanFassett
Nov 09 2015 01:34
gtk
karakarapw
@karakarapw
Nov 09 2015 01:35
@HermanFassett I used my powers of deduction to figure that one out! GTK is GTK
Herman Fassett
@HermanFassett
Nov 09 2015 01:35
GTK not as in the UI toolkit :P
Craig Morrison
@frogmorton
Nov 09 2015 01:36
right
best api for the quotes machine? anyone?
mendurim
@Mendurim
Nov 09 2015 01:37
@matty22 are they good, or should I check somethin else?
Craig Morrison
@frogmorton
Nov 09 2015 01:44
Anyone complete the quotes machine zipline yet?
cnkramer
@cnkramer
Nov 09 2015 01:48
Hi! Having issues resizing the cat image....not sure what I'm going wrong
any advice?
Awa
@au78de
Nov 09 2015 01:54
beginner need help
Herman Fassett
@HermanFassett
Nov 09 2015 01:54
Ask away
Awa
@au78de
Nov 09 2015 01:54
style element for h2
Michael Cheung
@m6cheung
Nov 09 2015 01:55
@frogmorton hard to find a quotes api
a lot of them are paid services only
Awa
@au78de
Nov 09 2015 01:55
<h2>CatPhotoApps</h2> {color: blue;} whats wrong?
Herman Fassett
@HermanFassett
Nov 09 2015 01:58
You're mixing html and css
Awa
@au78de
Nov 09 2015 01:59
how do you fix it
karakarapw
@karakarapw
Nov 09 2015 01:59
Are you doing “Waypoint: Change the Color of Text” for your exercise, @au78de ?
Awa
@au78de
Nov 09 2015 02:00
@karakarapw yes
cnkramer
@cnkramer
Nov 09 2015 02:00
Any help for Waypoint: Size your Images?
Awa
@au78de
Nov 09 2015 02:00
<style>
h2 {color: blue;}
</style>
karakarapw
@karakarapw
Nov 09 2015 02:01
@au78de In order to change the color to red, you would follow this code: <h2 style="color: blue">CatPhotoApp</h2> and substitute the blue for red
Awa
@au78de
Nov 09 2015 02:03
@karakarapw i am at next level with css
karakarapw
@karakarapw
Nov 09 2015 02:03
@au78de Same name of exercise?
Herdir
@herdir
Nov 09 2015 02:03
@au78de what is the problem ? and the exercise name ?
Awa
@au78de
Nov 09 2015 02:04
@herdir Waypoint: Use CSS Selectors to Style Elements
Herdir
@herdir
Nov 09 2015 02:05
<h2 style="color: red">CatPhotoApp</h2>
Craig Morrison
@frogmorton
Nov 09 2015 02:06
@m6cheung Yes, I'm finding that out
What are you working on now @m6cheung ?
@cnkramer what's happening with it?
@cnkramer What have you done so far?
Michael Cheung
@m6cheung
Nov 09 2015 02:08
@frogmorton wikipedia viewer
Craig Morrison
@frogmorton
Nov 09 2015 02:08
great, you're up to the intermediate ziplines
did you settle on a quotes api, or just use an array of quotes
Michael Cheung
@m6cheung
Nov 09 2015 02:09
@frogmorton i used an array of quotes i found a nice one but it wanted $5/mo
Herdir
@herdir
Nov 09 2015 02:09
@au78de is it ok ?
Michael Cheung
@m6cheung
Nov 09 2015 02:10
@frogmorton dw bout using an api theres plenty of ziplines where u can use and practice apis
Craig Morrison
@frogmorton
Nov 09 2015 02:10
@m6cheung I wanted to use www.quotesdaddy.com/
Michael Cheung
@m6cheung
Nov 09 2015 02:10
the twitch and the weather onefor ex.
karakarapw
@karakarapw
Nov 09 2015 02:10

@herdir @au78de, shouldn’t it be <style>
.red-text {
color: red;
}
</style>

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

Michael Cheung
@m6cheung
Nov 09 2015 02:10
@frogmorton hey if it works and you can use it go fo it
for*
cnkramer
@cnkramer
Nov 09 2015 02:11
I've got the first part "Your img element should have the class smaller-image."
It's telling me my image is not 100 px wide
Michael Cheung
@m6cheung
Nov 09 2015 02:11
it'll make your app less boring since there's less chance of running into the same quote over and over again
Craig Morrison
@frogmorton
Nov 09 2015 02:11
Ok, and in the css, did you set the width for that class?
Michael Cheung
@m6cheung
Nov 09 2015 02:11
?
Craig Morrison
@frogmorton
Nov 09 2015 02:12
@m6cheung sorry, I was talking to @cnkramer there
agreed about less boring. I also thought I'd learn more to use the api approach,
cnkramer
@cnkramer
Nov 09 2015 02:13
i think so...i did it like the example
Michael Cheung
@m6cheung
Nov 09 2015 02:13
@frogmorton sounds great
Craig Morrison
@frogmorton
Nov 09 2015 02:13
the problem is, I "signed up" for quotes daddy, but I can't find where to get a developer api user name and key
cnkramer
@cnkramer
Nov 09 2015 02:13

.smaller-image {

width: 100px;

}

Craig Morrison
@frogmorton
Nov 09 2015 02:13
what does the HTML look like, @cnkramer
Michael Cheung
@m6cheung
Nov 09 2015 02:14
@frogmorton you probably have to send them an email and tell them why you want ot use their api
cnkramer
@cnkramer
Nov 09 2015 02:14
<img class="smaller-image">
DJ
@qualitymanifest
Nov 09 2015 02:15
@cnkramer kind of random but... is your browser zoomed or shrunk?
Craig Morrison
@frogmorton
Nov 09 2015 02:15
i couldn't even find a contact / email button on their site!
DJ
@qualitymanifest
Nov 09 2015 02:15
oh wait
@cnkramer you don't have a src attribute for your img?
Michael Cheung
@m6cheung
Nov 09 2015 02:15
@frogmorton haha disorganized design at it's finest
Craig Morrison
@frogmorton
Nov 09 2015 02:15
exactly
cnkramer
@cnkramer
Nov 09 2015 02:15
<img src="https://bit.ly/fcc-relaxing-cat">
DJ
@qualitymanifest
Nov 09 2015 02:16
@cnkramer put the class smaller image alongside your src in that. you don't want 2 image tags
cnkramer
@cnkramer
Nov 09 2015 02:16
it could be the browser...i keep adjusting, but no fix
DJ
@qualitymanifest
Nov 09 2015 02:16
<img class="something" src="something">
cnkramer
@cnkramer
Nov 09 2015 02:16
ahhh!!
thank you!
CamperBot
@camperbot
Nov 09 2015 02:16
if you want to thank someone, put an @ before their name!
cnkramer
@cnkramer
Nov 09 2015 02:17
I'll let you know how that goes!
Alexander Køpke
@alexanderkopke
Nov 09 2015 02:17
Anyone else had problems with: Waypoint: Make Dead Links using the Hash Symbol
Craig Morrison
@frogmorton
Nov 09 2015 02:17
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">
DJ
@qualitymanifest
Nov 09 2015 02:18
@alexanderkopke post your code
cnkramer
@cnkramer
Nov 09 2015 02:18
@frogmorton @camperbot thanks! you rock!
CamperBot
@camperbot
Nov 09 2015 02:18
cnkramer sends brownie points to @frogmorton and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 525 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 310 | @frogmorton | http://www.freecodecamp.com/frogmorton
Alexander Køpke
@alexanderkopke
Nov 09 2015 02:18
<p>Click here for <a href="#">cat photos</a>.</p>
Craig Morrison
@frogmorton
Nov 09 2015 02:18
@alexanderkopke no quotes
DJ
@qualitymanifest
Nov 09 2015 02:19
camperbot stealin' my brownies
Craig Morrison
@frogmorton
Nov 09 2015 02:19
just the hash symbol after the equals
DJ
@qualitymanifest
Nov 09 2015 02:19
yes quotes
Alexander Køpke
@alexanderkopke
Nov 09 2015 02:19
makes no difference..
DJ
@qualitymanifest
Nov 09 2015 02:19
maybe it can be done without quotes... i wouldn't know. but i have always seen dead links done inside quotes
@alexanderkopke can you post a screenshot? its pretty easy you just drag the image into the chat
Alexander Køpke
@alexanderkopke
Nov 09 2015 02:20
ok I'll try
2015-11-09.png
Craig Morrison
@frogmorton
Nov 09 2015 02:22
actually, it should work with quotes... I stand corrected
DJ
@qualitymanifest
Nov 09 2015 02:24
@alexanderkopke that should work if you put the quotation marks back... maybe try another browser?
correction. i guess you can skip the quotation marks also @frogmorton
so either way works
Alexander Køpke
@alexanderkopke
Nov 09 2015 02:25
ok I'll try clearing the cookies and then try other browser.. Thanks for help so far :)
CamperBot
@camperbot
Nov 09 2015 02:25
if you want to thank someone, put an @ before their name!
Craig Morrison
@frogmorton
Nov 09 2015 02:26
maybe clear browser cache?
Alexander Køpke
@alexanderkopke
Nov 09 2015 02:28
yeah clearing the cache worked. Thanks for the help guys!
CamperBot
@camperbot
Nov 09 2015 02:28
if you want to thank someone, put an @ before their name!
Craig Morrison
@frogmorton
Nov 09 2015 02:28
np
tonytatom
@tonytatom
Nov 09 2015 02:45
hello all, I am having a problem on the lesson "Make Instances of Objects with a Constructor Function"
I am trying to add a property to var myCar = new Car()
i seem to have hit a roadblock...any suggestions?
h4r1m4u
@h4r1m4u
Nov 09 2015 02:48
@tonytatom adding properties to object follows this format: objectName.propertyName = propertyValue;
now you just need to plug in your actual values
Craig Morrison
@frogmorton
Nov 09 2015 02:49
tonytatom
@tonytatom
Nov 09 2015 02:49
ha!
@h4r1m4u got it!
h4r1m4u
@h4r1m4u
Nov 09 2015 02:49
great
Craig Morrison
@frogmorton
Nov 09 2015 02:49
oh, i see you sorted it
tonytatom
@tonytatom
Nov 09 2015 02:50
@frogmorton yes...i was using the wrong objectname
@h4r1m4u thank you!
CamperBot
@camperbot
Nov 09 2015 02:50
tonytatom sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 581 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Maik3ru
@Maik3ru
Nov 09 2015 03:18

var myMin = 15;

var myMax = 47;

function myFunction() {

return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;

}
Could someone please explain what the + 1 & + myMin does?

Emmanuel-Asuzu
@Emmanuel-Asuzu
Nov 09 2015 03:24
modify the data stored at index 0 of myArray to the value of 3.

var ourArray = [1,2,3];

ourArray1 = 3; // ourArray now equals [1,3,3].

var myArray = [1,2,3];

// Only change code below this line.
var myArray = [4,5,6];
myArray[2] = 6;

I can't seem to figure it out
Suraj Ghimire
@ghishadow
Nov 09 2015 03:25
ourArray1 in second line not ourArray1
oops
Awa
@au78de
Nov 09 2015 03:27
@herdir fixed it!
Ademola Adegbuyi
@ooade
Nov 09 2015 03:28
@Maik3ru myMin is the least value you want the random function to generate
@Emmanuel-Asuzu arr[index]=value;
Maik3ru
@Maik3ru
Nov 09 2015 03:31
@marhyorh Right I understand that, but what does adding the + myMin at the end do?
Alexander Køpke
@alexanderkopke
Nov 09 2015 03:32
@Maik3ru it adds 15 to the result so the result is at least 15
Kevin Dessely
@kevindessely
Nov 09 2015 03:33

@Maik3ru
(myMax - MyMin + 1) is setting the max number which you can possibly get from the random number u want to generate
while + myMin is the starting number

e.g below

// Say you want to generate a dice 1(myMin) - 6(myMax)
// Case 1
Math.floor( Math.random() * (6 - 1 + 1)       + 1 );
Math.floor(         0.56               * (      6      )        + 1);
Math.floor(                    1.56                                 + 1);
Math.floor( 2.56); // Results to 3

// Case 2 - this is where ur +myMin comes to work if random gives 0
Math.floor( Math.random() * (6 - 1 + 1)       + 1 );
Math.floor(         0.0              * (      6      )        + 1);
Math.floor(                  0.0                                 + 1);
Math.floor( 1); // Results to 1
Ademola Adegbuyi
@ooade
Nov 09 2015 03:33
@Emmanuel-Asuzu What you have there is wrong you shouldn't re-initialize myArray and your myArray[2]=6; sets the array at index 2 to 6
Kevin Dessely
@kevindessely
Nov 09 2015 03:33
sorry for the misalignment
Maik3ru
@Maik3ru
Nov 09 2015 03:33
@alexanderkopke Ohhh... Alright that makes more sense now. Thanks
CamperBot
@camperbot
Nov 09 2015 03:33
maik3ru sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 42 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 09 2015 03:34
np
Maik3ru
@Maik3ru
Nov 09 2015 03:35
@ouphana Thanks that helps
CamperBot
@camperbot
Nov 09 2015 03:35
maik3ru sends brownie points to @ouphana :sparkles: :thumbsup: :sparkles:
:star: 160 | @ouphana | http://www.freecodecamp.com/ouphana
Rex Schrader
@SaintPeter
Nov 09 2015 03:35

Known Issue: Submission of Ziplines and Basejumps is down at this time.

A patch has been written and we're just waiting to get it merged and pushed live.
Sabe Barker
@SabeBarker
Nov 09 2015 04:20
seems its all sorted now
Rex Schrader
@SaintPeter
Nov 09 2015 04:21

Zipline and Basejump Submission should be Live Again

sagar
@sagarbhaila
Nov 09 2015 04:44
i am stuck in Set the value of your placeholder attribute to "cat photo URL".
Otunba slim
@otunbaslim
Nov 09 2015 05:05
hey all. how do you delete all trailing comment tags
scoobysneck
@scoobysneck
Nov 09 2015 05:09
I'm stuck at "turn an image into a link" I understand that its a simple process, but the intructions are unclear and confusing here
Hans van Riet
@hansinla
Nov 09 2015 05:12

@scoobysneck Basically what you do is this:

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

Follow the instrcutions to see what your href must link to.

Hans van Riet
@hansinla
Nov 09 2015 05:18
@sagarbhaila What waypoint is this?
Ademola Adegbuyi
@ooade
Nov 09 2015 05:24
@sagarbhaila Heres a sample <input type="text" placeholder="Insert placeholder here">
Steven Parker
@Philosophist
Nov 09 2015 05:32
http://codepen.io/Philosophist/pen/GpGqXN
Hey, can I get some help in understanding what I'm doing wrong with getting jQuery to work on my codepen? I tried the basic thing of making all paragraphs disappear, but it didn't work.
DJ
@qualitymanifest
Nov 09 2015 05:34
@Philosophist why are you putting your jquery up in your html? it would be better to put it down in the JS
Herman Fassett
@HermanFassett
Nov 09 2015 05:35
Yeah if you put it in js it works
Adam Liechty
@liechty
Nov 09 2015 05:40
h2 {
font-family: Lobster, Monoscape;
}
is this the correct way to degrade fonts?
Your h2 element should degrade to the font Monospace when Lobster is not available.
Herman Fassett
@HermanFassett
Nov 09 2015 05:41
Something like that
Adam Liechty
@liechty
Nov 09 2015 05:42
it's not letting me check it off
typo...
DJ
@qualitymanifest
Nov 09 2015 05:42
@liechty you have monoscape not monospace
Herman Fassett
@HermanFassett
Nov 09 2015 05:42
lol
Adam Liechty
@liechty
Nov 09 2015 05:42
yea just caught iy
Herman Fassett
@HermanFassett
Nov 09 2015 05:42
;P
Adam Liechty
@liechty
Nov 09 2015 05:42
thank you
CamperBot
@camperbot
Nov 09 2015 05:42
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Nov 09 2015 05:43
Ademola Adegbuyi
@ooade
Nov 09 2015 05:46
@Philosophist keep it in the js file and your $("btn") is wrong. it should be $("button") and get used to classes, its way better than selecting the element itself
Bryan Hatton
@bryan-hatton
Nov 09 2015 05:54

I want to associate two jquery objects so I can look them up easily later, but when I try something like this:

var Assoc = {};
$('ul').children('li').each(function() {
     var id = $(this).attr(id);
     var key = $('div').filter(id);
     Assoc[key] = this;
});

My keys and values collapse into each other.

console.log(Assoc); // Object { object Object : Object }

Why is this happening?

Steven Parker
@Philosophist
Nov 09 2015 06:01
@qualitymanifest Thanks. That did the trick. I only know what I learned on this site and tried to figure out from the jQuery website. I have no idea what the difference is in terms of which tab the jQuery goes in. First it's at the top of the HTML, then it was suggested to go at the bottom of the HTML. You're the first time anyone suggested that I put it in JS. I recognize that I am confused...
CamperBot
@camperbot
Nov 09 2015 06:01
philosophist sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 360 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Steven Parker
@Philosophist
Nov 09 2015 06:03
@marhyorh Thanks. I thought btn was a bootstrap class. That's what I was aiming for since I didn't use <button>. I used a <div> instead. Should I just make an id?
Ademola Adegbuyi
@ooade
Nov 09 2015 06:06
@Philosophist yeah, you should
DJ
@qualitymanifest
Nov 09 2015 06:07
@Philosophist on FCC waypoints they have you use <script> tags to add javascript to your HTML, just to see how it works. but in general you will put it in a seperate .js file. or on codepen, in the JS tab, which is where you have loaded your jQuery
Steven Parker
@Philosophist
Nov 09 2015 06:08
@marhyorh Much better!
@qualitymanifest Ok, I can do that.
Jeremy Roe
@jeremyroe
Nov 09 2015 06:09
Anyone on that can give my Pomodoro a review before I submit? http://codepen.io/jeremyroe/full/dYKdve/
Steven Parker
@Philosophist
Nov 09 2015 06:11
@marhyorh Thanks again. Not sure why @camperbot didn't give you points the first time.
CamperBot
@camperbot
Nov 09 2015 06:11
philosophist sends brownie points to @marhyorh and @camperbot :sparkles: :thumbsup: :sparkles:
:star: 526 | @camperbot | http://www.freecodecamp.com/camperbot
:star: 321 | @marhyorh | http://www.freecodecamp.com/marhyorh
Steven Parker
@Philosophist
Nov 09 2015 06:11
lol... That greedy little....
bruglesco
@bruglesco
Nov 09 2015 06:12
cbot he wasnt thanking you
CamperBot
@camperbot
Nov 09 2015 06:12
you called?
Ademola Adegbuyi
@ooade
Nov 09 2015 06:13
LOL
DJ
@qualitymanifest
Nov 09 2015 06:16
@jeremyroe looks good
Jeremy Roe
@jeremyroe
Nov 09 2015 06:16
Thanks for looking it over @qualitymanifest
CamperBot
@camperbot
Nov 09 2015 06:16
jeremyroe sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 361 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Ademola Adegbuyi
@ooade
Nov 09 2015 06:16
@jeremyroe your Pomodoro is awesome but it looks like the one given by FCC
Jeremy Roe
@jeremyroe
Nov 09 2015 06:17
Yeah I tried to copy the project as much as I could - I could have varied the UI but I liked it - was I not supposed to?
DJ
@qualitymanifest
Nov 09 2015 06:18
@jeremyroe i have a couple very minor criticisms for you - it seems like restarting the timer after pausing takes 2 seconds, and it would be good to be able to change the break time on pause without resetting the session time
@jeremyroe either way you've surpassed the requirements, so don't worry about it unless you want to be a perfectionist
Jeremy Roe
@jeremyroe
Nov 09 2015 06:19
Ah Yes - That hadn’t occurred to me - Thanks for catching those @qualitymanifest
CamperBot
@camperbot
Nov 09 2015 06:19
jeremyroe sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: jeremyroe already gave qualitymanifest points
Jeremy Roe
@jeremyroe
Nov 09 2015 06:20
I have a resizing issue as small resolutions also it appears - Gonna table these for morning - Appreciate the help
Elliott McNary
@bighitbiker3
Nov 09 2015 06:56
Hey guys...I can't seem to get my clock to show 0:00 before it switches over to break time...any thoughts? http://codepen.io/bighitbiker3/pen/xwyEOm?editors=101
Starkiller12
@Starkiller12
Nov 09 2015 06:58
Hi. How does pairing work? Me and another guy are having problems pairing. Can anybody help us with this?
Rex Schrader
@SaintPeter
Nov 09 2015 07:00
@Starkiller12 You both need to have software like ScreenHero or TeamViewer installed. Then you just connect.
@Starkiller12 One person hosts the session, but you should both be able to type.
Kevin H.
@kbolt
Nov 09 2015 07:05
this is kicking my butt
Rex Schrader
@SaintPeter
Nov 09 2015 07:07

@bighitbiker3 Here is the problem:

if (sStr == 0 && mStr == 0) {
        clearInterval(startTimer)
        mStr = brkMin;
        sStr = brkSec;
      }

In the same tick that you detect that your numbers are at 0 and 0, you also set them to the break time. You never actually display 0 and 0. I suggest you change it to detect sStr == -1, assuming that won't make any other code explode. Then it will at least display 0:0 before it updates to the break time.

Elliott McNary
@bighitbiker3
Nov 09 2015 07:09
@SaintPeter yea that's making it explode
just goes all the way to NaN
Rex Schrader
@SaintPeter
Nov 09 2015 07:10
@bighitbiker3 So . . I guess that won't work. But do you understand the problem now?
Elliott McNary
@bighitbiker3
Nov 09 2015 07:11
@SaintPeter I do now thank you...now just need to figure out how to make it work :)
CamperBot
@camperbot
Nov 09 2015 07:11
bighitbiker3 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1472 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Nov 09 2015 07:11
@bighitbiker3 I'll leave the tricky bits to you then ;) Cheers!
Kevin H.
@kbolt
Nov 09 2015 07:42
I'm having trouble with the palindrome problem. I've remove all the punctuation and when i compare the strings they read exactly the same but some that are still reading as false and vice versa
Markus Kiili
@Masd925
Nov 09 2015 07:43
@wolfboyprime Could you post the code.
Kevin H.
@kbolt
Nov 09 2015 07:44
wait
Oleg de Leon
@eightmethods
Nov 09 2015 07:45

Hi guys, I'm stuck in the .map() exercise. Not sure why
'var array = newArray.map(function(val){
return val + 3;
});'

doesn't work. Am I missing something here?

Markus Kiili
@Masd925
Nov 09 2015 07:46
@wolfboyprime Maybe there was a lowercase problem there?
Kevin H.
@kbolt
Nov 09 2015 07:46
I fixed all of that
Markus Kiili
@Masd925
Nov 09 2015 07:46
@wolfboyprime lowercase the left side too.
I ran the code with printing and it showed all in lowercase, no punctuation
Markus Kiili
@Masd925
Nov 09 2015 07:48
@wolfboyprime but the original string on the left side can contain uppercase.
Kevin H.
@kbolt
Nov 09 2015 07:48
Ok, but what about "race car"? that was already lowercase
"You'll need to remove punctuation and turn everything lower case in order to check for palindromes."
h4r1m4u
@h4r1m4u
Nov 09 2015 07:49
@eightmethods you're saving the output of the map() into var array. but the waypoint tester function expects it in newArray: (function() {return newArray;})();
Markus Kiili
@Masd925
Nov 09 2015 07:50
@wolfboyprime doesn't matter on that case but if there are uppercase letters your code doesn't work. You can first replace and lowercase. Then do the reverse and comparing.
Jason
@Jauble
Nov 09 2015 07:51
Anyone know if there's a way to get the value of a property of an object? like property.value()
h4r1m4u
@h4r1m4u
Nov 09 2015 07:53
@Jauble just objectName.propertyName
that's all
e.g.var how_many_legs = myDog.legs; // myDog is an object with property legs
Markus Kiili
@Masd925
Nov 09 2015 07:53
@wolfboyprime I mean first do str = str+replace+lowercase and then return str===str+reverse
Kevin H.
@kbolt
Nov 09 2015 07:55
Hmm, yeah. it now reads correctly for everything accept the final one.
Jason
@Jauble
Nov 09 2015 07:57
@h4r1m4u I'm trying to make this work:
function where(collection, source) {
  var arr = [];
  var prop = Object.keys(source);

  for (var i = 0; i < collection.length; i++) {
      for (var key in collection[i]) {
          if (key === prop[0]) {
              if (key.value() === prop[0].value()) {
                  arr.push(collection[i]);
              }
          }
      }
  }
  console.log(arr);
  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Oleg de Leon
@eightmethods
Nov 09 2015 07:59
@h4r1m4u ah shit that makes sense. thank you!
CamperBot
@camperbot
Nov 09 2015 07:59
eightmethods sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 582 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Kevin H.
@kbolt
Nov 09 2015 08:00
This last one is not reading true. Do i need to break the code down further?
Markus Kiili
@Masd925
Nov 09 2015 08:00
@wolfboyprime post it again.
Kevin H.
@kbolt
Nov 09 2015 08:01
How do properly post code in here?
Jason
@Jauble
Nov 09 2015 08:01
wiki format
CamperBot
@camperbot
Nov 09 2015 08:01

:point_right: code format [wiki]

Inline code

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

How to Code

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

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

Jason
@Jauble
Nov 09 2015 08:01
@wolfboyprime
jaychy
@jaychy
Nov 09 2015 08:02
how to solve this: $(...).css(...) is undefined
Jason
@Jauble
Nov 09 2015 08:03
@jaychy what are you trying to do?
h4r1m4u
@h4r1m4u
Nov 09 2015 08:03
@Jauble so you're having problems with this line: if (key.value() === prop[0].value()) { am i correct?
Jason
@Jauble
Nov 09 2015 08:04
@h4r1m4u I'm not sure what I can put there. I tried if (collection[i].key === source[0].prop) {
jaychy
@jaychy
Nov 09 2015 08:05
@Jauble im trying to use font lobster in h2 element
Kevin H.
@kbolt
Nov 09 2015 08:06
ll
h4r1m4u
@h4r1m4u
Nov 09 2015 08:06
@Jauble collection[i].key looks correct to me. source[0].prop does not. source is not an array, it's an object. source.prop should be enough
Kevin H.
@kbolt
Nov 09 2015 08:06
ok that's annoying
Jerome Ricks
@jeromericks
Nov 09 2015 08:06
@jaychy do you have the link to google fonts?
Ende93
@Ende93
Nov 09 2015 08:07
@jaychy the jquery selector correct ?
Jason
@Jauble
Nov 09 2015 08:08
@h4r1m4u Ok I see that now thanks
CamperBot
@camperbot
Nov 09 2015 08:08
jauble sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 583 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
jaychy
@jaychy
Nov 09 2015 08:08

@jeromericks yes, used this: <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
and all i have done is this : <link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<style>
.fonts{
font-family: Lobster;
}
</style>

<h2 class="fonts">
Second Heading
</h2>

h4r1m4u
@h4r1m4u
Nov 09 2015 08:09
@Jauble actually, the prop is an array. so source.prop won't work. but something like source.prop[0] should. basically you need to get the key name from the prop array and then query the source object with it (source.propElement).
Markus Kiili
@Masd925
Nov 09 2015 08:09
@wolfboyprime Must be replace (regex) problem if it doesn't pass a test. Otherwise it is ok.
Kevin H.
@kbolt
Nov 09 2015 08:09
so I'm not mental then?
Jerome Ricks
@jeromericks
Nov 09 2015 08:10
@jaychy what does your jquery say?
Markus Kiili
@Masd925
Nov 09 2015 08:10
@wolfboyprime last test fails?
Kevin H.
@kbolt
Nov 09 2015 08:11
yes @Masd925
The one that is just all symbols
and digits
jaychy
@jaychy
Nov 09 2015 08:12
@jeromericks i m solving challenges of freecodecamp.com and the only error it shows is : $(..).css(...) undefined
Jerome Ricks
@jeromericks
Nov 09 2015 08:13
do you have anything in the parthesis
@jaychy do you have anything in the parenthesis?
Jason
@Jauble
Nov 09 2015 08:14
@h4r1m4u Ya, that makes sense. It's still not pushing anything to arr though :/
h4r1m4u
@h4r1m4u
Nov 09 2015 08:15
@Jauble i didn't check the code logic. you might have some issue there, so you might need to have a look at that. but that's how you get the property values
@jaychy which waypoint are on ?
jaychy
@jaychy
Nov 09 2015 08:16
@jeromericks nothing in the parenthesis
@h4r1m4u Waypoint: Import a google font
Kevin H.
@kbolt
Nov 09 2015 08:17
FINALLY, got it
I had to replace all symbols and make it blank
thanks @Masd925
CamperBot
@camperbot
Nov 09 2015 08:18
wolfboyprime sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 268 | @masd925 | http://www.freecodecamp.com/masd925
Markus Kiili
@Masd925
Nov 09 2015 08:18
@wolfboyprime You're wellcome.
h4r1m4u
@h4r1m4u
Nov 09 2015 08:20
@jaychy sometimes the waypoints break. try to reset the code, reload the page, and then do the exercise again. if that doesn't work, try clearing your cache or a different browser
it should pass
jaychy
@jaychy
Nov 09 2015 08:21
@h4r1m4u ok , im trying
h4r1m4u
@h4r1m4u
Nov 09 2015 08:21
@jaychy cool. let me know if it works. if not, please post your entire code here, so that i can check if there's some other issue with it
Emil Aasa
@emilaasa
Nov 09 2015 08:23
Hey guys! I’m looking for some help with “architecture” choices for a small project im doing. I’m going to do a site that will serve as material for repetition before an exam in Discrete Math.
Its main function should be to display exam questions, hide their answer, have a small input field where you can input your answer and then just remember each users completed questions. Oh and also the ability to show answer and explanation etc.
Jason
@Jauble
Nov 09 2015 08:23
@h4r1m4u Apparently you can't use a variable as a property
I dunno how I'm gonna get around that
h4r1m4u
@h4r1m4u
Nov 09 2015 08:23
@Jauble ?
Emil Aasa
@emilaasa
Nov 09 2015 08:24
So far I’ve gotten the theorems etc to render nicely with Mathjax, I’ve got the raw materials for the questions and answers etc.. but Im kinda wonder how fancy I need to get with the structure of the project to make it work as I wnt it.
Jason
@Jauble
Nov 09 2015 08:24
prop = "last" source.prop doesn't work, but source.last does
Emil Aasa
@emilaasa
Nov 09 2015 08:24
Seems like just using vanilla js or jQ is enough to do the hiding of answer divs and input checking etc..
h4r1m4u
@h4r1m4u
Nov 09 2015 08:25
@Jauble prop is an array, so yeah, source.prop wouldn't work
@Jauble it would have to be something like source.prop[0] or possibly source[prop][0]
Jason
@Jauble
Nov 09 2015 08:25
It was, but I changed it: prop = prop[0]
h4r1m4u
@h4r1m4u
Nov 09 2015 08:26
if you did prop = prop[0], source.prop should work
Jason
@Jauble
Nov 09 2015 08:27
That's what I thought, but it's not working. At least not on jsfiddle
h4r1m4u
@h4r1m4u
Nov 09 2015 08:27
can you post the code?
jaychy
@jaychy
Nov 09 2015 08:27
@h4r1m4u it worked, after i reset the code there appeared 1 different objective.. thanx
CamperBot
@camperbot
Nov 09 2015 08:27
jaychy sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 584 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 08:27
@jaychy great!
Jason
@Jauble
Nov 09 2015 08:28
function where(collection, source) {
  var arr = [];
  var prop = Object.keys(source);
  prop = prop[0];
  for (var i = 0; i < collection.length; i++) {
      for (var key in collection[i]) {
          if (key === prop[0]) {
              if (collection[i].key === source.prop[0]) {
                  arr.push(collection[i]);
              }
          }
      }
  }
  console.log(arr);
  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
oops I changed it back to prop[0] to try it again
h4r1m4u
@h4r1m4u
Nov 09 2015 08:30
can you update the code above to what you're using?
Jason
@Jauble
Nov 09 2015 08:31
collection.key doesn't work either. It gives undefined
@h4r1m4u i just changed source.prop[0] to source.prop
h4r1m4u
@h4r1m4u
Nov 09 2015 08:32
instead of source.prop, do this source[prop]
Jason
@Jauble
Nov 09 2015 08:32
collection[i].key*
h4r1m4u
@h4r1m4u
Nov 09 2015 08:33
```
function where(collection, source) {
  var arr = [];
  var prop = Object.keys(source);
  prop = prop[0];
  for (var i = 0; i < collection.length; i++) {
      for (var key in collection[i]) {
          if (key === prop) {
              if (collection[i].key === source[prop]) {
                  arr.push(collection[i]);
              }
          }
      }
  }
  console.log(arr);
  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
again, i'm not checking the code logic right now. just making sure that you can get the values as you're intending to
Ademola Adegbuyi
@ooade
Nov 09 2015 08:33
@Jauble since you know the property you are looking for, there's no need for the prop variable
h4r1m4u
@h4r1m4u
Nov 09 2015 08:34
@marhyorh he will not know what the property is, the input to the where() function can differ. he can't hardcode it
source can be both {last: "Capulet"} and { "a": 1, "b": 2, "c": 2 }
Jason
@Jauble
Nov 09 2015 08:35
@h4r1m4u That works thanks
CamperBot
@camperbot
Nov 09 2015 08:35
jauble sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Nov 09 2015 08:35
@Jauble great
Ademola Adegbuyi
@ooade
Nov 09 2015 08:38
@h4r1m4u just saying since that bonfire only require the last property
h4r1m4u
@h4r1m4u
Nov 09 2015 08:38
@marhyorh that's not correct.
the source argument can contain multiple properties
and not only last
check what input the bonfire tests to pass:
where([{ "a": 1 }, { "a": 1 }, { "a": 1, "b": 2 }], { "a": 1 }) should return [{ "a": 1 }, { "a": 1 }, { "a": 1, "b": 2 }].
where([{ "a": 1, "b": 2 }, { "a": 1 }, { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 }) should return [{ "a": 1, "b": 2 }, { "a": 1, "b": 2, "c": 2 }].
no last there
Ademola Adegbuyi
@ooade
Nov 09 2015 08:41
@h4r1m4u Oh, didnt know it changed, dats better
Fox Bachin
@foxbachin
Nov 09 2015 08:43
Hi.. Shiny here.. I just want to know for the apps lens (effects), does it comes with free or pricy? I'm working on photo app at the moment..
ztaheri
@ztaheri
Nov 09 2015 08:44
Hello all :) just working on array loops and need to make one that will only show odd numbers - what I have so far is this: for(var i=1; <10; i++){ myArray.push(i);}
Ademola Adegbuyi
@ooade
Nov 09 2015 08:44
@ztaheri nah, that wont work
h4r1m4u
@h4r1m4u
Nov 09 2015 08:44
@ztaheri could you tell me what does i++ do ?
ztaheri
@ztaheri
Nov 09 2015 08:45
haha not sure, the example I had to learn from was for even numbers and it had i+=2, when I googled odd number loops they showed i++
h4r1m4u
@h4r1m4u
Nov 09 2015 08:46
you should probably google it then. it increases the value of i by 1 on each loop pass
Fox Bachin
@foxbachin
Nov 09 2015 08:46
Hello?
h4r1m4u
@h4r1m4u
Nov 09 2015 08:46
so your loop starts at i = 1. on the next pass i = 2, on the next i = 3, etc. do you see the issue?
@foxbachin what does your question have to do with FCC?
ztaheri
@ztaheri
Nov 09 2015 08:47
yes, so how do I tell it only want the numbers not divisible by 2?
h4r1m4u
@h4r1m4u
Nov 09 2015 08:48
@ztaheri think about it. how do you need to increase the value of i on each pass, so that it's only odd number?
ztaheri
@ztaheri
Nov 09 2015 08:49
add 2 starting from 1?
h4r1m4u
@h4r1m4u
Nov 09 2015 08:49
bingo
ztaheri
@ztaheri
Nov 09 2015 08:49
haha thanks, I was over thinking things
CamperBot
@camperbot
Nov 09 2015 08:50
if you want to thank someone, put an @ before their name!
ztaheri
@ztaheri
Nov 09 2015 08:50
@h4r1m4u thank you :)
h4r1m4u
@h4r1m4u
Nov 09 2015 08:50
you also have an issue with the middle argument of the for loop. you're missing the i variable in the comparison expression: for(var i=1; <10; .... it should be for(var i=1; i < 10; ...
you're welcome
Aaron
@asauce99
Nov 09 2015 08:51
Having trouble in the [Reverse arrays with reverse waypoint] (http://www.freecodecamp.com/challenges/waypoint-reverse-arrays-with-reverse) Can anyone help me understand why this code is actually reversing the array, but is not letting me pass?
var array = [1,2,3,4,5,6,7];

// Only change code below this line.

array.reverse(function(){

});

// Only change code above this line.

(function() {return array;})();
h4r1m4u
@h4r1m4u
Nov 09 2015 08:52
@asauce99 .reverse() doesn't take any arguments. get rid of the callback function inside
Aaron
@asauce99
Nov 09 2015 08:52
Ok, so are you saying it should look like this?
array.reverse();
h4r1m4u
@h4r1m4u
Nov 09 2015 08:53
that's right!
Aaron
@asauce99
Nov 09 2015 08:53
Let me give it a shot
Oh my goodness! I thought I had tried that already. I probably forgot the semi-colon. I second guess myself so much. Usually my first guess is right.
h4r1m4u
@h4r1m4u
Nov 09 2015 08:55
:)
Aaron
@asauce99
Nov 09 2015 08:55
That worked. Thanks @h4r1m4u
CamperBot
@camperbot
Nov 09 2015 08:55
asauce99 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 585 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 08:55
you bet. when in doubt, it's always a good idea to check the documentation: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse
Aaron
@asauce99
Nov 09 2015 08:56
Wow, I didn't even know that existed. Thanks for the link!
CamperBot
@camperbot
Nov 09 2015 08:56
if you want to thank someone, put an @ before their name!
Aaron
@asauce99
Nov 09 2015 08:58
Thanks for the link @h4r1m4u ....forgot to put your name in there
CamperBot
@camperbot
Nov 09 2015 08:58
asauce99 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: asauce99 already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Nov 09 2015 08:58
my pleasure!
@asauce99 usually FCC provides the links to the documentation in the sidebar when they explain some new functions or concepts. i'm not sure why this waypoint doesn't do that
Oleg Cherkasky
@gunrunners-paradise
Nov 09 2015 09:04
Hey, can I get some advice on the Tic Tac Toe Zipline?
I want to make a simple AI for it, nothing too fancy.
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:16

check this palindrome function it's not returning true for the following:
palindrome("never odd or even")

function palindrome(str) {
str = str.replace(' ','');
str = str.replace(',','');
str = str.replace('.','');

str = str.toLowerCase();
rstr = str.split('').reverse('').join('');
if( str == rstr )
{
return true;
}
else{
return false;
}
}

I'm not able to find the glitch ... can anyone please help me
m-akmal
@m-akmal
Nov 09 2015 09:18
if(str===rstr)
Dustin Frank
@DustInCompetent
Nov 09 2015 09:18
function palindrome(str) {
  str = str.replace(' ','');
  str = str.replace(',','');
  str = str.replace('.','');

  str = str.toLowerCase();
  rstr = str.split('').reverse('').join('');
  if( str == rstr ) {
    return true;
  } else {
    return false;
  }
}

palindrome("never odd or even")
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:19
@m-akmal : that will include type checking, but how it will help.
Dustin Frank
@DustInCompetent
Nov 09 2015 09:19
string.reverse() doesn't take arguments
Ademola Adegbuyi
@ooade
Nov 09 2015 09:19
@gunrunners-paradise What i did was to make computer to start the game
/** First Test **/
if position 4 is blank placeIn 4
else if position 4 taken placeIn 0 
else placeIn 2 //Will not probably be used
Dustin Frank
@DustInCompetent
Nov 09 2015 09:20
What programming language is that?
h4r1m4u
@h4r1m4u
Nov 09 2015 09:21
@shyamaprasad you'll want to use regex when doing the replacements. without regex, str.replace(' ', '') will replace only the first occurrence of the character. so after all your modifications, your str looks like this: neverodd or even.
Dustin Frank
@DustInCompetent
Nov 09 2015 09:22
@h4r1m4u was about to write that ^^
h4r1m4u
@h4r1m4u
Nov 09 2015 09:22
;)
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:22
@h4r1m4u : ya, I got it ...
can you suggest me any link where I can start learning regex from basic.
Dustin Frank
@DustInCompetent
Nov 09 2015 09:22
Yeah, hold on
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:23
great! thanks.
CamperBot
@camperbot
Nov 09 2015 09:23
if you want to thank someone, put an @ before their name!
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:23
@h4r1m4u : Thanks
CamperBot
@camperbot
Nov 09 2015 09:23
shyamaprasad sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 586 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 09:23
@shyamaprasad what @DustInCompetent said above reverse() not taking arguments is also true
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:24
This message was deleted
h4r1m4u
@h4r1m4u
Nov 09 2015 09:24
you'll need to fix that as well
Shyamaprasad Patra
@shyamaprasad
Nov 09 2015 09:24
yah true ... but with argument also it's working fine.
Dustin Frank
@DustInCompetent
Nov 09 2015 09:25
Michael Cheung
@m6cheung
Nov 09 2015 09:25
hey guys if i want to make a div fit over everything but have a default height of 130px
Ademola Adegbuyi
@ooade
Nov 09 2015 09:25
@DustInCompetent its an algorithm
Michael Cheung
@m6cheung
Nov 09 2015 09:26
what should I do? for instance if the contents of the div exceed 130px, I want it the div to cover it 100%, but if the contents are less than 130, I want the div to be 130px in height
h4r1m4u
@h4r1m4u
Nov 09 2015 09:26
@m6cheung try min-height: 130px; instead of height: 130px;
Michael Cheung
@m6cheung
Nov 09 2015 09:28
@h4r1m4u awesome thanks
CamperBot
@camperbot
Nov 09 2015 09:28
m6cheung sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 587 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 09:29
:thumbsup:
Suraj Ghimire
@ghishadow
Nov 09 2015 10:16
explain Return Largest Numbers in Arrays
CamperBot
@camperbot
Nov 09 2015 10:16

:point_right: bonfire return largest numbers in arrays [wiki]

Explanation:

You will get an array that contains sub arrays of numbers and you need to return an array with the largest number from each of the sub arrays.

:pencil: read more about bonfire return largest numbers in arrays on the FCC Wiki

Julius
@Jukimani
Nov 09 2015 10:20
"Be sure to delete all trailing comment tags, i.e. -->." Please help
h4r1m4u
@h4r1m4u
Nov 09 2015 10:23
@Jukimani you're supposed to uncomment commented out tags. you do this by deleting the opening comment tag <!-- and the closing comment tag -->
Zakariya AbdulHameed
@Zaks0n
Nov 09 2015 10:27
hey guys, I am stuck at "Waypoint: Add Font Awesome Icons to our Buttons" I created a <p> , <h> element but they did not work. I need help ASAP.
h4r1m4u
@h4r1m4u
Nov 09 2015 10:28
post your code @Zaks0n
Zakariya AbdulHameed
@Zaks0n
Nov 09 2015 10:30
<button class="btn btn-block btn-primary">
<h class ="fa fa-thumbs-up">i</h>
like
</button>
h4r1m4u
@h4r1m4u
Nov 09 2015 10:31
the icon element is <i ...></i> not <h>
Zakariya AbdulHameed
@Zaks0n
Nov 09 2015 10:33
wow! thanks bro, I got it
CamperBot
@camperbot
Nov 09 2015 10:33
if you want to thank someone, put an @ before their name!
Zakariya AbdulHameed
@Zaks0n
Nov 09 2015 10:34
Thanks @h4r1m4u
CamperBot
@camperbot
Nov 09 2015 10:34
zaks0n sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 589 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 10:34
you're welcome
gts00k
@gts00k
Nov 09 2015 10:42
the editor freezed
:/
and it keeps on freezing
Markus Kiili
@Masd925
Nov 09 2015 10:44
@gts00k Try another browser
Rabin Shrestha
@jyapujuju
Nov 09 2015 10:48

~var myArray = [];

// Only change code below this line.
var i = 0;
while(i<5){
myArray.push(i);
}

// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}

~

help
CamperBot
@camperbot
Nov 09 2015 10:49

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

Markus Kiili
@Masd925
Nov 09 2015 10:49
wiki format
CamperBot
@camperbot
Nov 09 2015 10:49

:point_right: code format [wiki]

Inline code

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

How to Code

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

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

Rabin Shrestha
@jyapujuju
Nov 09 2015 10:50

```var myArray = [];

// Only change code below this line.
var i = 0;
while(i<5){
myArray.push(i);
}

// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
```

var myArray = [];

// Only change code below this line.
var i = 0;
while(i<5){
  myArray.push(i);
}

// Only change code above this line.

if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}
i is not defined
Markus Kiili
@Masd925
Nov 09 2015 10:52
@jyapujuju while runs forever like that.
@jyapujuju use myArray.push(i++);
Rabin Shrestha
@jyapujuju
Nov 09 2015 10:58
okay
jpjenkins
@jpjenkins
Nov 09 2015 11:01
hey folks, looking to see if there's an easier way to do this. I've done it before but I can't remember it being so ugly:
function truncate(str, num) {

  // crop and include the addition of ... to the total
  if(str.length > num + 3){ 
   return str.slice(0,(num-3)) + "..."; }

  // crop and don't include the addition of ...
  else if (str.length < 3){
    return str.slice(0,num) + "..."; }

  // If there is no difference between length and num or the difference is not greater than 3, return str.
  else if (str.length === num || (str.length + 3) > num) { 
    return str;
  }

}

truncate("A-tisket a-tasket A green and yellow basket", 11);
a push in the right direction would be nice :) thanks comrades!
CamperBot
@camperbot
Nov 09 2015 11:01
if you want to thank someone, put an @ before their name!
jpjenkins
@jpjenkins
Nov 09 2015 11:02
shhh
ah, I don't need the last else if, obviously :fire: anything else?
Julius
@Jukimani
Nov 09 2015 11:04
Hello, how do you you key in to get the "equal sign"? ctlr+?
Gleb
@GlebShaucou
Nov 09 2015 11:04
Hi, I have a misunderstanding. It gives me "word is undefined". Were is the trouble?
jpjenkins
@jpjenkins
Nov 09 2015 11:05
@Jukimani are you looking for the equals sign on your keyboard?
@HlebShautsou can you paste your code
Gleb
@GlebShaucou
Nov 09 2015 11:05
1.bmp
Michael Cheung
@m6cheung
Nov 09 2015 11:05
usually to the left of the backspace @Jukimani
jpjenkins
@jpjenkins
Nov 09 2015 11:05
explain format
CamperBot
@camperbot
Nov 09 2015 11:05

:point_right: code format [wiki]

Inline code

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

How to Code

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

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

jpjenkins
@jpjenkins
Nov 09 2015 11:06
@HlebShautsou your variable is different
'newStrArr' != strArr :)
change your array name at the top and see what happens
and l = str.length
you have to create l first too
var l = str.length
Markus Kiili
@Masd925
Nov 09 2015 11:08
@jpjenkins I did it like this.
function truncate(str, num) {
  if (str.length>num) {
    if (str.length <=3) str = str.substr(0,num);
    else str = str.substr(0,num-3);
    str += '...';
  }
  return str;
}
Ugly too.
jpjenkins
@jpjenkins
Nov 09 2015 11:09
yeah :/
nice idea though
Gleb
@GlebShaucou
Nov 09 2015 11:10
@jpjenkins didn't work(
jpjenkins
@jpjenkins
Nov 09 2015 11:10
@Masd925 you don't need to block the if else statements?
you can just have them running all in one hmmm
Ademola Adegbuyi
@ooade
Nov 09 2015 11:11
@jpjenkins his strArr n newStrArr does different thing
jpjenkins
@jpjenkins
Nov 09 2015 11:11
@HlebShautsou can you post your code mate
@marhyorh ah yeah, there's a lot of jumbling going on there
Gleb
@GlebShaucou
Nov 09 2015 11:12
@jpjenkins wait a minute
Ademola Adegbuyi
@ooade
Nov 09 2015 11:12
@HlebShautsou check your word=word.charAt(0).toUpperCase()+word.substr(1);
yeah
jpjenkins
@jpjenkins
Nov 09 2015 11:12
@HlebShautsou go over each of your variables and make sure that you have explicitly instantiated them
strArr hasn't been created either
Markus Kiili
@Masd925
Nov 09 2015 11:14
@jpjenkins I didn't understand your comment (blocking). Could you elaborate.
jpjenkins
@jpjenkins
Nov 09 2015 11:15
@HlebShautsou as @marhyorh said, you're using '+' but remember, there's a function for what you're intending to do there...
you're close, think about what you're trying to do, revolve the whole thing around that line and you'll come out on top
You don't need so many variables, after a lot of trying I managed to get this bonfire done with 1 variable and 2 lines of code.
You're already at an advantage with that 'word = ' line there...
Good luck :P
Gregory Getchell
@ggetchell
Nov 09 2015 11:19
On challenge #74 i have added the <div class="container-fluid"> and enclosed the hyperlink with </div>, but cannot figure to nest all html elements in .container-fluid. any ideas???
Gleb
@GlebShaucou
Nov 09 2015 11:19
@jpjenkins Thanks) I will try further
CamperBot
@camperbot
Nov 09 2015 11:19
hlebshautsou sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 217 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
Ademola Adegbuyi
@ooade
Nov 09 2015 11:19
@HlebShautsou and your for loop should be i < l instead of i<=l
Gleb
@GlebShaucou
Nov 09 2015 11:20
@marhyorh yeap)
jpjenkins
@jpjenkins
Nov 09 2015 11:20
@ggetchell
<p>
    <p>  this is a nested element </p>
</p>
above and below your html... the container is essentially the whole 'frame' of the block of information you have
@HlebShautsou hint: there are other ways to iterate...
jpjenkins
@jpjenkins
Nov 09 2015 11:26
@Masd925 just saw your message. What I meant was, unlike what I did for{} else{} you only have one set of curly blackets enclosing all of your ifs and else
Markus Kiili
@Masd925
Nov 09 2015 11:33
@jpjenkins ok.
jpjenkins
@jpjenkins
Nov 09 2015 11:34
I didn't know you could do that...
Julius
@Jukimani
Nov 09 2015 11:34
"Change your h2 element's style so that its text color is red." How do we go about that?
Ankit Panwar
@coderNoob
Nov 09 2015 11:36
On the bootstrap web site, what is the (#myTabs) ? It does not seem to be working for me.
$('#myTabs a').click(function (e) {
  e.preventDefault()
  $(this).tab('show')
})
h4r1m4u
@h4r1m4u
Nov 09 2015 11:38
@coderNoob it's the id of the <ul> that holds the tabs.
<ul id="myTabs" class="nav nav-tabs" role="tablist"> <!-- <=== SEE HERE? -->
      <li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab" aria-controls="home" aria-expanded="true">Home</a></li>
      <li role="presentation"><a href="#profile" role="tab" id="profile-tab" data-toggle="tab" aria-controls="profile">Profile</a></li>
      <li role="presentation" class="dropdown">
        <a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown" aria-controls="myTabDrop1-contents">Dropdown <span class="caret"></span></a>
        <ul class="dropdown-menu" aria-labelledby="myTabDrop1" id="myTabDrop1-contents">
          <li><a href="#dropdown1" role="tab" id="dropdown1-tab" data-toggle="tab" aria-controls="dropdown1">@fat</a></li>
          <li><a href="#dropdown2" role="tab" id="dropdown2-tab" data-toggle="tab" aria-controls="dropdown2">@mdo</a></li>
        </ul>
      </li>
    </ul>
Albert
@NomadRiding
Nov 09 2015 11:38
```
h4r1m4u
@h4r1m4u
Nov 09 2015 11:40
@coderNoob so you need to target your own ul with the tabs and since your html markup may be different, you'll probably need to adjust the selector in the jQuery click handler
Amardeep
@Amardeep91
Nov 09 2015 11:42
hiii ppl
jpjenkins
@jpjenkins
Nov 09 2015 11:50
hi :)
Pranay Kothapalli
@kotAPI
Nov 09 2015 11:51
man, i think converting numbers to roman is the hardest so far
i wanna stress eat more and more when i see this problem -.-
Ankit Panwar
@coderNoob
Nov 09 2015 12:03
@kotAPI Hint: use switch case
Dustin Frank
@DustInCompetent
Nov 09 2015 12:05
@kotAPI that one really was the most complicated
I had a little struggle with Steamroller and Smallest Common Multiple too but Roman Numerals was the most annoying one so far
Ankit Panwar
@coderNoob
Nov 09 2015 12:13
@h4r1m4u Still isn't working. The tabs just won't switch. The active tab remains the same.
Pranay Kothapalli
@kotAPI
Nov 09 2015 12:15
yeah i gotta
Ankit Panwar
@coderNoob
Nov 09 2015 12:19
<ul class="nav nav-pills" id="myTabs">
      <li role="presentation" class="active"><a href="#home">Home</a></li>
      <li role="presentation"><a href="#profile">Profile</a></li>
      <li role="presentation"><a href="#message">Messages</a></li>
    </ul>
$('#myTabs a').click(function(e) {
    e.preventDefault();
    $(this).tab('show');
  });
It's not working.
h4r1m4u
@h4r1m4u
Nov 09 2015 12:20
@coderNoob did you load the bootstrap.js into your project?
i believe the <a> should also have the data-toggle="tab" attribute
Ankit Panwar
@coderNoob
Nov 09 2015 12:22
@h4r1m4u Yea I did. I thought about the same thing.
h4r1m4u
@h4r1m4u
Nov 09 2015 12:23
do you have it in codepen?
Ankit Panwar
@coderNoob
Nov 09 2015 12:23
lemme try the data-toggle thing
@h4r1m4u it says that the data-toggle="tab" is when you don't wanna do it using JS. Any way, it didn't work.
http://codepen.io/coderNoob/pen/RWKbMN
Hemanta kakati
@hemanta234
Nov 09 2015 12:26
help me to solve waypoint 169. i have not fully understand the codes
CamperBot
@camperbot
Nov 09 2015 12:26
no wiki entry for: me to solve waypoint 169 i have not fully understand the codes
:pencil: click here to create one now!after creating your page type update to reload it here
h4r1m4u
@h4r1m4u
Nov 09 2015 12:27
@coderNoob where are you importing the bootstrap.js file?
Ankit Panwar
@coderNoob
Nov 09 2015 12:28
@h4r1m4u I click the settings icon and then quick add and then bootstrap.
h4r1m4u
@h4r1m4u
Nov 09 2015 12:28
bootstrap.css, yes. what about bootstrap.js?
Ankit Panwar
@coderNoob
Nov 09 2015 12:28
O_O
h4r1m4u
@h4r1m4u
Nov 09 2015 12:29
;)
gotta run now, but once you import the js file, it should sort it out
Ankit Panwar
@coderNoob
Nov 09 2015 12:30
@h4r1m4u Thanks a lot man. :D It's working now. Can't believe I wasted 1 and half hour over something this stupid.
CamperBot
@camperbot
Nov 09 2015 12:30
codernoob sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 591 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 12:31
glad to hear that. the bootstrap.js file is needed for all the fancy functionalities (outlined here: http://getbootstrap.com/javascript/)
@coderNoob
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:33
Is there anybody who can help out with classes and objects in JavaScript ?
andreivn2
@andreivn2
Nov 09 2015 12:33
Hello people
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:33
Hello, everyone
andreivn2
@andreivn2
Nov 09 2015 12:34
need some help with a jquery get() method
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:34
I am struggling with "Make Object Properties Private"
I am in the woods, totally.

var Car = function() {
// this is a private variable
var gear = 1;
// this is a private function (also known as a private method)
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
// this is a public method
this.getGear = function() {
return addStyle(this.gear);
};

};

var Bike = function() {

// Only change code below this line.

this.speed = 100;

function addUnit(value) {
return value + "KM/H";
}

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

};

// Only change code above this line.

var myCar = new Car();

var myBike = new Bike();

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

jpjenkins
@jpjenkins
Nov 09 2015 12:36
explain format
CamperBot
@camperbot
Nov 09 2015 12:36

:point_right: code format [wiki]

Inline code

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

How to Code

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

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

jpjenkins
@jpjenkins
Nov 09 2015 12:37
@AngeloRwanda hi :)
This is a tricky one simply because it isn't completely clear
The main thing you have to understand is that you're not 'creating' anything
Now, if you look at the top of the code, you'll see comments that walk you through the variables at the top
showing you what each one does
Your mission: to modify the code that's in the addUnit function so the permissions are what they ask for
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:43
@jpjenkins Hi
Okay. Let me try that out. I think I got lost a little bit after spending 24 hours away from this.
I totally can't get it right.
@jpjenkins Can you please help? :(
jpjenkins
@jpjenkins
Nov 09 2015 12:46
Sure @AngeloRwanda what are you having trouble with?
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:47
// Only change code below this line.

  this.speed = 100;

  function addUnit(value) {
    return addUnit(this.value + "KM/H");
  }

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

// Only change code above this line.
I do not understand how I can modify the code to give the expected results.
I am a newbie in this coding world
jpjenkins
@jpjenkins
Nov 09 2015 12:48
not a problem
So, did you read the top comments?
above that code you just pasted, there's a step by step explanation of how using 'this.' changes the permissions
Bill Zerega
@dedicatedfuture
Nov 09 2015 12:51
good morning
could anyone help me out with the node walkthrough a bit?
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:54
Thanks @jpjenkins
CamperBot
@camperbot
Nov 09 2015 12:54
angelorwanda sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:star: 218 | @jpjenkins | http://www.freecodecamp.com/jpjenkins
jpjenkins
@jpjenkins
Nov 09 2015 12:55
Did you manage it @AngeloRwanda ?
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 12:56
I just made it, but I honestly do not grasp the logic that well
But I appreciate your help @jpjenkins
jpjenkins
@jpjenkins
Nov 09 2015 12:57
the permissions are a little hard to understand at first, fortunately you won't need it for a while so once you have a better understanding of everything else it should become clear to you when you need it
Good luck
Mbos95
@Mbos95
Nov 09 2015 13:00
Hey guys. I've been working on a website in HTML & CSS. but after the first 10 minutes I get stuck xD I've now been trying to figure out what is wrong with my code for the last 50 minutes
You think someone can help me out ?
<!DOCTYPE html>
<html lang="nl">
    <head>
        <meta http-equiv="Content-Type" content="text/html"; charset="UTF-8">
        <link rel="stylesheet" href="styles.css">    
        <title>Laptop shop</title>
    </head>
    <body>

    <div id="banner">
    </div>

    <div class="tekstblok">
        <h1>Wij zijn altijd de goedkoopste</h1>
            <p>orem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur et volutpat augue. Integer quis metus lorem. Ut in felis convallis, scelerisque nulla a, ornare ex. Morbi neque purus, suscipit in libero eu, tempor lacinia augue. Phasellus odio metus, ullamcorper quis commodo sed, aliquam sit amet purus. Fusce massa arcu, finibus in tellus nec, pharetra scelerisque neque. Sed consectetur nunc nec nisl elementum ultricies. Nulla sagittis mauris mi, nec tempor eros tristique ut. Nam enim lacus, suscipit in molestie sit amet, blandit vitae neque. Donec dictum sem sit amet eros pretium, sit amet sagittis sapien tristique. Ut egestas, ipsum nec condimentum ultricies, nunc orci varius arcu, sed condimentum ante purus in lectus. Maecenas tellus metus, venenatis eget accumsan ac, cursus sit amet libero.

Proin eros ex, tincidunt vitae mauris vitae, commodo tristique nibh. Quisque lobortis lobortis massa sed accumsan. Aenean eu turpis fringilla, ornare nisl nec, rutrum ipsum. Nunc sagittis vehicula nulla non laoreet. In hac habitasse platea dictumst. Nulla auctor sem eu nulla facilisis, ac sodales eros tempor. Suspendisse nec nisl dapibus, rutrum lectus sit amet, convallis nunc. Suspendisse nec tristique diam, a lacinia urna. Vestibulum ac leo nec justo mattis blandit. Sed sollicitudin nec est vitae consectetur. Duis euismod lorem vel dictum venenatis.

Suspendisse potenti. Mauris dictum nibh mauris, ac congue lacus commodo vitae. Vestibulum aliquam rhoncus vehicula. Cras lacinia maximus odio id convallis. Nullam ipsum mi, aliquet a sagittis sit amet, ultricies non felis. Nunc leo lectus, vestibulum a mi nec, sagittis efficitur eros. Aenean euismod metus eget dolor venenatis faucibus nec ut quam. Cras accumsan, tellus tristique fermentum sollicitudin, libero diam iaculis nibh, non pellentesque nisi mi pretium odio. Nullam congue, justo sagittis gravida efficitur, tellus nibh mattis ligula, vitae faucibus tortor elit in turpis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam ac lacinia augue. Nunc a ligula sed est egestas auctor. Mauris posuere leo ac dolor porta sodales.

Phasellus porttitor consequat dolor viverra hendrerit. Sed commodo purus ac facilisis congue. Etiam ante turpis, commodo vel tincidunt consectetur, suscipit et mauris. Etiam metus ligula, feugiat et est at, laoreet bibendum lorem. Nullam vel placerat purus, id suscipit tortor. Morbi blandit lacus et ex facilisis, sit amet auctor lectus vehicula. Donec molestie cursus nisi condimentum pretium. Integer ultrices in nisl nec dictum. Etiam posuere sapien quis pretium malesuada. Vestibulum in nisi vel ante lobortis viverra. Nam hendrerit vulputate vehicula. Sed iaculis ut tellus nec rhoncus. Fusce eleifend mauris at elit tempor imperdiet.</p>
</div>
<div class="menu">
<ul>
    <a href="#">Apple</a>
    <a href="#">Dell</a>
    <a href="#">HP</a>
    <a href="#">About us</a>
    <a href="#">Contact</a>
</ul>
</div>
    <div class="Loginblok"></div>
    <div class="Socialmediablok"></div>
    <div class="reclameblock"></div>
    <div class="mapslocatie"></div>
<footer>




</footer>
#banner{
    background: url(images/banner1.jpg);
    background-repeat: no-repeat;
    background-size: 100% 300px;
    background-color: #0F0F3D;
    margin-top: 

}
As you can see, I want the banner to show! but it doesn't respond. Only if I made an <img src"---"> in the HTML. But I want the image to be loaded in via the CSS
I've tried making the div an Class element, an id element etc.
nothing worked
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 13:08
@jpjenkins Thank you very much
CamperBot
@camperbot
Nov 09 2015 13:08
angelorwanda sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
:warning: angelorwanda already gave jpjenkins points
jpjenkins
@jpjenkins
Nov 09 2015 13:09
You're welcome :)
Mohamed Fahadh
@fahadh14
Nov 09 2015 13:13
guys
have a small question
for bootstrap
btn-primary is always dark blue?
and btn-info is always light blue?
why is it that way?
howdy, is there an offline version for the 800 Hours of Practice module?
Ademola Adegbuyi
@ooade
Nov 09 2015 13:17
i dont think so @27a
Bill Zerega
@dedicatedfuture
Nov 09 2015 13:19
has anyone completed the node tutorial?
i could use some help figuring out the node
Ademola Adegbuyi
@ooade
Nov 09 2015 13:22
Yup @dedicatedfuture , i have
Kevin Dessely
@kevindessely
Nov 09 2015 13:22
@fahadh14 it's the default theme. Unless u prepacked a custom theme from bootstrap site
Bill Zerega
@dedicatedfuture
Nov 09 2015 13:23
do you think you could help me out @marhyorh ??
Ademola Adegbuyi
@ooade
Nov 09 2015 13:24
Yeah @dedicatedfuture , what's your issue ?
Angelo C. IGITEGO
@AngeloRwanda
Nov 09 2015 13:27
@Mbos95 I am not too sure what is wrong, but I would suggest to check well if the image you are trying to use is a jpg format. You can do this by opening its containing folder, right-click on it, check the properties.
aye, thanks @marhyorh :)
CamperBot
@camperbot
Nov 09 2015 13:27
27a sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 322 | @marhyorh | http://www.freecodecamp.com/marhyorh
Ademola Adegbuyi
@ooade
Nov 09 2015 13:32
@Mbos95 you left margin-top: with no value
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:33
hey guys, did anyone of you solve Bonfire: Everything Be True? I think there's some bug. I passed it but i cheated it to get through, I'm lookin for the right solution
Kevin Dessely
@kevindessely
Nov 09 2015 13:34
Markus Kiili
@Masd925
Nov 09 2015 13:36
This message was deleted
@kotAPI There is mine:
function every(collection, pre) {
  collection.forEach(
    function(entry) {
      if (!entry[pre]) return false;
    }
  );
  return true;
}
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:38
Oh god, I feel so dumb right now
thanks @Masd925
CamperBot
@camperbot
Nov 09 2015 13:38
kotapi sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 269 | @masd925 | http://www.freecodecamp.com/masd925
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:42
@Masd925 , did it pass for you?
Craig Morrison
@frogmorton
Nov 09 2015 13:44
@kotAPI did ydou work out the roman numeral bf?
Markus Kiili
@Masd925
Nov 09 2015 13:48
@kotAPI It did but doesn't anymore :) Maybe I have changed it somehow. Have to check it.
Bill Zerega
@dedicatedfuture
Nov 09 2015 13:48
thanks @marhyorh for walking me through silly mistakes
CamperBot
@camperbot
Nov 09 2015 13:48
dedicatedfuture sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 323 | @marhyorh | http://www.freecodecamp.com/marhyorh
Ademola Adegbuyi
@ooade
Nov 09 2015 13:48
YWC
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:50
@frogmorton , I haven't done that yet bud
@Masd925 , yeah i just realized, mine still works :P looks like it's some kinda bug
Craig Morrison
@frogmorton
Nov 09 2015 13:51
@m6cheung i found a good quotes api and they responded with a username / key in less than 10 hours... if you're interested in refactoring your quotes machine... http://www.quotes.net/quotes_api.php
@kotAPI Oh, ok. I agree with using switch statements. The key for me was to figure out how to handle 4's and 9's, as they behave differently than just adding another of the previous character.
Pat
@DwyDwys
Nov 09 2015 13:55
hey has anyone made it through the object constructor function waypoint on javascript? I can't figure out what it's asking for the final answer.
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:55
@frogmorton , i gotta bang my head first before i try and solve the roman problem :P
Matt Leonard
@matty22
Nov 09 2015 13:56
@DwyDwys This one?
Waypoint: Construct JavaScript Objects with Functions
Jason Wood
@catapixel
Nov 09 2015 13:57
@frogmorton I did the Roman Numerial one. Did you need help with it?
Pat
@DwyDwys
Nov 09 2015 13:57
@matty22 this one - Waypoint: Make Instances of Objects with a Constructor Function
Craig Morrison
@frogmorton
Nov 09 2015 13:58
I've done it too... I was kind of offering @kotAPI help, although my solution may not be optimized, it does work.
Rory Smith
@alanbuchanan
Nov 09 2015 13:58
@DwyDwys what have you got so far?
Craig Morrison
@frogmorton
Nov 09 2015 13:58
@catapixel thanks for the offer though, I'm actually about to start the quotes machine
CamperBot
@camperbot
Nov 09 2015 13:58
frogmorton sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 570 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Nov 09 2015 13:58
np
Adam Liechty
@liechty
Nov 09 2015 13:58
how do i use radio buttons correctly?
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:58
@frogmorton , i shall come for help to you if i get stuck :D
Markus Kiili
@Masd925
Nov 09 2015 13:58
@kotAPI This works
function every(collection, pre) {
  var result = true;
  collection.forEach(
    function(entry) {
      if (!entry[pre]) result = false;
    }
  );
  return result;
}
Craig Morrison
@frogmorton
Nov 09 2015 13:59
@catapixel wanna look at my code? maybe you could suggest ways to improve it
Pat
@DwyDwys
Nov 09 2015 13:59
@alanbuchanan nothing. I have tried several iterations of what I think im supposed to be doing (ie. "this.engines = 1;"), both private and public versions, but am not understanding what i am even supposed to be creating here
Pranay Kothapalli
@kotAPI
Nov 09 2015 13:59
This is my code, have a look at it for fun
function every(collection, pre) {
  // Is everyone being true?
  var lengthOfList = arguments[0].length;

  var tempArray = [];
  var counter =0;

  for(var i=0;i<lengthOfList;i++){  
    tempArray.push(collection[i][pre]);
    counter++;
    if(collection[i][pre]==null      || 
       collection[i][pre]==""        ||
       collection[i][pre]==undefined ||
       collection[i][pre]==NaN       )
    {  
      return false;
    }

  }
  if(collection[0][pre]=="double" ){
    return false;
  }
  return true;

}

every([{"single": "double"}, {"single": NaN}], "single");
Jason Wood
@catapixel
Nov 09 2015 14:00
@DwyDwys the last test is just looking for you to assign a value
Matt Leonard
@matty22
Nov 09 2015 14:01
My attempt at English-izing the instructions:
var Car = function() {
   this.wheels = 4;
};
This top part is a variable Car and we are storing the function inside of it.
Rory Smith
@alanbuchanan
Nov 09 2015 14:02
@DwyDwys you make a new instance of Car, called myCar, and then you assign a numeric value to the engines property of myCar
Matt Leonard
@matty22
Nov 09 2015 14:02
So later on, when we do var myCar = new Car(); the variable myCar inherits the this.wheels = 4;.
So myCar has the property wheels = 4;.
What you need to do is add the property engines, but you aren't doing it inside of that initial function, so you won't use this
What other way could you add a property to an object?
Pat
@DwyDwys
Nov 09 2015 14:05
@matty22 to make it a variable name the object and properties direction? "var wheels = 4"
@matty22 is that right?
Matt Leonard
@matty22
Nov 09 2015 14:08
No, you want to use something similar to this.wheels, but you won't use this. Man, this isn't explained terribly well in any of the previous exercises up to this point.
Maybe this last line of the instructions will help: Add an engines property with a number value to the myCar instance.
Pat
@DwyDwys
Nov 09 2015 14:09
@alanbuchanan @matty22 it isn't. glad that's not just me. I am beyond confused on virtually all of this javascript stuff
@matty22 i understand what it's asking me to do, but i'm confused on the notation to get me there. as i've never seen "var myCar = new Car();" before. the "new" thing is different so i don't know if i'm being asked to change the word "new" to something else or if i'm supposed to assume that "new" means that it's a separate command and that's what a Constructor is.
Matt Leonard
@matty22
Nov 09 2015 14:14
No, you shouldn't change anything that's already there. You should just add a new line. The syntax is exactly the same as this.wheels = 4; but you want to use myCar and engines.
I think of new as var myCar = a new copy of the Car() function and its contents, so myCar will inherit, myCar.wheels from the Car() function. You just need to add the engines property.

Maybe this is an easier way to figure this out:

```

var car = {
  "wheels":4,
  "engines":1,
  "seats":5
};
Pat
@DwyDwys
Nov 09 2015 14:20
@matty22 im so sorry for my confusion. I've tried adding "var myCar = function() {
this.engines = 4;
};" below "var myCar = new Car():" i've tried just adding engines = 1; I've tried other iterations. I guess my problem is that I'm not sure what a
Matt Leonard
@matty22
Nov 09 2015 14:20
If I wanted to console.log() one of these, I'd use console.log(car.seats);. So how might you assign a value to one of these instead of logging it.
Pat
@DwyDwys
Nov 09 2015 14:21
@matty22 i honestly don't know! ha eff
Matt Leonard
@matty22
Nov 09 2015 14:21
In this case, I'd try something like car.seats = 6;
Pat
@DwyDwys
Nov 09 2015 14:21
because it changes the existing, updates it
right!
okay
so i'd do myCar.engines = 1;
even though engines isn't shown prior to this and I don't know that it's even been included yet? yep that works. well that's stupid
or i am
wow thanks @matty22 i really appreciate your help
CamperBot
@camperbot
Nov 09 2015 14:23
dwydwys sends brownie points to @matty22 :sparkles: :thumbsup: :sparkles:
:star: 227 | @matty22 | http://www.freecodecamp.com/matty22
Matt Leonard
@matty22
Nov 09 2015 14:23
Sure. Hope my roundabout attempts at not just giving you the answer didn't confuse you further!
Rory Smith
@alanbuchanan
Nov 09 2015 14:24
@DwyDwys you might want to give this page a read, it will help you get it
Pat
@DwyDwys
Nov 09 2015 14:24
it didnt', thank you. i do have one question though, knowing that myCar.engines will add the idea of engines to that car that may have not existed prior, without the code up to this point how would i have known if it needs to stand alone or need to be included?
CamperBot
@camperbot
Nov 09 2015 14:24
if you want to thank someone, put an @ before their name!
Pat
@DwyDwys
Nov 09 2015 14:24
or am I missing the bigger point
thank you @alanbuchanan
CamperBot
@camperbot
Nov 09 2015 14:25
dwydwys sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 494 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Matt Leonard
@matty22
Nov 09 2015 14:25
Uhh..well it isn't explained well up to that point. In a prior exercise you had this code:
var car = { "wheels":4, "engines":1, "seats":5 };
So you can use that dot notation to do lots of things with objects. Change an existing property's value like car.wheels = 6; or add a new property car.hood = 1;
Markus Kiili
@Masd925
Nov 09 2015 14:28
@kotAPI This is even better
function every(collection, pre) {
  for (var i=0; i<collection.length; i++) {
    if (!collection[i][pre]) return false;
  }
  return true;
}
Pat
@DwyDwys
Nov 09 2015 14:29
@matty22 oh, these are all compounding interconnected lessons and not independent instances. Sometimes (in other moduals) they have been connected and sometimes not necessarily
eitiher way @matty22 thank you for your help and further explination
CamperBot
@camperbot
Nov 09 2015 14:31
dwydwys sends brownie points to @matty22 :sparkles: :thumbsup: :sparkles:
:warning: dwydwys already gave matty22 points
Matt Leonard
@matty22
Nov 09 2015 14:33
No, problem. Off to work. Good luck!
Pat
@DwyDwys
Nov 09 2015 14:34
@matty22 although, considering I was taught this dot notation in a previous lesson, what does that have anything to do with "contrustor function" as its a new thing and not contructing on anything
or is it just a new name for a thing i already learned, but they didn't call it that before
Harry Adel
@harryadel
Nov 09 2015 14:37
Hi guys, will somebody please explain why we have to readd
min
in this code
Math.floor(Math.random() * (max - min + 1)) + min
Amardeep
@Amardeep91
Nov 09 2015 14:38
so that the value is greater than min
Harry Adel
@harryadel
Nov 09 2015 14:40
and what about (max - min + 1) ?
shouldn't I just insert their equivalent directly ?
Markus Kiili
@Masd925
Nov 09 2015 14:42
@Harry97 Math.random is between 0 and 1 with 1 excluded (not in range). Math.random()(max-min+1) is between 0 and (max-min+1). Math.random() (max - min + 1) + min is between min and max+1 with max+1 excluded. Flooring it (rounding down) gives integer numbers min...max.
@Harry97 You can insert it but that form explains how to get any range of random integers.
Susan Nowoslawski
@susannowo
Nov 09 2015 14:52
Hung up on 174.var myCar = new Car(); {
this.engines = 1;
};
it's not working - but not sure what will
Harry Adel
@harryadel
Nov 09 2015 14:53
@Masd925 Thank you
CamperBot
@camperbot
Nov 09 2015 14:53
harry97 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 271 | @masd925 | http://www.freecodecamp.com/masd925
rbrtn
@rbrtn
Nov 09 2015 14:54
Thanks @SaintPeter! It worked and it makes sense. Don't know why it didn't occur to me. Thanks again!
CamperBot
@camperbot
Nov 09 2015 14:54
rbrtn sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1473 | @saintpeter | http://www.freecodecamp.com/saintpeter
Markus Kiili
@Masd925
Nov 09 2015 14:54
@susannowo try: var myCar = new Car(); myCar.engines=1;
Susan Nowoslawski
@susannowo
Nov 09 2015 14:55
It worked!! thanks!
CamperBot
@camperbot
Nov 09 2015 14:55
if you want to thank someone, put an @ before their name!
Susan Nowoslawski
@susannowo
Nov 09 2015 14:56
Thanks @Masd925 !
CamperBot
@camperbot
Nov 09 2015 14:56
susannowo sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star: 272 | @masd925 | http://www.freecodecamp.com/masd925
gts00k
@gts00k
Nov 09 2015 14:57
Xavier Sumba
@cuent
Nov 09 2015 15:02
Hello anyone have used mahout?
Ayaz Memon
@ayazmemon
Nov 09 2015 15:11
Hello room; I'm having issues on [Waypoint: Make Object Properties Private]; is there anyone that could help me through?
Markus Kiili
@Masd925
Nov 09 2015 15:11
@ayazmemon yes.
Ayaz Memon
@ayazmemon
Nov 09 2015 15:11
@Masd925 first time asking question; is there a way to have private chat?
Markus Kiili
@Masd925
Nov 09 2015 15:12
@ayazmemon hover the @name and click chat privately.
aleef
@aleefashraf
Nov 09 2015 15:47
can anyone help me by telling me how i make src attribute of img tag point to the inserted image
hello room;i'm having problem with [Waypoint: Add Images to your Website]can anyone help me?
Dee Martin
@dxmartin8
Nov 09 2015 15:50
@aleefashraf show me the code
aleef
@aleefashraf
Nov 09 2015 15:53

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

<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>
<img src="http://bit.1y/fcc-relaxing-cat">

Dee Martin
@dxmartin8
Nov 09 2015 15:55
make sure you include the backslash symbol (/) at the end of your image closing tag.
<img src="http://bit.1y/fcc-relaxing-cat" />
@aleefashraf
aleef
@aleefashraf
Nov 09 2015 15:57
@dxmartin8 thank you for your help .it worked
CamperBot
@camperbot
Nov 09 2015 15:57
aleefashraf sends brownie points to @dxmartin8 :sparkles: :thumbsup: :sparkles:
:star: 176 | @dxmartin8 | http://www.freecodecamp.com/dxmartin8
Dee Martin
@dxmartin8
Nov 09 2015 15:58
@aleefashraf your welcome
Susan Nowoslawski
@susannowo
Nov 09 2015 16:00

The line of code reversed the array but it isn't being accepted.

var array = array.reverse(function(val){});

Michael Randell
@MichaelRandell
Nov 09 2015 16:02
Ah man...need some help on Waypoint 79, I'm stuck on the part where it says "Give the text input in your form the class form-control...been trying everything I can think but a bit confused
<button type= "submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i>Submit</button>
Alexander Køpke
@alexanderkopke
Nov 09 2015 16:03
haven't done that one yet but is the variable suppose to have the same name?
theSyndical
@theSyndical
Nov 09 2015 16:03
@MichaelRandell thats the button input
Michael Randell
@MichaelRandell
Nov 09 2015 16:03
yea, that's what I was supposed to do on an earlier waypoint
theSyndical
@theSyndical
Nov 09 2015 16:03
@MichaelRandell you need a text input with the class from-control <input class="form-control" type="text">
Michael Randell
@MichaelRandell
Nov 09 2015 16:04
oh ok so I need to make an <input>
ok, I've got it. thanks guys. that one was a bit confusing..
CamperBot
@camperbot
Nov 09 2015 16:07
if you want to thank someone, put an @ before their name!
Michael Randell
@MichaelRandell
Nov 09 2015 16:07
thanks @Intr0nA
CamperBot
@camperbot
Nov 09 2015 16:07
michaelrandell sends brownie points to @intr0na :sparkles: :thumbsup: :sparkles:
:star: 54 | @intr0na | http://www.freecodecamp.com/intr0na
Mach
@vijesh-s
Nov 09 2015 16:08
how to push one array into an array which holds arrays
Rory Smith
@alanbuchanan
Nov 09 2015 16:12
targetArray.push(someArray) @vijesh-s
Michael Randell
@MichaelRandell
Nov 09 2015 16:16
<input type="text" class="form-control" placeholder="cat photo URL" required>
<button type="submit" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
does an <input>not need a closing?
it kinda just floats about the button?
above*
Alexander Køpke
@alexanderkopke
Nov 09 2015 16:18
input takes no closing tags
Michael Randell
@MichaelRandell
Nov 09 2015 16:20
thanks @alexanderkopke
CamperBot
@camperbot
Nov 09 2015 16:20
michaelrandell sends brownie points to @alexanderkopke :sparkles: :thumbsup: :sparkles:
:star: 86 | @alexanderkopke | http://www.freecodecamp.com/alexanderkopke
Alexander Køpke
@alexanderkopke
Nov 09 2015 16:20
do you have <label></label> around the input?
dainramnauth
@dainramnauth
Nov 09 2015 16:24
how do you make a for loop tat gives an array of 1,3,5,7,9?
Susan Nowoslawski
@susannowo
Nov 09 2015 16:24

Back again Waypoint 179 reverse method.
my line of code reversed the array
but isn't being accepted - not sure what's typed wrong

var array = array.reverse(function(val){});

dainramnauth
@dainramnauth
Nov 09 2015 16:24
that*
h4r1m4u
@h4r1m4u
Nov 09 2015 16:25
@susannowo the .reverse() function doesn't take any arguments
Dee Martin
@dxmartin8
Nov 09 2015 16:26
@dainramnauth You have to create a for loop. for(var i = 0 ; i < 10, i++ ){ push i to the array }
h4r1m4u
@h4r1m4u
Nov 09 2015 16:26
@dainramnauth do you have any ideas? i can guide you along, but would like to see some effort on your part. did you try any code?
@dxmartin8 that's not going to work. that'll give you array of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Dee Martin
@dxmartin8
Nov 09 2015 16:28
@dainramnauth sry the last part is for (var i = 1 ; i<10;i+2)
@dainramnauth i+=2
Mach
@vijesh-s
Nov 09 2015 16:28
thanks @alanbuchanan
CamperBot
@camperbot
Nov 09 2015 16:28
vijesh-s sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 495 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
dainramnauth
@dainramnauth
Nov 09 2015 16:29
@dxmartin8 thank you, it works
CamperBot
@camperbot
Nov 09 2015 16:29
dainramnauth sends brownie points to @dxmartin8 :sparkles: :thumbsup: :sparkles:
:star: 178 | @dxmartin8 | http://www.freecodecamp.com/dxmartin8
h4r1m4u
@h4r1m4u
Nov 09 2015 16:29
@dxmartin8 while it's good you're trying to help, do you think the best approach is to give him the code? how much will he learn that way?
Dee Martin
@dxmartin8
Nov 09 2015 16:30
@h4r1m4u You know I was just thinking that to myself.
Susan Nowoslawski
@susannowo
Nov 09 2015 16:30
Thanks @h4r1m4u
CamperBot
@camperbot
Nov 09 2015 16:30
susannowo sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 592 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Dee Martin
@dxmartin8
Nov 09 2015 16:30
@h4r1m4u I will keep that in mind next time
h4r1m4u
@h4r1m4u
Nov 09 2015 16:31
@dxmartin8 it's better to guide people along and point them towards the solution. it's a much better learning experience if they can figure it out themselves. they'll actually remember what they did. in my opinion, anyway
sounds good!
thank you @dxmartin8
CamperBot
@camperbot
Nov 09 2015 16:31
h4r1m4u sends brownie points to @dxmartin8 :sparkles: :thumbsup: :sparkles:
:star: 179 | @dxmartin8 | http://www.freecodecamp.com/dxmartin8
Dee Martin
@dxmartin8
Nov 09 2015 16:32
@h4r1m4u how do you send brownie points
Alexander Køpke
@alexanderkopke
Nov 09 2015 16:32
thank a name
CamperBot
@camperbot
Nov 09 2015 16:32
if you want to thank someone, put an @ before their name!
h4r1m4u
@h4r1m4u
Nov 09 2015 16:32
@dxmartin8 you just say thank you or thanks and include the person's name
CamperBot
@camperbot
Nov 09 2015 16:32
h4r1m4u sends brownie points to @dxmartin8 :sparkles: :thumbsup: :sparkles:
:warning: h4r1m4u already gave dxmartin8 points
Alexander Køpke
@alexanderkopke
Nov 09 2015 16:33
@dxmartin8 thanks
Dee Martin
@dxmartin8
Nov 09 2015 16:33
@h4r1m4u thanks
CamperBot
@camperbot
Nov 09 2015 16:33
dxmartin8 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 593 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 16:33
there you go :)
Mach
@vijesh-s
Nov 09 2015 17:11
i am stuck with Bonfire: Chunky Monkey
please help me
var counter=0;
  var finalArr = [[]];
  var chunks = [];
  while(counter<arr.length)
    {
      chunks.push(arr[counter]);
      counter++;
      console.log("each chunk" + chunks);

      if(chunks.length==size)
        {
          console.log("filling");
          var temp = [];
          while(chunks.length>0)
            temp.unshift(chunks.pop());

          finalArr.push(temp);
        }
    }

  if(chunks.length>0)
    {
      console.log("filling>0");
    finalArr.push(chunks);

    }
  return finalArr;
I cant see whats wrong in it
h4r1m4u
@h4r1m4u
Nov 09 2015 17:15
@vijesh-s that's a really complicated way of doing the waypoint :)
anyhow, why does your var finalArr = [[]];have an empty array in it when you define it?
Mach
@vijesh-s
Nov 09 2015 17:16
:P thats probably why i am going crazy
Isnt that the way of declaring an array which holds an array?
h4r1m4u
@h4r1m4u
Nov 09 2015 17:16
wouldn't the result look something like this [ [], [some chunk], [another chunk]]?
not really. it's declaring an array with an empty array as the first element in it
Mach
@vijesh-s
Nov 09 2015 17:17
yes it does look like that..
h4r1m4u
@h4r1m4u
Nov 09 2015 17:17
you can simply do var finalArr = [];
and then push elements into it
Mach
@vijesh-s
Nov 09 2015 17:17
oh .. i think thats the solution :)
h4r1m4u
@h4r1m4u
Nov 09 2015 17:17
array doesn't care what the element you push into it looks like
it can be a variable, string, array, object, ... whatever you wish
Mach
@vijesh-s
Nov 09 2015 17:18
didnt know that... I have been a C# programmer all these years..
let me check if that solve sthe problem
h4r1m4u
@h4r1m4u
Nov 09 2015 17:18
roger that
Mach
@vijesh-s
Nov 09 2015 17:18
thats it .. Done :)
thanks @h4r1m4u
CamperBot
@camperbot
Nov 09 2015 17:19
vijesh-s sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 595 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 17:19
@vijesh-s you're welcome. when you're fresh, trying to see if you can optimize the function. it's really unnecessarily complicated
Ayaz Memon
@ayazmemon
Nov 09 2015 17:20
Hello, could someone help me with a js issue?
Mach
@vijesh-s
Nov 09 2015 17:20
Cant believe i spent 2 hours on that.. !! I also solved the problem in my visual studio using C# and was wondering why it didnt work in javascript.. 2 hours of head scratching and the root cause: wrong array declaration
h4r1m4u
@h4r1m4u
Nov 09 2015 17:21
what's the problem @ayazmemon ?
@vijesh-s hahaha, i feel your pain :D
Ayaz Memon
@ayazmemon
Nov 09 2015 17:21
@h4r1m4u reversing strings .. dm-ing you
mrgoran
@mrgoran
Nov 09 2015 17:32
Hello everyone! Is there anyone out there who would like to help me with an issue on "Zipline: Build a JavaScript Calculator"?
CoreyThomas
@CoreyThomas
Nov 09 2015 17:33
Just wanna say how stoked I am! I'm learning Javascript!!!
h4r1m4u
@h4r1m4u
Nov 09 2015 17:36
@CoreyThomas way to go. keep the hype up!
@mrgoran what's the issue?
mrgoran
@mrgoran
Nov 09 2015 17:39
@h4r1m4u Thanks - Im trying to figure out how to pass a variable to another function when using multiple clicks as you do when you use a calculator. So when you click "1" for instance, how I can pass that number when button number two is pressed..
CamperBot
@camperbot
Nov 09 2015 17:39
mrgoran sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 596 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 17:41
@mrgoran you can store it in a variable
mrgoran
@mrgoran
Nov 09 2015 17:41
@h4r1m4u you can have a look at my code Im fiddling with here: http://codepen.io/mrgoran/pen/RWBrzx. I've only done a function for the "divide" button and I added all variables to the "screen" so I can see whats going on :)
h4r1m4u
@h4r1m4u
Nov 09 2015 17:42
@mrgoran store the first number in a variable, then use it when the second number is put in by the user
mrgoran
@mrgoran
Nov 09 2015 17:43
@h4r1m4u That's what I thought I was doing but..
Michael Randell
@MichaelRandell
Nov 09 2015 17:45
I'm just wondering guys... I'm on waypoint 80 and while I'm learning and going back over the code once in a while to review it and try interpret it, I am definitely not totally absorbing everything...Should I be trying to absorb and remember all this stuff as I go?
h4r1m4u
@h4r1m4u
Nov 09 2015 17:47

@mrgoran i'm confused by your operator click handler:

$( ".row button:not(#clear, #divide, #multiply, #minus, #plus)" ).click(function() { 

    if (operator === "-" || "+" || "/" || "*") {    
        var newNumber = $(this).text(); 
        var screen = newNumber;
        document.getElementById("screen").innerHTML = screen;
        document.getElementById("operator").innerHTML = operator;
        document.getElementById("number").innerHTML = number;
        document.getElementById("newNumber").innerHTML = newNumber;
    }

});

var newNumber = $(this).text(); doesn't the this in this line refer to the operator button that was clicked? why are you saving it into newNumber?

roadlesstraveled
@roadlesstraveled
Nov 09 2015 17:48

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

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

Rex Schrader
@SaintPeter
Nov 09 2015 17:49
@roadlesstraveled You have your class defined correctly, now you just need to apply it to the img element. Do you know how to add a class to an HTML element?
h4r1m4u
@h4r1m4u
Nov 09 2015 17:50
@MichaelRandell in the ideal scenario. but getting the concept, so that later on you can go 'ah, i think i could use this which i learned back in waypoint 80. i don't remember the syntax or the function exactly, but i can look that up'. it's understanding the concept and how you can apply them to solve problems at hand that's important
roadlesstraveled
@roadlesstraveled
Nov 09 2015 17:50
Is it something to the effect of <img class= ?? Idk I was guessing it might be something like that @SaintPeter but I'm pretty new to this and just started 2 days ago lol.
Rex Schrader
@SaintPeter
Nov 09 2015 17:51

@roadlesstraveled Yup, that's about it. You add a class attribute like this:

<tag class="class1 class2">

You can have multiple classes separated by spaces if you need.

@roadlesstraveled in this case, your tag is img
h4r1m4u
@h4r1m4u
Nov 09 2015 17:52
@roadlesstraveled yes, it is. <img class="some-class" src="....>
roadlesstraveled
@roadlesstraveled
Nov 09 2015 17:52
In other words, I'm not really sure how to add a class to an html element.
Thank you!
CamperBot
@camperbot
Nov 09 2015 17:52
if you want to thank someone, put an @ before their name!
mrgoran
@mrgoran
Nov 09 2015 17:53
@h4r1m4u you're right - its confusing, but that's button #3 and I cant get my way from button #1 to #2 :P The same goes for the "equal" sign. I just jotted down code that I thought would work.
h4r1m4u
@h4r1m4u
Nov 09 2015 17:53
ooops delay in chat rendering. @SaintPeter already answered you
Rex Schrader
@SaintPeter
Nov 09 2015 17:53
Wow, humm, are we getting chat lag?
h4r1m4u
@h4r1m4u
Nov 09 2015 17:53
could have been my internet
Rex Schrader
@SaintPeter
Nov 09 2015 17:55
@roadlesstraveled Don't know if you saw my response above: :point_up: November 9, 2015 9:51 AM
h4r1m4u
@h4r1m4u
Nov 09 2015 17:55
@mrgoran well, you can store the first number in number. then the operator in operator. when the next number is pressed, you check whether operator has value and if yes, you bring up number, the operator and the newly pressed number and perform the calculation
roadlesstraveled
@roadlesstraveled
Nov 09 2015 17:56
I did @SaintPeter Thank you! I'm glad to know I sort of already had the right idea. I had attempted to use <img class= the first time around, but there was a slight difference in how I did it because my code didn't look exactly like this <img class="some-class" src="....> so it wasn't working, but this time it worked! Thank you @SaintPeter and @h4r1m4u
CamperBot
@camperbot
Nov 09 2015 17:56
roadlesstraveled sends brownie points to @saintpeter and @saintpeter and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1474 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 1474 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 597 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
mrgoran
@mrgoran
Nov 09 2015 17:58
@h4r1m4u Yes, so far so good. I guess I have done something wrong with the scope or something. I thought I fetched the variable "number" in my case in a way that Im not supposed to. Thanks anyway!
CamperBot
@camperbot
Nov 09 2015 17:58
mrgoran sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mrgoran already gave h4r1m4u points
mrgoran
@mrgoran
Nov 09 2015 17:59
@h4r1m4u Err... "I thought I fetched the variable "number" in my case".
h4r1m4u
@h4r1m4u
Nov 09 2015 18:01
@mrgoran you're welcome. you have the right idea. you just need to polish the code and make it work. here's another tip. you could leverage the JS .eval() function. if you store an arithmetic expression as a string, you can use eval() to evaluate it later. for example: eval("10 + 5"); would return 15. notice that the function argument is a string, not numbers
so theoretically, you could store all the user input in a string and then just evaluate it when = is pressed.
mrgoran
@mrgoran
Nov 09 2015 18:02
@h4r1m4u Perfect, thanks for your help and tips! Then I know that Im on the right track.
CamperBot
@camperbot
Nov 09 2015 18:02
mrgoran sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: mrgoran already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Nov 09 2015 18:02
you're most welcome
Joshua Abu
@Absolutestunna
Nov 09 2015 18:03

@Absolutestunna
I'm working on the bonfire spinal tap case. So far, my code is passing the tests to check for underscore and spaces but I can't get a solution to take care of the second test. If anyone could help, that'll be great. Here's the code

function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

  var space = " ";
  var str_split = str.split("");

  for (var i=1; i<str_split.length; i++){
    if (str_split[i]===str_split[i].toUpperCase()&&str_split[i-1]!=="-"){         
      str_split.splice(i, 1,"-");

      } 
     if (str_split[i]===" "||str_split[i]==="_"){

         str_split.splice(i, 1,"-");
    }     

  }  
  return str_split.join("").toLowerCase();
}
spinalCase("thisIsSpinalTap");

My attempt to solve the second test where there are no spaces is displayed in the first "if" statement.

h4r1m4u
@h4r1m4u
Nov 09 2015 18:08
@Absolutestunna i would advise you to consider using regex. with regex you can solve the bonfire with 3 lines of code
the patterns that you need to identify are punctuation and small_letterCapital_letter letter combinations (no space)
Joshua Abu
@Absolutestunna
Nov 09 2015 18:11
@h4r1m4u I'm looking through the docs now. Thank you
CamperBot
@camperbot
Nov 09 2015 18:11
absolutestunna sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 598 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 09 2015 18:12
my pleasure
darrynwu29
@darrynwu29
Nov 09 2015 18:19
@Absolutestunna for regex, try this site, http://www.regexr.com/
Michael Randell
@MichaelRandell
Nov 09 2015 18:32
thank you for that answer @h4r1m4u
CamperBot
@camperbot
Nov 09 2015 18:32
michaelrandell sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 599 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Soumya Rauth
@soumyaRauth
Nov 09 2015 18:37
I need real help....Urgent.... My FCC not working.. May be a infinite loop problem.... I cleared cashe..still not working
What to do???
Michael Randell
@MichaelRandell
Nov 09 2015 18:43
that answer earlier cleared things up for me a bit @h4r1m4u I felt like I had to memorize everything. thanks
CamperBot
@camperbot
Nov 09 2015 18:43
michaelrandell sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: michaelrandell already gave h4r1m4u points
h4r1m4u
@h4r1m4u
Nov 09 2015 18:46
@MichaelRandell you're welcome. generally whenever i learn something new, i like to go through it first without worrying too much about remembering everything. i just want to get the general idea and overview of the topic. it's on the second run-through when i actually memorize and retain the material. the waypoints and bonfires are not that hard. once you get to the ziplines, that's where you'll be challenged and where you'll really test how many of the concepts you've been able to grasp and understand
it's also where hacking at the problem and asking for help or googling when stuck really helps. you're learn and absorb the material by doing
@soumyaRauth use the browser stop button to stop the page from loading before the code starts to execute. then you can edit the code and remove the infinite loop
Aleksander Gębicki
@Takumar
Nov 09 2015 19:04
Hi, all.
If someone buys ebooks from Packt Publishing, there is now JavaScript week, and you can buy 5 ebooks about JS for 50$ (it will take years to read it ;-) ).
https://www.packtpub.com/packt/offers/javascript-week-2015
What's more today you can get free ebook on JS: "Mastering JavaScript High Performance- Chad R. Adams". it is available for next 5 hours.
h4r1m4u
@h4r1m4u
Nov 09 2015 19:09
@Takumar thanks a lot for this. downloading the free book now
CamperBot
@camperbot
Nov 09 2015 19:09
h4r1m4u sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 663 | @takumar | http://www.freecodecamp.com/takumar
Anders Bengtsson
@anders462
Nov 09 2015 19:12
Bootstrap question on CamperNews zipline. Somehow the colmn doesn't expand as I want when larger screensize. I understand I set the colm width to fixed as well as image, but I only get 4 max in a row? If each pick is 200px and gutter is 30px it should be 920 all together, so I don't understand why it doesn't work. Here is link to my pen
(http://codepen.io/andben462/pen/rOqrNe)
h4r1m4u
@h4r1m4u
Nov 09 2015 19:15
@anders462 if you override the responsive column width and set a fixed width on the cols, they're not going to expand to fill the entire row
your cols are 200px wide with 10px margin. x 4, that's 880px.
Evelyn
@EvyLynne
Nov 09 2015 19:18
@Takumar thanks for the info on the free ebook
CamperBot
@camperbot
Nov 09 2015 19:18
evylynne sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 664 | @takumar | http://www.freecodecamp.com/takumar
Sushant
@sushaanttb
Nov 09 2015 19:19
need help with the last question of javascript tutorial while submitting the ans? I have added code for all slots as mentioned in tutorial but still its not getting submitted..
Anders Bengtsson
@anders462
Nov 09 2015 19:19
@h4r1m4u if i delete the fixed width and height, its still doesn't expand, add an extra colm but with a huge margin on each side?
h4r1m4u
@h4r1m4u
Nov 09 2015 19:20
@anders462 how do you want it to behave?
Anders Bengtsson
@anders462
Nov 09 2015 19:21
@h4r1m4u I want it to: col-xs-12 col-sm-6 col-md-2
Ayaz Memon
@ayazmemon
Nov 09 2015 19:22
sup bros; bonfire are killing me! who has the time to help me with checking for palindromes?
Pranay Kothapalli
@kotAPI
Nov 09 2015 19:22
@ayazmemon , same here man, bonfires are burning me
h4r1m4u
@h4r1m4u
Nov 09 2015 19:23
@anders462 you've added some extra rules on the .row/#news (margin-left, margin-right, max-width). get rid of those. also remove the margin:10px on the .colmn class
Ayaz Memon
@ayazmemon
Nov 09 2015 19:23
@kotAPI, how far along are you?
h4r1m4u
@h4r1m4u
Nov 09 2015 19:23
then you'll get 6 md-2 cols in a row
Pranay Kothapalli
@kotAPI
Nov 09 2015 19:23
@ayazmemon , a little here and there, not following any specific order
Joshua Abu
@Absolutestunna
Nov 09 2015 19:24
@h4r1m4u what character matches the small letter Capital letter combo..i can't seem to figure that one out
h4r1m4u
@h4r1m4u
Nov 09 2015 19:25
@Absolutestunna what have you tried?
Joshua Abu
@Absolutestunna
Nov 09 2015 19:26
@h4r1m4u
function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

 var regex = /[_\W]/g;
 var str_split = str.split("");  
 return str.replace(regex, "-").toLowerCase();

}

spinalCase("The_Andy_Griffith_Show");
Take the second line out
function spinalCase(str) {
  // "It's such a fine line between stupid, and clever."
  // --David St. Hubbins

 var regex = /[_\W]/g;
 return str.replace(regex, "-").toLowerCase();


}

spinalCase("The_Andy_Griffith_Show");
h4r1m4u
@h4r1m4u
Nov 09 2015 19:28
/[_\W]/g so that matches _ and any character that's not a 'word'
what about the capital letters?
Anders Bengtsson
@anders462
Nov 09 2015 19:28
@h4r1m4u sorry not following, what extra rules on the .row/#news (margin-left, margin-right, max-width?
h4r1m4u
@h4r1m4u
Nov 09 2015 19:29
@anders462
.row {
    width: 100%;
    margin-left: auto; // this