These are chat archives for FreeCodeCamp/Help

5th
Oct 2015
Herman Fassett
@HermanFassett
Oct 05 2015 00:24
@namsir I think you have to link with github to get points :P
noobstar
@namsir
Oct 05 2015 00:33
@HermanFassett i'm linked with github when i first signed up
Herman Fassett
@HermanFassett
Oct 05 2015 00:34
Hmm @namsir then camperbot must've stolen your brownies
noobstar
@namsir
Oct 05 2015 00:35
someone try to give me a free brownie and see if it works now;
Marcelo Marzola Leite
@marmleite
Oct 05 2015 00:36
I'm still in Bonfire: Check for Palindromes and can not return true for the ultimate challenge , but examining it did not seem that it should return true
Jose E. Pimentel
@jedpimentel
Oct 05 2015 00:36
@namsir does your fcc user account have your same username in the url?
so i guess not?
Jose E. Pimentel
@jedpimentel
Oct 05 2015 00:36
@marmleite share your code so we can check :)
Herman Fassett
@HermanFassett
Oct 05 2015 00:37
thanks @namsir
CamperBot
@camperbot
Oct 05 2015 00:37
hermanfassett sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for namsir
Marcelo Marzola Leite
@marmleite
Oct 05 2015 00:37
function palindrome(str) {
  str = str.toLowerCase();
  str = str.replace(/\W+/g, "");
  if(str === str.split("").reverse().join("")){
    return true;
  }else{
  return false;
  }
}
palindrome("0_0 (: /-\ :) 0-0");
Herman Fassett
@HermanFassett
Oct 05 2015 00:37
:cry:
noobstar
@namsir
Oct 05 2015 00:37
doesn't seem like it ;x
Herman Fassett
@HermanFassett
Oct 05 2015 00:38
@marmleite Try like /\W|_/g :P
Jose E. Pimentel
@jedpimentel
Oct 05 2015 00:39
@namsir I meant in th FCC page, try the url for when you check you point/activity
Marcelo Marzola Leite
@marmleite
Oct 05 2015 00:40
Thanks @HermanFassett ! saved me again!
CamperBot
@camperbot
Oct 05 2015 00:40
marmleite sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 303 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
noobstar
@namsir
Oct 05 2015 00:40
oh i see
it should work now
thefacilitator
@thefacilitator
Oct 05 2015 00:46
Hi everyone - I'm trying (and failing) to get through Bonfire: Check for Palindromes. I've given up trying to work it out myself and am instead trying to look at the solution to understand what is happening. However, the wiki page has two solutions, or two parts. Can anyone explain what's happening there? Am I using both sets of code, and if so, how am I arranging them in the code editor?
Herman Fassett
@HermanFassett
Oct 05 2015 00:48
@thefacilitator those are both two separate solutions
thefacilitator
@thefacilitator
Oct 05 2015 00:49
Oh, so either one works? Ok, thanks - I was getting worried you had to do two steps or something!
CamperBot
@camperbot
Oct 05 2015 00:49
if you want to thank someone, put an @ before their name!
thefacilitator
@thefacilitator
Oct 05 2015 00:49
@HermanFassett Thanks
Herman Fassett
@HermanFassett
Oct 05 2015 00:49
Lol
Yeah no problem
Do you understand the code?
thefacilitator
@thefacilitator
Oct 05 2015 00:50
Not in the slightest, haha. My plan is to have a look at it, try to figure out what each expression is doing, then replicate it
Herman Fassett
@HermanFassett
Oct 05 2015 00:50
;) Mk
thefacilitator
@thefacilitator
Oct 05 2015 00:50
Which probably will be a simply cut/paste, but I'm hoping to get some understanding of the whole thing before cheating my way through the bonfire challenges
Herman Fassett
@HermanFassett
Oct 05 2015 00:50
Probably a good idea lol
Dhaval
@dhavalchaudhary
Oct 05 2015 00:54
@thefacilitator write pseudocode
will help u understand stuff easily
Chris
@Aoxom
Oct 05 2015 00:55
@thefacilitator (im new too), but i liked the First solution. i thought of it like this... "Make the sentence all lower case, remove all symbols and spaces, split up the sentence into individual letters, reverse it all, then join it all together." Then see if that backwards string equals the original string
correct me if im wrong on that
Marcelo Marzola Leite
@marmleite
Oct 05 2015 00:55
@HermanFassett I did not understand what the "_" character does in the regexp and did not find anything on the internet. Can you help me?
thefacilitator
@thefacilitator
Oct 05 2015 00:56
@cdhaval96 @Aoxom Thanks guys - I think the wiki had some info on pseudocode and other pre-planning stuff, so I'll look at that and see if I can make a plan before finishing off this task
CamperBot
@camperbot
Oct 05 2015 00:56
thefacilitator sends brownie points to @cdhaval96 and @aoxom :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for aoxom
:star: 84 | @cdhaval96 | http://www.freecodecamp.com/cdhaval96
Herman Fassett
@HermanFassett
Oct 05 2015 00:56
@marmleite that's literally replacing the character _ :P
Which is needed for that last test I think
Marcelo Marzola Leite
@marmleite
Oct 05 2015 00:58
so I guess I did not understand the last test ;p
enjeyarr
@enjeyarr
Oct 05 2015 01:01
Hey there, I'm working on the Twitch Streaming Zipline, and I've been completely confused by my jQuery seemingly deploying in random order despite being looped in a fixed order (is the right place to ask?)
noobstar
@namsir
Oct 05 2015 01:13
anyone know a site to practice regular expression?
noobstar
@namsir
Oct 05 2015 01:14
cool. @Seytom thanks
CamperBot
@camperbot
Oct 05 2015 01:14
namsir sends brownie points to @seytom :sparkles: :thumbsup: :sparkles:
:star: 229 | @seytom | http://www.freecodecamp.com/seytom
Tom Seymour
@Seytom
Oct 05 2015 01:15
It's a great site, they used to have a link to it here.
Herman Fassett
@HermanFassett
Oct 05 2015 01:17
https://regex101.com/ is also pretty useful
Jason
@Jauble
Oct 05 2015 01:19
Can anyone help me with centering the thumbnails on here? http://codepen.io/auble220/pen/rOyGWw
Oops forgot to save hold on
Jonathan Coleman
@jondcoleman
Oct 05 2015 01:20
Hi all, need some node help here if you're able. I'm on the learnyounode step 'Juggling Async' and need some tips on how to print to console only after i have all three complete responses.
Jason
@Jauble
Oct 05 2015 01:20
Weird, that's not what I have in codepen
noobstar
@namsir
Oct 05 2015 01:20
those thumbnails are centered.
DJ
@qualitymanifest
Oct 05 2015 01:21
@Jauble it is actually, try changing the viewpoint size and you will see when it gets small enough it looks like that. which is a good thing.
noobstar
@namsir
Oct 05 2015 01:21
if the browser set to max.
Jonathan Lee Slew
@jlslew
Oct 05 2015 01:21
@jondcoleman you could use a library like https://www.npmjs.com/package/async#series
Jason
@Jauble
Oct 05 2015 01:22
@qualitymanifest The viewpoint size? Sorry, I'm new to Bootstrap
noobstar
@namsir
Oct 05 2015 01:22
he's using bootstrap. it's pretty easy
Jonathan Coleman
@jondcoleman
Oct 05 2015 01:22
@jlslew the exercise says not to use a library unfortunately.
Jason
@Jauble
Oct 05 2015 01:22
Wait, do you mean viewport?
DJ
@qualitymanifest
Oct 05 2015 01:22
@Jauble oops, yeah haha
Herman Fassett
@HermanFassett
Oct 05 2015 01:22
Rule #2: You may use whichever libraries or APIs you need.
Jonathan Coleman
@jondcoleman
Oct 05 2015 01:23
Here's what learnyounode says: "Counting callbacks is one of the fundamental ways of managing async in Node. Rather than doing it yourself, you may find it more convenient to rely on a third-party library such as async or after. But for this exercise, try and do it without any external helper library."
noobstar
@namsir
Oct 05 2015 01:23
set a class of img-responsive for those thumbnails.
i would put them all into a grid column.
Jason
@Jauble
Oct 05 2015 01:26
@namsir Tried img-responsive. Put them all in one column?
noobstar
@namsir
Oct 05 2015 01:27
what are you trying to achieve?
i see that you are using col-md-4.
@Jauble they are already centered
Jason
@Jauble
Oct 05 2015 01:29
The images all shift to the left a bit at least for me.
noobstar
@namsir
Oct 05 2015 01:29
@Jauble are you trying to set the H1 centered too?
Jonathan Lee Slew
@jlslew
Oct 05 2015 01:30
@jondcoleman
function counter() {
    // return if less than max else print to console
}

for (var i=0; i < max; i++)
    http.get(url, function(res) {
        counter();
    });
noobstar
@namsir
Oct 05 2015 01:30
        <div class="col-md-4 center-block text-center">
try that
Jonathan Coleman
@jondcoleman
Oct 05 2015 01:31
Ok thanks @jlslew I'll try that.
CamperBot
@camperbot
Oct 05 2015 01:31
jondcoleman sends brownie points to @jlslew :sparkles: :thumbsup: :sparkles:
:star: 269 | @jlslew | http://www.freecodecamp.com/jlslew
Jason
@Jauble
Oct 05 2015 01:31
@namsir Ya, but those are centered and the images aren't
noobstar
@namsir
Oct 05 2015 01:32
<div class="row row2 text-center">
this worked for me
Jonathan Lee Slew
@jlslew
Oct 05 2015 01:32
@jondcoleman this method doesn't care about order though
Jason
@Jauble
Oct 05 2015 01:33
@namsir For the images?
noobstar
@namsir
Oct 05 2015 01:33
yes.
Jason
@Jauble
Oct 05 2015 01:33
@namsir Cool, I'll try that. Thanks
CamperBot
@camperbot
Oct 05 2015 01:33
jauble sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:star: 177 | @namsir | http://www.freecodecamp.com/namsir
noobstar
@namsir
Oct 05 2015 01:33
they are shifted to the right and centered in the whole page.
Jason
@Jauble
Oct 05 2015 01:35
@namsir Sweet, it works! Thanks
CamperBot
@camperbot
Oct 05 2015 01:35
jauble sends brownie points to @namsir :sparkles: :thumbsup: :sparkles:
:warning: jauble already gave namsir points
noobstar
@namsir
Oct 05 2015 01:35
@Jauble yw.
skebz
@skebz
Oct 05 2015 01:36
hey everyone!
enjeyarr
@enjeyarr
Oct 05 2015 01:36
I'm working on the Twitch Streaming Zipline. I'm doing tests right now, so this codepen isn't near done, but I seem to have jQuery problems - the streams appear in random order sometimes when I hit "Run" Here's the codepen
skebz
@skebz
Oct 05 2015 01:36
blob
i'm stuck in jquery
anyone?
enjeyarr
@enjeyarr
Oct 05 2015 01:38
@skebz what are you trying to achieve?
skebz
@skebz
Oct 05 2015 01:39
trying to make the buttons bounce..
Jason
@Jauble
Oct 05 2015 01:39
@skebz You need a space between animated and bounce
noobstar
@namsir
Oct 05 2015 01:39
@skebz add a space between animated and bounce
skebz
@skebz
Oct 05 2015 01:40
nope dat doesn't work..
noobstar
@namsir
Oct 05 2015 01:40
addClass
skebz
@skebz
Oct 05 2015 01:40
blob
noobstar
@namsir
Oct 05 2015 01:40
@skebz try addClass instead of addclass
javascript is case sensitive.
skebz
@skebz
Oct 05 2015 01:41
thank you NAMSIR!!!\
CamperBot
@camperbot
Oct 05 2015 01:41
if you want to thank someone, put an @ before their name!
skebz
@skebz
Oct 05 2015 01:42
appreciate it a lot !
noobstar
@namsir
Oct 05 2015 01:42
yw.
glad i could help
enjeyarr
@enjeyarr
Oct 05 2015 01:45
If someone has a second, I could use a pair of eyes on the zipline problem I posted above :)
Susan Smilanich
@MissMarySue
Oct 05 2015 01:45
<div class="row">
<div class = "col-xs-6"><button class="btn btn-block btn-primary"><i class="fa fa-thumbs-up"></i> Like</button></div>
<div class="col-xs-6"><button class="btn btn-block btn-info"><i class="fa fa-info-circle"></i> Info</button></div>
<div class="col-xs-6"><button class="btn btn-block btn-danger"><i class="fa fa-trash"></i> Delete</button></div>
</div>
Jonathan Lee Slew
@jlslew
Oct 05 2015 01:48
@enjeyarr yes, that is normal behavior because the requests are async
Susan Smilanich
@MissMarySue
Oct 05 2015 01:48
Greetings, the above code is for the Responsively Style Radio Buttons exercise in Waypoint. I look up the solution in Wiki and it is fairly close to this one...BUT has "col-xs-4" and no thumbs up, circle or trash. Is there an error in the solution?
DJ
@qualitymanifest
Oct 05 2015 01:49
nevermind i still have a lot to learn about bootstrap. haha.
enjeyarr
@enjeyarr
Oct 05 2015 01:49
@jlslew oh okay thank you!
CamperBot
@camperbot
Oct 05 2015 01:49
enjeyarr sends brownie points to @jlslew :sparkles: :thumbsup: :sparkles:
:star: 270 | @jlslew | http://www.freecodecamp.com/jlslew
Yosafat Ariel
@yoskakomba
Oct 05 2015 01:54
Hi guys, need help please, I don't understand "waypoint-bring-your-javascript-slot-machine-to-life", please give hints or simple explanation about this chalenge. thanks
Susan Smilanich
@MissMarySue
Oct 05 2015 01:56
@qualitymanifest I completely understand! Thanks for even thinking about it! I have been working on this one on and off all day. ;)
CamperBot
@camperbot
Oct 05 2015 01:56
missmarysue sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 243 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Jason
@Jauble
Oct 05 2015 01:57
@MissMarySue Try using <span class=""></span>
Susan Smilanich
@MissMarySue
Oct 05 2015 01:58
@Jauble - nice! thanks, i will!
CamperBot
@camperbot
Oct 05 2015 01:58
missmarysue sends brownie points to @jauble :sparkles: :thumbsup: :sparkles:
:star: 195 | @jauble | http://www.freecodecamp.com/jauble
Jason
@Jauble
Oct 05 2015 01:58
@MissMarySue No problem. Hope that works for you
@MissMarySue I think your cols should be col-xs-4. They should add up to 12
DJ
@qualitymanifest
Oct 05 2015 02:01

@MissMarySue i found something unrelated to this waypoint but of interest:
"Why the example itself shows 18 also eludes me but the thing to consider is that if more than 12 columns are defined the next group of columns is pushed to the next line. This is normally easily shown with lg or sm or md.

With xs columns, the width is completely auto. This could possibly mean that you can define 18 on one line and they would all auto width. I say your best bet is to play around with xs and see why bootstrap provides it as an example of 18."

