These are chat archives for FreeCodeCamp/Help

26th
Sep 2015
MSWindows10
@MSWindows10
Sep 26 2015 00:07

```<h2 style="color:blue">CatPhotoApp</h2>

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

Hans van Riet
@hansinla
Sep 26 2015 00:07
@MSWindows10 the backticks need to be on a seperate line.
wiki format
CamperBot
@camperbot
Sep 26 2015 00:08

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

MSWindows10
@MSWindows10
Sep 26 2015 00:08

``` <h2 style="color:blue">CatPhotoApp</h2>

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

```<h2 style="color:blue">CatPhotoApp</h2>

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

Daniel Creutz
@prykor
Sep 26 2015 00:08
Hello, I cant get this codepen to get a reponse from an api:
http://codepen.io/danielcreutz/pen/VvmvmP?editors=101
Hans van Riet
@hansinla
Sep 26 2015 00:11
@prykor You have to specify the callback function name in that API;
&jsonp=callbackFunctionName
MSWindows10
@MSWindows10
Sep 26 2015 00:11
<h2 style="color:blue">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
there. anything wrong with my code? it doesn't work.
Hans van Riet
@hansinla
Sep 26 2015 00:13
@MSWindows10 what do the instructions say?
MSWindows10
@MSWindows10
Sep 26 2015 00:13
The h2 element should be red.
They give no clue
Hans van Riet
@hansinla
Sep 26 2015 00:13
@MSWindows10 what is the exact instruction? You set it to blue.
MSWindows10
@MSWindows10
Sep 26 2015 00:14
oh god. I fixed it. thanks @hansinla. wrong one
CamperBot
@camperbot
Sep 26 2015 00:14
mswindows10 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 394 | @hansinla | http://www.freecodecamp.com/hansinla
Star Cherrix
@Sparklepaws
Sep 26 2015 00:25
Uh oh, here comes the code-writer's block
MSWindows10
@MSWindows10
Sep 26 2015 00:26
@Sparklepaws What do you mean? :D
Star Cherrix
@Sparklepaws
Sep 26 2015 00:30
Well I'm working on a Zipline (the first where you reverse-engineer the site) and it's a little frustrating, so I'm feeling the writer's block coming on xD
peopleblazin
@peopleblazin
Sep 26 2015 00:31
Yeah i agree with what you said about zipline @Sparklepaws bc i tried it and i decided to stick to HTML and Javascript
MSWindows10
@MSWindows10
Sep 26 2015 00:32
this is real confusing. HTML is bogglin' my head. Java Script doesn't, so I like it better.
Star Cherrix
@Sparklepaws
Sep 26 2015 00:33
The codes are easy enough, it's when they don't behave like I expect them to that I have a problem xD
MSWindows10
@MSWindows10
Sep 26 2015 00:33
Then it might be a bug.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:34
@kirah1314 :point_up: September 26, 2015 3:38 AM
Noted. think you shouldn't work.
It's due to "E-Tank"
Star Cherrix
@Sparklepaws
Sep 26 2015 00:35
Possibly, there does seem to be some unexpected issues with margins and padding (they randomly get added)
MSWindows10
@MSWindows10
Sep 26 2015 00:35
yeah it's real confusing
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:36
@kirah1314 : @E-Tank is creating a lot of problem for bot. So it's already in the issue. :P dcsan/gitterbot#142
CamperBot
@camperbot
Sep 26 2015 00:36
abhisekp sends brownie points to @kirah1314 and @e-tank :sparkles: :thumbsup: :sparkles:
:star: 244 | @e-tank | http://www.freecodecamp.com/e-tank
:star: 267 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Hans van Riet
@hansinla
Sep 26 2015 00:36
@Sparklepaws You may want to use a framework like Bootstrap if you’re having problem with consistent lay-out.
Bill
@kirah1314
Sep 26 2015 00:37
@abhisekp ok, I later figured out it was e-tank :)
CamperBot
@camperbot
Sep 26 2015 00:37
kirah1314 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 475 | @abhisekp | http://www.freecodecamp.com/abhisekp
Star Cherrix
@Sparklepaws
Sep 26 2015 00:37
Oh I'm already using bootstrap
Daniel Creutz
@prykor
Sep 26 2015 00:38
Do APIs work with codepen at all? Every project that is using the Forismatic quote API is broken..
Wow nevermind, this whole time my browser was blocking the scripts
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:39
@Sparklepaws bootstrap adds 15px of padding left-right (30px total)
@Sparklepaws for no padding, add this class and apply
.no-padding {
    padding-left: 0;
    padding-right: 0;
}
Ted Patterson
@tedjpatterson
Sep 26 2015 00:40
Hello @all - I can't wrap my mind around "Waypoint: Manipulate Arrays With pop". Can anyone out there help me?
Star Cherrix
@Sparklepaws
Sep 26 2015 00:40
Yeah I noticed that one, it's pretty easy to get rid of. I was making a navbar earlier and couldn't account for the inability to control button (list item) sizes and margins, however. Still trying to figure that one out.
@tedjpatterson What sort of problem are you having with it, Ted?
Rex Schrader
@SaintPeter
Sep 26 2015 00:41
@tedjpatterson There is a good chance that all you need to do is add .pop() to the end of the existing myArray line, rather than adding your own line.
Ted Patterson
@tedjpatterson
Sep 26 2015 00:42
Sadly, I have no clue what it's asking of me... I've tried replicating the pattern that they put in front of me, but I just can't work it out.
Ok @SaintPeter . Will give it a shot.
Bam. You are a saint, indeed. Was overthinking it. Thanks @SaintPeter . And thanks for reaching out, as well, @Sparklepaws !
CamperBot
@camperbot
Sep 26 2015 00:44
tedjpatterson sends brownie points to @saintpeter and @sparklepaws :sparkles: :thumbsup: :sparkles:
:star: 731 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 188 | @sparklepaws | http://www.freecodecamp.com/sparklepaws
Star Cherrix
@Sparklepaws
Sep 26 2015 00:44
@tedjpatterson No problem! Glad you figured it out :D
Rex Schrader
@SaintPeter
Sep 26 2015 00:44
@tedjpatterson I think we need to rewrite that one, just note sure what the best way would be.
Ted Patterson
@tedjpatterson
Sep 26 2015 00:45
Hmm. Give me a sec. Will go back and see what threw me off.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:45
@Sparklepaws :sparkles: :paw_prints:
Star Cherrix
@Sparklepaws
Sep 26 2015 00:46
Haha, amazing xD
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:47
@SaintPeter :innocent:
Rex Schrader
@SaintPeter
Sep 26 2015 00:48
@abhisekp LOL - hey, they made an emoji just for me!
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:48
Ted Patterson
@tedjpatterson
Sep 26 2015 00:49

Actually, I'll tell you what happened, all the console and numbers talk overcomplicated things in my brain.

// var numbers = [1,2,3];
// console.log(numbers); // logs [1,2,3]
// var removed = numbers.pop();
// console.log(numbers); // logs [1,2]
// console.log(removed); // logs 3

Might be changed to:

// var ourArray= [1,2,3];
// var removed = ourArray.pop();
Staying with the ourArray / myArray combo has been great and the switchup threw me for a loop
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:50
@tedjpatterson you're in Matrix: Revolution
Rex Schrader
@SaintPeter
Sep 26 2015 00:51
So you'd remove all of the faux console.log statement?
Jonathan Lee
@Jwing28
Sep 26 2015 00:51
hi I have a general question for those familiar with javascript
Ted Patterson
@tedjpatterson
Sep 26 2015 00:51
But then again console info could be essential to understanding later lessons...
I would, but, again, if this stuff is essential, it needs to stay.
Rex Schrader
@SaintPeter
Sep 26 2015 00:52
@Jwing28 We'll do what we can. Lay it on us.
Jonathan Lee
@Jwing28
Sep 26 2015 00:52
I am working on a personal project. Does anyone have any tips/advice on alternatives to using multiple nested for loops? My code looks quite ugly (though it works fine) and I would prefer it be easier to read and more flexible.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:53
@Jwing28 there are JS functions.
Rex Schrader
@SaintPeter
Sep 26 2015 00:53
@Jwing28 The functional programming functions: .map, .reduce, .filter, etc can be helpful..
Jonathan Lee
@Jwing28
Sep 26 2015 00:53
i can post my code if you're curious
Rex Schrader
@SaintPeter
Sep 26 2015 00:54
@Jwing28 But they require that you think about your code in different ways. The other thing you can do is break out your code into functions.
@Jwing28 A GIST would be best, if there is a lot of it.
Jonathan Lee
@Jwing28
Sep 26 2015 00:54
i tried using functions but i was having trouble
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:54
@Jwing28 JSBin it.
@Jwing28 http://jsbin.com
Rex Schrader
@SaintPeter
Sep 26 2015 00:55
@Jwing28 Well, it requires that your code be structured in certain ways. You need to use fewer globals and such.
Jonathan Lee
@Jwing28
Sep 26 2015 00:56
okay i can do that
let me know if you can't see it. and there's a lot of white space because an image is there but that's on my pc
i really appreciate anyone looking at it and don't mind if you think its great or terrible lol i just want to make it better
Abhisek Pattnaik
@abhisekp
Sep 26 2015 00:58

@Jwing28 Replace window.onload with

document.addEventListener('DOMContentLoaded', function () {
    // bla bla bla
});

or if you're also planning to look for entire pg. load, use "load" instead of "DOMContentLoaded"

@Jwing28 you don't have a lot of nested for, btw.
Rex Schrader
@SaintPeter
Sep 26 2015 01:01
@Jwing28 Wow, this is a project that cries out for Angular.js or, at very least, jQuery.
Jonathan Lee
@Jwing28
Sep 26 2015 01:01
@abhisekp ok i will try that
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:02
@SaintPeter lolz :D
Jonathan Lee
@Jwing28
Sep 26 2015 01:02
@SaintPeter yeah i am only familiar with plain javascript =(
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:02
Pure JS :ok_hand:
Jonathan Lee
@Jwing28
Sep 26 2015 01:02
it was a huge pita lets just say, or i felt like it was more than it needed to be
document.getElementById() is basically embedded into my typing muscle memory at this point
Rex Schrader
@SaintPeter
Sep 26 2015 01:03
@Jwing28 Well, step 1: jQuery. Every single one of your document.getElementByID calls can be replaced by $('#idName').html
@Jwing28 You could also structure your IDs a bit better to simplify the replacements.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:04
@Jwing28 too much getElementByIds means you've too many IDs which could've been replaced with classes
then you could've used document.querySelector or document.querySelectorAll
Jonathan Lee
@Jwing28
Sep 26 2015 01:05
@abhisekp hmm okay i will look those up i dont even know what those are lol
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:05
that way, you can efficiently style them too
Rex Schrader
@SaintPeter
Sep 26 2015 01:06
@Jwing28 jQuery Example:
document.getElementById("M4S5").innerHTML = squatMax.value;
// Turns into:
$('M4S5').html = $('#squatMax').val();
Jonathan Lee
@Jwing28
Sep 26 2015 01:06
@SaintPeter haha looks so much better
peopleblazin
@peopleblazin
Sep 26 2015 01:06
I need help . where do i add the new font link ?

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

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

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

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

Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:07
@Jwing28 add performance overhead to that too (with jQ)
peopleblazin
@peopleblazin
Sep 26 2015 01:07
<style>
  .red-text {
    color: red;
  }

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Rex Schrader
@SaintPeter
Sep 26 2015 01:07
@peopleblazin At the very top of the editor window, before the <style> tag
peopleblazin
@peopleblazin
Sep 26 2015 01:07
before i paste it ?
Thanks @SaintPeter
CamperBot
@camperbot
Sep 26 2015 01:07
peopleblazin sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 732 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 26 2015 01:08
@Jwing28 Dunno, though, there is a lot going on here that might be made easier with lookup tables.
@Jwing28 For example, rather than having 5 entries for each week, pre-compute each of the IDs and store then in an array, then loop through the array.
Jonathan Lee
@Jwing28
Sep 26 2015 01:09
based on my code, do you think it would be better if i had used a callback within a loop? i was thinking maybe i could pass those pieces of the id into a callback function and that function would calculate the value then provide it back and that cell would get the value
@SaintPeter i see
DTing
@dting
Sep 26 2015 01:11
ya im not sure this need jquery but you could refactor your code with functions that accept week argument
Rex Schrader
@SaintPeter
Sep 26 2015 01:11
@Jwing28 I'm thinking sometihng like this:
var weeks = [ "M0S5", "M0B5", "M0R5" // etc
DTing
@dting
Sep 26 2015 01:12
oneThree is probably not the best name because it doesnt describe what the variable is it describes the value
Rex Schrader
@SaintPeter
Sep 26 2015 01:12
@Jwing28 I dunno, I just see all these computed indexes and wonder if they could be made easier to compute, or be made into a lookup or something.
Jonathan Lee
@Jwing28
Sep 26 2015 01:12
hmm
Rex Schrader
@SaintPeter
Sep 26 2015 01:13
@Jwing28 What I really see is that if you were to do this in Angular, you could trim your code by about 90%. But that may be asking too much for you to learn.
Jonathan Lee
@Jwing28
Sep 26 2015 01:13
@dting ok makes sense
MSWindows10
@MSWindows10
Sep 26 2015 01:13
confused:
<h2 ="color: red">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Jonathan Lee
@Jwing28
Sep 26 2015 01:14
@SaintPeter 90%? WOW haha yeah maybe a bit much right now
MSWindows10
@MSWindows10
Sep 26 2015 01:14
I don't get what they say here:
-Create a style element.
-Your h2 element should be blue.
-Make sure all your style elements are valid and have a closing tag.
got rid of the style element. got that right, but...
Rex Schrader
@SaintPeter
Sep 26 2015 01:14
@Jwing28 All of these repeated things can be handled automatically by angular.
@MSWindows10 Pretty sure that you're close here, you need to say style="color: red"
Jonathan Lee
@Jwing28
Sep 26 2015 01:15
@SaintPeter ahh i see
Rex Schrader
@SaintPeter
Sep 26 2015 01:16
@Jwing28 Do you have to fill this out every time? Is it being written to a DB or printed out?
MSWindows10
@MSWindows10
Sep 26 2015 01:16
@SaintPeter They said to get rid of the style elemnt
element
Rex Schrader
@SaintPeter
Sep 26 2015 01:16
@MSWindows10 oh, in that case, you need to create one up in between the <style> tags. For h2, right?
Jonathan Lee
@Jwing28
Sep 26 2015 01:16
@SaintPeter just printing to each <td> , no db
Rex Schrader
@SaintPeter
Sep 26 2015 01:17
@Jwing28 Is it for printing out so you can fill it out at the Gym?
MSWindows10
@MSWindows10
Sep 26 2015 01:17
@SaintPeter not sure.
Rex Schrader
@SaintPeter
Sep 26 2015 01:18
@MSWindows10 What is the specific waypoint name?
Jonathan Lee
@Jwing28
Sep 26 2015 01:18
oh i was thinking i would make it a free website then on my phone i could punch in my totals and just use it as a reference while i work out so i know what to lift
MSWindows10
@MSWindows10
Sep 26 2015 01:18
I'm doing Use CSS Selectors to Style Elements
it's real confusing
Jonathan Lee
@Jwing28
Sep 26 2015 01:18
@SaintPeter i would have it on my phone, dont plan on printing it out
Rex Schrader
@SaintPeter
Sep 26 2015 01:18
@MSWindows10 ok, they give you a specific example of using the <style> tags.
@Jwing28 Ahh - I was going to say you could do this in Excel really easily :D
MSWindows10
@MSWindows10
Sep 26 2015 01:19
at the top. I got that right
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:19
Jonathan Lee
@Jwing28
Sep 26 2015 01:19
@SaintPeter ah hahah yeah for sure, i built this for myself, but also as a project for a program im applying for
Rex Schrader
@SaintPeter
Sep 26 2015 01:19
@MSWindows10 ok, and you have your style definition for h2, you need to set the color to blue.
MSWindows10
@MSWindows10
Sep 26 2015 01:19
nope. it somewhat hid the instructions. can't see em
Jonathan Lee
@Jwing28
Sep 26 2015 01:19
@SaintPeter i dont really know if this is up to standard since create a project was vague but they did say try to stick with plain JS
@abhisekp thanks i will take a look at that too!
CamperBot
@camperbot
Sep 26 2015 01:20
jwing28 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 476 | @abhisekp | http://www.freecodecamp.com/abhisekp
MSWindows10
@MSWindows10
Sep 26 2015 01:20
<style>
<h2 ="color: red">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Rex Schrader
@SaintPeter
Sep 26 2015 01:20
@Jwing28 Naw, js is fine. I think a move to jQuery will help reduce your code somewhat.
@MSWindows10 The example they give is:
<style>h2 {color: red;}</style>
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:20
@Jwing28 those projects might not be applicable to your current proj. :(
Arooj
@aroojahmad
Sep 26 2015 01:21
Trying to title case sentence on Bonfire:
Jonathan Lee
@Jwing28
Sep 26 2015 01:21
@abhisekp no problem =P
MSWindows10
@MSWindows10
Sep 26 2015 01:21
@SaintPeter Thank you. it worked.
CamperBot
@camperbot
Sep 26 2015 01:21
mswindows10 sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 733 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 26 2015 01:21
@MSWindows10 :D
@MSWindows10 I'm a little concerned that you lost the directions. They're important.
Jonathan Lee
@Jwing28
Sep 26 2015 01:22
thanks @abhisekp , @SaintPeter i need to take a break now but i will review what you guys have said and try to improve my code.
CamperBot
@camperbot
Sep 26 2015 01:22
jwing28 sends brownie points to @abhisekp and @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: jwing28 already gave abhisekp points
:star: 734 | @saintpeter | http://www.freecodecamp.com/saintpeter
Arooj
@aroojahmad
Sep 26 2015 01:22
str.split(' ');
for(i = 0; i < str.length; i++) {
str[i].charAt(0).toUpperCase();
}
return str;
Does this need a join method?
'
MSWindows10
@MSWindows10
Sep 26 2015 01:22
maybe.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:22
@Jwing28 or I think you can manually create jQuery like functions to reduce the clutter e.g.
var $ = function(selector) {
    return document.querySelectorAll(selector);
}
Rex Schrader
@SaintPeter
Sep 26 2015 01:24
@aroojahmad Yes, but you also need to understand that in javascript strings are immutable. That means they cannot be changed once created. The toUpperCase() function returns a new string. If you don't write it back to a string, nothing will be changed.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:24
explain format
CamperBot
@camperbot
Sep 26 2015 01:24

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Rex Schrader
@SaintPeter
Sep 26 2015 01:24
@aroojahmad Also, not sure why you are splitting the string.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:24
@aroojahmad :point_up: September 26, 2015 6:54 AM
Jonathan Lee
@Jwing28
Sep 26 2015 01:24
@abhisekp cool idea! i will make a note of that
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:25
@Jwing28 but it won't give you function chaining functionality of jQuery tho
Jonathan Lee
@Jwing28
Sep 26 2015 01:25
@abhisekp okay
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:26
@Jwing28 replace var $ = function (selector) with function $(selector)
Arooj
@aroojahmad
Sep 26 2015 01:26
@SaintPeter Split the string to make an array
Rex Schrader
@SaintPeter
Sep 26 2015 01:27
@aroojahmad Ah, I see. But remember that split returns an array. It doesn't modify str, so right now your split is not doing anything.
Jonathan Lee
@Jwing28
Sep 26 2015 01:27
i definitely think i can shorten my code based on what you both have said. i think i need to think about the structure more since i think it can be shortened with functions or maybe populating array with the values then using a loop to send those values to the cells, if thats what @SaintPeter was saying
i gotta go now for a bit but will be on later to check if anyone said anything, thanks again
CamperBot
@camperbot
Sep 26 2015 01:28
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:28
Split to create Array and Stay Happy :)
Rex Schrader
@SaintPeter
Sep 26 2015 01:29
@Jwing28 Or using an array to hold the IDs and/or structuring the IDs or maybe make an ID maker function.
@abhisekp You make me lose the ability to even
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:30
This message was deleted
Arooj
@aroojahmad
Sep 26 2015 01:31
@SaintPeter Thank you for the tip. ```js
var array = str.split(‘ ‘)
for (i = 0; i < array.length; i++) {
var string = array[i].charAt(0).toUpperCase();
}
return string;
CamperBot
@camperbot
Sep 26 2015 01:31
aroojahmad sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 736 | @saintpeter | http://www.freecodecamp.com/saintpeter
Arooj
@aroojahmad
Sep 26 2015 01:31
Sorry about in-line code problems
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:32
@SaintPeter am I adding too much of smthng? :)
Rex Schrader
@SaintPeter
Sep 26 2015 01:33
@aroojahmad Getting there. You need to update each element of the array and then rejoin that array back into a string. Right now you're creating a new string over and over again.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:33
@aroojahmad You need to read the wiki :point_up: September 26, 2015 6:54 AM
Over and over again... to be only yours....
A Walk to Remember
peopleblazin
@peopleblazin
Sep 26 2015 01:40
<style>
  .red-text {
    color: red;
  }

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
What did i do wrong?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:40
@peopleblazin double style starting tags
peopleblazin
@peopleblazin
Sep 26 2015 01:41
it says to keep the monospace font though
and make a lobster font
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:42
@peopleblazin link tag outside of style tags
peopleblazin
@peopleblazin
Sep 26 2015 01:42
okay THanks @abhisekp
CamperBot
@camperbot
Sep 26 2015 01:42
peopleblazin sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 477 | @abhisekp | http://www.freecodecamp.com/abhisekp
Joshua Abu
@Absolutestunna
Sep 26 2015 01:48
help zipline random quote machine
CamperBot
@camperbot
Sep 26 2015 01:48
no wiki entry for: zipline random quote machine
:pencil: click here to create one now!after creating your page type update to reload it here
Nikolaos Alexiou
@nalexiou
Sep 26 2015 01:52
Can anyone help with setting up basejumps on Cloud9? I get an error when running the following command: grunt serve
Jalita
@UsefulPixels
Sep 26 2015 01:53
Hello campers, I’m stuck on this exercise "Waypoint: Make Object Properties Private”, I’ve tried a few different solutions but don’t understand what I need to do. Checked google too but can’t find any hints to help me forward. Anyone who can point me in the right direction?
var Car = function() {
  this.gear = 1;
  function addStyle(styleMe){
    return 'The Current Gear Is: ' + styleMe;
  }
  this.getGear = function() {
    return addStyle(this.gear);
  };
};

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

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

};