Susan Smilanich
@MissMarySue
Oct 05 2015 02:02
I am with you on col-xs-4...it looks good...but the challenge asks for col-xs-6 for the 3 elements...and it does not allow me to get past this level.
Ahhhh, @qualitymanifest, makes sense.
Jason
@Jauble
Oct 05 2015 02:03
Oh ok, I guess I'm wrong lol
Susan Smilanich
@MissMarySue
Oct 05 2015 02:05
Well, @Jauble, I think you are correct, but I have something off. I will be happy to be beyond this level. LOL!!! ;)
DJ
@qualitymanifest
Oct 05 2015 02:06
@MissMarySue yeah. you'll always hit a brick wall at some point, but, i remember completing that waypoint easily before - and now i can't seem to figure out what they want for it
i don't often recommend this but i'd say just skip it and come back to it later
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:10
Hi guys, please need help on
"waypoint-bring-your-javascript-slot-machine-to-life" thank you
DJ
@qualitymanifest
Oct 05 2015 02:12
@yoskakomba post your code, if you have it.
if you don't, what are you stuck on?
Jason
@Jauble
Oct 05 2015 02:12
@MissMarySue I know how that is. Hopefully it won't be too long
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:12
wait, thank you for your effort
CamperBot
@camperbot
Oct 05 2015 02:12
if you want to thank someone, put an @ before their name!
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:12
@qualitymanifest thank you
CamperBot
@camperbot
Oct 05 2015 02:12
yoskakomba sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 244 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Oct 05 2015 02:13
@yoskakomba do you mean you figured it out?
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:13
not yet
I'm trying to copy my code here
DJ
@qualitymanifest
Oct 05 2015 02:13
got it
help format
CamperBot
@camperbot
Oct 05 2015 02:13

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Yosafat Ariel
@yoskakomba
Oct 05 2015 02:14

the instruction, I don't understand ```Let's use the jQuery selector $(".slot") to select all of the slots.

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

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

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

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

```S(document).ready(function () {
$(".slot")[0]).html(slotOne);
$(".slot")[0]).html(slotOne);
$(".slot")[0]).html(slotOne);
});```
Susan Smilanich
@MissMarySue
Oct 05 2015 02:14
@qualitymanifest - I think I will skip it and see what happens. I think there might be a glitch in this code exercise.
@Jauble - thanks!
CamperBot
@camperbot
Oct 05 2015 02:14
missmarysue sends brownie points to @jauble :sparkles: :thumbsup: :sparkles:
:warning: missmarysue already gave jauble points
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:14
bad copy and paste, sorry
I will recopy and paste it
DJ
@qualitymanifest
Oct 05 2015 02:15
@yoskakomba you need to do the backticks on separate lines, above and below your code
Bill Kroger
@BillKroger
Oct 05 2015 02:15
hint
CamperBot
@camperbot
Oct 05 2015 02:15
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:16
s(document).ready(function () {
    $(".slot")[0]).html(slotOne);
    $(".slot")[0]).html(slotOne);
    $(".slot")[0]).html(slotOne);
     $
    });
Jason
@Jauble
Oct 05 2015 02:16
@MissMarySue No problem. Ya, probably better to go on to something else for a while, and then go back to it.
Rex Schrader
@SaintPeter
Oct 05 2015 02:16
@yoskakomba Looks to me like you need to change your index for the slot you're selecting and the variable name for the number.
DJ
@qualitymanifest
Oct 05 2015 02:16
for starters, it looks like you're writing your code in the wrong spot

did you write that in here

  $(document).ready(function(){
     $(".go").click(function(){
       runSlots();
     });

?

Yosafat Ariel
@yoskakomba
Oct 05 2015 02:17
no below the comment
DJ
@qualitymanifest
Oct 05 2015 02:17
okay, then yes, what @SaintPeter said
and you don't need the document ready function
Bill Kroger
@BillKroger
Oct 05 2015 02:18
bonfire palindrome
CamperBot
@camperbot
Oct 05 2015 02:18

: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

Bill Kroger
@BillKroger
Oct 05 2015 02:18
hint
CamperBot
@camperbot
Oct 05 2015 02:18
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Rex Schrader
@SaintPeter
Oct 05 2015 02:18
@BillKroger Do you have code or a specific issue you're having with the Palindrome bonfire?
@BillKroger (We humans give much better hints than @camperbot )
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:21
@qualitymanifest I passed one of two requirement to pass with the code below
// Only change code below this line.

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

    // Only change code above this line.
DJ
@qualitymanifest
Oct 05 2015 02:21
@yoskakomba you're still targeting the first slot each time
Susan Smilanich
@MissMarySue
Oct 05 2015 02:21
@Jauble and @qualitymanifest : here is a good laugh, I go on to the next level and the solution is col-xs-4. LOL!!! Of course, when I put that in my solution, it will not clear. I think there is a problem with this exercise.
DJ
@qualitymanifest
Oct 05 2015 02:22
@MissMarySue i generally assume i'm doing something wrong before calling out a bug... but i really kind of think there's a problem with that waypoint
Rex Schrader
@SaintPeter
Oct 05 2015 02:22
@yoskakomba Note the index:
$($(".slot")[0 /* <-- This is the index */]).html(slotTwo);
DJ
@qualitymanifest
Oct 05 2015 02:22
@yoskakomba $(".slot")[0] is the first slot
Jason
@Jauble
Oct 05 2015 02:22
@MissMarySue Lol weird!
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:23
@SaintPeter thanks alot, I think I am getting there
CamperBot
@camperbot
Oct 05 2015 02:23
yoskakomba sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 849 | @saintpeter | http://www.freecodecamp.com/saintpeter
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:23
@qualitymanifest thanks alot, I think I am getting there
DJ
@qualitymanifest
Oct 05 2015 02:25
@SaintPeter could you take a look at 18:48 - 19:06 ?
(sorry i don't know how to create a clickable time link... but i think we are in the same time zone)
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:26
@SaintPeter @qualitymanifest yeaay thanks guy for your help
I passed with the hint you gave
$($(".slot")[0]).html(slotOne);
    $($(".slot")[1]).html(slotTwo);
    $($(".slot")[2]).html(slotThree);
CamperBot
@camperbot
Oct 05 2015 02:26
yoskakomba sends brownie points to @saintpeter and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: yoskakomba already gave saintpeter points
:warning: yoskakomba already gave qualitymanifest points
DJ
@qualitymanifest
Oct 05 2015 02:26
@yoskakomba cool, glad you got it. almost onto the bonfires!
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:27
wow, feels great thanks
CamperBot
@camperbot
Oct 05 2015 02:27
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 05 2015 02:28
@yoskakomba Awesome, way to go!
@qualitymanifest You alt-click on the timestamp to get a link (on windows). Mouse over the timestamp to see. I took a look about the discussion - was the issue that the solution on the Wiki was wrong? Or didn't match the current problem? Or a question about how grids are supposed to be used?
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:29
thanks
CamperBot
@camperbot
Oct 05 2015 02:29
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 05 2015 02:29
blob
@qualitymanifest Or was the question about the font-awesome icons?
DJ
@qualitymanifest
Oct 05 2015 02:31
the question that that waypoint wants you to make a row with 18 xs columns... i found some stuff on stackexchange that says xs auto-resizes the columns so that could work... but i really thought bootstrap was always 12 columns?
Rex Schrader
@SaintPeter
Oct 05 2015 02:33
@qualitymanifest Don't think of it as being 18 xs columns, think of it as being 3 half width columns. The Grid is 12 units = one screen width. If you need something perfectly aligned every time, then just make sure that your units of a size sum up to 12. But if all you want is a specific width that floats/reflows, you can use any combination of sizes you want.
DJ
@qualitymanifest
Oct 05 2015 02:33
i've been trying the alt-click thing but it doesn't work for me for some reason...
Rex Schrader
@SaintPeter
Oct 05 2015 02:33
@qualitymanifest It may be in the Gitter App only?
DJ
@qualitymanifest
Oct 05 2015 02:33
maybe
Rex Schrader
@SaintPeter
Oct 05 2015 02:33
@qualitymanifest RE: Grid - I actually used it on my voting app to have reflowing columns of polls. http://poll-tastic.herokuapp.com
DJ
@qualitymanifest
Oct 05 2015 02:34
@SaintPeter anyway, three of us were trying but nobody could get it to pass. which is weird, because i passed that easily a little while back...
Rex Schrader
@SaintPeter
Oct 05 2015 02:34
@qualitymanifest ok, lemme take a look again. What is the specific waypoint?
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:35

guys, please help me with simple and plain English how this code works, I passed this waypoint by copied an pasted it the instruction code, I don't want to pass any waypoint without understand it

$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');

thank you

CamperBot
@camperbot
Oct 05 2015 02:35
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 05 2015 02:38

@yoskakomba Sure. There are two main things going on here:
1) You need to select a specific slot element to apply an image to it. This code:

$($('.slot')[0])

Says: Give me an array of all of the elements with a class .slot, then give me the 0th element. Then use that 0th element as a selector.
2) Then yo need to assign your "random" image to the slot you've selected.

.html('<img src = "'

is the assigning the html to the page that creates an image link, then

images[slotOne-1]

is selecting an image url from the array images. It is selecting it using the random number assigned to slotOne and it's subtracting one because it's a zero indexed array.

DJ
@qualitymanifest
Oct 05 2015 02:39
damn i was trying to explain it but that blew my explanation out of the water
Yosafat Ariel
@yoskakomba
Oct 05 2015 02:40
wow, now I understand it clearly, thanks a lot @SaintPeter
CamperBot
@camperbot
Oct 05 2015 02:40
:warning: yoskakomba already gave saintpeter points
yoskakomba sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
Rex Schrader
@SaintPeter
Oct 05 2015 02:41

@qualitymanifest ok, here was my passing code for the radio button thing:

<div class="row">  <!--  I think this may be the key, the row class -->
      <div class="col-xs-6">
      <label><input type="radio" name="indoor-outdoor"> Indoor</label>
      </div>
      <div class="col-xs-6">
      <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
      </div>
    </div>

Note: I only added these for the radio buttons, not the checkboxes. There are only 2 total, so 6 + 6 = 12

Herman Fassett
@HermanFassett
Oct 05 2015 02:41
@qualitymanifest that's what happens with @SaintPeter
Rex Schrader
@SaintPeter
Oct 05 2015 02:41
@MissMarySue See my passing code, just above
Herman Fassett
@HermanFassett
Oct 05 2015 02:42
And he only misspelled a few things
Rex Schrader
@SaintPeter
Oct 05 2015 02:42
@qualitymanifest I'm sorry for making a clear explanation. I'll tryo to be worse, later, so you'll have a chance to shine. ;) :D
DJ
@qualitymanifest
Oct 05 2015 02:43
@SaintPeter i was just saying you did a good job!
Rex Schrader
@SaintPeter
Oct 05 2015 02:44
@HermanFassett I need to get a wireless keyboard, so I can blame my spelling errors on missed letters. Anyway, I figure that folks would rather have a complete answer that has slight misspellings than waiting for my spellcheck to run. On a related note, why doesn't the Gitter app have spellcheck
@qualitymanifest Sorry, forgot the winkies and smiles. Thank you :D
CamperBot
@camperbot
Oct 05 2015 02:44
saintpeter sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 245 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Rex Schrader
@SaintPeter
Oct 05 2015 02:45
@qualitymanifest I'm actually delighted to see you (And others) in here helping. Love to see the help community grow!
vere perrot
@perrot
Oct 05 2015 02:45
Hi,
I have a problem in the unit "Waypoint: Continue working with Nodejs Servers".
I don't know how to " queue the results and keep track of how many of the URLs have returned their entire contents" at the check item 6.Complete "Juggling Async".
Thanks.
CamperBot
@camperbot
Oct 05 2015 02:45
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Oct 05 2015 02:45
@SaintPeter ah, sarcasm on the internet. i wasn't sure haha. anyway, please let me know if you get a chance to look at that waypoint. i would like to know if it's just me
Rex Schrader
@SaintPeter
Oct 05 2015 02:46
@qualitymanifest See above - I already described the issue
vere perrot
@perrot
Oct 05 2015 02:46
thank you @0x90936
CamperBot
@camperbot
Oct 05 2015 02:46
perrot sends brownie points to @0x90936 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for 0x90936
DJ
@qualitymanifest
Oct 05 2015 02:47
@SaintPeter ahhhhh....... can't believe i didn't think of that. guess i lost some of the things i learned back then. thanks
CamperBot
@camperbot
Oct 05 2015 02:47
qualitymanifest sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 850 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 05 2015 02:49
@perrot ok, this is a tricky one. There are three issues you need to juggle:
1) You need to keep track of how many times the callback has been called. You can do this fairly easily with a global variable of some sort that gets incremetned inside the callback
2) You need to store your data in some way that is relative to the order in which the calls were made. I did this by encapsulating my callback in a function which took the index of the calling data as a param and then storing the results of the callback in an array at that index. That way order was not important.
3) You need to display all your data ONLY when your counter (from 1 above) is at or above the expected count (in this case, 3)
@perrot I know that is a lot of words . . . so let me know if you're still confused. #2 especially is kinda counter-intuitive.
vere perrot
@perrot
Oct 05 2015 02:52
@SaintPeter Thank you for your explain. I will try later.
CamperBot
@camperbot
Oct 05 2015 02:52
perrot sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 851 | @saintpeter | http://www.freecodecamp.com/saintpeter
Susan Smilanich
@MissMarySue
Oct 05 2015 02:57
@SaintPeter, Thank you!!! I was stuck on the 3 buttons instead of limiting it to just 2 buttons. NICE!!!
CamperBot
@camperbot
Oct 05 2015 02:57
missmarysue sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 852 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 05 2015 02:57
@MissMarySue I made exactly that same mistake as I was testing it. I saw more "inputs" and I just kept changing them. Totally understandable, especially when they're so wide and kind of wrap and are hard to see.
Susan Smilanich
@MissMarySue
Oct 05 2015 02:58
@Jauble and @qualitymanifest thanks both for your insight and help! I learned from both of you!
CamperBot
@camperbot
Oct 05 2015 02:58
missmarysue sends brownie points to @jauble and @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: missmarysue already gave jauble points
:star: 246 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Rex Schrader
@SaintPeter
Oct 05 2015 02:58
@MissMarySue Haha - great smile in your profile pic - even your last name has a "smile" in it :D
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:00
can anyone explain to me how the factorialize Basejump works? I found the solution, but I have no clue on the logic behind it.
Rex Schrader
@SaintPeter
Oct 05 2015 03:01
@Leeiaisabelle Bonfire? Sure, I can lay it down. Lemme guess: You've got a recursive solution?
OverTheNeptune
@OverTheNeptune
Oct 05 2015 03:01
@Leeiaisabelle what is the solution?
Susan Smilanich
@MissMarySue
Oct 05 2015 03:02
@SaintPeter - thanks! The pic is just one in front of a bush at my home...this is just me...nothing fancy! I was thinking the same of your pic: with your fun eyebrow up. BTW, I grew up in Sacto.
CamperBot
@camperbot
Oct 05 2015 03:02
missmarysue sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: missmarysue already gave saintpeter points
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:03
Well I have no idea where to begin, so I went looking for help and found the actual solution. Sometimes when I find the solution to a problem I can read it and understand the logic....but I have no idea what the solution is even doing
Rex Schrader
@SaintPeter
Oct 05 2015 03:03
@MissMarySue :D Not my hometown, but my adopted home.
@Leeiaisabelle Guessing it calls itself?
@Leeiaisabelle If you can drop some code, I can explain.
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:04