// Only change code above this line.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 01:55
@UsefulPixels first you need to figure out what are the object properties.
Could you say which are the obj. props?
@UsefulPixels assigning smthng to this makes the property publicly available for new objects created using that object.
gtg. :wave: bye
peopleblazin
@peopleblazin
Sep 26 2015 01:57
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster;
  }

  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>
First day with coding and already at this
Nikolaos Alexiou
@nalexiou
Sep 26 2015 01:58
Here is the error I get: $ grunt serve
    throw err;
          ^
Error: Cannot find module './lexer'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/coffee-script.js:10:10)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/coffee-script.js:167:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12) `
ninjatron
@ninjatron
Sep 26 2015 02:00
does anyone know angular?
peopleblazin
@peopleblazin
Sep 26 2015 02:00
seen it done but not really into it
How do i comment out my call to Google Fonts?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:09
@ninjatron wats the issue?
@peopleblazin use this
<!-- .............. -->
Jalita
@UsefulPixels
Sep 26 2015 02:10
Hi @abhisekp I think one property is the this.speed which is public, I don’t really understand the addUnit one. It says in the instructions it’s myBike.addUnit but in the code it’s written as a new function? Should I create a new property called .addUnit? The third property should be getSpeed, tried to add this. before that but doesn’t work. Or maybe I’m just on the completely wrong foot… Hm
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:11
@peopleblazin :point_up: September 26, 2015 7:39 AM
@UsefulPixels that addUnit is method (also a property called functional property)
Jalita
@UsefulPixels
Sep 26 2015 02:13
@abhisekp Ok, so the this.speed property has the methods of add.Unit
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:14
@UsefulPixels but in your code, since addUnit is not written as this.addUnit = function, hence it's just a general function.
ninjatron
@ninjatron
Sep 26 2015 02:15
@abhisekp sent code
Alexander
@teichopsia-
Sep 26 2015 02:15
folks, I'm having trouble finding out why my code isn't working for Javascript waypoint 37 - Create a Javascript Slot Machine
This is my code:
```
    slotOne = Math.floor(Math.random() 
                         * (3 - 1 + 1)) + 1;

    slotTwo = Math.floor(Math.random() *
                        (3 - 1 + 1)) + 1;

    slotThree = Math.floor(Math.random() *
                        (3 - 1 + 1)) + 1;
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:16
@UsefulPixels basically in the Car function (constructor), you've gear and getGear as public prop.
And in the Bike function (contructor), you've speed as public prop.
Alexander
@teichopsia-
Sep 26 2015 02:16
it's telling me that:
You should have used Math.floor(Math.random() * (3 - 1 + 1)) + 1; three times to generate your random numbers.
Jalita
@UsefulPixels
Sep 26 2015 02:17
Hm, so just a general function of that property. If I wanted to make this.speed private I thought I had to remove “this” but that didn’t work.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:18
@UsefulPixels remove this and add the var keyword before it to make it a normal variable rather than a prop.
Alexander
@teichopsia-
Sep 26 2015 02:18
Nevermind... it was the spacing.
Jalita
@UsefulPixels
Sep 26 2015 02:20
@abhisekp Ok, but I thought the exercise wanted me to keep it as a property? Really confused now
Nikolaos Alexiou
@nalexiou
Sep 26 2015 02:22
Where can I get support for setting up Basejumps/MEAN stack? I am following the instructions in the Waypoint and I've been stuck for days :-(
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:23
@UsefulPixels whc waypt.?
Jalita
@UsefulPixels
Sep 26 2015 02:23
@abhisekp This one "Waypoint: Make Object Properties Private” and thanks for your help! Been stuck on this for two days now
CamperBot
@camperbot
Sep 26 2015 02:23
usefulpixels sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 478 | @abhisekp | http://www.freecodecamp.com/abhisekp
Jalita
@UsefulPixels
Sep 26 2015 02:25
@abhisekp when I removed thisand replaced with varone error message went away but I still don’t understand the logic which is not good.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:26
explain js res
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:26
@UsefulPixels if you could spend sometime, then go thru this 3.5 hr vid. https://www.youtube.com/watch?v=Bv_5Zv5c-Ts
@UsefulPixels that'll actually help u in the long run.
Jalita
@UsefulPixels
Sep 26 2015 02:27
@abhisekp thanks! Will do
CamperBot
@camperbot
Sep 26 2015 02:27
usefulpixels sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: usefulpixels already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:28
@UsefulPixels :warning: it's not for beginners but watch it 3.5hrs (and don't ask questions). At the end of the vid. you'll know what you need to know. :)
E-Tank
@E-Tank
Sep 26 2015 02:29
Wait, what? What did I do? I'm sorry if I did something wrong.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:30
@E-Tank lolz :D No. You didn't.
CamperBot
@camperbot
Sep 26 2015 02:30
abhisekp sends brownie points to @e-tank :sparkles: :thumbsup: :sparkles:
:star: 245 | @e-tank | http://www.freecodecamp.com/e-tank
Jalita
@UsefulPixels
Sep 26 2015 02:30
@abhisekp haha ok, will do, thanks for all the links
CamperBot
@camperbot
Sep 26 2015 02:30
usefulpixels sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: usefulpixels already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:30
@E-Tank that's the wrong thing. :P :point_up: September 26, 2015 8:00 AM
Jesse
@jctm30
Sep 26 2015 02:30
function where(arr, num) {
  var newArr = arr[0];
  newArr.push(num);
  newArr.sort(function(a,b) {return a-b});
  return newArr.indexOf(num);
}

where([40, 60], 50, "");
hey guys, im doing the where do i belong bonfire. what am i missing here?
it says that newArr.push is not a function
E-Tank
@E-Tank
Sep 26 2015 02:31
I glanced upwards and it said that the bot was having a lot of issues thanks to me. I have no clue whats going on.
CamperBot
@camperbot
Sep 26 2015 02:31
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:31
@E-Tank don't worry! it's sm internal bot issues with the word tank
CamperBot
@camperbot
Sep 26 2015 02:31
abhisekp sends brownie points to @e-tank :sparkles: :thumbsup: :sparkles:
:warning: abhisekp already gave e-tank points
E-Tank
@E-Tank
Sep 26 2015 02:32
Oh, Thank goodness. I was afraid that I'd screwed something up somehow.
CamperBot
@camperbot
Sep 26 2015 02:32
if you want to thank someone, put an @ before their name!
E-Tank
@E-Tank
Sep 26 2015 02:32
Yes, Camperbot. I understand. Tha-. . . you have my gratitude.
ninjatron
@ninjatron
Sep 26 2015 02:33
@abhisekp hey i think i have a cleaner question
so what i want to achieve is this
data-ng-options="p as p.name for p in priorities"
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:34
@jctm30 you've assigned a number to newArr var and numbers don't have a push method
ninjatron
@ninjatron
Sep 26 2015 02:34
so all i need to do is to get p.id as the value to pass ng-modal
Jesse
@jctm30
Sep 26 2015 02:37
@abhisekp i did? i thought it was just the arr[0]
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:37
arr[0] is a number
Jesse
@jctm30
Sep 26 2015 02:39
@abhisekp i figured it out! thanks
CamperBot
@camperbot
Sep 26 2015 02:39
jctm30 sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 479 | @abhisekp | http://www.freecodecamp.com/abhisekp
peopleblazin
@peopleblazin
Sep 26 2015 02:54
how do i degrade to a font?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 02:56
@peopleblazin it's called fallback
just append the fallback fonts comma separated after Lobster
if the font name has spaces e.g. Times New Roman, just quote it 'Times New Roman'
easy peasy lemon squeezy!
E-Tank
@E-Tank
Sep 26 2015 03:49
Gaaah. I can't find anything on how to select and remove spaces and punctuation. I know it's a Regex thing, and you do .replace(regexstuff, ''); but for the life of me I cannot find the thing. Is it g\s for spaces in all strings? I can't find the thing on punctuation.
Rex Schrader
@SaintPeter
Sep 26 2015 03:50
@E-Tank Try testing at http://regex101.com
CamperBot
@camperbot
Sep 26 2015 03:50
saintpeter sends brownie points to @e-tank :sparkles: :thumbsup: :sparkles:
:star: 246 | @e-tank | http://www.freecodecamp.com/e-tank
DJ
@qualitymanifest
Sep 26 2015 04:09
tank
CamperBot
@camperbot
Sep 26 2015 04:09
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Sep 26 2015 04:09
aha. i was wondering why it send him a thank. it's built into his name haha
CamperBot
@camperbot
Sep 26 2015 04:09
if you want to thank someone, put an @ before their name!
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:10
@qualitymanifest dcsan/gitterbot#142
@SaintPeter have you seen Plunker?
DJ
@qualitymanifest
Sep 26 2015 04:11
@abhisekp ah. tanks for the enlightenment
CamperBot
@camperbot
Sep 26 2015 04:11
qualitymanifest sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
tva10
@tva10
Sep 26 2015 04:11
@0-tank
CamperBot
@camperbot
Sep 26 2015 04:11
:star: 480 | @abhisekp | http://www.freecodecamp.com/abhisekp
tva10
@tva10
Sep 26 2015 04:12
tank
CamperBot
@camperbot
Sep 26 2015 04:12
if you want to thank someone, put an @ before their name!
tva10
@tva10
Sep 26 2015 04:12
@camperbot tank
CamperBot
@camperbot
Sep 26 2015 04:12
tva10 sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:12
oh! pls stop it... :(
CamperBot
@camperbot
Sep 26 2015 04:12
:star: 259 | @camperbot | http://www.freecodecamp.com/camperbot
Eva
@evasyl1
Sep 26 2015 04:27
Hi, I am getting close on Bonfire: Confirm the Ending but not quite there. I have got it to confirm that "n" is the last character of "Bastian", but not that "name" is the ending of "He has to give me a new name" -- and how would I get the same code to confirm both, because one is looking for a character within a word and the other is looking for a whole word?
function end(str, target) {
return Boolean(target===str.substr(-1,1));
}

end("Bastian", "n", "");
Carly Wysocki
@carlylillian
Sep 26 2015 04:31
Hello, I have what is probably a dumb question, but I am a beginner so I hope you won't judge me too harshly! haha I just finished going through the jQuery course, and I was wondering what exactly is the purpose of adjusting HTML or CSS with jQuery, rather than making your changes right in the HTML or CSS itself?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:31
@evasyl1 you can split and compare the last index
@carlylillian you're being judged. :P
@carlylillian bcoz of dynamics!!
Eva
@evasyl1
Sep 26 2015 04:32
@abhisekp What does that mean?
Rex Schrader
@SaintPeter
Sep 26 2015 04:32
@carlylillian You can use it for things like animations and interactive webpages. They don't actually cover event handlers, but you can set up things so when you click it does . . . stuff
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:33
@carlylillian JS adds interaction dynamically depending on the present state of a pg. (whc might differ from user to user)
Rex Schrader
@SaintPeter
Sep 26 2015 04:33
@carlylillian Mostly it's for changing the page progrematically. For example, you can make drag and drop interactions.
@carlylillian There are also a lot of features having to do with fetching data programatically (also not demonstrated in the tutorials)
tva10
@tva10
Sep 26 2015 04:34
@carlylillian you can make a server app using JS in Node
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:34
@evasyl1 sry! split and compare won't work here. :(
@evasyl1 but you can use for loop in reverse and join the characters and compare it
@evasyl1 you can also harness the length property of strings in your code
Eva
@evasyl1
Sep 26 2015 04:37
@abhisekp But if I did either of those things, how would it know where to begin the target?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:37
@evasyl1 harness the length prop. of string
Carly Wysocki
@carlylillian
Sep 26 2015 04:38
@abhisekp @SaintPeter @tva10 Thank you very the help. I feel like I'm still a bit confused but I guess it will make more sense as I code more and use jQuery for more things. :smile:
CamperBot
@camperbot
Sep 26 2015 04:38
carlylillian sends brownie points to @abhisekp and @saintpeter and @tva10 :sparkles: :thumbsup: :sparkles:
:star: 482 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 738 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 253 | @tva10 | http://www.freecodecamp.com/tva10
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:38
@carlylillian certainly. The need of JS will reveal soon. :)
tva10
@tva10
Sep 26 2015 04:39
@carlylillian Look around this popular JS libs too: http://bower.io/search/
sometimes they may be more useful than JQurey
Rex Schrader
@SaintPeter
Sep 26 2015 04:40
@carlylillian Mostly, though, it simplifies interaction with the DOM and makes it cross-browser compatible.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:40
@tva10 that's overwhelming
Aaron Markle
@aaronmarkle
Sep 26 2015 04:43
if i'm running through a loop statement, can i set a parameter like this?
for (var j=0; j < 10 || otherVariable === false; j++)
tva10
@tva10
Sep 26 2015 04:44
@aaronmarkle you can write more simplier: for (var j=0; j < 10 || !otherVariable; j++)
Rex Schrader
@SaintPeter
Sep 26 2015 04:44
@aaronmarkle Yes, but I don't think it'll do what you want.
tva10
@tva10
Sep 26 2015 04:44
may be
Aaron Markle
@aaronmarkle
Sep 26 2015 04:44
@tva10 thanks
CamperBot
@camperbot
Sep 26 2015 04:44
aaronmarkle sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:warning: aaronmarkle already gave tva10 points
tva10
@tva10
Sep 26 2015 04:44
if you whant you can break; from the loop
Rex Schrader
@SaintPeter
Sep 26 2015 04:44
@aaronmarkle Well, not sure what you want it to do. But it's certainly valid code. The loop continues to loop while the middle part returns true.
Aaron Markle
@aaronmarkle
Sep 26 2015 04:45
@SaintPeter i want the loop to stop once a certain variable is assigned the value false
@tva10 ok i can just put break; and that will also stop the loop?
Rex Schrader
@SaintPeter
Sep 26 2015 04:45
@aaronmarkle You can do that, or you can use the break; command. Or you can return out of the funciton, if that's what you need.
tva10
@tva10
Sep 26 2015 04:45
@aaronmarkle it also get off the loop
@aaronmarkle there is continue; operator to take next step of loop
Aaron Markle
@aaronmarkle
Sep 26 2015 04:46
function mutation(arr) {
  for (var j=0; j<arr.length; j++){
    if (arr[0].indexOf(arr[1][j]) === -1){
      return false;
    }
  }
don't pay attention to the actualy if statement, im not sure if it makes sense yet lol
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:47
@aaronmarkle but it's not a good idea to use break;. If you're using it, that means you need to fix your logic.
Aaron Markle
@aaronmarkle
Sep 26 2015 04:47
@abhisekp i want the function to basically end once that return false; goes through
Aayush Kapoor
@xeoneux
Sep 26 2015 04:48
@aaronmarkle
```js
function mutation(arr) {
  for (var j=0; j<arr.length; j++){
    if (arr[0].indexOf(arr[1][j]) === -1){
      break; // Break the loop and continue the rest of the function
      continue; // Skip the current iteration of the loop and continue the loop
    }
  }
Aaron Markle
@aaronmarkle
Sep 26 2015 04:49
lol thank you everyone for the help, i will be back once i flesh out the entire code lol
CamperBot
@camperbot
Sep 26 2015 04:49
if you want to thank someone, put an @ before their name!
Aaron Markle
@aaronmarkle
Sep 26 2015 04:49
@xeoneux @abhisekp @SaintPeter @tva10 thank you, brb with new code :P (or not if it passes)
CamperBot
@camperbot
Sep 26 2015 04:49
aaronmarkle sends brownie points to @xeoneux and @abhisekp and @saintpeter and @tva10 :sparkles: :thumbsup: :sparkles:
:warning: aaronmarkle already gave abhisekp points
:warning: aaronmarkle already gave tva10 points
:star: 739 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 223 | @xeoneux | http://www.freecodecamp.com/xeoneux
clintbarton
@clintbarton
Sep 26 2015 04:54
how do i change the size of an image?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:54
@clintbarton there are 3 ways
@clintbarton you can HARD code, SOFT code or DYNAMIC code
clintbarton
@clintbarton
Sep 26 2015 04:55
okay? i don't understand? i'm sorry
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:55

@clintbarton

HARD code

Use img tag
<img src="xyz.jpg" width="123" height="123">

clintbarton
@clintbarton
Sep 26 2015 04:55
oh! @abhisekp thank you
CamperBot
@camperbot
Sep 26 2015 04:55
clintbarton sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 483 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:56

@clintbarton

SOFT code

Use css

img {
    width: 123px;
    height: 123px;
}
clintbarton
@clintbarton
Sep 26 2015 04:57
i see. @abhisekp life-saver
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:57

@clintbarton

DYNAMIC code

Use JS

var img = document.getElementsByTagName('img')[0];
img.style.width = 123 + 'px';
img.style.height = 123 + 'px';
clintbarton
@clintbarton
Sep 26 2015 04:58
@abhisekp thanks so much!
CamperBot
@camperbot
Sep 26 2015 04:58
clintbarton sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: clintbarton already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:58

@clintbarton there is one more way!

The Wise Way!

Use photoshop and resize the img. to appropriate size. :)

clintbarton
@clintbarton
Sep 26 2015 04:59
haha, thanks again @abhisekp
CamperBot
@camperbot
Sep 26 2015 04:59
clintbarton sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:warning: clintbarton already gave abhisekp points
Abhisek Pattnaik
@abhisekp
Sep 26 2015 04:59
@clintbarton the last one is the best way in fact for best performance and optimization.
clintbarton
@clintbarton
Sep 26 2015 05:00
i'll keep it in mind @abhisekp
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:00
cheers :beers:
Aaron Markle
@aaronmarkle
Sep 26 2015 05:05
so i was able to solve the Mutations bonfire, but i had a question, is it taboo to post a solution in here?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:05
@aaronmarkle head over to https://gitter.im/FreeCodeCamp/CodeReview and post solns. there for reviewing.
Aaron Markle
@aaronmarkle
Sep 26 2015 05:05
thanks
CamperBot
@camperbot
Sep 26 2015 05:05
if you want to thank someone, put an @ before their name!
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:10
Hello everyone. Now I need help with Bonfire Factorialize! Been stumped since last night.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:11
@aaronmarkle but for questions based on your soln, you can ask here. :)
@IshMary wats your progress in that bf?
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:13

@abhisekp I've done this:
function factorialize(num) {
var i = 1;
if(num === 0){
return 1;
}else{
while(num >= 1){
return i = num-- * i;
}
}
}

factorialize(5);

Scores the first part right. Second part is way weird
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:15
explain format
CamperBot
@camperbot
Sep 26 2015 05:15

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:15
@IshMary :point_up: September 26, 2015 10:45 AM
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:17
function factorialize(num) {
  var i = 1;
  if(num === 0){
    return 1;
  }else{
    while(num >= 1){
    return i = num-- * i;
    }
  }
}

factorialize(5);
Thanks for the tip @abhisekp .
CamperBot
@camperbot
Sep 26 2015 05:17
ishmary sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 484 | @abhisekp | http://www.freecodecamp.com/abhisekp
Rex Schrader
@SaintPeter
Sep 26 2015 05:18
@IshMary That's close, but if you return it exist the function. You also need to loop - factorial is (5 4 3 2 1)
@IshMary It looks like you've seen a solution online for a recurrsive solution
Aayush Kapoor
@xeoneux
Sep 26 2015 05:18
@IshMary You while loop is returning in the first iteration and that will end the while loop
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:19
@IshMary if you've seen a soln. that's a bad practice and doesn't add much to your learning unless you've tried it for sm days.
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:19
@SaintPeter I didn't give the recursive solutions a second look. I saw them though. I think my logic is somewhat convoluted.
Aayush Kapoor
@xeoneux
Sep 26 2015 05:20
function bouncer(arr) {
  return arr.filter(function(x) {
    return x != false;
  });
}

bouncer([7, "ate", "", false, 9], "");
Why is this code failing the third test in the Falsy Bouncer Bonfire?
The third test is [false, null, 0] should return []
Rex Schrader
@SaintPeter
Sep 26 2015 05:21
@xeoneux Just return x
@IshMary ok - at any rate, you'll need a loop.
Aayush Kapoor
@xeoneux
Sep 26 2015 05:22
Hahaha
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:22
@SaintPeter your help is needed in CodeReview chat room
Aayush Kapoor
@xeoneux
Sep 26 2015 05:22
It was that simple!
Thanks @SaintPeter :smile:
CamperBot
@camperbot
Sep 26 2015 05:22
xeoneux sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 740 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Sep 26 2015 05:22
@xeoneux It's basically a trick question :D
Aayush Kapoor
@xeoneux
Sep 26 2015 05:22
Hehe, got it!
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:23
THANKS @xeoneux . Worked better than magic.
CamperBot
@camperbot
Sep 26 2015 05:23
ishmary sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 227 | @xeoneux | http://www.freecodecamp.com/xeoneux
Rex Schrader
@SaintPeter
Sep 26 2015 05:23
@abhisekp I can't seem to speak in the codeReview channel
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:23
```js

function factorialize(num) {
var i = 1;
if(num === 0){
return 1;
}else{
while(num >= 1){
i = num-- * i;
}
return i;
}
}

factorialize(5);

Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:24
@SaintPeter but why? Have they banned you?
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:24
```
Rex Schrader
@SaintPeter
Sep 26 2015 05:24
@abhisekp Well, I've never seen it before - can you see if I have been invited? Maybe the permissions are wrong?
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:24
```js

function factorialize(num) {
var i = 1;
if(num === 0){
return 1;
}else{
while(num >= 1){
i = num-- * i;
}
return i;
}
}

factorialize(5);

```js
Aayush Kapoor
@xeoneux
Sep 26 2015 05:25
@IshMary End the block with only ```
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:25

function factorialize(num) {
var i = 1;
if(num === 0){
return 1;
}else{
while(num >= 1){
i = num-- * i;
}
return i;
}
}

factorialize(5);
```

Aayush Kapoor
@xeoneux
Sep 26 2015 05:25
@IshMary Start it with ```js
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:25
:-)
Aayush Kapoor
@xeoneux
Sep 26 2015 05:25
@IshMary But end it with ```
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:25
@SaintPeter i've manually added you but there is no reason why you couldn't speak in that channel.
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:26
```js
```js
Abhisek Pattnaik
@abhisekp
Sep 26 2015 05:26
@IshMary read the wiki :point_up: September 26, 2015 10:45 AM
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:26
function factorialize(num) {
  var i = 1;
  if(num === 0){
    return 1;
  }else{
    while(num >= 1){
     i = num-- * i;
    }
    return i;
  }
}

factorialize(5);
Finally
Aayush Kapoor
@xeoneux
Sep 26 2015 05:27
Congrats!
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:27
THankxs @xeoneux
DTing
@dting
Sep 26 2015 05:37
@IshMary good job. I have some notes on that bf if you are interested in taking a look https://github.com/dting/fccbonfires/blob/master/basic/Basic%2003%20-%20Factorialize%20a%20Number.ipynb
Aaron Markle
@aaronmarkle
Sep 26 2015 05:39
does while(--num) stop at when num equals 0, because 0 translates to false?
DTing
@dting
Sep 26 2015 05:40
ya
Aaron Markle
@aaronmarkle
Sep 26 2015 05:41
i'll have to keep that in mind, haven't had a lot of practice with while's
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 05:47
@dting I'll look at it asap.
Thank you so much.
CamperBot
@camperbot
Sep 26 2015 05:47
ishmary sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1252 | @dting | http://www.freecodecamp.com/dting
Jason Yang
@zjasonyang
Sep 26 2015 06:58
Hi all, new to here
is there a way to check my code with chrome developer tools?
Aayush Kapoor
@xeoneux
Sep 26 2015 06:59
Hi @zjasonyang
Welcome
Jason Yang
@zjasonyang
Sep 26 2015 06:59
hi @xeoneux
Aayush Kapoor
@xeoneux
Sep 26 2015 06:59
You can write console.log() statements and check the console
Jason Yang
@zjasonyang
Sep 26 2015 06:59
yeah
function palindrome(str) {
// Good luck!
var tmp=str.replace(/\w/gi,"");
var tmp=str.split(str.toLowerCase,"");
for(i=0,j=str.length-1;i<=j;i++,j--){
if(str[i]!==str[j])
return false;}
return true;
}
palindrome("eye");
console.log(palindrome("eye"));
developer tools, in the console tab shows Should be displaying bad tests
Aayush Kapoor
@xeoneux
Sep 26 2015 07:02
function palindrome(str) {
  // Good luck!
  var tmp=str.replace(/\w/gi,"");
  var tmp=str.split(str.toLowerCase,""); 
  for(i=0,j=str.length-1;i<=j;i++,j--){
    console.log(i) // Print value of i for each iteration
    if(str[i]!==str[j]) 
      return false;}
    return true;
}
console.log(palindrome("eye")); 
// console.log(palindrome("eye")); will call the function 2nd time
Jason Yang
@zjasonyang
Sep 26 2015 07:02
let me check this. thanks!
CamperBot
@camperbot
Sep 26 2015 07:02
if you want to thank someone, put an @ before their name!
Aayush Kapoor
@xeoneux
Sep 26 2015 07:02
It shows that because your code is not passing all the tests
Jason Yang
@zjasonyang
Sep 26 2015 07:03
@xeoneux got it. thanks again
CamperBot
@camperbot
Sep 26 2015 07:03
zjasonyang sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 234 | @xeoneux | http://www.freecodecamp.com/xeoneux
DTing
@dting
Sep 26 2015 07:04
you might want to console.log your tmp variable
you are spliting on a function
str.toLowerCase is the toLowerCase function. to call that function you want to use ().
you also declare the same variable twice
you regex also is matching all [a-zA-Z0-9_] https://regex101.com/r/nN8pK1/1
and replacing those with empty string you probably want to replace not [a-zA-Z0-9_]
Carl Parrish
@carl-parrish
Sep 26 2015 07:07

help

var sum = 0;
var fs  = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (number) {
    if (number != null) {
          console.log(parseInt(number));


    }
});

when I pass it a file name with the following text inside.

27
13
4

I’m getting back the following output.

☁  codeEval  node sum.js sum.txt
27
13
4
NaN

Where is the NaN coming from?

DTing
@dting
Sep 26 2015 07:08
@carl-parrish try logging "number" before the ifstatement to get a clearer picture on what is happening
Carl Parrish
@carl-parrish
Sep 26 2015 07:12

@dting

var sum = 0;
var fs  = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (number) {
    console.log(number);
    if (number != null) {
          console.log(parseInt(number));
    }
});

gives me

☁  codeEval  node sum.js sum.txt
27
27
13
13
4
4

NaN
DTing
@dting
Sep 26 2015 07:13
you are checking if number is != null
number is probably empty string not null in that last case
Aayush Kapoor
@xeoneux
Sep 26 2015 07:14
Did you edit the sum.txt file in nano?
DTing
@dting
Sep 26 2015 07:15
var a = "27\n13\n4\n";
a.split('\n');
["27", "13", "4", ""]
Carl Parrish
@carl-parrish
Sep 26 2015 07:15
@xeoneux vim
where would the empty string come from?
same input file with the following ruby code works.
sum = 0
File.open(ARGV[0]).each_line do |num|
    sum += num.chomp.to_i unless num.chomp.nil?
end
puts sum
Okay this seems to be working
var sum = 0;
var fs  = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (number) {
    if (number != '') {
          sum += parseInt(number);
    }
});
console.log(sum);
thanks.
CamperBot
@camperbot
Sep 26 2015 07:18
if you want to thank someone, put an @ before their name!
Carl Parrish
@carl-parrish
Sep 26 2015 07:18
thanks @dting
CamperBot
@camperbot
Sep 26 2015 07:18
carl-parrish sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1254 | @dting | http://www.freecodecamp.com/dting
Aayush Kapoor
@xeoneux
Sep 26 2015 07:18
@carl-parrish Try if (number != false)
Carl Parrish
@carl-parrish
Sep 26 2015 07:20
@xeoneux also seems to work.
DTing
@dting
Sep 26 2015 07:25
using loose false comparison works for sumation but would fail if you were trying to multiply.
also equivalent would be if (number)
using loose false comparison would skip 0's
Carl Parrish
@carl-parrish
Sep 26 2015 07:29
hmmm JavaScript seems to suck at file I/O same exercise in four languages and Javascript took the longest.
https://www.dropbox.com/s/7bzyk7e2b4i91wr/Screenshot%202015-09-26%2000.28.48.png?dl=0
DTing
@dting
Sep 26 2015 07:31
your screenshot is taking a while to sync. can you drag and drop the png into this window?
Aayush Kapoor
@xeoneux
Sep 26 2015 07:33
arr.filter(function(x) {
    return x != arg[1] && x != arg[2] && x != arg[3];
  });
}
How can I compare the value for all the values of the array?
Instead of x != arg[1] && x != arg[2] && x != arg[3];
DTing
@dting
Sep 26 2015 07:33
indexOf
or a loop
Aayush Kapoor
@xeoneux
Sep 26 2015 07:36
How will introduce a loop if it's a return statement with &&
bf Seek and Destroy
CamperBot
@camperbot
Sep 26 2015 07:37

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.

more info:  bf details | bf links | hint

Monesul Haque
@mones-cse
Sep 26 2015 07:37
hi @all
DTing
@dting
Sep 26 2015 07:38
arr.filter(function(x) {
  for (var i = 0; i < arg.length; i++) {
    if (x === arg[i]) {
      return false;
    }
  }
  return true;
});
Carl Parrish
@carl-parrish
Sep 26 2015 07:38
This message was deleted
DTing
@dting
Sep 26 2015 07:39
Screen Shot 2015-09-26 at 12.38.56 AM.png
Monesul Haque
@mones-cse
Sep 26 2015 07:39
can any one help me about how to convert an object into an array ?
Aayush Kapoor
@xeoneux
Sep 26 2015 07:39
I need to return x if it goes through all the checks
Can I post my solution to the Bonfire here?
DTing
@dting
Sep 26 2015 07:40
sure
Aayush Kapoor
@xeoneux
Sep 26 2015 07:41
function destroyer(arr) {
  var arg = arguments;
  return arr.filter(function(x) {
    return x != arg[1] && x != arg[2] && x != arg[];
  });
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3, "");
This solution works but is not ideal
Forgot to put 3 there*
Francis Torda
@freeman29
Sep 26 2015 07:43
@xeoneux what bonfire is that?
Aayush Kapoor
@xeoneux
Sep 26 2015 07:43
bf Seek and Destroy
CamperBot
@camperbot
Sep 26 2015 07:43

:fire:Bonfire: Seek and Destroy :link:

function destroyer(arr) {
  // Remove all the values
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.

more info:  bf details | bf links | hint

DTing
@dting
Sep 26 2015 07:44
replace your hard coded return statement with a loop that iterates over arg
see the code here :point_up: September 26, 2015 12:38 AM
or use Array.indexOf
bf links
CamperBot
@camperbot
Sep 26 2015 07:45
Aayush Kapoor
@xeoneux
Sep 26 2015 07:47
Yeah!
Thanks @dting
CamperBot
@camperbot
Sep 26 2015 07:47
xeoneux sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: xeoneux already gave dting points
x34passenger
@x34passenger
Sep 26 2015 07:58
Regarding Bonfire: Sum All Odd Fibonacci Numbers, I got sumFibs(4) correct, but how do we test the other huge ones like sumFibs(1000)?
Yan Kozlovskiy
@YanKozlovskiy
Sep 26 2015 08:00
!title case
help title case
CamperBot
@camperbot
Sep 26 2015 08:00

:point_right: bonfire title case a sentence [wiki]

Explanation:

We have to return a sentence with camel case. This means that the first letter will always be in uppercase and the rest lowercase.

:pencil: read more about bonfire title case a sentence on the FCC Wiki

DTing
@dting
Sep 26 2015 08:00
bf sum
CamperBot
@camperbot
Sep 26 2015 08:00

:fire:Bonfire: Sum All Numbers in a Range :link:

function sumAll(arr) {
  return(1);
}

sumAll([1, 4]);

We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them.

more info:  bf details | bf links | hint

DTing
@dting
Sep 26 2015 08:00
bf fib
CamperBot
@camperbot
Sep 26 2015 08:00

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

function sumFibs(num) {
  return num;
}

sumFibs(4);

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

more info:  bf details | bf links | hint

DTing
@dting
Sep 26 2015 08:01
@x34passenger change sumFibs(4); to sumFibs(1000);
x34passenger
@x34passenger
Sep 26 2015 08:01
Isn't the solution incorrect expect(sumFibs(1000)).to.equal(1785);, shouldn't it be 1597?
DTing
@dting
Sep 26 2015 08:02
are you including num?
x34passenger
@x34passenger
Sep 26 2015 08:02
@dting what do you mean num?
DTing
@dting
Sep 26 2015 08:02
whats your code look like?
x34passenger
@x34passenger
Sep 26 2015 08:03
DTing
@dting
Sep 26 2015 08:03
you are getting a sum?
not an actual fib number
Return the sum of all odd Fibonacci numbers up to and including the passed number if it is a Fibonacci number.
x34passenger
@x34passenger
Sep 26 2015 08:04
@dting I am getting a sum, however based on the url, isn't the solution incorrect for fib 1000, isn't the solution 1597 instead of 1785?
DTing
@dting
Sep 26 2015 08:04
that is a sequence of fib numbers
you are getting a sum of odd fib numbers up to 1000
1 + 1 + 3 + 5 + 13 + 21 + 55 + 89 + 233 + 377 + 987
x34passenger
@x34passenger
Sep 26 2015 08:05
@dting what I am asking is isn't the solution incorrect based on the url I posted, shouldn't it be 1597 instead of 1785?
DTing
@dting
Sep 26 2015 08:06
why would it be 1597?
DTing
@dting
Sep 26 2015 08:06
yes. i saw the link
x34passenger
@x34passenger
Sep 26 2015 08:06
@dting okay, then?
DTing
@dting
Sep 26 2015 08:07
why would it be 1597?
that sequence in the link isnt a sum
those are actual fib numbers
you need to find the sum of the fib numbers less than or equal to 1000 that are odd
x34passenger
@x34passenger
Sep 26 2015 08:08
@dting I see what you are saying
DTing
@dting
Sep 26 2015 08:08
1 + 1 + 3 + 5 + 13 + 21 + 55 + 89 + 233 + 377 + 987
x34passenger
@x34passenger
Sep 26 2015 08:08
@dting okay, got confused, thanks for clarifying
CamperBot
@camperbot
Sep 26 2015 08:08
x34passenger sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1255 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 26 2015 08:08
np
x34passenger
@x34passenger
Sep 26 2015 08:08
@dting got it now
x34passenger
@x34passenger
Sep 26 2015 08:25
@x34passenger regarding sumFibs(4), the fib sequence is 1, 1, 2, 3, isn't that 7 instead of 5, doesn't the fib sequence include 2?
@dting regarding sumFibs(4), the fib sequence is 1, 1, 2, 3, isn't that 7 instead of 5, doesn't the fib sequence include 2?
DTing
@dting
Sep 26 2015 08:26
2 is not odd
1 + 1 + 3 is 5, 2 is excluded because it is an even number
x34passenger
@x34passenger
Sep 26 2015 08:27
@dting sorry I missed, that, you are right, I was rereading and the sum of the odd
thanks @dting
CamperBot
@camperbot
Sep 26 2015 08:27
x34passenger sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: x34passenger already gave dting points
Lukas
@lladynski
Sep 26 2015 08:29
Hi guys
one question
expect(drop([1, 2, 3, 7, 4], function(n) { return n > 5; })).to.eqls([7, 4]);expected [ 7 ] to deeply equal [ 7, 4 ]
Is here a mistake made by freecodecamp or I don't see something
how 4 can be bigger than 5?
DTing
@dting
Sep 26 2015 08:30
bf drop
CamperBot
@camperbot
Sep 26 2015 08:30

:fire:Bonfire: Drop it :link:

function drop(arr, func) {
  // Drop them elements.
  return arr;
}

drop([1, 2, 3], function(n) {return n < 3; });

Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.

more info:  bf details | bf links | hint

Lukas
@lladynski
Sep 26 2015 08:30
a OK
thanks
CamperBot
@camperbot
Sep 26 2015 08:30
if you want to thank someone, put an @ before their name!
Lukas
@lladynski
Sep 26 2015 08:31
i get it
@camperbot thank you :)
CamperBot
@camperbot
Sep 26 2015 08:31
lladynski sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 260 | @camperbot | http://www.freecodecamp.com/camperbot
Lukas
@lladynski
Sep 26 2015 08:31
my bad ;)
DTing
@dting
Sep 26 2015 08:31
drop all elements before the statement is true
once the statement is true stop dropping the elements
Lukas
@lladynski
Sep 26 2015 08:31
@dting thanks
CamperBot
@camperbot
Sep 26 2015 08:31
lladynski sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1256 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 26 2015 08:31
np
Lukas
@lladynski
Sep 26 2015 08:32
i get it :)
do you make stats how many times the same question appeared here ? ;)
Sam
@xpkc34
Sep 26 2015 08:40

Hey all. I'm stuck on Bonfire: Chunky Monkey, I wonder if anyone can help me: I'm getting an error "seg.push is not a function", I'm sure there's some stupid error somewhere but I'm completely blind to it seemingly. Here is my code:

function chunk(arr, size) {
  ar2 = [];
  count = 0;
  count2 = 0;
  while (count < arr.length) {
    for (j = 0; j < arr.length; j = j + size) {
        seg = [];
        for (i = count2; i < count2 + size; i++) {
            seg = seg.push(arr[i]);
            count = count + 1;
            }
        count2 = count2 + size;
        ar2.push(seg);
        }
    }
    return ar2
}

I feel like there's possibly a much more elegant solution to this as well, but I want to try and make this one work...

DTing
@dting
Sep 26 2015 08:41
@lladynski there is a FreeCodeCamp/DataSince room they are trying to analyze the chat room data
@xpkc34
seg = seg.push(arr[i])
the Array.push function returns "The new length property of the object upon which the method was called."
so you are setting set = to a number
the next time you try to push to seg it will throw that error
Sam
@xpkc34
Sep 26 2015 08:43
okay
Lukas
@lladynski
Sep 26 2015 08:43
is the ";" necessary after "return" statement or not?
you miss one
Sam
@xpkc34
Sep 26 2015 08:43
so I just want seg.push(arr[i]) on it's own with out the assignment?
DTing
@dting
Sep 26 2015 08:43
semi colons are optional in js but most style guides suggest always having the semicolon
@xpkc34 yes
Aayush Kapoor
@xeoneux
Sep 26 2015 08:43
@lladynski ";" is optional everywhere in JS but sometimes causes some bugs in complex code
Sam
@xpkc34
Sep 26 2015 08:44
sick cheers
how do I give brownie points / can I
DTing
@dting
Sep 26 2015 08:45
@xpkc34 the other thing im seeing in your code is that you are using global vars everywhere
its good practice to not use global variables unless there is a good reason to
wiki brownie
CamperBot
@camperbot
Sep 26 2015 08:46

:point_right: brownie points [wiki]

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

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

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

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

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

Sam
@xpkc34
Sep 26 2015 08:47
hmm okay, I'll look into that. Thanks @dting
CamperBot
@camperbot
Sep 26 2015 08:47
xpkc34 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1257 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 26 2015 08:47
@lladynski http://mislav.uniqpath.com/2010/05/semicolons/ I personally like the semicolons everywhere because then i dont need to remember the cases where i do need them
Aniruddh Agarwal
@anrddh
Sep 26 2015 08:47
+1
Aayush Kapoor
@xeoneux
Sep 26 2015 08:48
@dting I have no idea why my code works!
bf Where art thou
CamperBot
@camperbot
Sep 26 2015 08:48

:fire:Bonfire: Where art thou :link:

function where(collection, source) {
  var arr = [];
  // What's in a name?
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).

more info:  bf details | bf links | hint

Aayush Kapoor
@xeoneux
Sep 26 2015 08:49
function where(collection, source) {
  var arr = [];
  collection.forEach(function(obj) {
    for (var key in source) {
      var flag = 0;
      if (obj.hasOwnProperty(key)) {
        if (obj[key] === source[key]) flag++;
      }
    }
    if (flag > 0) arr.push(obj);
  });
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
DTing
@dting
Sep 26 2015 08:49
which part is not making sense?
Aayush Kapoor
@xeoneux
Sep 26 2015 08:50
if (flag > 0) arr.push(obj);
I think it should not clear the last test
DTing
@dting
Sep 26 2015 08:51
ya that code actually shouldnt work
Aayush Kapoor
@xeoneux
Sep 26 2015 08:51
But it does so only because the matched object is the last one in the array!
DTing
@dting
Sep 26 2015 08:51
it looks like it is just checking the last key
probably needs more test cases
Aayush Kapoor
@xeoneux
Sep 26 2015 08:52
Yes, thought so too :smile:
DTing
@dting
Sep 26 2015 08:52
Screen Shot 2015-09-26 at 1.52.29 AM.png
maybe file a bug report
Aayush Kapoor
@xeoneux
Sep 26 2015 08:52
Is it fine if I create an issue?
Cool!
DTing
@dting
Sep 26 2015 08:55
I would mention that varying which property of source is missing from the collection elements would fix the issue.
Aayush Kapoor
@xeoneux
Sep 26 2015 09:00
Created #3502
Why is the issue not getting linked here?
FreeCodeCamp/FreeCodeCamp#3502
Got it!
@dting Can I PM you?
DTing
@dting
Sep 26 2015 09:10
okay
Pratik Ratnaparkhi
@pratikr1593
Sep 26 2015 09:38
// var numbers = [1,2,3];
// console.log(numbers); // logs [1,2,3]
// var removed = numbers.pop();
// console.log(numbers); // logs [1,2]
// console.log(removed); // logs 3




// Only change code below this line.
var myArray = ["John", 23, ["cat", 2]];
console.log(myArray);
var removed = myArray.pop();
console.log(myArray);
console.log(removed);

var removed = myArray; // This should be ["cat", 2] and myArray should now be ["John", 23]

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & removed = ' + JSON.stringify(z);})(myArray, removed);
I dont understand whats wrong here
Aayush Kapoor
@xeoneux
Sep 26 2015 09:43
@pratikr1593 What should the output be?
Pratik Ratnaparkhi
@pratikr1593
Sep 26 2015 09:46
@xeoneux it says removed variable should be ["john", 23]
Aayush Kapoor
@xeoneux
Sep 26 2015 09:47
@pratikr1593 Why are you reinitializing and setting var removed = myArray;
Pratik Ratnaparkhi
@pratikr1593
Sep 26 2015 09:48
@xeoneux I am referring the code in top comment
@xeoneux Mabe you can help ,e out?
Aayush Kapoor
@xeoneux
Sep 26 2015 09:50

At line

var removed = myArray.pop();

removed is ["cat", 2]
But after line

var removed = myArray;

There is no change to myArray and value of removed is the same as that of myArray = ["John", 23]

Pratik Ratnaparkhi
@pratikr1593
Sep 26 2015 09:55
@xeoneux okay, but what I did wrong? can you guide me?
Aayush Kapoor
@xeoneux
Sep 26 2015 09:57
@pratikr1593 Remove the var removed = myArray; statement
Pratik Ratnaparkhi
@pratikr1593
Sep 26 2015 10:06
@xeoneux Thanks, it worked
CamperBot
@camperbot
Sep 26 2015 10:06
pratikr1593 sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 241 | @xeoneux | http://www.freecodecamp.com/xeoneux
Aayush Kapoor
@xeoneux
Sep 26 2015 10:59
bf Make a Person
CamperBot
@camperbot
Sep 26 2015 10:59

:fire:Bonfire: Make a Person :link:

var Person = function(firstAndLast) {
    return firstAndLast;
};

var bob = new Person('Bob Ross');
bob.getFullName();

Fill in the object constructor with the methods specified in the tests.

more info:  bf details | bf links | hint

Aayush Kapoor
@xeoneux
Sep 26 2015 10:59
Here, the 2nd test says
expect(bob instanceof Person).to.be.true;
All my other tests are passing except this one...
Here's my code:
var Person = function(firstAndLast) {
        var fullName = firstAndLast.split(" ");
        var firstName = fullName[0];
        var lastName = fullName[1];

        function getFirstName() {
            return firstName;
        }

        function getLastName() {
            return lastName;
        }

        function getFullName() {
            return firstName + " " + lastName;
        }

        function setFirstName(first) {
            firstName = first;
        }

        function setLastName(last) {
            lastName = last;
        }

        function setFullName(firstAndLast) {
            var name = firstAndLast.split(" ");
            firstName = name[0];
            lastName = name[1];
        }

        return {
            getFirstName: getFirstName,
            getLastName: getLastName,
            getFullName: getFullName,
            setFirstName: setFirstName,
            setLastName: setLastName,
            setFullName: setFullName
        };
};

var bob = new Person('Bob Ross');
bob.getFullName();
Sam
@xpkc34
Sep 26 2015 12:28
Hi, tis me again. I'm having some trouble understanding Bonfire: Slasher Flick. From reading the description it seems straight forward enough, and I've written a function which can satisfy the last two tests. However I don't understand the first test: "[1, 2, 3], 2, [3] should return [3]". It looks like there are three arguments here when the function should only take two? And I can't really see how this result [3] corresponds with the description of the task either. Either there's a mistake here or it's very poorly explained...
bf Slasher Flick
CamperBot
@camperbot
Sep 26 2015 12:28

:fire:Bonfire: Slasher Flick :link:

function slasher(arr, howMany) {
  // it doesn't always pay to be first
  return arr;
}

slasher([1, 2, 3], 2);

Return the remaining elements of an array after chopping off n elements from the head.

more info:  bf details | bf links | hint

a1rr0wh3ad
@a1rr0wh3ad
Sep 26 2015 12:34
@xpkc34 It looks like a typo. it should just be "[1, 2, 3], 2 should return [3]."
Sam
@xpkc34
Sep 26 2015 12:34
should it not return 1 though? If we're chopping two elemnts off the end...
oh perhaps from the head it means from the beginning
Thanks @a1rr0wh3ad
CamperBot
@camperbot
Sep 26 2015 12:35
xpkc34 sends brownie points to @a1rr0wh3ad :sparkles: :thumbsup: :sparkles:
:star: 320 | @a1rr0wh3ad | http://www.freecodecamp.com/a1rr0wh3ad
a1rr0wh3ad
@a1rr0wh3ad
Sep 26 2015 12:37
@xpkc34 Oh right! Probably it means start but I'm not sure.
x34passenger
@x34passenger
Sep 26 2015 12:49
If you sum all the prime numbers up to 10, isn't the sequence 1+2+3+5+7 = 18, not 17?
Aayush Kapoor
@xeoneux
Sep 26 2015 12:51
@x34passenger 1 is not a prime number...
Luciano Oliveira
@lucky500
Sep 26 2015 12:51
This message was deleted
x34passenger
@x34passenger
Sep 26 2015 12:51
sorry, 1 isn't prime because it is only divisible by itself
Aayush Kapoor
@xeoneux
Sep 26 2015 12:52
Exactly
Alexandrix Ikechukwu
@SpaghettiThots
Sep 26 2015 12:53
How did anyone manage the logic of the palindrome exercise?
I am thinking of setting another variable to the reverse of the original string and then ultimately comparing both strings.
x34passenger
@x34passenger
Sep 26 2015 12:56
thanks @xeoneux
CamperBot
@camperbot
Sep 26 2015 12:56
x34passenger sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 242 | @xeoneux | http://www.freecodecamp.com/xeoneux
Luciano Oliveira
@lucky500
Sep 26 2015 12:58
This message was deleted
This message was deleted
how to i post an image here?
x34passenger
@x34passenger
Sep 26 2015 13:04
I don't understand how expect(smallestCommons([1,5])).to.equal(60), is the smallest common multiple just not 5?
Aayush Kapoor
@xeoneux
Sep 26 2015 13:05
@x34passenger Which challenge?
x34passenger
@x34passenger
Sep 26 2015 13:06
@xeoneux Bonfire: Smallest Common Multiple
Aayush Kapoor
@xeoneux
Sep 26 2015 13:07
@x34passenger It's for the range of numbers between them
@x34passenger [1,5] means LCM for 1, 2, 3, 4, 5, which is 60!
x34passenger
@x34passenger
Sep 26 2015 13:08
@xeoneux how do you get 60, can you do the math for me?
@xeoneux or show me the math?
@xeoneux sorry, I got it
Aayush Kapoor
@xeoneux
Sep 26 2015 13:09
@x34passenger Are you serious?
x34passenger
@x34passenger
Sep 26 2015 13:09
thanks @xeoneux
CamperBot
@camperbot
Sep 26 2015 13:09
x34passenger sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:warning: x34passenger already gave xeoneux points
Aayush Kapoor
@xeoneux
Sep 26 2015 13:09
@x34passenger Find the factors for every number first and it be
x34passenger
@x34passenger
Sep 26 2015 13:09
@xeoneux If I am serious, I am serious, sorry that my math is not that great
Aayush Kapoor
@xeoneux
Sep 26 2015 13:10
@x34passenger 1 - 1 | 2 - 1, 2 | 3 - 1, 3 | 4 - 2, 2 | 5 - 1, 5
@x34passenger Correction! 4 - 1, 2, 2
@x34passenger Take out any common factors between 2 numbers
@x34passenger 1 - | 2 - | 3 - 3 | 4 - 2 | 5 - 5
@x34passenger Multiply the remaining and then multiply the common ones exactly once!
@x34passenger The answer will be 3x2x5x(1x2) = 60
@x34passenger Thanks for helping me revise the 3rd grade :smile:
CamperBot
@camperbot
Sep 26 2015 13:13
xeoneux sends brownie points to @x34passenger :sparkles: :thumbsup: :sparkles:
:star: 216 | @x34passenger | http://www.freecodecamp.com/x34passenger
Aaron Freidus
@shadowfool
Sep 26 2015 13:17
Hey all I'm currently doing the pairwise Bonfire and don't understand this case expect(pairwise([0, 0, 0, 0, 1, 1], 1)).to.equal(10); how would the sum of the items = 10 ?
Aayush Kapoor
@xeoneux
Sep 26 2015 13:21
@shadowfool Read the question carefully
@shadowfool What you have to do is return the sum of indices where it is possible to add it with one of the elements to form the 2nd argument
@shadowfool Let's walkthrough this example
Aaron Freidus
@shadowfool
Sep 26 2015 13:22
right but if you use one you can't use it again correct?
Aayush Kapoor
@xeoneux
Sep 26 2015 13:22
@shadowfool Use one what? Element?
Aaron Freidus
@shadowfool
Sep 26 2015 13:23
"[1, 3, 2, 4], 4) would only equal 1, because only the first two elements can be paired to equal 4, and the first element has an index of 0!"
Aayush Kapoor
@xeoneux
Sep 26 2015 13:23
@shadowfool You'd HAVE to use it again, otherwise the answer will be different every time
Aaron Freidus
@shadowfool
Sep 26 2015 13:23
so I run through it using index 0 and then index 0 and index 1 = 4 so I reduce it and now the only elements remaning are 2 and 4
Aayush Kapoor
@xeoneux
Sep 26 2015 13:23
@shadowfool You did not get the question
Aaron Freidus
@shadowfool
Sep 26 2015 13:24
oh
wait
I'm an idiot
Aayush Kapoor
@xeoneux
Sep 26 2015 13:24
@shadowfool Let's take [1, 3, 2, 4], 4 as example
@shadowfool Hehe, got it now?
Aaron Freidus
@shadowfool
Sep 26 2015 13:24
yeah ... @xeoneux coffee hasn't hit yet thanks lol
CamperBot
@camperbot
Sep 26 2015 13:24
shadowfool sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 243 | @xeoneux | http://www.freecodecamp.com/xeoneux
Aayush Kapoor
@xeoneux
Sep 26 2015 13:25
:smile:
Monesul Haque
@mones-cse
Sep 26 2015 13:29
is there any one who has time to help me ?
Aaron Freidus
@shadowfool
Sep 26 2015 13:30
sure I think the coffee has hit by now
azaleas
@azaleas
Sep 26 2015 13:49

Hi guys,

I almost finished the Zipline 5 - TwitchTV JSON API, but I can't get the search done. Can some1 look at my code please, I can't get the lists to show or hide for search results.

(http://codepen.io/azaleas/pen/ZbBzbr?editors=001)

VladkoSW
@VladkoSW
Sep 26 2015 14:10

.red-text {color: red;}

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

<p>Kitty</p>

Where is mistake?

sorry
i know)
Hans van Riet
@hansinla
Sep 26 2015 14:14
@azaleas PM’ed you.
peopleblazin
@peopleblazin
Sep 26 2015 14:35
Hello again @hansinla
I have a quick question
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster;
  }

  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>
Where would i put the degrade of h2 element monospace when lobster is not available
Adrian Skelsey
@AdrianSkelsey
Sep 26 2015 14:37
I am having trouble grasping the concept in javascript of the if else statement can anyone offer some help please? Waypoint: Use Conditional Logic with If and Else Statements #32 of 40.
Aayush Kapoor
@xeoneux
Sep 26 2015 14:38
@AdrianSkelsey What exactly is the problem?
Adrian Skelsey
@AdrianSkelsey
Sep 26 2015 14:39
@xeoneux I really do not understand what is required?
peopleblazin
@peopleblazin
Sep 26 2015 14:40
can someone answer my question please
Ammar Ali Shah
@AmmarAliShah
Sep 26 2015 14:40
Need help with the weather zipline
peopleblazin
@peopleblazin
Sep 26 2015 14:40
dont we all
lol
reconspartan55
@reconspartan55
Sep 26 2015 14:40
I need help with waypoint 21 in the basic javascript tab thanks
CamperBot
@camperbot
Sep 26 2015 14:40
if you want to thank someone, put an @ before their name!
Ammar Ali Shah
@AmmarAliShah
Sep 26 2015 14:40
@reconspartan55 link please
Aayush Kapoor
@xeoneux
Sep 26 2015 14:41
@AdrianSkelsey It simply says to compare the flip variable with 0
@AdrianSkelsey if (flip === 0) { // Rest of the logic here }
Ammar Ali Shah
@AmmarAliShah
Sep 26 2015 14:42
@reconspartan55 what's the problem?
Hans van Riet
@hansinla
Sep 26 2015 14:42
@peopleblazin You put the alternative fonts right after Lobster, seperated by a comma.
Adrian Skelsey
@AdrianSkelsey
Sep 26 2015 14:42
@xeoneux okay thank you
CamperBot
@camperbot
Sep 26 2015 14:42
adrianskelsey sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 247 | @xeoneux | http://www.freecodecamp.com/xeoneux
x34passenger
@x34passenger
Sep 26 2015 14:54
I don't understand how the following functions work:

I don't understand how the following functions work:

function find(arr, func) {
  var num = 0;
  return num;
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });

why is arr and func being passed?

why is arr and func being passed in?
Rob Simpson
@pertrai1
Sep 26 2015 14:57
Totally stumped on the logic of Sum all Numbers in a range. I don't think I understand reduce as it should be used
function sumAll(arr) {
arr.reduce(function(previous, next, index, array) {
return Math.max(next) + Math.min(previous);
});
return arr;
}
Obviously my return is totally wrong. Please ignore last return
Hans van Riet
@hansinla
Sep 26 2015 15:04
@pertrai1 You could use reduce, but not that way in this problem. Given [1, 5], you’ll need to find the sum of 1+2+3+4+5. So a loop would be the easiest way to go. Think also about the case where the first number in the array is larger than the second.
@x34passenger Which problem is this?
Tyler St. Onge
@tylerstonge
Sep 26 2015 15:06
I'm on the ExpressWorks waypoint and I'm trying to convert the req.query object to JSON, but when I do it also adds the proto property as a JSON field, how do I get rid of it, or not JSONify it in the first place?
x34passenger
@x34passenger
Sep 26 2015 15:06
@hansinla Bonfire: Finders Keepers
Hans van Riet
@hansinla
Sep 26 2015 15:09
@x34passenger Okay, so you want to loop through the first argument (arr) and apply the passed function to it (func) is the function returns true, you return that array element. In this case the function test for ean even number.
peopleblazin
@peopleblazin
Sep 26 2015 15:10
I have been working on HTML and some Javascript all night and keep getting stuck
Nvm
got it
x34passenger
@x34passenger
Sep 26 2015 15:12
@hansinla So in function find, the array is being passed in as the first argument and the anonymous function is being passed in as the second argument?
Hans van Riet
@hansinla
Sep 26 2015 15:12
@x34passenger Correct.
x34passenger
@x34passenger
Sep 26 2015 15:13
@hansinla is there documentation I can read up on this stuff? Is this called currying where you pass in an anonymous function?
Hans van Riet
@hansinla
Sep 26 2015 15:14
@x34passenger Yes, in currying you break down a function into multiple functions.
x34passenger
@x34passenger
Sep 26 2015 15:15
@hansinla is the anonymous function simply referred to as func in the body of the function find?
Hans van Riet
@hansinla
Sep 26 2015 15:15
@x34passenger In JS a function is just another Object, so you’re passing that Object as a parameter to the function find().
x34passenger
@x34passenger
Sep 26 2015 15:16
@hansinla okay but when I need to use the anonymous function, is the handle or the reference simply func()?
peopleblazin
@peopleblazin
Sep 26 2015 15:18
I need an example on degrading
please
degrading fonts
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>
WHere would i put the call out to google
Hans van Riet
@hansinla
Sep 26 2015 15:21
@peopleblazin
p {
    font-family: "Times New Roman", Georgia, Serif;
}
peopleblazin
@peopleblazin
Sep 26 2015 15:22
just put that anywhere i guess
or before the h2 element
Hans van Riet
@hansinla
Sep 26 2015 15:22
@peopleblazin Your link needs to be in <>
Korry Williams
@korrywill
Sep 26 2015 15:22
Anyone else have a hard time with the slot machine waypoint?
Hans van Riet
@hansinla
Sep 26 2015 15:22
@peopleblazin You showing you the syntax
peopleblazin
@peopleblazin
Sep 26 2015 15:23
it is @hansinla it must have pasted wrong
casielane
@casielane
Sep 26 2015 15:23
@kwill-i-am where are you stuck?
Hans van Riet
@hansinla
Sep 26 2015 15:25
@peopleblazin In that case your code is correct
Korry Williams
@korrywill
Sep 26 2015 15:25
@casielane Waypoint 37. I guess what’s confusing me is that they already incorporate most of the code for you
peopleblazin
@peopleblazin
Sep 26 2015 15:25
okay thank you once again @hansinla
CamperBot
@camperbot
Sep 26 2015 15:25
peopleblazin sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 395 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Sep 26 2015 15:25
@kwill-i-am what is Wp 37?
Korry Williams
@korrywill
Sep 26 2015 15:25
@hansinla Yes
Hans van Riet
@hansinla
Sep 26 2015 15:26
@kwill-i-am What is the problem, can you paste the instructions and your code?
azaleas
@azaleas
Sep 26 2015 15:26
@hansinla thanks
CamperBot
@camperbot
Sep 26 2015 15:26
azaleas sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 396 | @hansinla | http://www.freecodecamp.com/hansinla
Korry Williams
@korrywill
Sep 26 2015 15:27
Screen Shot 2015-09-26 at 11.26.45 AM.png
peopleblazin
@peopleblazin
Sep 26 2015 15:28
Comment out your call to Google for the Lobster font by putting <!-- in front of it.
what does this mean
casielane
@casielane
Sep 26 2015 15:29
set the formula for each slot @kwill-i-am
peopleblazin
@peopleblazin
Sep 26 2015 15:29
What is my call?
x34passenger
@x34passenger
Sep 26 2015 15:29
I am not getting it:
function find(arr, func) 
{
  var num = arr.some(func());
  return num;
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
casielane
@casielane
Sep 26 2015 15:29
@peopleblazin just make a comment like <!--- this is the font, yo
Hans van Riet
@hansinla
Sep 26 2015 15:30
@peopleblazin The way to comment out code (keep the code in your file, but de-activate it) is to prepend <!— and append—> . This is to demonstarte to you that, when your call for Lobster doesn’t work, your code will use the alternative font(s).
@peopleblazin your <link> to the Google font
peopleblazin
@peopleblazin
Sep 26 2015 15:31
Thank you @casielane @hansinla , i literally fiqured it out before i even saw your comments :)
CamperBot
@camperbot
Sep 26 2015 15:31
peopleblazin sends brownie points to @casielane and @hansinla :sparkles: :thumbsup: :sparkles:
:warning: peopleblazin already gave hansinla points
:star: 173 | @casielane | http://www.freecodecamp.com/casielane
Hans van Riet
@hansinla
Sep 26 2015 15:31
@peopleblazin Great! Always better when you figure it out by yourself.
casielane
@casielane
Sep 26 2015 15:31
that's great @peopleblazin :fire:
peopleblazin
@peopleblazin
Sep 26 2015 15:31
Yes Thank you all
CamperBot
@camperbot
Sep 26 2015 15:31
if you want to thank someone, put an @ before their name!
casielane
@casielane
Sep 26 2015 15:32
Anyone else seem like they can do the waypoint challenges but then totally go complete blank when it's Bonfire time?
Hans van Riet
@hansinla
Sep 26 2015 15:32
@kwill-i-am And paste the code you have so far.
wiki format
CamperBot
@camperbot
Sep 26 2015 15:32

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

x34passenger
@x34passenger
Sep 26 2015 15:33
@casielane the waypoints are not enough to do the bonfires by yourself
Korry Williams
@korrywill
Sep 26 2015 15:33
@hansinla I was aggravated with it, so I reset the code. The only code it consist of is what they complete for you
peopleblazin
@peopleblazin
Sep 26 2015 15:34
Does anyone know somewhere where i can practice my own code on a phone like on Free Code camp where it isnt challenging me ?
just like free roam
Korry Williams
@korrywill
Sep 26 2015 15:34
@casielane I feel that way after watching tutorials
casielane
@casielane
Sep 26 2015 15:35
thanks @x34passenger I'm finding I'm having to research more and I think I am in way over my head. But knowing that they aren't enough for me to do it boosts my crippled confidence ;)
CamperBot
@camperbot
Sep 26 2015 15:35
casielane sends brownie points to @x34passenger :sparkles: :thumbsup: :sparkles:
:star: 218 | @x34passenger | http://www.freecodecamp.com/x34passenger
Hans van Riet
@hansinla
Sep 26 2015 15:36
@casielane There are a ton of free JS books available for download. I would use any and all resources that you can get your hands on. Once it clicks, you will be happy that you did.
x34passenger
@x34passenger
Sep 26 2015 15:37
@casielane there definitely is a wide chasm between the waypoints and bonfires, like regex, I am not familiar with it at all and I think there should definitely be more waypoints for regex
Korry Williams
@korrywill
Sep 26 2015 15:37
@casielane you’re not the only one, even though it seems way over you head. The unknown is always an added attraction. Just keept at it. Take a break or two if you have to.
x34passenger
@x34passenger
Sep 26 2015 15:38
I am lost, can anyone help me:
function find(arr, func) 
{
  var num = arr.some(func());
  return num;
}

find([1, 2, 3, 4], function(num){ return num % 2 === 0; });
peopleblazin
@peopleblazin
Sep 26 2015 15:38
So no free roam code thing for HTML CSS stuff like on HTMLCSS where you have a phone and you can make your own stuff for fun?
x34passenger
@x34passenger
Sep 26 2015 15:38
@peopleblazin are you talking about putting the code onto the smart phone?
peopleblazin
@peopleblazin
Sep 26 2015 15:39
yes just for fun and practice
Hans van Riet
@hansinla
Sep 26 2015 15:39
@x34passenger You have to loop throught the elements in arr
for (var i = 0; i < arr.length; i++)
x34passenger
@x34passenger
Sep 26 2015 15:39
@peopleblazin you can use apache cordova or ionic, but you would have to know how to use these frameworks
@hansinla ok, will try it
Hans van Riet
@hansinla
Sep 26 2015 15:40
@x34passenger Then apply func to arr[i]
x34passenger
@x34passenger
Sep 26 2015 15:40
@hansinla ok
@hansinla but why does it say to use arr.some():
@hansinla what is === as opposed to ==?
Hans van Riet
@hansinla
Sep 26 2015 15:42
@x34passenger because you can also use an array method to solve this problem if you want. When you compare values with === the type must be the same as well. == only compares the value.
x34passenger
@x34passenger
Sep 26 2015 15:42
@hansinla how do you use the array method?
peopleblazin
@peopleblazin
Sep 26 2015 15:43
link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Where exactly would i put the style element to make the picture larger ? before the IMG or after?
Hans van Riet
@hansinla
Sep 26 2015 15:43
This message was deleted
@peopleblazin Either in the <style> section or inside the <img> tag
peopleblazin
@peopleblazin
Sep 26 2015 15:46
okay
thanks
CamperBot
@camperbot
Sep 26 2015 15:46
if you want to thank someone, put an @ before their name!
srishi2110git
@srishi2110git
Sep 26 2015 15:46
Bonfire: Check for Palindromes
CamperBot
@camperbot
Sep 26 2015 15:46

:fire:Bonfire: Check for Palindromes :link:

function palindrome(str) {
  // Good luck!
  return true;
}



palindrome("eye");

Return true if the given string is a palindrome. Otherwise, return false.

more info:  bf details | bf links | hint

peopleblazin
@peopleblazin
Sep 26 2015 15:48
<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;
    larger-image { width: 500px; }
  }
</style>

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
This is what i did but still didnt work?
x34passenger
@x34passenger
Sep 26 2015 15:50
Still not getting it:
function find(arr, func) 
{
  // fruits.forEach(function (item, index, array)
  var num = arr.forEach(func);

  return num;
}
tva10
@tva10
Sep 26 2015 15:52
@peopleblazin say the name of waypoint...
peopleblazin
@peopleblazin
Sep 26 2015 15:52
rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
i had to make it 100px not 500px and also it needs to be smaller not larger
Waypoint: Size your Images
tva10
@tva10
Sep 26 2015 15:53
@peopleblazin ok... look
@peopleblazin first you need to make a class
but you need to put dot before smaller-image
peopleblazin
@peopleblazin
Sep 26 2015 15:54
oh
tva10
@tva10
Sep 26 2015 15:54
look at red-text class
@peopleblazin second you need to add this class in to your image
using class='className' construction
@peopleblazin look around you code and you can find needed syntax.
@x34passenger Hm I think that forEach returns nothing....
@x34passenger If you whant to return something look around map or reduce
Korry Williams
@korrywill
Sep 26 2015 15:57
Screen Shot 2015-09-26 at 11.27.02 AM.png
I’m confused as to how to set the slots with the formula
tva10
@tva10
Sep 26 2015 15:58
@kwill-i-am you need to put random value into slots there?
Aleksander Gębicki
@Takumar
Sep 26 2015 15:59
@kwill-i-am Hi, you have to set random values to your variables.
mhm
@mierea
Sep 26 2015 15:59
hey guys
i need a bit of help with the diff two arrays bonfire
CamperBot
@camperbot
Sep 26 2015 16:00
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
mhm
@mierea
Sep 26 2015 16:00
i do not understand something when formatting the output for the last assert
assert.deepEqual(diff([], ['snuffleupagus', 'cookie monster', 'elmo']), ['snuffleupagus', 'cookie monster', 'elmo'], 'empty array');
Korry Williams
@korrywill
Sep 26 2015 16:00
@tva10 @Takumar Thanks
CamperBot
@camperbot
Sep 26 2015 16:00
kwill-i-am sends brownie points to @tva10 and @takumar :sparkles: :thumbsup: :sparkles:
:star: 351 | @takumar | http://www.freecodecamp.com/takumar
:star: 254 | @tva10 | http://www.freecodecamp.com/tva10
Aleksander Gębicki
@Takumar
Sep 26 2015 16:00
You have your randomizing function between comments: Math.floor(Math.random ... and you can use it to set values of each of three variables: slotOne, slotTwo and slotThree
i.e. slotOne = Math.floor ...
mhm
@mierea
Sep 26 2015 16:01
i have my first array with the result but how do i put the empty array string there so that the challenge acccepts my answer?
i tried multi array with newArr on pos0 and empty array on second
still not working though -.-
Aleksander Gębicki
@Takumar
Sep 26 2015 16:02
@mierea show your code, so we can look at it.
mhm
@mierea
Sep 26 2015 16:02
function diff(arr1, arr2) {
  var newArr = [];
  var newArr2 = [];
  var emptyAr = 'empty array';
  // Same, same; but different.
  newArr = arr1.concat(arr2);
  newArr.sort();

  var count = newArr.length;
  for(i=0; i<count;i++){

    if( newArr[i] !== newArr[i+1]) {
      newArr2.push(newArr[i]);

    } else { i = i+1;}

  }
  console.log(arr1.length);
  if (arr1.length ==0 || arr2.length ==0) 
  {               
    var multi = [ 
          newArr2,
          [],
         ];
    return multi;
  }
  return newArr2;

}

diff([], ['snuffleupagus', 'cookie monster', 'elmo']);
the last assert fails
Korry Williams
@korrywill
Sep 26 2015 16:03
@Takumar Thanks again
CamperBot
@camperbot
Sep 26 2015 16:03
kwill-i-am sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: kwill-i-am already gave takumar points
mhm
@mierea
Sep 26 2015 16:03
i also do not really like the if that check if the arrays are empty
but i couldnt think of something else
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:05
Can someone briefly explain to me how setFirstName works. I'm a bit confused about the return
```
this.setFirstName = function(first) { 
      this.getFirstName = function() { 
          return first; 
      };
if I do: test.setFirstName("John");
it changes it....but I'm not sure how exactly
it's that return that's confusing me
Aayush Kapoor
@xeoneux
Sep 26 2015 16:09
@TheHighPriestess They are both different functions and let you interact with variables inside the function
tva10
@tva10
Sep 26 2015 16:10
@mierea you can not pass last test case, because something was wrong when you concat arr... (you have some other sorted array after that...)
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:11
@xeoneux it's not immediately clear to me how that "return first" is changing the first name
Here's the whole thing
var Person = function(firstAndLast) {

  this.getFirstName = function() { 
      return firstAndLast.split(" ")[0]; 
  }

  this.getLastName = function() { 
      return firstAndLast.split(" ")[1]; 
  };

  this.getFullName = function() { 
      return firstAndLast 
  };

  this.setFirstName = function(first) { 
      this.getFirstName = function() { 
          return first; 
      }; 
  };
  this.setLastName = function(last) { 
      this.getLastName = function() { 
          return last; 
      }; 
  };

  this.setFullName = function(fl) { 
      this.getFullName = function() { 
          return fl; 
      } 
  };

  return firstAndLast;
};
Aayush Kapoor
@xeoneux
Sep 26 2015 16:12
@TheHighPriestess For example:
function someFunction() {

  var hiddenVariable = 1;

  this.getHiddenVariable = function() {
    return hiddenVariable;

  this.setHiddenVariable = function(input) {
    hiddenVariable = input;
}
@TheHighPriestess You can create variables in the function that remain private to the function like the hiddenVariable and store values there
tva10
@tva10
Sep 26 2015 16:13
@mierea uhh, you also use Sort there...
@mierea also I move cheking Length of array before sorting
and It will be works
Aayush Kapoor
@xeoneux
Sep 26 2015 16:13
@TheHighPriestess What is the setFullName function setting if it's only getting? :P
tva10
@tva10
Sep 26 2015 16:13
newArr = arr1.concat(arr2);
  if (arr1.length ==0 || arr2.length ==0) 
  {
    return newArr;
  }
  newArr.sort();
@mierea
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:14
@xeoneux I didn't write the code
tva10
@tva10
Sep 26 2015 16:14
and you can make this code more compact:
newArr = arr1.concat(arr2);
  if (!arr1.length || !arr2.length) 
  {
    return newArr;
  }
  newArr.sort();
Aayush Kapoor
@xeoneux
Sep 26 2015 16:15
@TheHighPriestess Oh, kay
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:15
@xeoneux someone else did...and it does pass the bonfire...and I understand most of it...
i was just a bit confused about how it allows one to change the names
Aayush Kapoor
@xeoneux
Sep 26 2015 16:16
@TheHighPriestess Exactly!
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:16
@xeoneux Your example seems to clear things up though. Thank you.
CamperBot
@camperbot
Sep 26 2015 16:16
thehighpriestess sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 248 | @xeoneux | http://www.freecodecamp.com/xeoneux
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:17
I was having trouble thinking of this.getFullName as a variable...which it is
or rather...getFirstName...sorry
but I am still a bit unclear on exactly how "return" sets the variable
but...I suppose that if a function returns a certain value...that's the same as saying that the function = that value????
I don't know if I'm making sense
Aayush Kapoor
@xeoneux
Sep 26 2015 16:20
@TheHighPriestess The return keyword does not set a value!
@TheHighPriestess It only returns the existing one
@TheHighPriestess That's why it's called a getter method
@TheHighPriestess Check out this blog post
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:22
@xeoneux ok...I haven't heard of this before. I will read about it. Thanks!
CamperBot
@camperbot
Sep 26 2015 16:22
thehighpriestess sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:warning: thehighpriestess already gave xeoneux points
peopleblazin
@peopleblazin
Sep 26 2015 16:25
Im looking for a website that has nothing on it so i can just write some HTML and test it out for fun ? anyone got one?
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:25
@peopleblazin use codepen
peopleblazin
@peopleblazin
Sep 26 2015 16:25
okay thanks
CamperBot
@camperbot
Sep 26 2015 16:25
if you want to thank someone, put an @ before their name!
peopleblazin
@peopleblazin
Sep 26 2015 16:26
thanks @TheHighPriestess
CamperBot
@camperbot
Sep 26 2015 16:26
peopleblazin sends brownie points to @thehighpriestess :sparkles: :thumbsup: :sparkles:
:star: 269 | @thehighpriestess | http://www.freecodecamp.com/thehighpriestess
mhm
@mierea
Sep 26 2015 16:27
@tva10 thx for the pointers
peopleblazin
@peopleblazin
Sep 26 2015 16:27
Nvm i would rather not have to pay for it
if i cant have a trial
and see how it is
mhm
@mierea
Sep 26 2015 16:27
thanks @tva10
CamperBot
@camperbot
Sep 26 2015 16:27
mierea sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
:star: 256 | @tva10 | http://www.freecodecamp.com/tva10
peopleblazin
@peopleblazin
Sep 26 2015 16:27
before I make my mind up
tva10
@tva10
Sep 26 2015 16:28
@mierea no problem))
Elizabeth Hatleli
@TheHighPriestess
Sep 26 2015 16:28
@peopleblazin it's free
peopleblazin
@peopleblazin
Sep 26 2015 16:29
it doesnt say so
oh i guess it is jsut not free for the packages
peopleblazin
@peopleblazin
Sep 26 2015 16:36
Its Almost FreeCodeCamp's One Year Anniversary !!!
peopleblazin
@peopleblazin
Sep 26 2015 16:59
<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>

<style>
  smaller-image { width: 100px; }
</style>
<img src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Can anyone tell me where i went wrong?
Thnx!
CamperBot
@camperbot
Sep 26 2015 16:59
if you want to thank someone, put an @ before their name!
Aayush Kapoor
@xeoneux
Sep 26 2015 17:00
<style>
  .smaller-image { width: 100px; }
</style>
The dot before smaller-image
jdreiser1
@jdreiser1
Sep 26 2015 17:15

<script>
$(document).ready(function() {
$("button").$(".btn").$("#target1").addClass("animated shake btn-primary");
});
</script>

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

can someone tell me where i went wrong?
azaleas
@azaleas
Sep 26 2015 17:19
@jdreiser1, next time try addin your code between "```". this way it will be much more readable..
Kouty
@koouty
Sep 26 2015 17:20
@navyvel Yes!
I forgot the variables max and min defined above!
When I replace 10 and 0 by "max" and "min" respectively it is good!
azaleas
@azaleas
Sep 26 2015 17:24
@jdreiser1 try this
 $("button").addClass("animated shake btn-primary");
    $(".btn").addClass("animated shake btn-primary");
    $("#target1").addClass("animated shake btn-primary");
x34passenger
@x34passenger
Sep 26 2015 17:37
Having trouble with the bonfire: steamroller:
function steamroller(arr) 
{
  var flattenedArr = [];

  // I'm a steamroller, baby
  for( var i = 0; i < arr.length; i++ )
  {
    if( arr.isArray(arr[i]) == true )
    {
      flattenedArr.push(arr[i].toString);
    }
    else
    {
      flattenedArr.push(arr[i]);
    }
  }

  return arr;
}
jdreiser1
@jdreiser1
Sep 26 2015 17:38
@azaleas thanks! great help
CamperBot
@camperbot
Sep 26 2015 17:38
jdreiser1 sends brownie points to @azaleas :sparkles: :thumbsup: :sparkles:
:star: 194 | @azaleas | http://www.freecodecamp.com/azaleas
Aayush Kapoor
@xeoneux
Sep 26 2015 17:39
@x34passenger Why don't you create a function that flattens an array once
@x34passenger Then loop over the array with that function?
x34passenger
@x34passenger
Sep 26 2015 17:39
@xeoneux how do I flatten the array once?
Aayush Kapoor
@xeoneux
Sep 26 2015 17:41
@x34passenger Think! That's what the challenge is for :)
x34passenger
@x34passenger
Sep 26 2015 17:42
@xeoneux If I had any idea, I would not have asked the question
Aayush Kapoor
@xeoneux
Sep 26 2015 17:43
@x34passenger Concatenation is your friend
@x34passenger In the loop, check if the current value is an array and then concatenate it to the previous iteration
x34passenger
@x34passenger
Sep 26 2015 17:45
thanks @xeoneux
CamperBot
@camperbot
Sep 26 2015 17:45
x34passenger sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 252 | @xeoneux | http://www.freecodecamp.com/xeoneux
x34passenger
@x34passenger
Sep 26 2015 17:47
@xeoneux I am using arr.isArray() but with my statement: if( arr.isArray(arr[i]) == true ), it is not working, is my if condition incorrect?
Aayush Kapoor
@xeoneux
Sep 26 2015 17:48
@x34passenger Yes
isArray is an Array object method
x34passenger
@x34passenger
Sep 26 2015 17:49
@xeoneux how do I check if it is an array then?
Aayush Kapoor
@xeoneux
Sep 26 2015 17:49
You'll use it like Array.isArray(arr);
x34passenger
@x34passenger
Sep 26 2015 17:50
@xeoneux each array element could be an array, isn't that what I have: if( arr.isArray(arr[i]) == true )
Aayush Kapoor
@xeoneux
Sep 26 2015 17:51
@x34passenger if( arr.isArray(arr[i]) == true ) is the wrong usage. The correct usage will be if( Array.isArray(arr[i]) == true )
x34passenger
@x34passenger
Sep 26 2015 17:52
thanks @xeoneux
CamperBot
@camperbot
Sep 26 2015 17:52
x34passenger sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:warning: x34passenger already gave xeoneux points
Shawn Grooms
@SEGrooms
Sep 26 2015 18:02
make object properties private
I need help on this one
Aayush Kapoor
@xeoneux
Sep 26 2015 18:03
Where exactly is the problem @SEGrooms?
Shawn Grooms
@SEGrooms
Sep 26 2015 18:05
I don't know how to phrase my question

//Let's create an object with a two functions. One attached as a property and one not.
var Car = function() {
this.gear = 1;
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
this.getGear = function() {
return addStyle(this.gear);
};
};

var Bike = function() {
// Only change code below this line.
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());})();};