here is 1 solution `function factorialize(num) {
if (num === 0 || num == 1) { return 1; }
return num * factorialize(num-1);
}

factorialize(5);`

Rex Schrader
@SaintPeter
Oct 05 2015 03:04
@Leeiaisabelle Yup. It's a recursive solution. That means it calls itself.
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:05

here is the second `function factorialize(num) {
var factorial = 1;
for (var n = 2; n <= num; n++) {
factorial = factorial * n;
}

return factorial;
}`

Abhisek Pattnaik
@abhisekp
Oct 05 2015 03:05
explain format
CamperBot
@camperbot
Oct 05 2015 03:05

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Oct 05 2015 03:05
@Leeiaisabelle :point_up: October 5, 2015 8:35 AM
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:06
let me try it again
function factorialize(num) {
  var factorial = 1;
  for (var n = 2; n <= num; n++) {
    factorial = factorial * n;
  }

  return factorial;
}
perfect!
I will read up on some recursive functions and come back with any questions. Thanks @SaintPeter
CamperBot
@camperbot
Oct 05 2015 03:07
leeiaisabelle sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 853 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 05 2015 03:08

@Leeiaisabelle There are two key elements to understanding the way this function works. Both work the same way.
1) Let's look at the code that does the work:

return num * factorialize(num-1);

The imporant thing to understand here is that in order for return to work, everything to the right of it must be resolved first. That means the call to factorialize(num - 1) must be completed and return a number.
So, you'll see that it calls itself with num -1
2) Now, why don't we loop forever, just calling factorialize over and over and over?
The answer is in this line:

if (num === 0 || num == 1) { return 1; }

This line says that if num is 0 or 1, return a 1. So the first time we call factorialize(5), say, then we call it again from within at 5 - 1 (4), and then again with 4 - 1 (3) and so on.
So the return statement from the first call ends up looking like this:
return 5 * (4 * (3 * (2 * (1))))

@Leeiaisabelle Lemme explain the second code.
Jason
@Jauble
Oct 05 2015 03:11
Anyone know if you can put a border around an image that has a bootstrap img class?
It's not working for me
Rex Schrader
@SaintPeter
Oct 05 2015 03:12

@Leeiaisabelle This one is a bit easier to understand. Remember that a number factorial is that number times each of the numbers from 1 to that number.
so if we want 5 factorial, it might look like this:
([1] * 2 * 3 * 4 * 5) (The one is optional because 1 * n = n)
So if we look at that code:

for (var n = 2; n <= num; n++) {

We're going to loop from 2 to num
and each loop we're going to multiply our value by n
So:
n = 2, factorial = 2
n = 3, factorial = 6
n = 4, factorial = 24
n = 5, factorial = 120
and then we return it.

@Leeiaisabelle Clear?
@Jauble Should be able to. Got a Codepen?
Yosafat Ariel
@yoskakomba
Oct 05 2015 03:14

guys please help me with "waypoint-make-object-properties-private"
I don't understand, the instruction saying:

"See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible."

Code I should edit:

//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.
  this.speed = 100;
  function addUnit(value) {
    return value + "KM/H";
  }

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

};
Rex Schrader
@SaintPeter
Oct 05 2015 03:16
@yoskakomba A public variable is defined as this.someVar, a private variable is defined as var someOtherVar. You need to change this.gear to be defined as a private variable and then change all of the references to it from this.gear to just gear
Yosafat Ariel
@yoskakomba
Oct 05 2015 03:17
ok got it, thanks @SaintPeter
CamperBot
@camperbot
Oct 05 2015 03:17
yoskakomba sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: yoskakomba already gave saintpeter points
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:18
Thanks @SaintPeter I think I like the first solution....only thing is what is the difference between
CamperBot
@camperbot
Oct 05 2015 03:18
leeiaisabelle sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: leeiaisabelle already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 05 2015 03:19
@Leeiaisabelle The recursive solution is the most "elegant", but it is more resource intensive. It may not scale well. The itterative soltution is probably objectively "better".
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:19
What is the difference between == and ===?
I couldn't find a clear answer using Google.
vere perrot
@perrot
Oct 05 2015 03:21
Hello,
I study the unit "Waypoint: Continue working with Nodejs Servers".
At the check box 6.Complete "Juggling Async". I get an error message "rror connecting to localhost:45792: connect ECONNREFUSED" after command "learnyounode verify juggling\ async.js". And how to fix it?
The full error message is:
http.js:1844
if (options.protocol && options.protocol !== 'http:') {
^
TypeError: Cannot read property 'protocol' of undefined
at Object.exports.request (http.js:1844:14)
at Object.exports.get (http.js:1852:21)
at Object.<anonymous> (/home/ubuntu/workspace/juggling async.js:30:6)
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)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:929:3
✗ Error connecting to localhost:45792: connect ECONNREFUSED
Rex Schrader
@SaintPeter
Oct 05 2015 03:21
@Leeiaisabelle The difference is that when you do a ==, it will freely change the type of the variables from either side of the ==. For example, 5 == '5', because it auto converts the string '5' into a number. The === operator is a strict comparison. In that case, 5 === '5' returns false, because number 5 and string 5 have different types.
Jason
@Jauble
Oct 05 2015 03:21
@SaintPeter That's weird. I went to update my codepen with what I tried on my computer, and it works on there. I just can't get it to work on my computer. This is what I have though: http://codepen.io/auble220/pen/rOyGWw
Rex Schrader
@SaintPeter
Oct 05 2015 03:21
@perrot Do you have a url that reads http: vs http:// somewhere?
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:22
OK I understand that @SaintPeter so why are we using it in this instance?
@Jauble did anyone answer your border question?
Rex Schrader
@SaintPeter
Oct 05 2015 03:23
@Leeiaisabelle No idea - I always use === by default. I guess using == means that the code "just works" in the general case, but can potentially be a sign of bad coding. Ideally, if you're comparing numbers, you ought to know if one thinks its a string or not.
@Jauble That looks correct to me.
@Jauble If you're testing locally, it's possible you didn't save a file, or an old instance of your css file is cached. In chrome you can check a box to tell it not to cache when you have the dev console open.
vere perrot
@perrot
Oct 05 2015 03:25
Hi @SaintPeter , The url will read from the first parameter.
http.get(process.argv[2] , callback) ;
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:25
OK thanks @SaintPeter
CamperBot
@camperbot
Oct 05 2015 03:25
leeiaisabelle sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: leeiaisabelle already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 05 2015 03:25
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:27
OHHHHH! This is what I was looking for! Couldn't find it though! Thanks @SaintPeter !
CamperBot
@camperbot
Oct 05 2015 03:27
leeiaisabelle sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: leeiaisabelle already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 05 2015 03:27
@perrot You can do learnyounode run yourcodehere.js and run it without the verify, so you can add console.log statements to see what is maybe going on?
@Leeiaisabelle My google search: javascript == vs ===
Leeia Isabelle
@Leeiaisabelle
Oct 05 2015 03:28
i searched what is the difference between == and === in JavaScript....
vere perrot
@perrot
Oct 05 2015 03:28
Thank you @SaintPeter . I will try it.
CamperBot
@camperbot
Oct 05 2015 03:28
perrot sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: perrot already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 05 2015 03:29
@Leeiaisabelle I find the phrase X vs Y in google can be very helpful. I also try to put the overall topic or domain as the first query term. I think that google treats earlier words as more important when searching.
Jason
@Jauble
Oct 05 2015 03:32
@SaintPeter Ok thanks I'll try that. I actually have another question. Do you know if there's a way to make the figcaption background opaque, but not the text?
CamperBot
@camperbot
Oct 05 2015 03:32
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 855 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 05 2015 03:34

@Jauble Sure - just set the color like so:

background-color: rgba(128,128,128, 0.5);

Where the first three numbers are the RGB values and the last number is a floating point opacity (Alpha channel) from 0 (transpatent) to 1 (opaque)

Jason
@Jauble
Oct 05 2015 03:34
@Leeiaisabelle Just saw your mention. Figured it out. Thanks for asking
CamperBot
@camperbot
Oct 05 2015 03:34
jauble sends brownie points to @leeiaisabelle :sparkles: :thumbsup: :sparkles:
:star: 176 | @leeiaisabelle | http://www.freecodecamp.com/leeiaisabelle
Jason
@Jauble
Oct 05 2015 03:34
@SaintPeter Awesome thanks!
Yosafat Ariel
@yoskakomba
Oct 05 2015 03:41

guys , need help with http://freecodecamp.com/challenges/waypoint-make-instances-of-objects-with-a-constructor-function

here is my code:

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

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

  new Car = function() {
  this.engines = 1;
};
//Add the property "engines" to myCar, and make it a number.
Erick Ruano
@ErickRuano
Oct 05 2015 03:44
I just did this

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

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

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

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

Rex Schrader
@SaintPeter
Oct 05 2015 03:45
@yoskakomba You need to reference your instance of myCar and add a property to it. IE:
myCar.someNewProperty = someValue
Erick Ruano
@ErickRuano
Oct 05 2015 03:45
Hod wo I post code?
Rex Schrader
@SaintPeter
Oct 05 2015 03:45
wiki format
CamperBot
@camperbot
Oct 05 2015 03:45

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Rex Schrader
@SaintPeter
Oct 05 2015 03:46
@iKazuma Awesome that you're helping, but try not to just show the answer. See if you can't explain what they need to do without explicilty saying "here is the code". The key is to increase their understanding of what is going on so they can solve it. Sort of the "teach them to fish" thing.
Erick Ruano
@ErickRuano
Oct 05 2015 03:48
@SaintPeter Ok! I was but my internet failed and then you explained it :D will be more careful next time!
Rex Schrader
@SaintPeter
Oct 05 2015 03:48
@iKazuma :D
@iKazuma I'm just excited that you're helping. Do you see the instructions above about how to post code?
Erick Ruano
@ErickRuano
Oct 05 2015 03:50
This message was deleted
Yosafat Ariel
@yoskakomba
Oct 05 2015 03:50
@SaintPeter why I can't write like the above sample?
var Car = function() {
   this.wheels = 4;
};

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

  new Car = function() {
  this.engines = 1;
};
Erick Ruano
@ErickRuano
Oct 05 2015 04:01
@SaintPeter Actually you can! It just wont produce the desired result.
The point of this exercise is to write a Car constructor (first three lines), then get an instance of Car and add a engines property to that specific instance.
Rex Schrader
@SaintPeter
Oct 05 2015 04:01
@yoskakomba Because it doesn't make sense to say new Car = - new can only be use to the right of the equals operator. Also becuase you're modifying the existing myCar, not creating a new instance of Car
Erick Ruano
@ErickRuano
Oct 05 2015 04:03
This message was deleted
Yosafat Ariel
@yoskakomba
Oct 05 2015 04:06
@SaintPeter & @iKazuma thanks a lot
English is my second language, If freecodecamp doesn't mind, why can't we read new instruction with simple definition? like; what is 'instances' etc
CamperBot
@camperbot
Oct 05 2015 04:06
yoskakomba sends brownie points to @saintpeter and @ikazuma :sparkles: :thumbsup: :sparkles:
:star: 2 | @ikazuma | http://www.freecodecamp.com/ikazuma
:star: 858 | @saintpeter | http://www.freecodecamp.com/saintpeter
Rex Schrader
@SaintPeter
Oct 05 2015 04:07
@yoskakomba I agree that the verbiage could be better defined in that Waypoint. You can potentially google those words, though, to see if you can find a suitable definition or example.
Yosafat Ariel
@yoskakomba
Oct 05 2015 04:07
yes I did google that, got many answer from stackoverflow etc
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
your help and above link help me alot to understand objects in javascript, thanks a lot
CamperBot
@camperbot
Oct 05 2015 04:09
if you want to thank someone, put an @ before their name!
Rex Schrader
@SaintPeter
Oct 05 2015 04:10
@yoskakomba Glad to help. I'll see if I can come up with some more detailed explanation to go in that waypoint and form a pull request for it. Maybe file an issue against it on GitHub? Explain what was confusing to you?
Yosafat Ariel
@yoskakomba
Oct 05 2015 04:10
ok, thank you @SaintPeter
CamperBot
@camperbot
Oct 05 2015 04:10
yoskakomba sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: yoskakomba already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 05 2015 04:11
@yoskakomba File an issue here: https://github.com/FreeCodeCamp/freecodecamp/issues
Yosafat Ariel
@yoskakomba
Oct 05 2015 04:19
Yes you're right @SaintPeter
I want to be a fluent programmer in Javascript that understand javascripts from its core, not only copy and paste example. I am learning a tutorial from U#emy : "understanding Javascript the weird parts", I hope I can master it. thanks for your effort to help me
CamperBot
@camperbot
Oct 05 2015 04:19
yoskakomba sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:warning: yoskakomba already gave saintpeter points
Rex Schrader
@SaintPeter
Oct 05 2015 04:20
@yoskakomba You bettcha!
DJ
@qualitymanifest
Oct 05 2015 04:27
@yoskakomba it's really good that you want to really understand everything, and it sounds like that waypoint needs some help. but i will say - don't worry - once you hit bonfires and beyond there will be no copy and pasting, except for cheaters, who won't get anywhere anyway.
CamperBot
@camperbot
Oct 05 2015 04:27
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Prashanth
@dgprashanth
Oct 05 2015 04:38
Guys need a question answered regarding the twitch api zipline!
vere perrot
@perrot
Oct 05 2015 04:49
Hi my friend,
I study the unit "Waypoint: Finish working with Nodejs Servers".
At the check item 7.Complete "HTTP JSON API Server".
I don't understand the map method. Because the variable chunk always empty in the function map. And the return value is empty, too. I don't know why. Thanks.
Here is my code:
  var http = require('http')
  var url=require('url')
    var map = require('through2-map')

    var server = http.createServer(function (req, res) {
      if (req.method != 'GET')
        return res.end('send me a GET\n')

        var k=url.parse(req.url, true);

        var date=new Date(k.query.iso)
        var n = date.getTime();
        var goal={};
        goal['hour']=date.getHours();
        goal['minute']=date.getMinutes();
        goal['second']=date.getSeconds();
        goal['unixtime']=n;
        console.log(goal);
       req.pipe(map(function (chunk) {
      return JSON.stringify(goal);
    })).pipe(res);
    })

    server.listen(Number(process.argv[2]),process.argv[3])
Jason
@Jauble
Oct 05 2015 04:54
@SaintPeter You around?
Rex Schrader
@SaintPeter
Oct 05 2015 04:55
@Jauble For some values of "around"
Jason
@Jauble
Oct 05 2015 04:57
@SaintPeter lol. I was just wondering; when using bootstrap how often should you use a container? Should you use one main container for the page and then just use rows and columns, or should you put rows and columns in containers?
Rex Schrader
@SaintPeter
Oct 05 2015 04:59
@Jauble I think that you should just use one container but, honestly, I have no idea. I don't know what the reccomendation is. I think you use a container to give you space/margin around the edges.
Jason
@Jauble
Oct 05 2015 05:00
@SaintPeter Ya, I've seen people do it both ways, so it kinda confused me. Thanks
CamperBot
@camperbot
Oct 05 2015 05:00
jauble sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 859 | @saintpeter | http://www.freecodecamp.com/saintpeter
Erick Ruano
@ErickRuano
Oct 05 2015 05:05
Actually, the recommendation is to not use nested containers. Check this docs:
http://getbootstrap.com/css/#overview-container
http://getbootstrap.com/css/#grid-nesting
Alexandrix Ikechukwu
@SpaghettiThots
Oct 05 2015 05:08
Could anyone help analyse this? Just not able to make it work.
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  arr = arr.filter(test);
  return arr;
}