See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.
I removed the this from this.speed = 100; which makes speed private
addUnit is private, so I guess my question is how do I make getSpeed public?
Aayush Kapoor
@xeoneux
Sep 26 2015 18:07
@SEGrooms this.getSpeed = ...
Shawn Grooms
@SEGrooms
Sep 26 2015 18:07
gah...
thank you @xeoneux !
CamperBot
@camperbot
Sep 26 2015 18:08
segrooms sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 254 | @xeoneux | http://www.freecodecamp.com/xeoneux
x34passenger
@x34passenger
Sep 26 2015 18:08
@xeoneux the concat isn't working:
function steamroller(arr) 
{
  var flattenedArr = [];

  // I'm a steamroller, baby
  for( var i = 0; i < arr.length; i++ )
  {
    if( Array.isArray(arr[i]) == true )
    {
      flattenedArr.concat(arr[i]);
    }
  }

  return flattenedArr;
}
Star Cherrix
@Sparklepaws
Sep 26 2015 18:28
Alright so, I have a dilemma everyone. I'm on the first zipline (where you need to reverse engineer the portfolio site). Should I be attempting to replicate the website's structure perfectly (for example, making the navigation bar look the same)?
x34passenger
@x34passenger
Sep 26 2015 18:35
I am not sure how to flatten out the array when it is embedded in another layer several times
peopleblazin
@peopleblazin
Sep 26 2015 18:50
im still really stuck on this hold on let me get it on here
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
where would i put the new img elemen
t
Matt Yamamoto
@MattYamamoto
Sep 26 2015 18:52
@Sparklepaws, as long as you meet the user stories, I think you're good.
@x34passenger you need to assign the concatenation to a variable. the concat method returns an array. So, flattenedArr = flattenedArr.concat(arr[i]);
haha..whoa, just looked at time stamps... seems I'm a little late to the party, sorry
Karin Meersman
@mientje
Sep 26 2015 19:02
I'm looking at the twitch tv codepen and scratching my head. I click on a link and a new tab is opened. I'm on the twitch site but I'm getting nothing. Empty purple screen with spinning wheel. Anyone?
peopleblazin
@peopleblazin
Sep 26 2015 19:05
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
Still no one has answered me yet? why is chat so inactive today
What i was asking was where do i put the img element in the editors box???
Avil
@Avil172
Sep 26 2015 19:06
@peopleblazin what is your waypoint objective?
peopleblazin
@peopleblazin
Sep 26 2015 19:07
Your img element should have the class smaller-image.
Your image should be 100 pixels wide.
Avil
@Avil172
Sep 26 2015 19:09
@peopleblazin you need to declare a class called smaller image, inside your style element, which should have width: 100px;
like..
.smaller-image
{
width:100px;
}
<!-- then give your class element this class like-->
<img class="smaller-image" src..>
x34passenger
@x34passenger
Sep 26 2015 19:09
@MattYamamoto will try it out
x34passenger
@x34passenger
Sep 26 2015 19:18
@MattYamamoto the array is still not flat, not sure what is wrong:
function steamroller(arr) 
{
  var flattenedArr = [];
  var i = 0;

  for( var i = 0; i < arr.length; i++ )
  {
    if( Array.isArray(arr[i]) == true )
    {
       flattenedArr = flattenedArr.concat(arr[i]);
    }
  }

  return flattenedArr;
}
Kouty
@koouty
Sep 26 2015 19:22