function test(element){
  if(element === true){
    return true;
  }return false;
}

bouncer([7, "ate", "", false, 9], "");
SojournerOctocat
@SojournerOctocat
Oct 05 2015 05:15
@IshMary Your code has me stumped! I don't know why it's not working.
Jason
@Jauble
Oct 05 2015 05:15
@iKazuma Thanks!
CamperBot
@camperbot
Oct 05 2015 05:15
jauble sends brownie points to @ikazuma :sparkles: :thumbsup: :sparkles:
:star: 12 | @ikazuma | http://www.freecodecamp.com/ikazuma
Aleksander Gębicki
@Takumar
Oct 05 2015 05:15
@IshMary inside your function you construct another function test() which is testing its parameter if it fullfills condition specified by you. Then your function is called on each element of your array: arr.filter(test); and when your function returns true this element remains when it returns false it iremoved from resulting array.
SojournerOctocat
@SojournerOctocat
Oct 05 2015 05:16
@IshMary I am seeing that, according to what @Takumar says, every item in your array is returning as false.
Aleksander Gębicki
@Takumar
Oct 05 2015 05:16
@SojournerOctocat yes because array doesn't contain 'true' element.
SojournerOctocat
@SojournerOctocat
Oct 05 2015 05:17
@Takumar "ate" isn't true?
Aleksander Gębicki
@Takumar
Oct 05 2015 05:17
@IshMary your test is element === true so you look only for boolean true value!
Erick Ruano
@ErickRuano
Oct 05 2015 05:17
That's exactly whats happening. If you evaluate each of them:
7 === true or "" === true they will both go to your else statement
Aayush Kapoor
@xeoneux
Oct 05 2015 05:17
@IshMary Simply use
if (element) {
}
Rex Schrader
@SaintPeter
Oct 05 2015 05:19
@IshMary The reason why it works is that in any statement where Javascript expects a boolean value (like an if statement), it will attempt to coerce any value you give it to true or false.
wiki falsy
CamperBot
@camperbot
Oct 05 2015 05:19

:point_right: bonfire falsy bouncer [wiki]

Problem Explanation:

Remove all falsey values from an array.

:pencil: read more about bonfire falsy bouncer on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 05 2015 05:19
wiki js falsey
CamperBot
@camperbot
Oct 05 2015 05:19
no wiki entry for: js falsy
:pencil: click here to create one now!after creating your page type update to reload it here
Rex Schrader
@SaintPeter
Oct 05 2015 05:19
find js falsey
CamperBot
@camperbot
Oct 05 2015 05:19

find js falsey

:zero: js falsey

Rex Schrader
@SaintPeter
Oct 05 2015 05:19
0
CamperBot
@camperbot
Oct 05 2015 05:19

:point_right: js falsey [wiki]

Something which evaluates to FALSE. There are only five falsey values in JavaScript:
undefined, null, NaN, 0, "" (empty string), and false of course.

See also: truthy | Truthy & Falsey blog post
:pencil: read more about js falsey on the FCC Wiki

Rex Schrader
@SaintPeter
Oct 05 2015 05:20
@IshMary Only those 5 values above will be considered "false" (thus "falsey") when coerced into a boolean.
Devon Jones
@jones-codes
Oct 05 2015 05:21
I'm having trouble figuring out how to divide a web page into sections that can be reached with in-page anchor tags
can anyone point me in the right direction?
Aayush Kapoor
@xeoneux
Oct 05 2015 05:21
@Takumar Are you a photographer?
Devon Jones
@jones-codes
Oct 05 2015 05:22
hey @Jauble how's the portfolio coming along
henry fritz
@henryamster
Oct 05 2015 05:22
@jones-codes give your divs ID's, then set your anchors to correspond with the IDs
Devon Jones
@jones-codes
Oct 05 2015 05:23
ok I tried that, maybe just not working in code pen
henry fritz
@henryamster
Oct 05 2015 05:23
what's your anchor look like?
Aleksander Gębicki
@Takumar
Oct 05 2015 05:23
@xeoneux I like taking photos but don't have time recently. Why are you asking?
Devon Jones
@jones-codes
Oct 05 2015 05:24
I'm ultimately trying to have the sections separated by different background images. I can't get the images to stack on top of each other as you scroll
<li class="nav-link"><a href="#projects">Projects</a></li>
Aayush Kapoor
@xeoneux
Oct 05 2015 05:24
@Takumar I used a few super neat, high aperture but manual focus Takumar lens on my Pentax SLR
henry fritz
@henryamster
Oct 05 2015 05:25
and your div tag for projects section?
Aleksander Gębicki
@Takumar
Oct 05 2015 05:25
@IshMary you have to correct your test() function.
henry fritz
@henryamster
Oct 05 2015 05:25
better yet, maybe the codepen link :P
Devon Jones
@jones-codes
Oct 05 2015 05:26
lol yeah good call :clap:
henry fritz
@henryamster
Oct 05 2015 05:27
the anchors are working fine, you need to play around with the divs a bit
go into the html settings and add the viewport meta tag, there's a button for it in the bottom left hand corner
Aleksander Gębicki
@Takumar
Oct 05 2015 05:28
@xeoneux I have forgotten about nick. I have created GitHub account and my usual nick gebi has been taken so I wrote Takumar as I like Asahi M42 lens. For a long time I've been using SMC Takumar 1.8/55mm and S-M-C 3.5/28mm. Still have two 55s and many other manual lenses :-) Now I'm using Pentax DSLR system but still like the most manual lenses but my favourite is now Pentax 1.8/85mm - beautiful lense.
henry fritz
@henryamster
Oct 05 2015 05:28
after that, maybe try setting the new-page class to height:100vh;
Aayush Kapoor
@xeoneux
Oct 05 2015 05:29
@Takumar Hahaha! That's why I asked :D
Devon Jones
@jones-codes
Oct 05 2015 05:30
thanks! what's the viewport meta tag do? @henryamster
CamperBot
@camperbot
Oct 05 2015 05:30
jones-codes sends brownie points to @henryamster :sparkles: :thumbsup: :sparkles:
:star: 272 | @henryamster | http://www.freecodecamp.com/henryamster
Aayush Kapoor
@xeoneux
Oct 05 2015 05:31
@Takumar All I tried were the two Super Takumar 50mm F1.4 manual lens to get how soft they can be
henry fritz
@henryamster
Oct 05 2015 05:32
There's a really great video on https://developers.google.com/web/ about it but I can't find it
Devon Jones
@jones-codes
Oct 05 2015 05:33
Awesome, 100vh has me on the right track for sure
henry fritz
@henryamster
Oct 05 2015 05:34
it essentially compensates for the difference in what a pixel is on a desktop or laptop versus a cellphone screen, there's a lot more to it than that, but I'm not really an expert on the subject :/
Devon Jones
@jones-codes
Oct 05 2015 05:34
should I add the multiple background images onto the body element or the individual div tags
Aleksander Gębicki
@Takumar
Oct 05 2015 05:34
@xeoneux I don't have Takumar 50mm but I really like SMC-A 50mm/1:1.4 a lot better than FA 50mm/1:1.4 which really was soft on aperture 1.4.
henry fritz
@henryamster
Oct 05 2015 05:34
individual divs, use background:url('URL HERE');
then to get that cool scrolly effect in the template you can use background-size: cover; which will fill the entire screen in proportion to the image, then
background-attachment: fixed; which will keep it in one place as the user scrolls down
Aayush Kapoor
@xeoneux
Oct 05 2015 05:36
@Takumar I don't know the exact difference between SMC and FA but yes, 1.4 is really soft and gives you the most wonderful images! :)
Aleksander Gębicki
@Takumar
Oct 05 2015 05:37
@xeoneux FA series is the latest from SLR era with bayonett K and autofocus.
Aayush Kapoor
@xeoneux
Oct 05 2015 05:38
@Takumar Oh! So that would make SMC manual
Devon Jones
@jones-codes
Oct 05 2015 05:38
thanks a bunch
CamperBot
@camperbot
Oct 05 2015 05:38
if you want to thank someone, put an @ before their name!
henry fritz
@henryamster
Oct 05 2015 05:39
@jones-codes no problem, if you want to take a look at the one I made a while back here's the codepen: http://codepen.io/henryamster/pen/YyKEpN it's pretty simple, might be worth stealing a little from
Devon Jones
@jones-codes
Oct 05 2015 05:41
awesome, thanks again
CamperBot
@camperbot
Oct 05 2015 05:41
if you want to thank someone, put an @ before their name!
Jason
@Jauble
Oct 05 2015 05:41
Hey @jones-codes it's comin along ok http://codepen.io/auble220/pen/rOyGWw. Yours looks dope btw. I like the opaque navbar. I gotta find out how to do different sections as you scroll down like you did
Devon Jones
@jones-codes
Oct 05 2015 05:43
Thanks! Yea I found this really cool tool for the navbar
CamperBot
@camperbot
Oct 05 2015 05:43
if you want to thank someone, put an @ before their name!
Devon Jones
@jones-codes
Oct 05 2015 05:44
Dude I literally just figured out the different sections 5 minutes ago lol
sorry bot. thanks @Jauble
CamperBot
@camperbot
Oct 05 2015 05:44
jones-codes sends brownie points to @jauble :sparkles: :thumbsup: :sparkles:
:star: 196 | @jauble | http://www.freecodecamp.com/jauble
Aleksander Gębicki
@Takumar
Oct 05 2015 05:44
@xeoneux as I said now I'm more collector than photographer but we could for sure talk a long about lenses but let's finish for now because it is not photography chat :-) but thanks for discussion.
CamperBot
@camperbot
Oct 05 2015 05:44
takumar sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 269 | @xeoneux | http://www.freecodecamp.com/xeoneux
when you open up the color tool, there's a bar on the right that gives you the shades of transparency for that color you're looking at
Jason
@Jauble
Oct 05 2015 05:47
Sweet
henry fritz
@henryamster
Oct 05 2015 05:47
http://codepen.io/henryamster/full/BoWbOd/ There's really no way to make this work with a switch is there? I'm going to have to push this stuff to an array I think? anyone on finished calc zipline?
Brian van Vlymen
@arduino731
Oct 05 2015 05:48
I am stuck with this level http://freecodecamp.com/challenges/waypoint-make-object-properties-private not sure what should I update the code
DTing
@dting
Oct 05 2015 05:50

@ironheartbj18

We can also create private properties and private methods, which aren't accessible from outside the object.

To do this, we omit the word this from the property or method declaration.

See if you can keep myBike.speed and myBike.addUnit private, while making myBike.getSpeed publicly accessible.

Jason
@Jauble
Oct 05 2015 05:52
try speed = 100; and add this. to getSpeed
When you remove the "this" keyword, it makes it private. When you add it it makes it public
@ironheartbj18
Brian van Vlymen
@arduino731
Oct 05 2015 05:57
thanks @dting @Jauble for clear explanation
CamperBot
@camperbot
Oct 05 2015 05:57
ironheartbj18 sends brownie points to @dting and @jauble :sparkles: :thumbsup: :sparkles:
:star: 197 | @jauble | http://www.freecodecamp.com/jauble
:star: 1308 | @dting | http://www.freecodecamp.com/dting
Jason
@Jauble
Oct 05 2015 06:03
@ironheartbj18 No problem :smile: . I didn't notice @dting was helping you, so my post was kinda redundant lol
Brian van Vlymen
@arduino731
Oct 05 2015 06:07
@Jauble the challenge was a little bit of confused
Devon Jones
@jones-codes
Oct 05 2015 06:09
I'm not sure how to ask this question, but I want to add padding to the top of my body element to make sure the content sits below to the fixed header bar
But the navbar is losing its transparency when I apply the padding to the body
is there a way around this?
ahh I cracked it, add the padding-top the individual divs rather than the body element
Jason
@Jauble
Oct 05 2015 06:15
@ironheartbj18 ya
Brian van Vlymen
@arduino731
Oct 05 2015 06:15
looking good so far @jones-codes
Jason
@Jauble
Oct 05 2015 06:15
@jones-codes Nice. I'm still trying to figure out how you added those different sections lol
I tried
        <div class="container-fluid new-page">
          <h1>Section 2</h1>
        </div>
and added css to .new-page like you did height: 100vh; but it doesn't do anything for me lol
henry fritz
@henryamster
Oct 05 2015 06:26
@Jauble go to your html settings in codepen and there's a button in the bottom left corner to add meta viewport tags
click on that and see if it helps
without those tags, the browser doesn't know how to render the 'vh' or 'vw' units, which are equal to 1/100th of the size of the window
so 100vh translates into the height of the entire window, 100vw translates to 100% of the width, and say 50 vh would translate to half the size of the window
you don't have to necessarily use new-page either, you can name it whatever you'd like, just as long as the css matches what you have in the class part of your div tag
Jason
@Jauble
Oct 05 2015 06:31
@henryamster Thanks I'll try that! I was wondering what that vh was all about lol
CamperBot
@camperbot
Oct 05 2015 06:31
jauble sends brownie points to @henryamster :sparkles: :thumbsup: :sparkles:
:star: 273 | @henryamster | http://www.freecodecamp.com/henryamster
Paras Arora
@parasaro92
Oct 05 2015 06:44
J-Query question 1 is not running
problem with server
vere perrot
@perrot
Oct 05 2015 07:49

Hello,
I study the "Waypoint: Build Web Apps with Expressjs" unit.
At the check item 17.Complete "Good Old Form".
I get these messages response after command "expressworks verify good_old_form.js".
Your submission results compared to the expected:

             ACTUAL                                 EXPECTED                

────────────────────────────────────────────────────────────────────────────────

"Cannot GET /home" != "Hello World!"

────────────────────────────────────────────────────────────────────────────────

✗ Submission results did not match expected!

FAIL

Your solution to HELLO WORLD! didn't pass. Try again!

Here is my code program.js:

var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.urlencoded( {extended: true} ));
app.post('/form', function (req, res) {
    res.end(req.body.str.split('').reverse().join(''));
});
app.listen(process.argv[2]);
Jonathan Lee Slew
@jlslew
Oct 05 2015 07:57
@perrot extended should be false, https://www.npmjs.com/package/body-parser#extended
vere perrot
@perrot
Oct 05 2015 07:59
Thank you @jlslew . I set the extended as false. But the output still ""Cannot GET /home" != "Hello World!" . I don't know why.
CamperBot
@camperbot
Oct 05 2015 07:59
perrot sends brownie points to @jlslew :sparkles: :thumbsup: :sparkles:
:star: 272 | @jlslew | http://www.freecodecamp.com/jlslew
Jonathan Lee Slew
@jlslew
Oct 05 2015 08:06
@perrot could you type expressworks and reselect Good Old Form then expressworks verify
vere perrot
@perrot
Oct 05 2015 08:08
Thank you very much @jlslew . I miss this step. :smile:
CamperBot
@camperbot
Oct 05 2015 08:08
perrot sends brownie points to @jlslew :sparkles: :thumbsup: :sparkles:
:warning: perrot already gave jlslew points
vere perrot
@perrot
Oct 05 2015 08:54
Hi,
I study the "Waypoint: Build Web Apps with Expressjs".
At the check item 19.Complete "Param Pam Pam".
I get a output '"Cannot PUT /message/a2a2cbafbdd6b5ea4281a5876790d5f4" != "c19685072e57443cb57489cab5a98cc5a9cc6a3f"' after command "expressworks verify param_pam.js".Maybe something wrong.
This is my code:
var express = require('express')
    var app = express()
    app.put('/path/:NAME', function(req, res){
        console.log(req.params.NAME);
    });

    app.listen(process.argv[2])