what is wrong in exercise 154?
'<script>
function runSlots(){
var slotOne;
var slotTwo;
var slotThree;

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

// Only change code below this line.

slotOne = Math.floor(Math.random() * (3)) + 1 ;
slotTwo = Math.floor(Math.random() * (3)) + 1 ;
slotThree = Math.floor(Math.random() * (3)) + 1;

// Only change code above this line.

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

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

}

$(document).ready(function(){
$(".go").click(function(){
runSlots();
});
});
</script>

<div>
<div class = "container inset">
<div class = "header inset">
<img src="https://s3.amazonaws.com/freecodecamp/freecodecamp_logo.svg.gz" alt="learn to code javascript at Free Code Camp logo" class="img-responsive nav-logo">
<h2>FCC Slot Machine</h2>
</div>
<div class = "slots inset">
<div class = "slot inset">

</div>
<div class = "slot inset">

</div>
<div class = "slot inset">

</div>
</div>
<br/>
<div class = "outset">
<button class = "go inset">
Go
</button>
</div>
<br/>
<div class = "foot inset">
<span class = "logger"></span>
</div>
</div>
</div>

<style>
.container {
background-color: #4a2b0f;
height: 400px;
width: 260px;
margin: 50px auto;
border-radius: 4px;
}
.header {
border: 2px solid #fff;
border-radius: 4px;
height: 55px;
margin: 14px auto;
background-color: #457f86
}
.header h2 {
height: 30px;
margin: auto;
}
.header h2 {
font-size: 14px;
margin: 0 0;
padding: 0;
color: #fff;
text-align: center;
}
.slots{
display: flex;
background-color: #457f86;
border-radius: 6px;
border: 2px solid #fff;
}
.slot{
flex: 1 0 auto;
background: white;
height: 75px;
margin: 8px;
border: 2px solid #215f1e;
border-radius: 4px;
}
.go {
width: 100%;
color: #fff;
background-color: #457f86;
border: 2px solid #fff;
border-radius: 2px;
box-sizing: none;
outline: none!important;
}
.foot {
height: 150px;
background-color: 457f86;
border: 2px solid #fff;
}