Michael Bomholt
@bomholtm
Oct 05 2015 11:41
hey having trouble with
whats <REMOTENAME>?
Abhishek
@Abhi493
Oct 05 2015 11:58
help me on palindrome check program
CamperBot
@camperbot
Oct 05 2015 11:58
no wiki entry for: me on palindrome check program
:pencil: click here to create one now!after creating your page type update to reload it here
Abhishek
@Abhi493
Oct 05 2015 11:58

function palindrome(str) {

str = str.toLowerCase();
str = str.replace(",", "");
str = str.replace("_", "");
str = str.replace(":", "");
str = str.replace(";", "");
str = str.replace("-", "");
str = str.replace(" ", "");
str = str.replace(".", "");

var array2 = str.split("").reverse().join("");

var array = str.split("").join("");

if(array === array2)
{
return true;
}
else{
return false;
}
}

any1 please
Aleksander Gębicki
@Takumar
Oct 05 2015 11:59
@Abhi493 give a second to check your code, don't be so impatient :-)
Abhishek
@Abhi493
Oct 05 2015 12:00
okay
palindrome.png
palindrome.png
banto1
@banto1
Oct 05 2015 12:06
please i need help with text editing page; i don't see anyplace i could type my code. the editing place just white page.
noobstar
@namsir
Oct 05 2015 12:06
@Abhi493 it is more efficience to use regular expression to solve that problem.
Abhishek
@Abhi493
Oct 05 2015 12:07
@Namsir y isnt it working, is something wrong with my code
Aleksander Gębicki
@Takumar
Oct 05 2015 12:07
@Abhi493 your replace() function now removes only single occurence of each character you are checking.
Abhishek
@Abhi493
Oct 05 2015 12:07
oh
then what should i do?
noobstar
@namsir
Oct 05 2015 12:08
put in loop?
Abhishek
@Abhi493
Oct 05 2015 12:08
ok giving it a try
noobstar
@namsir
Oct 05 2015 12:08
then you would have 7 loops
Aleksander Gębicki
@Takumar
Oct 05 2015 12:08
@Abhi493 if you want to do like you do now, you need to use regular expressions like @namsir suggested, or change a little
use something like this: str = str.replace(/,/g, "");
noobstar
@namsir
Oct 05 2015 12:09
but regular expressions will save you lots of time :)
Aleksander Gębicki
@Takumar
Oct 05 2015 12:09
@namsir or he will loose a lot of time learning it ;-) but @Abhi493 you should really learn regexp
Abhishek
@Abhi493
Oct 05 2015 12:09
wow it worked
but how to replace / \ with replace funvtion
Aleksander Gębicki
@Takumar
Oct 05 2015 12:10
@Abhi493 but it is not all, you have to add this /g to your every replace() function, because g means global so it replaces every occurence of your sign.
Check documentation of replace(): replace
Abhishek
@Abhi493
Oct 05 2015 12:11
Untitled.png
@Takumar u r right i didnt understand REgEXp
Aleksander Gębicki
@Takumar
Oct 05 2015 12:12
@Abhi493 that's true because you still didn't remove all unnecessary characters like slash and backslash. You can finish your exercise now adding a few replace() function and then do it again with regular expressions.
noobstar
@namsir
Oct 05 2015 12:12
for learning and practicing.
Abhishek
@Abhi493
Oct 05 2015 12:12
problem is //\ slashes arent working as other special characters
noobstar
@namsir
Oct 05 2015 12:13
http://www.ultrapico.com/expresso.htm is a good one as well.
Abhishek
@Abhi493
Oct 05 2015 12:14
thankyou NamSir
noobstar
@namsir
Oct 05 2015 12:14
you're welcome. good luck
after you've learned regexp download expresso and go to expression library...they have some examples you can look at.
those are commonly use matching techniques.
Abhishek
@Abhi493
Oct 05 2015 12:17
how replace slashes ??? NamSir @Takumar'
noobstar
@namsir
Oct 05 2015 12:17
\
Abhishek
@Abhi493
Oct 05 2015 12:17
with replace function?
noobstar
@namsir
Oct 05 2015 12:17
\\
Abhishek
@Abhi493
Oct 05 2015 12:17
its isnt working, dont no why.
Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:26
Monesul Haque
@mones-cse
Oct 05 2015 12:26
/hint
CamperBot
@camperbot
Oct 05 2015 12:26
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Monesul Haque
@mones-cse
Oct 05 2015 12:27
hint make
CamperBot
@camperbot
Oct 05 2015 12:27
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Chris
@Shifthawke
Oct 05 2015 12:28
@khanrafay What do you need?
Aleksander Gębicki
@Takumar
Oct 05 2015 12:29

@Abhi493 backslash is a special 'escape' character. You have to use something like this:

str = str.replace(/[\/]/g, "");
str = str.replace(/[\\]/g, "");

But after thinking a little you should really start learning RexExp :-)

Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:30
@Shifthawke I really can't understand this line (Give the text input in your form the class form-control)
Chris
@Shifthawke
Oct 05 2015 12:31
It's literally the class form-control
for your <input>
Aleksander Gębicki
@Takumar
Oct 05 2015 12:32
@khanrafay look for example in your code how other tags i.e. <div> get class applied and do the same with your <input> field but with the class you want.
Chris
@Shifthawke
Oct 05 2015 12:33
I use other code as example too ^_^
Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:33
i am getting all of that but only this, like what do i have to do ? either to make a class ? or not because this is bootstrap.
Chris
@Shifthawke
Oct 05 2015 12:33
Yes it's a class.
like your red-text class
Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:34
so i have to make a class in my <style >?
Chris
@Shifthawke
Oct 05 2015 12:34
no
In the <input>
Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:34

ok i get it but tell me do i have to make it like

<form class="form-control">

Chris
@Shifthawke
Oct 05 2015 12:34
No need to touch the style. I simply meant like you would put a red text class into your <p> or <h2>
yeah
Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:35
but its not working.
Chris
@Shifthawke
Oct 05 2015 12:35
it's input not form though.
The one right above your button.
Aleksander Gębicki
@Takumar
Oct 05 2015 12:36
@khanrafay your input text field will change a little you'll see it. The borders will be rounded.
Abdul Rafay Khan
@khanrafay
Oct 05 2015 12:39
Thanks @Shifthawke @Takumar :)
CamperBot
@camperbot
Oct 05 2015 12:39
khanrafay sends brownie points to @shifthawke and @takumar :sparkles: :thumbsup: :sparkles:
:star: 373 | @shifthawke | http://www.freecodecamp.com/shifthawke
:star: 388 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Oct 05 2015 12:41
@Abhi493 I would like to tell you that you not need line: var array = str.split("").join(""); in your code. Your str variable is string not array, and you could use join() function to join elements of an array to make it a string, but you have string already!
Stjepan Mazalovic
@stjema
Oct 05 2015 12:45
http://codepen.io/Napelazam/pen/EVmYrL <span class="bold">the View</span> isn't working with
.bold {
font-weight: bold;
}
why? :<
BaLin
@Kinderspiel86
Oct 05 2015 12:47
HEy guys, how to add the ".btn-block"-class in addition to a (simple) "block"-class
Chris
@Shifthawke
Oct 05 2015 12:48
@Kinderspiel86 What code do you have so far?
Stjepan Mazalovic
@stjema
Oct 05 2015 12:48
it's a kinderspiel
Chris
@Shifthawke
Oct 05 2015 12:48
Was ist das?
childs play?
Stjepan Mazalovic
@stjema
Oct 05 2015 12:49
no
i think, it is a kinderspiel, to win a race, if you have a 1000hp car
you understand? it is so easy to win the game
Chris
@Shifthawke
Oct 05 2015 12:54
Lol how is it so easy to win?
Stjepan Mazalovic
@stjema
Oct 05 2015 12:55
because the others have only 400 hp cars
Mateja Trifunovski
@Matko95
Oct 05 2015 12:55
@stjema you were missing "}" above your .bold
Stjepan Mazalovic
@stjema
Oct 05 2015 12:56
oh my ....
that is not normal-..
i thought i am a good html junkie now
thanks @Matko95
CamperBot
@camperbot
Oct 05 2015 12:57
stjema sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 408 | @matko95 | http://www.freecodecamp.com/matko95
Chris
@Shifthawke
Oct 05 2015 12:57
I suppose that would still technically be child's play then lol. @stjema
Stjepan Mazalovic
@stjema
Oct 05 2015 12:58
more a cinch @Shifthawke
Costas Chaitas
@CostasChaitas
Oct 05 2015 13:16
can anybody help me with this codepen?
why it doesnt change the content of the message-box?
Raygendary
@raygendary
Oct 05 2015 13:28

what is rong with this map method?

array = array.map (function(val){
return val + 3;

});

Logan Tegman
@ltegman
Oct 05 2015 13:32

@rasakos The function that should be changing the contents of message-box when you guess is

$(".boxname").click(function(){
    colorVal=this.innerHTML;
    console.log(colorVal);
    guess_count++;
    console.log(guess_count);
    $(".message-box").css("background",colorVal);
});

but at no point does it alter the html of the message-box

@raygendary There’s nothing inherently wrong with it. What is it doing wrong?
i just fix it bro
thanks for your interesting
CamperBot
@camperbot
Oct 05 2015 13:37
if you want to thank someone, put an @ before their name!
Costas Chaitas
@CostasChaitas
Oct 05 2015 13:37
thanks @ltegman
CamperBot
@camperbot
Oct 05 2015 13:37
rasakos sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 223 | @ltegman | http://www.freecodecamp.com/ltegman
Mateja Trifunovski
@Matko95
Oct 05 2015 13:40
This message was deleted
@raygendary nothing is wrong
Craig Morrison
@frogmorton
Oct 05 2015 13:55
i need help with trying to add a font to my project
i have it set up the way I think it needs to be, but some items won't render for me
Stjepan Mazalovic
@stjema
Oct 05 2015 13:56
sublime 2 oder 3?
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 13:56
I'm having trouble understanding the solution to Symmetric Difference...the one in the wiki. Did anyone do it that way?
@frogmorton are you using Google fonts?
Craig Morrison
@frogmorton
Oct 05 2015 14:03
Yes, and THOSE work beautifully
i found this one library that was written originally as an extension of font awesome...but for some reason, it doesn't work when I try to embed, although font awesome works great too.
The odd thing is, the font icons work great on this preview page... http://217.199.187.68/craigmorrison.com/preview.html
but not when I try to slip them into another page
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:07
what happens?
cheesestrings
@cheesestrings
Oct 05 2015 14:09
hey, has any done Bonfire: Map the debris? im having major problems with the formulae
Craig Morrison
@frogmorton
Oct 05 2015 14:10
i see a little box
but no icon
i thought i had my files and paths all correct
That's the one difference. I am serving it myself.... whether locally for testing or on the free domain i mentioned, it doesn't seem to work
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:13
are you using bootstrap?
Craig Morrison
@frogmorton
Oct 05 2015 14:14
yes
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:14
and font awesome
Craig Morrison
@frogmorton
Oct 05 2015 14:14
yes
i have the font.mbuzz.css file AND the actual font files
CamperBot
@camperbot
Oct 05 2015 14:18
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Abhishek
@Abhi493
Oct 05 2015 14:18
please
Craig Morrison
@frogmorton
Oct 05 2015 14:19
there are several of those... .ttf, .eot, .wwof, .svg @TheHighPriestess
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:19
@frogmorton all I can think of is thta it must be a problem with the path
Abhishek
@Abhi493
Oct 05 2015 14:20
bonfire-title-case-a-sentence
itle-case-a-sentence
Craig Morrison
@frogmorton
Oct 05 2015 14:20
right. if the .css is at the root level, and the font files are in a fonts folder in the root directory, and within the .css file, they are referred to as src="fonts/*.woff" I thought I'd be golden
i was trying to look over the inline css and classes used in the preview.html to see if something special was being done to display them...
Hans van Riet
@hansinla
Oct 05 2015 14:23
@Abhi493 What’s your question?
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:24
@frogmorton i'm going to try it out now..
Craig Morrison
@frogmorton
Oct 05 2015 14:25
@TheHighPriestess Great
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:25
@frogmorton do I need fontawesome?
the instructions make it sound as if one needs all three
Craig Morrison
@frogmorton
Oct 05 2015 14:25
it's driving me nuts, but the icons are so cool
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:25
yeah..they are
i might want to use them one day
Craig Morrison
@frogmorton
Oct 05 2015 14:25
well, i was already using font awesome, so I didn't have to add anything
Abhishek
@Abhi493
Oct 05 2015 14:25
@hansinla
i just cant complete tha bornfire
can u tell me what i am doing wrong?
Untitled.png
hello any1 there to help me on this?
Moisés Man
@moigithub
Oct 05 2015 14:29
@Abhi493 array = str.split(" "); <-- this will take str content string.. and create an array with all words ["Im","a","little","tea" ,"pot"]
Craig Morrison
@frogmorton
Oct 05 2015 14:29
@Abhi493 put var before array
Abhishek
@Abhi493
Oct 05 2015 14:29
okay
Craig Morrison
@frogmorton
Oct 05 2015 14:29
you didn't define it as a new variable
Abhishek
@Abhi493
Oct 05 2015 14:30
now i just defined
after ur suggestion
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:30
@frogmorton same thing is happening to me...just a little square
Moisés Man
@moigithub
Oct 05 2015 14:30
@Abhi493 after ur code enter ur for/loop.. it REPLACES UR array and set a new value to it.. so it become NO MORE an array
array = array[i].charAt(0) but a single character
so the next iteration array[i] point to a undefined character and charAt(0) get error
Mike G.
@mgraham134
Oct 05 2015 14:30
Hey guys I have a quick question regarding CSS
Abhishek
@Abhi493
Oct 05 2015 14:30
oh
Mike G.
@mgraham134
Oct 05 2015 14:30
I'm not sure if it's a glitch or not but my border isn't showing
Abhishek
@Abhi493
Oct 05 2015 14:31
programming is intimidating
Craig Morrison
@frogmorton
Oct 05 2015 14:31
@TheHighPriestess that sucks
Abhishek
@Abhi493
Oct 05 2015 14:31
can u tell me how to complete that bornfire?
Craig Morrison
@frogmorton
Oct 05 2015 14:31
@Abhi493 I don't think that is in your best interest
being guided and being given the solution are two very different things
Abhishek
@Abhi493
Oct 05 2015 14:32
i will appreciate if u have time to guide me
Craig Morrison
@frogmorton
Oct 05 2015 14:32
do you know how to post your code in this room without using a screen shot?
Abhishek
@Abhi493
Oct 05 2015 14:32
no
i m quite new here
Aleksander Gębicki
@Takumar
Oct 05 2015 14:33
wiki format
CamperBot
@camperbot
Oct 05 2015 14:33

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Moisés Man
@moigithub
Oct 05 2015 14:33
@Abhi493 array = array[i].charAt(0) u need to fix that line so instead replace the whole array variable.. it only replaces a single array element
Craig Morrison
@frogmorton
Oct 05 2015 14:33
the bot just told you how...LOL
Abhishek
@Abhi493
Oct 05 2015 14:33