.logger {
color: white;
margin: 10px;
}

.outset {
-webkit-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
box-shadow: 0px 0px 15px -2px rgba(0,0,0,0.75);
}

.inset {
-webkit-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
-moz-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
}
</style>
'

medully
@medully
Sep 26 2015 19:23

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

orange-text {

color: orange;
color: white

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

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

Give your h1 element the inline style of color: white. error
Star Cherrix
@Sparklepaws
Sep 26 2015 19:26
So, I have a FIXED Div above a STATIC Div, and when I do this to the STATIC Div: margin-top: 20px; it causes the FIXED Div to move down as well. Aren't they supposed to be separated?
Avil
@Avil172
Sep 26 2015 19:30
@medully which waypoint?
inline style is done differently, eg-
<h1 style="color:white">text</h1>
medully
@medully
Sep 26 2015 19:40
all understand
Abhisek Pattnaik
@abhisekp
Sep 26 2015 19:41
@Sparklepaws collapsing margin at work!!
explain format
CamperBot
@camperbot
Sep 26 2015 19:41

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Sep 26 2015 19:48
@medully ^
Tyler St. Onge
@tylerstonge
Sep 26 2015 19:56
Is using JavaScript to set sizes or margins on divs to make it more responsive a good habit to get into? Like say setting a margin of the top div to the size() of a header?
Emily
@emvertes8711
Sep 26 2015 19:56

'<
<div class="well" id="left-well">
<h4>#left-well</h4>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
<button class="btn btn-default target"></button>
</div>
</div>
<div class="col-xs-6">

  <div class="well" id="right-well">
    <h4>#right-well</h4>
    <button class="btn btn-default target"></button>
    <button class="btn btn-default target"></button>
    <button class="btn btn-default target"></button>
  </div>
</div>

'

Where am I going wrong? The editor is not registering the h4 element
Avil
@Avil172
Sep 26 2015 20:00
@emvertes8711 what is your waypoint objective?
Nunya84
@Nunya84
Sep 26 2015 20:02
Quick question. I am tasked to change the color of my h2. I do believe i am doing it correctly but its not working. I need to change my h2 text to red. And this is how i am entering the code. <h2style="color:red">CatPhotoApp</h2>. Is this correct or is the program bugged?
Abhisek Pattnaik
@abhisekp
Sep 26 2015 20:02
This message was deleted
Avil
@Avil172
Sep 26 2015 20:04
@Nunya84 that is correct for changing the style inline, but if you were asked to change it using css, then you will need a style element separately.
Abhisek Pattnaik
@abhisekp
Sep 26 2015 20:04
@emvertes8711 :point_up: Look here
Nunya84
@Nunya84
Sep 26 2015 20:09

This is my task: Change your h2 element's style so that its text color is red.

We can do this by changing the "style" of your h2 element.

The style that is responsible for the color of an element's text is the "color" style.

Here's how you would set your h2 element's text color to blue: <h2 style="color: blue">CatPhotoApp</h2>. And i entered<h2style="color:red">CatPhotoApp</h2>

I know it says blue but my task is to change it to red.
medully
@medully
Sep 26 2015 20:11

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

<div class="container-fluid row col-xs-4">
<h2 class="red-text text-center">CatPhotoApp</h2>

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

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

<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<button class="btn btn-block btn-primary">Like</button>
<button class="btn btn-block btn-info">Info</button>
<button class="btn btn-block btn-danger">Delete</button>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

Star Cherrix
@Sparklepaws
Sep 26 2015 20:11

So, I have this:

.headerl {
    display: inline-block;
}

<div class="header">
    <a class="headerl" href="#">Testbutton</a>
    <a class="headerl" href="#">Testbutton</a>
</div>

Can anyone explain why this disables my links and their ability to have hover effects? xD

medully
@medully
Sep 26 2015 20:11
Each of your Bootstrap buttons should be nested within its own div element with the class col-xs-4. error
Abhisek Pattnaik
@abhisekp
Sep 26 2015 20:11
This message was deleted
Avil
@Avil172
Sep 26 2015 20:12
@Nunya84 give a space between h2 and style
Nunya84
@Nunya84
Sep 26 2015 20:13
Thanks you Avil172. That did clear up the situation.
CamperBot
@camperbot
Sep 26 2015 20:13
if you want to thank someone, put an @ before their name!
Nunya84
@Nunya84
Sep 26 2015 20:13
Thank you @Avil172 . That did work.
CamperBot
@camperbot
Sep 26 2015 20:13
nunya84 sends brownie points to @avil172 :sparkles: :thumbsup: :sparkles:
:star: 139 | @avil172 | http://www.freecodecamp.com/avil172
medully
@medully
Sep 26 2015 20:13
help please
CamperBot
@camperbot
Sep 26 2015 20:13

:point_right: bonfire no repeats please [wiki]

Problem Explanation:

  • This task requires us to look at each possible permutation of a string. This is best done using a recursion function. Being able to build a function which collects all permutations of a string is a common interview question, so there is no shortage of tutorials out there on how to do this, in many different code languages.
  • This task can still be daunting even after watching a tutorial. You will want to send each new use of the function 3 inputs: 1. a new string (or character array) that is being built, 2. a position in your new string that's going to be filled next, and 3. an idea of what characters (more specifically positions) from the original string have yet to be used. The pseudo code will look something like this:

    ```
    var str = ???;
    perm(current position in original string, what's been used in original string, current string build thus far){
    if(current string is finished) {
    print current string;
    }else{
    for(var i = 0; i < str.length; i++) {

    if(str[i] has not been used) {
      put str[i] into the current position;
      mark str[i] as used
      perm(current position in original string, what's been used in original string, current string build thus far)
      unmark str[i] as used because another branch in the tree for i + 1 will still likely use it;
    }

    }
    }
    }
    :pencil: read more about bonfire no repeats please on the FCC Wiki

medully
@medully
Sep 26 2015 20:14

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

<div class="container-fluid col-xs-4 row">

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

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

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

<img src="http://bit.ly/fcc-running-cats" class="img-responsive">
<button class="btn btn-block btn-primary">Like</button>
<button class="btn btn-block btn-info">Info</button>
<button class="btn btn-block btn-danger">Delete</button>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor"> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality"> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Crazy</label>
<input type="text" placeholder="cat photo URL" required>
<button type="submit">Submit</button>
</form>
</div>

Star Cherrix
@Sparklepaws
Sep 26 2015 20:14
@medully You may want to use GIST to post large segments of code =)