function titleCase(str) {

var array = str.split(" ");

for(i=0;i<str.length;i++){

array[i].charAt(0).toUpperCase();

}
str = array.join();

return str;
}

titleCase("I'm a little tea pot", "");

Mizzix
@Mizzix
Oct 05 2015 14:34
make sure you’re putting the three ticks (`) before and after your code, @Abhi493
Craig Morrison
@frogmorton
Oct 05 2015 14:34
look up and use the backticks as the bot told you
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:34
@frogmorton and when I increased the pixel size...the box got bigger
Aleksander Gębicki
@Takumar
Oct 05 2015 14:34
@Abhi493 edit your code don't put it once again :-) You know how to edit? Press three dots on the right side of your post and then choose 'Edit'.
Craig Morrison
@frogmorton
Oct 05 2015 14:35
so, something IS happening @TheHighPriestess
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:35
yeah
Stjepan Mazalovic
@stjema
Oct 05 2015 14:35
guys. sublime 2 or 3?
JensGryspeert
@JensGryspeert
Oct 05 2015 14:35
@stjema I used alot sublime 2
Craig Morrison
@frogmorton
Oct 05 2015 14:35
yeah, my box is rather large, because I was using size= 8em;
JensGryspeert
@JensGryspeert
Oct 05 2015 14:35
But now I'm working on Atom and likes Atom much more.
Craig Morrison
@frogmorton
Oct 05 2015 14:36
i had steered clear of ST3 for a while, but I think it's pretty stable at this point. Haven't tried Atom, but heard good things
Aleksander Gębicki
@Takumar
Oct 05 2015 14:38
@Abhi493 learn yourself to edit code you put here it will help you and us.
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:39
@frogmorton and it's interesting that when I Googled I didn't find anyone else with the same problem
Abhishek
@Abhi493
Oct 05 2015 14:39
function titleCase(str) {

  var array = str.split(" ");

  for(i=0;i<str.length;i++){

 array[i].charAt(0).toUpperCase();

  }
str = array.join();

  return str;
}

titleCase("I'm a little tea pot", "");
thanks man , now i learned
CamperBot
@camperbot
Oct 05 2015 14:40
if you want to thank someone, put an @ before their name!
Craig Morrison
@frogmorton
Oct 05 2015 14:40
@TheHighPriestess hmmm
Aleksander Gębicki
@Takumar
Oct 05 2015 14:40
@Abhi493 good work.
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:41
@frogmorton oh wait...i have it working
i see the feather icon...or whatever it is
Abhishek
@Abhi493
Oct 05 2015 14:41
now please help me on my code
Craig Morrison
@frogmorton
Oct 05 2015 14:41
really! ROCK ON! woo hoo
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:42
i just dumped it all into the same folder as my index file
and i have this in the head:
<link rel="stylesheet" href="font-awesome.min.css">
<link rel="stylesheet" href="font-mfizz.css">
they all have to be in the same folder
Craig Morrison
@frogmorton
Oct 05 2015 14:43
oh, so you downloaded the font awesome min file, and are not linking it over the web? You didn't modify the paths of the mfizz fonts (at the top of the font-mfizz.css file), right?
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:44
yeah...i have it in the same folder as my index file
...and the paths as shown above
Craig Morrison
@frogmorton
Oct 05 2015 14:44
you mean, as they were when you downloaded it
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:45
well...i downloaded it...and then took EVERYTHING...and just copied into the same folder that contains my index file..
Craig Morrison
@frogmorton
Oct 05 2015 14:45
i mean, you didn't actually open the css file and modify it in any way
with respect to the paths
Aleksander Gębicki
@Takumar
Oct 05 2015 14:45
@Abhi493 your 'for' loop is now looping through elements of string 'str' but I think that you wanted to loop through elements of array if you know what I mean? for(i=0;i<str.length;i++){
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:46
@frogmorton no...i didn't alter the css file at all
it just need the right path
your paths are wrong
Logan Tegman
@ltegman
Oct 05 2015 14:46
@Abhi493 You're close. However your code array[i].charAt(0).toUpperCase(); does not actually alter the word at array[i], because strings are immutable. You need to construct a new word from the first capitalized letter and the rest lower case and concatenate them into a new string that you assign back into that spot on the array.
Craig Morrison
@frogmorton
Oct 05 2015 14:47
I DID go in and change them :(
Juan Riquelme
@soulchainer
Oct 05 2015 14:47
@Abhi493 Maybe it would be helpful if you, at least, explain your problem.
But, for now, adding to what @Takumar said, I see you dont declare local variables, but globals (you didn't put var before the first use of i, as example. You shouldn't do that.
Simeon
@Boasbabs
Oct 05 2015 14:47
hello everyone
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:47
So...I then created a new folder called "css" and then copied everything to it and changed my link to:
<link rel="stylesheet" href="css/font-mfizz.css">
..and it works
Craig Morrison
@frogmorton
Oct 05 2015 14:48
the the paths to the actual font files is wrong
Jason Wood
@catapixel
Oct 05 2015 14:48
Anyone willing to look at my code for the mongodb waypoint "Insert" and tell me why I'm getting an AssertionError when I run the verify?
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:49
@frogmorton It has to be a problem with the path. Put everything...all the files...in the SAME folder
Craig Morrison
@frogmorton
Oct 05 2015 14:49
@TheHighPriestess will do
Babs Craig
@babzcraig
Oct 05 2015 14:52
Hello everyone
How are we today?
Simeon
@Boasbabs
Oct 05 2015 14:52
Please can someone help with how to find the largest of 4 arrays? BonFire7: basic algorithm scripting
CamperBot
@camperbot
Oct 05 2015 14:52
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Babs Craig
@babzcraig
Oct 05 2015 14:52
Can someone please explain how this code works?:
Craig Morrison
@frogmorton
Oct 05 2015 14:53
@TheHighPriestess victory is mine!
LOL
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:53
@Boasbabs use arrayname.length
@frogmorton hooray!
Babs Craig
@babzcraig
Oct 05 2015 14:53

function bouncer(arr) {
function isTruthy(arg) {
return Boolean(arg);
}

var filteredArray = arr.filter(isTruthy);
return filteredArray;
}

bouncer([7, "ate", "", false, 9], "");

Juan Riquelme
@soulchainer
Oct 05 2015 14:54
wiki format
CamperBot
@camperbot
Oct 05 2015 14:54

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Simeon
@Boasbabs
Oct 05 2015 14:54
@TheHighPriestess ok? how do i go by that?
Babs Craig
@babzcraig
Oct 05 2015 14:54
This message was deleted
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 14:54
arrayname.length will give you the length of the array. Then...compare them in order to find the longest
Craig Morrison
@frogmorton
Oct 05 2015 14:55
@babzcraig the ticks have to be on separate lines to the code
Babs Craig
@babzcraig
Oct 05 2015 14:55
  function bouncer(arr) {
  function isTruthy(arg) {
    return Boolean(arg);
  }

  var filteredArray = arr.filter(isTruthy);
  return filteredArray;
}

bouncer([7, "ate", "", false, 9], "");
Craig Morrison
@frogmorton
Oct 05 2015 14:55
There you go
Juan Riquelme
@soulchainer
Oct 05 2015 14:55
Better :D.
Babs Craig
@babzcraig
Oct 05 2015 14:55
Thanks @frogmorton
CamperBot
@camperbot
Oct 05 2015 14:55
babzcraig sends brownie points to @frogmorton :sparkles: :thumbsup: :sparkles:
:star: 281 | @frogmorton | http://www.freecodecamp.com/frogmorton
Juan Riquelme
@soulchainer
Oct 05 2015 14:55
Oh. You're welcome.
Craig Morrison
@frogmorton
Oct 05 2015 14:55
no problem
Babs Craig
@babzcraig
Oct 05 2015 14:55
Do you have any idea how that code works?
Abhishek
@Abhi493
Oct 05 2015 14:55
hi guys i desperetely need your help
function palindrome(str) {
    for(var i =0 ; i<str.length;i++){
    str = str.toLowerCase();
    str = str.replace(",", "");
    str = str.replace("_", "");
    str = str.replace(":", "");
    str = str.replace(";", "");
    str = str.replace("-", "");
    str = str.replace(" ", "");
    str = str.replace(".", "");
    str = str.replace(/\/\g,"");


    }                 

  var array2 = str.split("").reverse().join("");

  var array = str;


  if(array === array2)
    {
    return true;
    }
  else{
    return false;
  }
}




palindrome("eye");
tell me how to replace slashes / \ / , as it is not working as other special characters
Juan Riquelme
@soulchainer
Oct 05 2015 14:58
@Abhi493 This way /\\/, I think.
Logan Tegman
@ltegman
Oct 05 2015 14:58
@babzcraig The isTruthy function returns the input converted to a boolean and filter keeps the element of the array it is called on whenever that boolean the isTruthy function creates is true. So any falsy values will be converted to a boolean value of false and then removed from the array.
Mateja Trifunovski
@Matko95
Oct 05 2015 14:58
@babzcraig
  function bouncer(arr) {
  function isTruthy(arg) {
    return Boolean(arg);//converts the element to a boolean, if it's a falsey value it will return false
  }

  var filteredArray = arr.filter(isTruthy);
  return filteredArray;//applies the filter on every  element, and only those that return true stay
}

bouncer([7, "ate", "", false, 9], "");
Babs Craig
@babzcraig
Oct 05 2015 15:00
Okay, so the Boolean function is an inbuilt function that evaluates a value as true or false?
And of course the five Falsy values will evaluate to false which the filter method will remove from the array
Is that it?
Chris
@Shifthawke
Oct 05 2015 15:01
I havent seen this bonfire but it contains ' bouncer, truthy, 7 ate 9.'lol this bonfire will be funny.
Abhishek
@Abhi493
Oct 05 2015 15:01
woo ho tysm @soulchainer
Logan Tegman
@ltegman
Oct 05 2015 15:01
@babzcraig Yup. Boolean() creates a new boolean value from the input.
Babs Craig
@babzcraig
Oct 05 2015 15:01
Haha. @Shifthawke they do have a funny dry sense of humor with the lessons.
Mateja Trifunovski
@Matko95
Oct 05 2015 15:01
This message was deleted
Juan Riquelme
@soulchainer
Oct 05 2015 15:02
@Abhi493 I was wrong xD.
Aleksander Gębicki
@Takumar
Oct 05 2015 15:02

@Abhi493 I wrote you at 14:29:

str = str.replace(/[\/]/g, "");
str = str.replace(/[\\]/g, "");

But you should change your first part which removes these characters.
Entire your loop can be done in one line using regular expressions.

Abhishek
@Abhi493
Oct 05 2015 15:02
but it worked
Babs Craig
@babzcraig
Oct 05 2015 15:02
Thanks guys. @soulchainer @frogmorton @ltegman
CamperBot
@camperbot
Oct 05 2015 15:02
babzcraig sends brownie points to @soulchainer and @frogmorton and @ltegman :sparkles: :thumbsup: :sparkles:
:warning: babzcraig already gave frogmorton points
:star: 224 | @ltegman | http://www.freecodecamp.com/ltegman
:star: 320 | @soulchainer | http://www.freecodecamp.com/soulchainer
Chris
@Shifthawke
Oct 05 2015 15:02
truthy. That's like sort of like the truth but not quite lol
Abhishek
@Abhi493
Oct 05 2015 15:02
i just submitted it succesfully
Juan Riquelme
@soulchainer
Oct 05 2015 15:03
Oh. Then I was not wrong xD. I tried in my local node, but it wasn't replacing it well. I guess it got drunk xD, @Abhi493
Abhishek
@Abhi493
Oct 05 2015 15:03
now back to born fire title case a sentence, again i need ur help @Takumar
Juan Riquelme
@soulchainer
Oct 05 2015 15:03
@Abhi493 (Because of that I said I was wrong, because I tried that with a simple string :þ).
Aleksander Gębicki
@Takumar
Oct 05 2015 15:03
@Abhi493 so why are you asking it on 16:55?
Abhishek
@Abhi493
Oct 05 2015 15:04
i was trying to do that since lunch timw
but then i quiet and again tried now
Aleksander Gębicki
@Takumar
Oct 05 2015 15:05
@Abhi493 gain all answers everyone gave you on topic of: "Title case a sentence" and think about it.
Craig Morrison
@frogmorton
Oct 05 2015 15:07
The most valuable pair programming is when someone can ask YOU questions to justify the decisions YOU are making in the code, and if you're lost, possibly remind you what key words to the requirements mean, and what the suggested methods actually do, @Abhi493
Aleksander Gębicki
@Takumar
Oct 05 2015 15:07
I will give you one more hint. You have problem with line: array[i].charAt(0).toUpperCase(); because I don't know if you know :-) what it does? It changes case of first character of i-element of your array, but it doesn't do anything with that - it flows now in the air.
Abhishek
@Abhi493
Oct 05 2015 15:09
basically i have to divide the string into many sub arrays and then capitalize there first alphabet?
Aleksander Gębicki
@Takumar
Oct 05 2015 15:10
@Abhi493 right. But you did it already with split() function.
Abhishek
@Abhi493
Oct 05 2015 15:10
how to build sub arrays or how to select sub array from a collecrion of array?
but how can i select those array independently
?
Herman Fassett
@HermanFassett
Oct 05 2015 15:11
indexes
Abhishek
@Abhi493
Oct 05 2015 15:12
function titleCase(str) {

  var array = str.split(" ");

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

 array[i].charAt(0).toUpperCase();

  }
str = array.join(" ");

  return str;
}

titleCase("I'm a little tea pot", "");
is my for loop select these sub array independently
Herman Fassett
@HermanFassett
Oct 05 2015 15:14
There aren't any sub arrays really, but yes, array[i] would be selecting each index of the array
James Smith
@matthew02
Oct 05 2015 15:14
@Abhi493 They aren't sub arrays. It's an array of strings. You are selecting the correct character.
Aleksander Gębicki
@Takumar
Oct 05 2015 15:15
@Abhi493 I will ask you a simple question. When you have variable: var i = 0; and then you write in your code i; what will happen?
Nothing.
But when I later write: i = 2; what happens? Variable i will get value of 2.
So look inside your loop and think about the line you've got there.
Abhishek
@Abhi493
Oct 05 2015 15:17
it will show 0 in console
Aleksander Gębicki
@Takumar
Oct 05 2015 15:18
@Abhi493 I tried to say to you, that inside your loop you really don't change case of first letter of every string you take in your loop from 'array'.
Just assign value of your statement to variable.
Abhishek
@Abhi493
Oct 05 2015 15:19
then how to capitalize there first letter of every word?
Herman Fassett
@HermanFassett
Oct 05 2015 15:20
array[i].charAt(0).toUpperCase() gets the first letter of every word capitalized, but doesn't give you the rest of the string... Need to get that and assign the whole thing, not just the first letter, to array[i]
Yes?
Aleksander Gębicki
@Takumar
Oct 05 2015 15:21
@Abhi493 another hint: var result = "abc".charAt(0).toUpperCase(); will give you: result === 'A'
@HermanFassett was faster.
Abhishek
@Abhi493
Oct 05 2015 15:21
wondering..
Jonathan Coleman
@jondcoleman
Oct 05 2015 15:22
Hey all, starting mongo on port 27017, how long should this take?
on c9
seems stuck
Aayush Kapoor
@xeoneux
Oct 05 2015 15:22
@jondcoleman Not more than a few seconds?
Abhishek
@Abhi493
Oct 05 2015 15:22
then how to add the result to the original string?
Jonathan Coleman
@jondcoleman
Oct 05 2015 15:22
hmm
this is what I have so far but it just sits here:
2015-10-05T15:21:48.132+0000 [initandlisten] MongoDB starting : pid=22895 port=27017 dbpath=./data 64-bit host=jondcoleman-coleman_workspace_1-1954596
2015-10-05T15:21:48.133+0000 [initandlisten] db version v2.6.9
2015-10-05T15:21:48.133+0000 [initandlisten] git version: df313bc75aa94d192330cb92756fc486ea604e64
2015-10-05T15:21:48.133+0000 [initandlisten] build info: Linux build20.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-10-05T15:21:48.133+0000 [initandlisten] allocator: tcmalloc
2015-10-05T15:21:48.133+0000 [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "./data", journal: { enabled: false } } }
2015-10-05T15:21:48.167+0000 [initandlisten] waiting for connections on port 27017
2015-10-05T15:22:48.169+0000 [clientcursormon] mem (MB) res:51 virt:223
2015-10-05T15:22:48.169+0000 [clientcursormon]  mapped:80
2015-10-05T15:22:48.169+0000 [clientcursormon]  connections:0
this was my command: 'mongod --port 27017 -dbpath=./data --nojournal'
Aleksander Gębicki
@Takumar
Oct 05 2015 15:24
@Abhi493 I'm sure you have heard about contatenation of strings? str = str1 + str2; or rather str = str + str2;
Aayush Kapoor
@xeoneux
Oct 05 2015 15:25
@jondcoleman I think it's up and running
Jonathan Coleman
@jondcoleman
Oct 05 2015 15:25
@xeoneux oh ok, so I shouldn't expect to see the prompt again in that window?
Aayush Kapoor
@xeoneux
Oct 05 2015 15:26
@jondcoleman As long as it's running, nope!
Jonathan Coleman
@jondcoleman
Oct 05 2015 15:26
ok, thanks @xeoneux I didn't follow that
CamperBot
@camperbot
Oct 05 2015 15:26
jondcoleman sends brownie points to @xeoneux :sparkles: :thumbsup: :sparkles:
:star: 271 | @xeoneux | http://www.freecodecamp.com/xeoneux
Aayush Kapoor
@xeoneux
Oct 05 2015 15:26
@jondcoleman You'll see information about new connections here and warnings too
Aleksander Gębicki
@Takumar
Oct 05 2015 15:27
@Abhi493 you can also need slice() function read about it.
Roger Hoffman
@rhoffman3621
Oct 05 2015 15:28
I'm stuck on make objects private. I passed the first two tests but this one: assert(typeof(myBike.getSpeed)!=='undefined' && typeof(myBike.getSpeed) === 'function', 'The method getSpeed of myBike should be accessible outside the object');

//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.
Bike.speed = 100;
function addUnit(value) {
return value + "KM/H";
}

getSpeed = function () {
this.speed = 100;
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());})();};
I can't figure out

Craig Morrison
@frogmorton
Oct 05 2015 15:29
@rhoffman3621 wiki format
Roger Hoffman
@rhoffman3621
Oct 05 2015 15:30
wiki?
CamperBot
@camperbot
Oct 05 2015 15:30
usage:
wiki $topic info on that topic
topics for a list of topics
Craig Morrison
@frogmorton
Oct 05 2015 15:33
for some reason the bot didn't come up... it usually spits out some info
format
Aleksander Gębicki
@Takumar
Oct 05 2015 15:33
wiki format
CamperBot
@camperbot
Oct 05 2015 15:33

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Aleksander Gębicki
@Takumar
Oct 05 2015 15:33
Ta da! :-)
Craig Morrison
@frogmorton
Oct 05 2015 15:33
I typed that... didn't I?
i guess I included his name
that's why it disregarded mine
For the slick easy to read format for your code in these rooms, use the camperbot's instructions, @rhoffman3621
Aleksander Gębicki
@Takumar
Oct 05 2015 15:34
@frogmorton yes that was the problem with command.
Karolis
@Luomint
Oct 05 2015 15:36
topics
!topics
Aleksander Gębicki
@Takumar
Oct 05 2015 15:37
@rhoffman3621 you are very close to solution. Read carefully how to make properties and methods public, and make your 'getSpeed()' function public.
Roger Hoffman
@rhoffman3621
Oct 05 2015 15:37
where do i find instructions for pasting code in the blog
Craig Morrison
@frogmorton
Oct 05 2015 15:38
scroll up just a bit
Aleksander Gębicki
@Takumar
Oct 05 2015 15:38
This message was deleted
Craig Morrison
@frogmorton
Oct 05 2015 15:38
or did I misunderstand
Prashanth
@dgprashanth
Oct 05 2015 15:44
Guys I need some help with duplicating a bunch of html over and over again
How can I create dynamic html based on a for loop in js?
Rex Schrader
@SaintPeter
Oct 05 2015 15:48
@dgprashanth You can use jQuery
@dgprashanth Like this:
var output = '<div class="someClass">Some Content - ' + someVar + ' and more Content</div>'
$('.someDestination').append(output);
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 15:52
quick question about this bit of code:
function filterFunction(arr1, arr2) {
      return arr1.filter(function(item) {
        return arr2.indexOf(item) === -1;
      });
    }
the "item" mean...every item in the array, correct?
Aleksander Gębicki
@Takumar
Oct 05 2015 15:53
@rhoffman3621 I haven't seen that before. You don't need line: this.speed = 100; in your getSpeed() function. Now it can make problems with your solution.
Rex Schrader
@SaintPeter
Oct 05 2015 15:54
@TheHighPriestess Correct. When you have a callback function for .filter, the variable (in this case item) is populated with each value of arr1 once. The above code should remove anything not found in arr2 from arr1 (I think)
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 15:54
Why the two returns?
i'm not sure i understand that
So...you would do something like this: var x = filterFunction([3,4,6],[7,6]); Correct?
Aleksander Gębicki
@Takumar
Oct 05 2015 15:58
@TheHighPriestess you have a function inside a function.
Every function returns something.
Rex Schrader
@SaintPeter
Oct 05 2015 15:58
@TheHighPriestess The inner return is for the filter function. For each item it returns true or false. For filter, if you return a true, the item is kept in the array. If you return false, it is discarded. So the outer return is returning the filtered arr1. It's basically saying:
"Take arr1 and filter it. If arr2 does not contain a value from arr1, discard that item. When I'm done, return the resulting filtered array"
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 15:59
@Takumar ah ok..sure
@Takumar @SaintPeter Thank you.
CamperBot
@camperbot
Oct 05 2015 15:59
thehighpriestess sends brownie points to @takumar and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 861 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 389 | @takumar | http://www.freecodecamp.com/takumar
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 16:00
I was doing the Bonfire Symmetric Difference...when I couldn't get one test to work..and I realized..at that point...that there must be a better way to do it. So, I looked at the solution on the wiki.
Now I'm studying that...because at this point it seems like a more productive use of my time
Prashanth
@dgprashanth
Oct 05 2015 16:03
@SaintPeter Thank you so much :)
CamperBot
@camperbot
Oct 05 2015 16:03
dgprashanth sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 862 | @saintpeter | http://www.freecodecamp.com/saintpeter
vere perrot
@perrot
Oct 05 2015 16:08
Hi my friend,
I work in the unit "zipline-use-the-twitchtv-json-api".
The example likes http://codepen.io/GeoffStorbeck/full/GJKRxZ.
I don't know how to create the style. It is a difficult task I think.
Has a simple method to do the task? Thanks.
Logan Tegman
@ltegman
Oct 05 2015 16:09
@perrot You don't need to make it look just like the example. As long as your app can fulfill the user stories it can look however you want :)
vere perrot
@perrot
Oct 05 2015 16:10
@ltegman I got it. Thank you for your information.
CamperBot
@camperbot
Oct 05 2015 16:10
perrot sends brownie points to @ltegman :sparkles: :thumbsup: :sparkles:
:star: 225 | @ltegman | http://www.freecodecamp.com/ltegman
Abhishek
@Abhi493
Oct 05 2015 16:11
@TaKumar r u there?
Abhishek
@Abhi493
Oct 05 2015 16:17
how to add elements to array dynamicaly
Dag Stromsvag
@daggemann
Oct 05 2015 16:19
Hi, could someone help me with "Bonfire: Check for Palindromes"?
Erick Ruano
@ErickRuano
Oct 05 2015 16:19
@Abhi493 maybe I can help
Pratik Ratnaparkhi
@pratikr1593
Oct 05 2015 16:19

Can anyone guide me to the direct answer to this waypoint? don't ask for my code, I have tried multiple things and have failed, so i reset the code. Bonfire: Reverse a String
Reverse the provided string.

You may need to turn the string into an array before you can reverse it.

Your result must be a string.

Remember to use Read-Search-Ask if you get stuck. Write your own code.

Aleksander Gębicki
@Takumar
Oct 05 2015 16:20
@Abhi493 read about array.push()
Erick Ruano
@ErickRuano
Oct 05 2015 16:20
@Abhi493 have you tried the array.push() and array.unshift() methods?
vere perrot
@perrot
Oct 05 2015 16:20

Hi my friend ,
I get stuck for a long time. The test case 2 "add(2)(3) should return 5: expected undefined to deeply equal 5" in the unit "Bonfire: Arguments Optional".
Here is my code:

function add() {
  if(arguments.length==2){
    var n=arguments[0]+arguments[1];
    if(typeof arguments[1]==='string'||typeof arguments[0]==='string'){
          return undefined;
    }else{
        return n;
    }
  }else{
    if(typeof arguments[0]==='string'){
        return undefined;
    }else{
    }
    w=0;
    return sumTwo;
  }
}
var w=0;
function sumTwo(k){
  w+=k;
}

Have any suggestions?Thanks.

Pratik Ratnaparkhi
@pratikr1593
Oct 05 2015 16:22
anyone can pm me the code? i wanna know what I was doing wrong all those days
Mateja Trifunovski
@Matko95
Oct 05 2015 16:23
@perrot the first problem is that you are just checking if it's a string
@perrot what if you were given an arr? it should still return undefined
Abhishek
@Abhi493
Oct 05 2015 16:24
yaya remembered thanks @Takumar , u are very genuine n helpfull to me.
CamperBot
@camperbot
Oct 05 2015 16:24
abhi493 sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 390 | @takumar | http://www.freecodecamp.com/takumar
Abhishek
@Abhi493
Oct 05 2015 16:25
how to use nested loop in js?
Jonathan Lee Slew
@jlslew
Oct 05 2015 16:26
@perrot if only one number is passed in, you need to return a function
Mateja Trifunovski
@Matko95
Oct 05 2015 16:26
@jlslew he does return sumTwo
but not correctly
Abhishek
@Abhi493
Oct 05 2015 16:27
bonfire Return largest numbers in array, whats wrong with my code?
CamperBot
@camperbot
Oct 05 2015 16:27
Sorry, can't find a bonfire called return largest numbers in array whats wrong with my code. [ Check the map? ]
Abhishek
@Abhi493
Oct 05 2015 16:28
function largestOfFour(arr) {

  for(var i = 0;i<arr.length; i++)
  {
     var max=1;
    for(j=0;j<4;j++)
      {
        if(max<arr[i][j])
          max = arr[i][j];

      }
    var newArr.push(max);
  }
  // You can do this!
  return newArr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]], "");
Pratik Ratnaparkhi
@pratikr1593
Oct 05 2015 16:28
@ErickRuano thanks
CamperBot
@camperbot
Oct 05 2015 16:28
pratikr1593 sends brownie points to @erickruano :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for erickruano
Mateja Trifunovski
@Matko95
Oct 05 2015 16:28
@Abhi493 [i][i] should be [i][j] if i'm not wrong
Abhishek
@Abhi493
Oct 05 2015 16:28
yaya its j
Mateja Trifunovski
@Matko95
Oct 05 2015 16:29
@Abhi493 and try not using var in the for loop, when you use var, the previous value gets deleted and a new variable is declared
@Abhi493 var newArr.push(max); and this definently isn't a variable
Abhishek
@Abhi493
Oct 05 2015 16:30
then?
vere perrot
@perrot
Oct 05 2015 16:31
thanks @jlslew @Matko95 . I will try later.
CamperBot
@camperbot
Oct 05 2015 16:31
perrot sends brownie points to @jlslew and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 273 | @jlslew | http://www.freecodecamp.com/jlslew
:star: 409 | @matko95 | http://www.freecodecamp.com/matko95
Abhishek
@Abhi493
Oct 05 2015 16:32
@Matko95 u there?
Mateja Trifunovski
@Matko95
Oct 05 2015 16:32
@Abhi493 yes
GenavieveMarie
@GenavieveMarie
Oct 05 2015 16:38
topics
Dag Stromsvag
@daggemann
Oct 05 2015 16:38
Hi, can anyone tell me how not to make the backslash in "0_0 (: /-\ :) 0-0" disappear when passing the string to the function?
function palindrome(str) {

  var period = /\./g;
  var space = /\s/g;
  var comma = /,/g;

  str = str.replace(period,"");
  str = str.replace(space,"");
  str = str.replace(comma,"");

  str = String.toLowerCase(str);

  var array = str.split("");
  array = array.reverse();
  var strReverse = array.join("");

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



palindrome("0_0 (: /-\ :) 0-0");
Moisés Man
@moigithub
Oct 05 2015 16:39
@daggemann replace/remove like u doin with all "other" characters..
Dag Stromsvag
@daggemann
Oct 05 2015 16:40
@moigithub but I am not suppose to ignore those characters: A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.
James Smith
@matthew02
Oct 05 2015 16:41
@daggemann You have to escape it with another backslash. palindrome("0_0 (: /-\\ :) 0-0");
Erick Ruano
@ErickRuano
Oct 05 2015 16:41
@daggemann not sure, but also try using double backslash, since the backslash is an escaping character.
Dag Stromsvag
@daggemann
Oct 05 2015 16:42
@moigithub but then you are altering the input string and I still fail...
Mateja Trifunovski
@Matko95
Oct 05 2015 16:43
@daggemann to pass the test, you need to remove all the special characters
dionneo
@dionneo
Oct 05 2015 16:44

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

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

Dag Stromsvag
@daggemann
Oct 05 2015 16:45
@Matko95 but if I do that then I would have to check if I removed the same character at the opposite end of the string?
Alfonso Balsera Martinez
@AlfonB6
Oct 05 2015 16:45
having problems with Waypoint: Make Object Properties Private.
http://freecodecamp.com/challenges/waypoint-make-object-properties-private
dionneo
@dionneo
Oct 05 2015 16:45
is that correct? I've tried to place style before the image, but it won't do anything :[
Alfonso Balsera Martinez
@AlfonB6
Oct 05 2015 16:45
any quick help?
you need to give the image
the class
of smaller-image
Erick Ruano
@ErickRuano
Oct 05 2015 16:46
@dionneo inside your style tag you are defining style for a .smaller-image class but your img doesnt have that class
Alfonso Balsera Martinez
@AlfonB6
Oct 05 2015 16:46

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

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

dionneo
@dionneo
Oct 05 2015 16:46
right, that's what I assumed
thanks guys!
CamperBot
@camperbot
Oct 05 2015 16:46
if you want to thank someone, put an @ before their name!
Mateja Trifunovski
@Matko95
Oct 05 2015 16:46
@daggemann you just remove all characters, there isn't a opposite side :D
Alfonso Balsera Martinez
@AlfonB6
Oct 05 2015 16:48
any one helps me really quick with the waypoint?
Mateja Trifunovski
@Matko95
Oct 05 2015 16:48
@AlfonB6 sure
explain formatting
CamperBot
@camperbot
Oct 05 2015 16:48

:point_right: code formatting [wiki]

Inline code

alt text

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

Code Block

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

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

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

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

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

Mateja Trifunovski
@Matko95
Oct 05 2015 16:48
@AlfonB6 format the code, and post the full solution
James Smith
@matthew02
Oct 05 2015 16:50
@daggemann 0_0 (: /-\ :) 0-0 fails because it's not a palindrome. First of all, you start with 0_0 and end with 0-0. If you correct that to 0_0 (: /-\ :) 0_0 and then mirror it, you get 0_0 (: \-/ :) 0-0which is not the same thing you started with.
MJDevelopZ
@MJDevelopZ
Oct 05 2015 16:51
Hi! Why would one need to nest one array within another in JavaScript?
Dag Stromsvag
@daggemann
Oct 05 2015 16:52
@matthew02 thanks! I see know that I have to remove all special characters...
CamperBot
@camperbot
Oct 05 2015 16:52
daggemann sends brownie points to @matthew02 :sparkles: :thumbsup: :sparkles:
:star: 318 | @matthew02 | http://www.freecodecamp.com/matthew02
Erick Ruano
@ErickRuano
Oct 05 2015 16:52
@MJDevelopZ Because maybe you have a burguers array and on each index you want an array of burguer ingredients.
MJDevelopZ
@MJDevelopZ
Oct 05 2015 16:54
@ErickRuano So if I wanted an array called "coffee" and then wanted to list all the supplier of fair trade coffee I would nest them within the coffee array?
I do realize now that I just said exactly what you did in a different manner.
Erick Ruano
@ErickRuano
Oct 05 2015 16:55
@MJDevelopZ That might be a reason, although there sure are more suitable data structures for those purposes, but basically, you nest an array into another if that's what your data must look like :)
MJDevelopZ
@MJDevelopZ
Oct 05 2015 16:56
@ErickRuano ok...I understand the concept of Nested Arrays, just trying to find a real-life application so to say.
Erick Ruano
@ErickRuano
Oct 05 2015 17:00

@MJDevelopZ I hardly come up with a case in which I have to nest arrays, a most common real life example is an array of objects, but this objects have a property which is an array.

For example:

var posts = [
    {
       from : "MJDevelop2",
       content : "Hello World",
       likes : ["_9943942040", "_9239432949", "_922394394" ]
    },
    {
       from : "ErickRuano",
       content : "Hello World 2",
       likes : ["_34343440", "_923934349", "_232394394" ]
    }
]

Where those "_2349324" sort of things might be references to the users who liked a post :D

MJDevelopZ
@MJDevelopZ
Oct 05 2015 17:01
@ErickRuano Makes sense! Thank you
dionneo
@dionneo
Oct 05 2015 17:06
How do I insert a border around the image?
MJDevelopZ
@MJDevelopZ
Oct 05 2015 17:07
@dionneo via CSS
Erick Ruano
@ErickRuano
Oct 05 2015 17:07
@dionneo learn about the border style on CSS
MJDevelopZ
@MJDevelopZ
Oct 05 2015 17:07
img{ border-color: red;} for example
Luis Felipe López G.
@luishendrix92
Oct 05 2015 17:08
You may also want to look at: Border Radius and Box Shadow
ami-linish
@ami-linish
Oct 05 2015 17:09
hello..i am working on Bonfire: Find the Longest Word in a String and I am getting it partially right.. not sure where I am going wrong
Erick Ruano
@ErickRuano
Oct 05 2015 17:09
@dionneo And if that is for your kitten picture which already has a "smaller-image" class, just add the style you come up with to that same class.
.smaller-image { width: 100px; border : red } for example.
ami-linish
@ami-linish
Oct 05 2015 17:09

function findLongestWord(str) {
str = str.split([" "]);
longestNum = 0;
for (var i=0; i<str.length; i++){ if (str[i].length > longestNum){
longestNum = str[i];
return str[i].length;
};
};
}

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

dionneo
@dionneo
Oct 05 2015 17:09
@ErickRuano Thanks!
CamperBot
@camperbot
Oct 05 2015 17:09
dionneo sends brownie points to @erickruano :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for erickruano
Ernest L. Phillips
@ernest-phillips
Oct 05 2015 17:12
I'm working on that same bonfire @ami-linish, but you seem to have gotten way further than i
So far all I have done is turn the string into an array
tva10
@tva10
Oct 05 2015 17:12
@ami-linish first remove bracketsstr = str.split(" ");
second if you Write in longestNum the length of the longest word you need to write longestNum=str[i].length
ami-linish
@ami-linish
Oct 05 2015 17:13
@tva10 - removed.. still not completely solved
tva10
@tva10
Oct 05 2015 17:13
and last if you return str[i].length in loop you break the function.
Mateja Trifunovski
@Matko95
Oct 05 2015 17:13
@ami-linish do not use return in a for loop, it will stop after returning the first value
tva10
@tva10
Oct 05 2015 17:13
I think you should put return after loop
@ami-linish this is revised version:
function findLongestWord(str) {
str = str.split(" ");
longestNum = 0;
for (var i=0; i<str.length; i++){ 
  if (str[i].length > longestNum){
   longestNum = str[i].length;
  };
};
  return longestNum;

}
ami-linish
@ami-linish
Oct 05 2015 17:16
got it now.. thanks a lot @tva10 and @Matko95 ... best of luck @blulew77 :)
tva10
@tva10
Oct 05 2015 17:17
no problem
dionneo
@dionneo
Oct 05 2015 17:50
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
It keeps saying that Your p element should have the text "View more " (with a space after it).
any idea?
Erick Ruano
@ErickRuano
Oct 05 2015 17:51
@dionneo let me see which exercise is that from to get a better idea
dionneo
@dionneo
Oct 05 2015 17:52
Waypoint: Nest an Anchor Element within a Paragraph
Joshua Needham
@joshuaneedham
Oct 05 2015 17:53
Stuck on reverse string
Chris
@Shifthawke
Oct 05 2015 17:54
@dionneo Link the WP so we can test it
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 17:54
Can someone briefly explain about the .filter part of this works...especially the index?
// Run filter function on each array against the other then get unique values
    return filterFunction(arr1, arr2)
      .concat(filterFunction(arr2, arr1))
      .filter(function(item, idx, arr) {
        // Keep any items that are unique - the index of the current item === index of the first occurrence in the array
        return arr.indexOf(item) === idx;
      });
  };
Chris
@Shifthawke
Oct 05 2015 17:54
-nods- I got stuck on that one too. @joshuaneedham
Erick Ruano
@ErickRuano
Oct 05 2015 17:54
@dionneo got it!
not sure why yours aint working.
<p>View more
  <a href="http://www.freecatphotoapp.com">cat photos</a>
</p>
dionneo
@dionneo
Oct 05 2015 17:56
I got everything checked except that it keeps saying my p element needs view more and a space which it does
Erick Ruano
@ErickRuano
Oct 05 2015 17:57

@dionneo Seems like some sort of spacing problem, because if I hit "enter" before "View" like this:

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

I get the same error.

Chris
@Shifthawke
Oct 05 2015 17:57
copy your code, clear the code, refresh and then paste the code again. @dionneo
Erick Ruano
@ErickRuano
Oct 05 2015 17:58
Not sure whats going on, maybe someone has better insights about it. @SaintPeter any thoughts here?
Jonathan Lee Slew
@jlslew
Oct 05 2015 18:00
@TheHighPriestess the filter will loop through your arr and check whether it the index of item is equal to idx
dionneo
@dionneo
Oct 05 2015 18:01
Yeah tried it, won't do anything.
Jonathan Lee Slew
@jlslew
Oct 05 2015 18:01
@dionneo which waypoint is that?
Aleksandar B.
@aleksandar-b
Oct 05 2015 18:02
@TheHighPriestess indexOf() only returns index of first element that is found and stops there. So if you have 'cat' on second index and 'cat' on third index it will return second index. If your iteration index idx with filter is third ('cat') one then that will not be equal to the indexOf bc it (indexOf)will return only index of element that is first found- in this case second.
Aleksander Gębicki
@Takumar
Oct 05 2015 18:02
@dionneo do you remember to put space between "more" an "<a href..." ? Because I don't see it in your code.
Craig Morrison
@frogmorton
Oct 05 2015 18:02
dumb question... can you revert stepwise in codepen?
I had been developing something locally on my own machine, which was looking great, but then I pasted that exact code into codepen, and a bunch of the styles are broken
Aleksander Gębicki
@Takumar
Oct 05 2015 18:04
@dionneo quote from tests: "Your p element should have the text "View more " (with a space after it.)"
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:04
@frogmorton did you save it?
Jonathan Lee Slew
@jlslew
Oct 05 2015 18:04
@dionneo between <p> and View, there are a new line and some spaces, and between more and <a> there are a new line and some spaces
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:05
@jlslew @samosale What is "idx"?
Aleksander Gębicki
@Takumar
Oct 05 2015 18:05
@TheHighPriestess index - just a shortcut for the name of variable
Aleksandar B.
@aleksandar-b
Oct 05 2015 18:05
@TheHighPriestess index parameter of filter function
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:05
@Takumar you mean...as in first element of an array etc?
Jonathan Lee Slew
@jlslew
Oct 05 2015 18:06
@TheHighPriestess the name of the second parameter of the filter function
Aleksandar B.
@aleksandar-b
Oct 05 2015 18:06
@TheHighPriestess you called it idx
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:06
It's not my code. it's a solution to Symmetric Difference
Aleksandar B.
@aleksandar-b
Oct 05 2015 18:07
@TheHighPriestess nvm, did you get it/
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:07
i'm trying to understand it..because I would have done it using for loops etc
dionneo
@dionneo
Oct 05 2015 18:07
@jslew I tried with the space but it still gives me an error
Ariel
@ArielLeslie
Oct 05 2015 18:08
@dionneo You can't have the <a tag on a new line. It has to be inline
<p>stuff <a href="thing">more stuff</a></p>
dionneo
@dionneo
Oct 05 2015 18:08
<p>
view more
<a href="http://www.freecatphotoapp.com">cat photos</a></p>
max77p
@max77p
Oct 05 2015 18:08
@max77p
regarding chunky monkey how would one start from the next location in array after slicing whatever number of characters from the array?
for example if i slice ["a","b"] from [a, b, c,d,e]...how would i start the next iteration from c? and so forth?
Craig Morrison
@frogmorton
Oct 05 2015 18:09
yes... not only that, I actually closed the tab @TheHighPriestess
max77p
@max77p
Oct 05 2015 18:09
can someone help me wit this?
Odinaka Amadi
@Odis22
Oct 05 2015 18:09
How do I turn a <p> element red?

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

<h2 class="red-text">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>

Aleksandar B.
@aleksandar-b
Oct 05 2015 18:09
@TheHighPriestess watch from: 6:45 https://youtu.be/q_MXH_Ponpg?t=6m45s
Aleksander Gębicki
@Takumar
Oct 05 2015 18:09
@TheHighPriestess here you have filter and quote:
"callback
Function to test each element of the array. Invoked with arguments (element, index, array). Return true to keep the element, false otherwise."
Ariel
@ArielLeslie
Oct 05 2015 18:09
@Odis22 The same way you turned the h2 element red
@max77p Use a loop?
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:11
@samosale @jlslew ok....so idx is the actual number that's there at that index in the array...not the index itself. I"m having a hard time visualing this
Aleksandar B.
@aleksandar-b
Oct 05 2015 18:12
@TheHighPriestess no it returns index itself. Watch video from 6:45
Aleksander Gębicki
@Takumar
Oct 05 2015 18:13
@dionneo you have to put one or more spaces after the word 'more'. New line is not necessary. When you don't put space you will get: "View morecat photos". That's not what you want? That's the reason why the exercise won't pass.
Odinaka Amadi
@Odis22
Oct 05 2015 18:14
thanks ArielLesllie. I am a beginner so this is going to take a while to master
CamperBot
@camperbot
Oct 05 2015 18:14
if you want to thank someone, put an @ before their name!
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:14

return arr.indexOf(item) === idx;

So...it looks through the array and compares the index of every element to....the index.

Ok...in other words..it's saying that IF there's an indexof for this element...that means that it exists?

Odinaka Amadi
@Odis22
Oct 05 2015 18:14
Thanks @ArielLeslie. I am still a beginner, so this will take a while to master
CamperBot
@camperbot
Oct 05 2015 18:14
odis22 sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 439 | @arielleslie | http://www.freecodecamp.com/arielleslie
Jonathan Lee Slew
@jlslew
Oct 05 2015 18:15
@Takumar having an extra new line or spaces can change the design of a website
Ariel
@ArielLeslie
Oct 05 2015 18:15
@Odis22 You'll get there
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:15
obviously...if an element doesn't exist in the array...it won't have an "indexOf"
Aleksander Gębicki
@Takumar
Oct 05 2015 18:15
@jlslew of course, but he needs space to make space between words! He or she doesn't need: "View morecats photos" but "View more cats photos";
@dionneo do you read this?
Ariel
@ArielLeslie
Oct 05 2015 18:16
@TheHighPriestess If the element doesn't exist in an array indexOf returns -1
Aleksandar B.
@aleksandar-b
Oct 05 2015 18:16
@TheHighPriestess the catch here is that indexOf() only returns index of first element that is found.
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:16
so...if there's a 5 in the array....arr.indexOf(5) will be some number let's say...2....so that number, 2, is compared to index?
That doesn't seem right
Michael Lefkowitz
@lfkwtz
Oct 05 2015 18:17
I'm working on Advanced Algorithm Scripting - Bonfore: Exact Change. I'm getting stuck with how how JS handles digits. For instance, if I have an item worth $19.50, and the customer gives me $139.01, why does JS return "119.50999999999999"? Is there an easy way to avoid this, aside from calling a Math.floor (or similar) command everytime I do a computation?
Elizabeth Hatleli
@TheHighPriestess
Oct 05 2015 18:18
@ArielLeslie ah...ok...so if the number doesn't exist...that is, if indexOf(num) returns -1
Ariel
@ArielLeslie
Oct 05 2015 18:18
@leftynaut I recommend multiplying everything by 100 and working with integers.