These are chat archives for FreeCodeCamp/Help

16th
Oct 2015
Garrett Schultz
@garettschultz
Oct 16 2015 01:09
when they say "find the Nth character" what exactly does Nth mean?
Aleksandar B.
@aleksandar-b
Oct 16 2015 01:11
@gratschultz2013 a placeholder for every number you put
Garrett Schultz
@garettschultz
Oct 16 2015 01:11
huh?
var firstName = "Ada";

var secondLetterOfFirstName = firstName[1];

var lastName = "Lovelace";

var thirdLetterOfLastName = lastName[2];
I have to find the Nth character in the string. What does Nth mean exactly?
KofiAkorli
@KofiAkorli
Oct 16 2015 01:13
the 'N' is supposed to be a number
Garrett Schultz
@garettschultz
Oct 16 2015 01:14
so why dont they just the the number of the character im suupposed to find instead of saying Nth?
KofiAkorli
@KofiAkorli
Oct 16 2015 01:14
they do check through the instructions
which, waypoint number are you on?
Garrett Schultz
@garettschultz
Oct 16 2015 01:17
it does, in the instructions it says to find the 3rd characted but then why say Nth in the name of the waypoint when they could have just said 3rd? its stuff like this that confuses a complete beginner.
Elektropay
@elektropay
Oct 16 2015 01:18
3 backticks
Aleksandar B.
@aleksandar-b
Oct 16 2015 01:18
@gratschultz2013 nth means in math : The item at position n in a sequence.
@gratschultz2013 dictionary : used to refer to an unknown number in a series of numbers
Garrett Schultz
@garettschultz
Oct 16 2015 01:20
@samosale there is no "n" in the sequence of the challenge at all
the name of the way point is: Use Bracket Notation to Find the Nth Character in a String. What im asking is why say Nth when in the directions of the challenge it says to find the 3rd character not the Nth?
Simone Lewis
@simlew
Oct 16 2015 01:22
@gratschultz2013 I think the reason they use Nth is to demonstrate that the specific character/number can be any number/character instead of always three. I know it's super confusing! I had to google that one myself as well.
KofiAkorli
@KofiAkorli
Oct 16 2015 01:23
@gratschultz2013 what we are trying to say is 'n' stands in for a position in a series of numbers, it could be the 1st, 2nd, 5th, 35th. When you are not specifying a particular position in the sequence you use 'n' to represent that position.
JoelLindsey
@JoelLindsey
Oct 16 2015 01:24
Hi I just started on my challenges but I am stuck on Comment on JavaScript Code.
KofiAkorli
@KofiAkorli
Oct 16 2015 01:25
@JoelLindsey What exactly is the issue?
Aleksandar B.
@aleksandar-b
Oct 16 2015 01:25
@gratschultz2013 it is just semantic. if you are reffereng to something unknown
JoelLindsey
@JoelLindsey
Oct 16 2015 01:26
@KofiAkorli I am not sure what Im supposed to do.
KofiAkorli
@KofiAkorli
Oct 16 2015 01:27
@JoelLindsey you are supposed to recreate the two ways of commenting out code in javascript
AmyMcKnight
@AmyMcKnight
Oct 16 2015 01:28

Hi this is the assignment:

In the same way you can add classes to an element with jQuery's addClass() function, you can remove them with jQuery's removeClass() function.

Here's how you would do this for a specific button, add $("#target2").removeClass("btn-default");

Let's remove the btn-default class from all of our button elements.

<script>
$(document).ready(function() {
$("button").addClass("animated bounce");
$(".well").addClass("animated shake");
$("#target3").addClass("animated fadeOut");
$("button").removeClass(".btn-default");
});
</script>

this is what I keep getting:

Remove the btn-default class from all of your button elements.
Only remove the btn-default class.

Any help would be appreciated. I've reset it twice.

never mind see my mistake!
JoelLindsey
@JoelLindsey
Oct 16 2015 01:30
@KofiAkorli How exactly is that done?
KofiAkorli
@KofiAkorli
Oct 16 2015 01:31
@JoelLindsey the samples are written in red in the instructions ```
JoelLindsey
@JoelLindsey
Oct 16 2015 01:32
@KofiAkorli So Im just re typing it?
KofiAkorli
@KofiAkorli
Oct 16 2015 01:33
@JoelLindsey ummm, basically, yes
Yusef Habib
@yhabib
Oct 16 2015 01:39
hi guys!! I’m working with on the Zipline about Twitch. When I check the if the users are connected or not, sometimes checks all of them and sometimes no. Therefore each time the table is different
any clue? Right now i’m lost
not sure where is the problem
JoelLindsey
@JoelLindsey
Oct 16 2015 01:46
Screenshot 2015-10-15 20.44.55(2).png
@KofiAkorli like this?
KofiAkorli
@KofiAkorli
Oct 16 2015 01:49
@JoelLindsey yeah, that's it, but you don't need lines 3 and 4, it's lines 1 and 2 that are the two ways of commenting out code in JS.
JoelLindsey
@JoelLindsey
Oct 16 2015 01:52
@KofiAkorli oh ok but when I click run tests nothing happens
Matt Yamamoto
@MattYamamoto
Oct 16 2015 01:53
@yhabib I think the problem is you need to add a callback to the api call, that is append ?callback=? to the end of your api call url (in your 'user' variable). This is something needed for JSONP. I thought it was always needed... but for some reason that is not always the case (as you have it some of the calls obviously work). I helped someone before with this problem and meant to go back an look at why it works your way some of the time, but I haven't gotten to it yet so I can't give you more of a detailed answer as to why you are even getting data back at all.
carolinechoi953
@carolinechoi953
Oct 16 2015 01:53
HI everyone.
Matt Yamamoto
@MattYamamoto
Oct 16 2015 01:54
Hi @carolinechoi953
Yusef Habib
@yhabib
Oct 16 2015 01:55
@MattYamamoto thanks for the info I’m checking it!!
CamperBot
@camperbot
Oct 16 2015 01:55
yhabib sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 374 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
carolinechoi953
@carolinechoi953
Oct 16 2015 01:55
I'm a bit confused about placing a text input element within form element in section 31. any tips?
KofiAkorli
@KofiAkorli
Oct 16 2015 01:56
@JoelLindsey try deleting what you typed on lines 3 and 4 and try again
@carolinechoi953 what exactly is confusing you
Matt Yamamoto
@MattYamamoto
Oct 16 2015 01:57
@carolinechoi953 well, you're basically just adding the examp code in the form area in the html.
JoelLindsey
@JoelLindsey
Oct 16 2015 01:57
@KofiAkorli nope did nothing
Matt Yamamoto
@MattYamamoto
Oct 16 2015 01:59
@JoelLindsey try refreshing the page and submitting again
Jenna B.
@osnapitzjen
Oct 16 2015 01:59
how do i give h1 a class?
carolinechoi953
@carolinechoi953
Oct 16 2015 01:59
ok thanks MattYamoto and KofiAkoli. i got it to work
CamperBot
@camperbot
Oct 16 2015 01:59
if you want to thank someone, put an @ before their name!
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:00
@osnapitzjen just add class="" inside the h1 tag
with the class name inside the quotes
Jenna B.
@osnapitzjen
Oct 16 2015 02:01
@MattYamamoto thanks
CamperBot
@camperbot
Oct 16 2015 02:01
osnapitzjen sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 375 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
CamperBot
@camperbot
Oct 16 2015 02:09
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
JoelLindsey
@JoelLindsey
Oct 16 2015 02:09
@MattYamamoto still nothing do I need some type of program for the test to work?
Wister
@r3t51w
Oct 16 2015 02:09
Is codePen down?
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:10
@r3t51w looks like it...it's been up and down all day I think
Wister
@r3t51w
Oct 16 2015 02:10
@MattYamamoto Thank you for confirming
CamperBot
@camperbot
Oct 16 2015 02:10
r3t51w sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 376 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:10
@JoelLindsey can you share the code?
actually, just copy and past the url in here
shoot gotta step out real fast...sorry
Yusef Habib
@yhabib
Oct 16 2015 02:29
@MattYamamoto I keep tryint to fix it, but nothing so far. One question in your answer did you use client_id=….. before the callback=? ??
hotwings26
@hotwings26
Oct 16 2015 02:32
tbh no idea what im doing with this one http://puu.sh/kLRDc/625a1b1c17.png
Hugo
@hugoender
Oct 16 2015 02:35
@hotwings26 lets help you out then
it wants you to create a variable called myData
so let’s do that first
create it inbetween the commented lines that say to only change code below and above those lines
hotwings26
@hotwings26
Oct 16 2015 02:36
thanks @hugoender
CamperBot
@camperbot
Oct 16 2015 02:36
hotwings26 sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:star: 269 | @hugoender | http://www.freecodecamp.com/hugoender
Hugo
@hugoender
Oct 16 2015 02:36
@hotwings26 let me know once youve done that
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:36
@yhabib oh, I see where you added it. You need to add it the url for the api call, not the link. so var user = twitchAPI + element + "?callback=?"; on line 10
hotwings26
@hotwings26
Oct 16 2015 02:37
@hugoender i did that
Hugo
@hugoender
Oct 16 2015 02:37
@hotwings26 now assign the first value of the myArray array to that variable. Remember you assign values to variables as follows varName = valueToAssign
Tim
@tdecker81
Oct 16 2015 02:37
Can someone explain to me how the Bonfire: Smallest Common Multiple of 5 and 1 is supposed to be 60?
Hugo
@hugoender
Oct 16 2015 02:38
and with arrays, the way to get individual values is to use the following syntax: arrName[#] where # is the index number
Tim
@tdecker81
Oct 16 2015 02:38
Should the smallest common multiple be 5?
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:38
@JoelLindsey that works for me, not sure why you're having the issue.
Hugo
@hugoender
Oct 16 2015 02:38
@hotwings26 let me know if you’re still with me
hotwings26
@hotwings26
Oct 16 2015 02:38
@hugoender so its =[1]?
Hugo
@hugoender
Oct 16 2015 02:38
@hotwings26 it makes sense that it would be 1 for the first value but with arrays, it starts at 0
so 0 is the first value, 1 is the second, etc
hotwings26
@hotwings26
Oct 16 2015 02:39
even though the array is just 1,2,3?
Hugo
@hugoender
Oct 16 2015 02:39
@hotwings26 1,2,3 are the values assigned to the index spots of 0,1,2
does that make sense?
hotwings26
@hotwings26
Oct 16 2015 02:39
@hugoender yeah making a little more sense now
Hugo
@hugoender
Oct 16 2015 02:39
think of 1,2,3 as the envelopes of data and 0,1,2 and the mailbox holes
envelope 1 goes into mailbox 0
hotwings26
@hotwings26
Oct 16 2015 02:40
gotcha
Yusef Habib
@yhabib
Oct 16 2015 02:40
@MattYamamoto thanks a lot!! I don’t what I was thinking :( . Spent a lot of time with this bug!
CamperBot
@camperbot
Oct 16 2015 02:40
yhabib sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: yhabib already gave mattyamamoto points
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:40
@tdecker81 you're finding the smallest common multiple of all numbers in that range.
Hugo
@hugoender
Oct 16 2015 02:40
@hotwings26 alright so finish that way point and let me know if it worked! :)
before my wife comes and drags me to bed
hotwings26
@hotwings26
Oct 16 2015 02:41
@hugoender i got it, but the answer was 1 not 0
JoelLindsey
@JoelLindsey
Oct 16 2015 02:41
Screenshot 2015-10-15 21.40.38.png
hotwings26
@hotwings26
Oct 16 2015 02:41
but thanks, wouldn't have gotten it without your help
CamperBot
@camperbot
Oct 16 2015 02:41
if you want to thank someone, put an @ before their name!
Tim
@tdecker81
Oct 16 2015 02:41
thanks @MattYamamoto
CamperBot
@camperbot
Oct 16 2015 02:41
tdecker81 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 377 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:41
@yhabib you're welcome... it is an interesting bug that I sitll hope to fully research one day. . . you know, when I have free time!
Tim
@tdecker81
Oct 16 2015 02:41
it says that but i missed it.
Junior Griffiths
@Jegriff23
Oct 16 2015 02:41
Hello @all, can someone help me with Waypoint: Use Responsive Design with Bootstrap Fluid Containers?
Hugo
@hugoender
Oct 16 2015 02:41
@hotwings26 the answer was 1 … but the index was 0
so myArr[0] = 1
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:42
@Jegriff23 what's your question?
JoelLindsey
@JoelLindsey
Oct 16 2015 02:42
@MattYamamoto does that gray box at the bottom have anything to do with it?
hotwings26
@hotwings26
Oct 16 2015 02:42
true ya, thanks for helping me understand @hugoender there was nothing anywhere else online to help with that one for some reason
CamperBot
@camperbot
Oct 16 2015 02:42
hotwings26 sends brownie points to @hugoender :sparkles: :thumbsup: :sparkles:
:warning: hotwings26 already gave hugoender points
Hugo
@hugoender
Oct 16 2015 02:43
@hotwings26 the fact that they are using numbers makes it confusing… if the array had been myArray = [dog, cat, wolf]… then myArr[0] = dog. And that would make it more clear as to what’s going on
Junior Griffiths
@Jegriff23
Oct 16 2015 02:43
@MattYamamoto , its asking about nest all of our HTML in a div element with the class container-fluid. Im stuck dont know if it is everything in the styles portion
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:43
@JoelLindsey uh..what gray box?
JoelLindsey
@JoelLindsey
Oct 16 2015 02:44
Screenshot 2015-10-15 21.40.38.png
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:44
@JoelLindsey what does it look like if you click "run tests"?
JoelLindsey
@JoelLindsey
Oct 16 2015 02:44
@MattYamamoto nothing happens
Junior Griffiths
@Jegriff23
Oct 16 2015 02:45
```
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:46
@Jegriff23 well, everything from lines 1 to 28 would normally be in the head seaction... so really it's everything after linke 29 that you need to nest inside a div
Junior Griffiths
@Jegriff23
Oct 16 2015 02:47
This message was deleted
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:47
@JoelLindsey well that's werid... you're sure you didn't somehow disable javascript on that page? try it in your chrome browser instead of ie
Junior Griffiths
@Jegriff23
Oct 16 2015 02:49
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Crazy</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:50

@Jegriff23 so a div would be this

<div class=" ">
....
</div>

where the content you want in the div inside the two tags. so it's asking you to wrap all the html that's alread there in a div..in otherwords, palce it in between an opening and closing div tag. then set the class to class="container-fluid"

You also need to add the linke to bootstrap. Just add it under the link for the google font at t the top.
Junior Griffiths
@Jegriff23
Oct 16 2015 02:53
@MattYamamoto , like this:
<div class="red-text">CatPhotoApp</div>

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Crazy</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:56
@Jegriff23 no, you changed the h2 to be div. change it back. Basically take everything you just pasted in (chaging back to h2) and put a <div> above all that, and a </div> below all that.
JoelLindsey
@JoelLindsey
Oct 16 2015 02:56
@MattYamamoto chrome works wonders thanks
CamperBot
@camperbot
Oct 16 2015 02:56
joellindsey sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 378 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Oct 16 2015 02:57
@JoelLindsey that's really weird. . .but glad that worked, I'm sure that was frustrating!
Junior Griffiths
@Jegriff23
Oct 16 2015 03:01
This message was deleted
@MattYamamoto , got it
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>

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

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

<div class="container-fluid">

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

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

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

<p>Things cats love:</p>
<ul>
  <li>cat nip</li>
  <li>laser pointers</li>
  <li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
  <li>flea treatment</li>
  <li>thunder</li>
  <li>other cats</li>
</ol>
<form action="/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor"> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
  <label><input type="checkbox" name="personality"> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Crazy</label>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
</div>
Matt Yamamoto
@MattYamamoto
Oct 16 2015 03:03
@Jegriff23 nicely done!
Junior Griffiths
@Jegriff23
Oct 16 2015 03:03
thanks @MattYamamoto
CamperBot
@camperbot
Oct 16 2015 03:03
jegriff23 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 379 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Adam Schmidt
@Chimasu
Oct 16 2015 03:17
anyone available to discuss 'Bonfire: Everything Be True'?
Hans van Riet
@hansinla
Oct 16 2015 03:20
@Chimasu yes
Adam Schmidt
@Chimasu
Oct 16 2015 03:20
my friend and I have solved the exercise but we disagree on the 'correct' way to solve it
Hans van Riet
@hansinla
Oct 16 2015 03:21
@Chimasu what are the two ways?
mkclark
@mkclark
Oct 16 2015 03:22
I can't run any of the javascript??
but the html exercises work
Adam Schmidt
@Chimasu
Oct 16 2015 03:24
checking properties vs checking properties and values
where in the second and third exercises ask if there's an object sex: female inside each object
rather than if each object is a female
if the third exercise was true
then it would be checking properties and values
but both 2 and 3 want false
which leaves the 'correct' answer ambiguous
Hans van Riet
@hansinla
Oct 16 2015 03:44
@Chimasu Whether it’s the correct way is up for discussion of course, but the ‘advanced’ way is to use .hasOwnProperty(pre) to check for the property, not for the value.
Adam Schmidt
@Chimasu
Oct 16 2015 03:48
wouldn't that be the easier way?
EngineeredEdge
@EngineeredEdge
Oct 16 2015 03:50
wiki gitter
CamperBot
@camperbot
Oct 16 2015 03:50

:point_right: gitter [wiki]

Gitter is a chat room system popular with open source projects.

A screenshot from Gitter

Gitter.im is a rapidly growing startup based in London.

Free Code Camp has hundreds of Gitter rooms. These are accessible through Gitter's website, as well as desktop and mobile apps.

Gitter allows you to share formatted code with fellow campers.
:pencil: read more about gitter on the FCC Wiki

EngineeredEdge
@EngineeredEdge
Oct 16 2015 03:50
wiki camperbot
CamperBot
@camperbot
Oct 16 2015 03:50

:point_right: camperbot [wiki]

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Jeff
@Garanimal
Oct 16 2015 04:31
At what point should I start asking for help. I'm a complete nobody when it comes to coding and I'm starting to face some issues at the javascript tutorials. I guess I can follow the motions fine, but I'm not sure how much I am retaining at this point.
DJ
@qualitymanifest
Oct 16 2015 04:34
@Garanimal the waypoints do a lot of hand-holding. try to absorb what you're getting now, but don't worry too much. when you hit the bonfires you will have to learn for yourself - they do provide vague resources to help you help yourself though (the same type of resources you will use when you are completely on your own).
Jeff
@Garanimal
Oct 16 2015 04:35
Ok, I think my problem is I want to know how they are using each piece and right now They are just kind of prodding me to do things without that full understanding. Also I'm stuck on how to split a string into an array by the spaces in the string
Rex Schrader
@SaintPeter
Oct 16 2015 04:36
@Garanimal You can also describe what level of help you're looking for. Maybe you want high level concepts or references. I think most of the helpers can tailor what they give ya.
@Garanimal Have you read the split documentation?
Brian K
@BKtheDAD
Oct 16 2015 04:47
help truncate a string
CamperBot
@camperbot
Oct 16 2015 04:47

:point_right: test issue with bonfire truncate a string [wiki]

Hi everyone,

There is an issue with "Bonfire:Truncate a String".
First heres the code:

    function truncate(str, num) {
  var truncd = '';
  if (str.length > num) {
    truncd = str.slice(0, num - 3) + '...';
    return truncd;
  }

  return str;
}
truncate("A-tisket a-tasket A green and yellow basket", 1, "");

It should not pass the first test that is
"A-tisket a-tasket A green and yellow basket", 1 should return "A-tisket..."

According to this test the console should shoe "A-tisket..."but the console says"A-tisket a-tasket A green and yellow bask..."
:pencil: read more about test issue with bonfire truncate a string on the FCC Wiki

FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:07
I did the "Waypoint: Add Borders Around your Elements" correctly but it keeps telling me "Give your image a border width of 10px." is uncompleted
Bill
@kirah1314
Oct 16 2015 05:08
@FledFromNowhere post your codes?
Jeff
@Garanimal
Oct 16 2015 05:08
@FledFromNowhere make sure there are no spaces after your px value. The code for that one needs to be exact
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:08

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

<style>
.thick-green-border { border-width: 10px; border-color: green; border-style: solid;
}
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

DJ
@qualitymanifest
Oct 16 2015 05:10
@FledFromNowhere you gave it a width of 100px
Bill
@kirah1314
Oct 16 2015 05:10
This message was deleted
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:10
.thick-green-border { border-width: 10px; border-color: green; border-style: solid;
}
DJ
@qualitymanifest
Oct 16 2015 05:10
@FledFromNowhere and you need to make it a border-width
ah
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:11
100px is the width of the image not of its border
Bill
@kirah1314
Oct 16 2015 05:12
@FledFromNowhere ok, can you post the link to this?
DJ
@qualitymanifest
Oct 16 2015 05:12
yeah i see that now, mea culpa, i'm a little tired. let me take another look
DJ
@qualitymanifest
Oct 16 2015 05:13
@FledFromNowhere i copied and pasted your code for that and it passes for me.
@FledFromNowhere try another browser?
Jeff
@Garanimal
Oct 16 2015 05:13

I need help with the second bonfire way point. My code is
'''var reverseString = "hello";
var array = reverseString.split('');

var reverseArray=array.reverse();
reverseString=reverseArray.join("");

function reverseString(str)
{return str;};'''

and the error I'm recieving says
reverseString() should return a string.
reverseString("hello") should become "olleh".
reverseString("Howdy") should become "ydwoH".
reverseString("Greetings from Earth") should return "htraE morf sgniteerG".

CamperBot
@camperbot
Oct 16 2015 05:13
:bulb: to format code use backticks! ``` more info
Bill
@kirah1314
Oct 16 2015 05:13
@FledFromNowhere yeah same here, try copying the code and reset your codes
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:13
ok, I'll try another browser
Jeff
@Garanimal
Oct 16 2015 05:14
'''
CamperBot
@camperbot
Oct 16 2015 05:14
:bulb: to format code use backticks! ``` more info
Jeff
@Garanimal
Oct 16 2015 05:14
'''
CamperBot
@camperbot
Oct 16 2015 05:14
:bulb: to format code use backticks! ``` more info
Jeff
@Garanimal
Oct 16 2015 05:15

'''
var reverseString = "hello";
var array = reverseString.split('');

var reverseArray=array.reverse();
reverseString=reverseArray.join("");

function reverseString(str)
{return str;};
'''

CamperBot
@camperbot
Oct 16 2015 05:15
:bulb: to format code use backticks! ``` more info
Bill
@kirah1314
Oct 16 2015 05:15
@Garanimal you need to return reverseString
you're returning str, which is the original string
DJ
@qualitymanifest
Oct 16 2015 05:16
@Garanimal get rid of reverseString. they already provide the input - it's "str" - use that
Jeff
@Garanimal
Oct 16 2015 05:16
sorry, last try
var reverseString = "hello";
var array = reverseString.split('');

var reverseArray=array.reverse();
 reverseString=reverseArray.join("");



function reverseString(str) 
 {return str;};
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:16
I just tried it on Chrome but it keeps telling me the same. All the previous challenges worked just fine
Bill
@kirah1314
Oct 16 2015 05:16
@FledFromNowhere did you try to reset the codes and paste it again?
Jeff
@Garanimal
Oct 16 2015 05:16
@qualitymanifest what does that str stand for? I dont understand how that function at the bottom is ouputting
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:17
@kirah1314 Yes
Bill
@kirah1314
Oct 16 2015 05:17
i'm using chrome and your codes passed the test
@FledFromNowhere .thick-green-border { border-width: 10px; border-color: green; border-style: solid; }
and add thick-green-border to the img class?
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:18
yes, that's what i did
DJ
@qualitymanifest
Oct 16 2015 05:18
@Garanimal so here's the code you start with
function reverseString(str) {
  return str;
}

reverseString("hello");
str is the input to the reverseString function
Jeff
@Garanimal
Oct 16 2015 05:19
so str is just a placeholder that I could change, as long as i also changed the return?
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:19
in fact, the border of the image is 10px. when i change its value to 12 or 5, the border also changes, so i guess it is working
DJ
@qualitymanifest
Oct 16 2015 05:19
you need to split it into individual characters, reverse them, and then join them back together into a string @Garanimal
Bill
@kirah1314
Oct 16 2015 05:20
@FledFromNowhere yeah it's strange, i'm using the same codes you posted. Compare my link with what you have?
DJ
@qualitymanifest
Oct 16 2015 05:21
This message was deleted
Tim
@tdecker81
Oct 16 2015 05:21
The example provided for Zipline Show the local weather doesn't seem to work currently. Without viewing the code how is one supposed to determine what API source is being used for the weather and why possibly it isn't working to return the weather.
Jeff
@Garanimal
Oct 16 2015 05:21
@qualitymanifest will I need to create new variables?
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:21
@kirah1314 how do i do that? those links are huge
Jeff
@Garanimal
Oct 16 2015 05:22
@qualitymanifest or can this be done simply by using .split, .join, and .reverse?
DJ
@qualitymanifest
Oct 16 2015 05:22
@Garanimal Nope. let me create some pseudocode
Bill
@kirah1314
Oct 16 2015 05:22
@FledFromNowhere just click on the link above and it'll go to the the waypoint
my codes are on it already and it's all green checks. Well technically it's your codes :)
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:23
it doesn't work either
it's all green checks besides "Give your image a border width of 10px."
Bill
@kirah1314
Oct 16 2015 05:24
lol now that's weird
@FledFromNowhere try copy and paste this then
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

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

  h2 {
    font-family: Lobster, Monospace;
  }

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

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

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

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
DJ
@qualitymanifest
Oct 16 2015 05:24
@Garanimal just noticed that last thing you said. yes.
Jeff
@Garanimal
Oct 16 2015 05:26
@qualitymanifest so my next attempt was
DJ
@qualitymanifest
Oct 16 2015 05:27
@Garanimal
function reverseString(str) {
  return str.split into individual characters, reversed, then joined into a string again;
}

reverseString("hello");
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:27
I cleared the code and then copied and pasted that. It didn't work again. Here's a pic http://i.imgur.com/68WFGk4.png @kirah1314
Bill
@kirah1314
Oct 16 2015 05:29
@qualitymanifest were you able to check out this waypoint too? Does my link above have all green checks for you?
Stephen Harris
@outoftheboxthinker
Oct 16 2015 05:29
Hi, very green, but I can't seem to work the degrade
blob
DJ
@qualitymanifest
Oct 16 2015 05:30
@kirah1314 yes it works for me
Bill
@kirah1314
Oct 16 2015 05:30
blob
@FledFromNowhere hmm, I suggest skip to next waypoint and come back later to finish this. Your codes clearly work and should pass it so that's what is important :)
@qualitymanifest thanks
CamperBot
@camperbot
Oct 16 2015 05:32
kirah1314 sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 276 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
Jeff
@Garanimal
Oct 16 2015 05:32
@qualitymanifest I think I'm gonna see how this is supposed to be done and kick myself.
Stephen Harris
@outoftheboxthinker
Oct 16 2015 05:33
ok thanks
CamperBot
@camperbot
Oct 16 2015 05:33
if you want to thank someone, put an @ before their name!
FledFromNowhere
@FledFromNowhere
Oct 16 2015 05:33
@kirah1314 ok
DJ
@qualitymanifest
Oct 16 2015 05:33
@Garanimal you almost had it before actually. i'd advise against checking the hints....
Jeff
@Garanimal
Oct 16 2015 05:34
@qualitymanifest I had a program that worked. Albeit it was probably very roundabout, but my original post did the desired process. I am pretty confused now.
DJ
@qualitymanifest
Oct 16 2015 05:34
@Garanimal you did your split reverse and join methods correctly, you just weren't applying them right
Kouty
@koouty
Oct 16 2015 05:35
@qualitymanifest
I suppressed 16 lines!
function diff(arr1, arr2) {
  // Same, same; but different.
// the array of union
newArr = [];
  var arr3 = arr1.concat(arr2);
  for (i = arr3.length - 1; i > -1 ; arr3--) {
  var item3 = arr3[i];
  if(arr1.indexOf(item3)== -1 || arr2.indexOf(item3)== -1 ) {
    newArr.unshift(item3);
  }
}
for (m = 0; m <newArr.length - 1; m ++) {
    if (newArr[m] == newArr[m + 1]){newArr.splice(m,1);}
  }
return newArr;
}
diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Jeff
@Garanimal
Oct 16 2015 05:36

@qualitymanifest I just got it,
```function reverseString(str) {
return str.split('').reverse().join('');}

reverseString("hello");
```

function reverseString(str) {
  return str.split('').reverse().join('');}



reverseString("hello");
Thank you for the help, I'm enjoying myself now. We'll see how long this lasts
CamperBot
@camperbot
Oct 16 2015 05:37
if you want to thank someone, put an @ before their name!
DJ
@qualitymanifest
Oct 16 2015 05:37
@Garanimal yep, there you go. if you got that on your own, good job
Jeff
@Garanimal
Oct 16 2015 05:38
@qualitymanifest ya, your hint was a big help, I just didn't think I could string them all together, but I guess that does make sense.
DJ
@qualitymanifest
Oct 16 2015 05:40
@navyvel that's about how long my solution was, even using .filter. i haven't checked the efficiency of mine vs yours but right on. if you want to see mine i'll PM it to you
Kouty
@koouty
Oct 16 2015 05:41
@qualitymanifest OK
Kouty
@koouty
Oct 16 2015 05:52

@navyvel

function diff(arr1, arr2) {
  // Same, same; but different.
// the array of union
newArr = [];
  var arr3 = arr1.concat(arr2);
  for (i = arr3.length - 1; i > -1 ; i--) {
  var item3 = arr3[i];
  if(arr1.indexOf(item3)== -1 || arr2.indexOf(item3)== -1 ) {
    newArr.unshift(item3);
  }
}
for (m = 0; m <newArr.length - 1; m ++) {
    if (newArr[m] == newArr[m + 1]){newArr.splice(m,1);}
  }
return newArr;
}
diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Sorry But I can't modify the precedented code and in the first loop now corrected "i--" instead"arr3--"

Stephen Harris
@outoftheboxthinker
Oct 16 2015 05:56
Hi, I'm asking incorrectly but when I do the last part of the waypoint. It turns everything off and won't work. I don't what to do. I'm up to 4 hours on this question
Jeff
@Garanimal
Oct 16 2015 06:10
I'm just looking to see if im on the right track. Would I need to create an array from a loop in order to perform a factorial operation? or am I overthinking it?
Adam Schmidt
@Chimasu
Oct 16 2015 06:22
you don't NEED an array but you can use an array
Jeff
@Garanimal
Oct 16 2015 06:24
I mean, I'm a math teacher, but I don't see how to use basic multiplication and addition and subtraction to factorial any number. I could also be a little sleepy haha
Marq
@alionking
Oct 16 2015 06:25
hi... how do some of u guys stay awake in front of the pc?
Jeff
@Garanimal
Oct 16 2015 06:25
Get up and stretch. Honestly I'm pretty new to this so I also tend to get sleepy pretty quickly
Adam Schmidt
@Chimasu
Oct 16 2015 06:26
think of it as 'what I've added together' * the next number in the sequence
Eva
@evasyl1
Oct 16 2015 06:35
Hi, I am on Bonfire: Diff Two Arrays and have all but one of the checks green. The only check not working is [1, 2, 3, 3], [1] should return [2, 3]. At this point it must be a minor error, right?
function diff(arr1, arr2) {
  var filter1 = arr1.filter(function(item) { 
                                   return arr2.indexOf(item) == -1;
                               });
  var filter2 = arr2.filter(function(item) { 
                                   return arr1.indexOf(item) == -1;
                               });


  return filter2.concat(filter1);
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Ajinkya Raut
@AjinkyaRaut
Oct 16 2015 06:42
blob
Hi.. Getting this error PLz Help
blob
Jeff
@Garanimal
Oct 16 2015 06:44
@ajinkyaraut you are using the same text as the previous example. They have provided you with new text for this second <p>.
aka your paragraphs shouldnt be the same. They should have given you a second paragraph.
Ajinkya Raut
@AjinkyaRaut
Oct 16 2015 06:45
Oh.. Thank you.. It worked :)
CamperBot
@camperbot
Oct 16 2015 06:45
if you want to thank someone, put an @ before their name!
Ajinkya Raut
@AjinkyaRaut
Oct 16 2015 06:46
Thanks @Garanimal
CamperBot
@camperbot
Oct 16 2015 06:46
ajinkyaraut sends brownie points to @garanimal :sparkles: :thumbsup: :sparkles:
:star: 176 | @garanimal | http://www.freecodecamp.com/garanimal
Jeff
@Garanimal
Oct 16 2015 06:46
@AjinkyaRaut no problem. Happy coding!
Adam Schmidt
@Chimasu
Oct 16 2015 06:52
@evasyl1 none of the other problems have more than one of the same value in the resulting array. you'll have to filter out duplicate entries
pwdd
@pwdd
Oct 16 2015 06:55

Hi! I'm working on Zipline: Use the Twitchtv JSON API. Right now, I get everything right if user is online. However, I have no clue on how to even get the names of the offline users. I'm using Bootstrap and Angular (that I know just a little bit). Here is what I have:

(function() {
  var app = angular.module('fccapp', []);

  var streammers = [
    "freecodecamp", 
    "storbeck", 
    "terakilobyte", 
    "habathcx",
    "RobotCaleb",
    "thomasballinger",
    "noobs2ninjas",
    "medrybw",
    "beohoff"/*, 
    "brunofin",
    "comster404"*/
  ];

  var url = 'https://api.twitch.tv/kraken/streams/'

  app.controller('TabController', ['$scope', '$http', function($scope, $http) {

    $scope.entries = [];

    streammers.forEach(function(name) {
      $http.jsonp(url + name + "?callback=JSON_CALLBACK")
      .success(function(response) {
        $scope.entries.push(angular.extend(response));
      })
      .error(function(response) {
        $scope.entries.push(angular.extend(response));
      });
    });
  }]);

})();

It works perfectly inside my ng-repeat="entry in entries, but only if user is online. How can I get the user's data if they are offline?

Eva
@evasyl1
Oct 16 2015 06:57
@Chimasu Right, so how do I filter out duplicate entries?
Eduardo Augusto
@duuz
Oct 16 2015 06:59
hey ppl
Adam Schmidt
@Chimasu
Oct 16 2015 06:59
@evasyl1 you could loop through them and push them to a new array if they aren't already present in the new array
@evasyl1 I'm not quite sure how to use arr.filter to do that though - I don't use it enough in these bonfires
Eva
@evasyl1
Oct 16 2015 07:16
@Chimasu Thanks. I am finding some stuff online about the loops that would do that but have to go to bed now.
Thanks @Chimasu
CamperBot
@camperbot
Oct 16 2015 07:17
evasyl1 sends brownie points to @chimasu :sparkles: :thumbsup: :sparkles:
:star: 2 | @chimasu | http://www.freecodecamp.com/chimasu
Guy Minsky
@mygodlyname
Oct 16 2015 07:25
I just got to the end of the basic JS section...

but I cant get what this code means:

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

can someone break it down for me?

Aleksandar B.
@aleksandar-b
Oct 16 2015 08:05
@mygodlyname expresion $('.slot') returns an array like object of all elements that have class slot. You pick wich element you want by typing for example [0] if you want first. If you want second element whit that class, type [1]. Then it wraps it in another $() statement, but that is unimportant. The html part changes the content of element with that class. You are still inside of that element object. Now you are just changing properties of it. You are putting <img> tag inside that element via html property and you are making his src atribute to be whatever you want it to be. In this example it is a content from array or object images. I dont know what is the value of slotOne , but for example if slotOne is 4 than it accesss images[4-1] which is equal to images[3].
Meghan
@MeghanG
Oct 16 2015 08:07
I have tried everything that I've found and it still wont work?! Can someone please take a peak at my code for the script tags and document ready? This is what I'm to do: Inside your script element, add this code: $(document).ready(function() { to your script. Then close it on the following line (still inside your script element) with: });
This is my code: <script>
$(document).ready(function(){});
</script>
Aleksandar B.
@aleksandar-b
Oct 16 2015 08:11
@MeghanG it should be right. Try to hit f5 to refresh page. If it does not help hit Ctrl+f5
Meghan
@MeghanG
Oct 16 2015 08:13
@samosale I just tried both of those and they didn't work. I think I'll wait and try it on my desktop b/c right now I'm on a netbook/laptop! Thanks for the info, I'll remember that for later!
CamperBot
@camperbot
Oct 16 2015 08:13
meghang sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 374 | @samosale | http://www.freecodecamp.com/samosale
Aleksandar B.
@aleksandar-b
Oct 16 2015 08:14
@MeghanG try to put }); in a new line.
Meghan
@MeghanG
Oct 16 2015 08:16
@samosale still nothing, now the original code isn't even showing up! I think I broke it...
Aleksandar B.
@aleksandar-b
Oct 16 2015 08:17
@MeghanG Can you copy the url of of your work and paste it here?
Meghan
@MeghanG
Oct 16 2015 08:21
This message was deleted
that didn't work
kirbyedy
@kirbyedy
Oct 16 2015 08:23
it's working here
<script>
$(document).ready(function(){});
</script>
Aleksandar B.
@aleksandar-b
Oct 16 2015 08:28
@MeghanG I don't see your url
Abe Coronado
@abe03
Oct 16 2015 08:41
function repeat(str, num) {
  var repeatStr = "";
  for (var i = 0; i < num; i++) {
    repeatStr.concat(str);
  }
  return repeatStr;
}
Wondering why this isn't working
I don't know if concat() would be the right thing to use, but i don't see why it should be a problem
i need to repeat the passing string(str) multiplied by the passing number (num)
Abe Coronado
@abe03
Oct 16 2015 08:47
nevermind using += instead of concat is the solution
jihad khorfan
@spyshow
Oct 16 2015 08:48
hi every one
Abe Coronado
@abe03
Oct 16 2015 08:48
I still don't know why concat() wouldn't work though, so if anyone can shed some light into it i would be thankful
jihad khorfan
@spyshow
Oct 16 2015 08:49
i need some help on Bonfire: Title Case a Sentence
CamperBot
@camperbot
Oct 16 2015 08:49
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
jihad khorfan
@spyshow
Oct 16 2015 08:50

'''
function titleCase(str) {
array = str.split(" ");
var word;
var i=0;
for(i=0; i< array.length; i++){
word[i] = array[i].charAt(0).toUpperCase();
}
return word.join(" ");
}

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

'''

CamperBot
@camperbot
Oct 16 2015 08:50
:bulb: to format code use backticks! ``` more info
jihad khorfan
@spyshow
Oct 16 2015 08:51

function titleCase(str) {
array = str.split(" ");
var word;
var i=0;
for(i=0; i< array.length; i++){
word[i] = array[i].charAt(0).toUpperCase();
}
return word.join(" ");
}
titleCase("I'm a little tea pot");
Jose E. Pimentel
@jedpimentel
Oct 16 2015 08:57
@spyshow to declare an empty array you would have to use var word = [], else "word" has an undefined type, and word[i] would not work (since it only works array-type variables)
there are a couple other things, I'd advise running it in your browser console to double check the return string
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:06
@abe03 concat is not array nor string mutator. So, you need to write like this
repeatStr = repeatStr.concat(str);
Jose E. Pimentel
@jedpimentel
Oct 16 2015 09:09
repeatStr += str; would also work
Jim
@Herbie2015
Oct 16 2015 09:09

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

}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();

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

}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();```

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

}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();
```
Hi guys, apologies for cluttering the chat! Could anyone let me know why this code doesn't return an integer please?

Jose E. Pimentel
@jedpimentel
Oct 16 2015 09:11
the "10" seems out of place, I think you meant to use the mas variable
(also, pro-tip, you can edit your most previous comment by using the arrow up key... I use it all the time to avoid multiple posts)
max*
Jim
@Herbie2015
Oct 16 2015 09:13
@jedpimentel Nice one, cheers for that. Let me check the code.
JoelLindsey
@JoelLindsey
Oct 16 2015 09:13
How exactly do you complete the Waypoint: Declare JavaScript Variables challenge?
Screenshot 2015-10-16 04.12.53.png
Jose E. Pimentel
@jedpimentel
Oct 16 2015 09:14
@JoelLindsey similar to the example, only not using the souble dash comment thingie
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:15
This is exampe using my name. You use yours;
var myName = "Sale";
JoelLindsey
@JoelLindsey
Oct 16 2015 09:19
Thanks @jedpimentel @samosale
CamperBot
@camperbot
Oct 16 2015 09:19
joellindsey sends brownie points to @jedpimentel and @samosale :sparkles: :thumbsup: :sparkles:
:star: 365 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
:star: 377 | @samosale | http://www.freecodecamp.com/samosale
Kamen08
@Kamen08
Oct 16 2015 09:22
Hello I have a problem with Make Instances of Objects with a Constructor Function. Dont know how to make instance.
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:22
@Kamen08 paste url here
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:25
@Kamen08
Jim
@Herbie2015
Oct 16 2015 09:26

@jedpimentel

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

}

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
(function(){return myFunction();})();

I tried using the max and min vars but not sure I am doing it right. I am still receiving a decimal. Any ideas?

Aleksandar B.
@aleksandar-b
Oct 16 2015 09:27
Your task is not to make an instance, bc it is aleady there. you need to declare new property @Kamen08
Jose E. Pimentel
@jedpimentel
Oct 16 2015 09:27
@Herbie2015 your return value is off :P, you're throwing awway the logic in the previous line
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:28
@Herbie2015 your + min is outside mat.floor
Jose E. Pimentel
@jedpimentel
Oct 16 2015 09:29
@Herbie2015 as long as min is an integer it's okay to be out of math.floor, I'd advise making a new variable to hold the random number, then have the function return that variable (hence, returning that value). Basically what's being returned is just the Math.random() next to return
Kamen08
@Kamen08
Oct 16 2015 09:36
Man in so dumb thanks @samosale got it now.
CamperBot
@camperbot
Oct 16 2015 09:36
kamen08 sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 378 | @samosale | http://www.freecodecamp.com/samosale
Jim
@Herbie2015
Oct 16 2015 09:37
@jedpimentel Sorry I think I am being dumb on this one. I am completely stumped.
Ankit Panwar
@coderNoob
Oct 16 2015 09:37

I'm doing the Calculator Zipline and this is how I'm doing the buttons for the inputs, e.g. when you click the button "3", the following code executes.

$('#three').click(function(){
  $('#ans').val($('#ans').val()+3);
});

I was wondering if there was an easier way to do this instead of writing the same code for every button?
@samosale

Alex
@cod7alex
Oct 16 2015 09:38
@Herbie2015 you return just result of random but not the result of floor from previous line
Jose E. Pimentel
@jedpimentel
Oct 16 2015 09:39
@Herbie2015 you're function needs to return an integer between the minimum and the maximun. As-is, it has return Math.random() which means it returns a fraction between zero and one
whatever is next to return is the value that the function passes when it's called
azaleas
@azaleas
Oct 16 2015 09:41
@coderNoob you can wrap your click event in each function. just make sure to create ids in a sequential way so that you can iterate. then create an array with the same names in your js. i.e. ids: 0-9, array [0-9]. then your each function will take care of the rest.
Alex
@cod7alex
Oct 16 2015 09:42
@coderNoob you can use the html attributes to store data and get it using jQuery like this :<a data-num="3"></a> If i understand your goal correctly.
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:44
as @azaleas said you can do that and inside of each use $(this) to reference to the current element
JoelLindsey
@JoelLindsey
Oct 16 2015 09:45
Stuck on Waypoint: Declare String Variables
Screenshot 2015-10-16 04.45.35.png
Kamen08
@Kamen08
Oct 16 2015 09:53
@JoelLindsey you need to just follow example in top. To give you another example var myNickName ="Kamen08"
@JoelLindsey now you just need to create two more vars : myFirstName and myLastName
JoelLindsey
@JoelLindsey
Oct 16 2015 09:56
@Kamen08 yeah i made a line var myfirstName = bob then one for mylastName ="Jones
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:56
@coderNoob this is not correct
$('#ans').val($('#ans').val()+3);
JoelLindsey
@JoelLindsey
Oct 16 2015 09:57
@Kamen08 It did not work
Ankit Panwar
@coderNoob
Oct 16 2015 09:57
@samosale
$('#ans').val($('#ans').val()+3);
@samosale it works
inserts the value 3 whenever you click the button 3 into the text field named "ans".
Aleksandar B.
@aleksandar-b
Oct 16 2015 09:58
@coderNoob yeah sorry
h4r1m4u
@h4r1m4u
Oct 16 2015 09:59
@JoelLindsey you need to wrap string in quotes, like so: var myfirstName = "bob". otherwise bob is considered a variable
JoelLindsey
@JoelLindsey
Oct 16 2015 09:59
Screenshot 2015-10-16 04.59.36.png
Kamen08
@Kamen08
Oct 16 2015 10:00
@JoelLindsey "f" and "l" need to be capital letters too
h4r1m4u
@h4r1m4u
Oct 16 2015 10:00
@JoelLindsey look at the examples carefully and compare with your code
Kamen08
@Kamen08
Oct 16 2015 10:01
@JoelLindsey how this curse work u need to create exactle the same name of vars here
@JoelLindsey so var myFirstName and var myLastName
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:02
@coderNoob you could also give it data atribute as someone mention above. Uou could also give each number a same class. And then i think:
document.getElementsByClassName('yourClass').forEach(function(val){
val.addEventListener('click', function(){
---your code
}, false);
})
Abhisek Pattnaik
@abhisekp
Oct 16 2015 10:03
hey! this won't work document.getElementsByClassName('yourClass').forEach
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:03
@abhisekp why? It is an object?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 10:04
@samosale it's an instance of NodeList object not Array object
@samosale use [].slice.call(document.getElementsByClassName('yourClass')).forEach
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:06
@abhisekp he could use for loops also
Abhisek Pattnaik
@abhisekp
Oct 16 2015 10:07
@samosale bad! Hail Functional Programming
:P
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:07
@abhisekp performance issue, remember?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 10:08

@samosale Yes in my P3 PC i just threw 10 yrs ago. ;)

NOTE: I never had a P3 :P

@coderNoob Use event delegation for the buttons http://jqfundamentals.com/chapter/events
Ankit Panwar
@coderNoob
Oct 16 2015 10:11

@abhisekp @samosale @cod7alex

$('#num').click(function(){
  var s = $(this).val();
  $('#ans').val($('#ans').val()+s);
});

HTML portion

<input type="button" value="1" id='num' data-one="1">
<input type="button" value="2" id='num' data-two="2">
<input type="button" value="3" id='num' data-three="3">

It seems to be working only for the button 1 and not the others and I don't know why.

Jim
@Herbie2015
Oct 16 2015 10:11
@jedpimentel @cod7alex Yep got it. I can see what I was doing wrong now. I think I need another coffee :) Thanks for your help guys! :)
CamperBot
@camperbot
Oct 16 2015 10:11
herbie2015 sends brownie points to @jedpimentel and @cod7alex :sparkles: :thumbsup: :sparkles:
:star: 47 | @cod7alex | http://www.freecodecamp.com/cod7alex
:star: 366 | @jedpimentel | http://www.freecodecamp.com/jedpimentel
Jose E. Pimentel
@jedpimentel
Oct 16 2015 10:12
@Herbie2015 no prob... it took me quite a while to notice that bit (and I had just recently gotten coffee)
Abhisek Pattnaik
@abhisekp
Oct 16 2015 10:13
:wave: bye everyone.
gotta get back to dev my personal project. :D
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:17
@coderNoob
You should not name differently each data attribute. Use only data-number
var s = $(this).data(data-number);
Ankit Panwar
@coderNoob
Oct 16 2015 10:22
@samosale I need the same function called no matter which button I click. What you suggest would require me to specify the data-number for every individual button like data-one, data-two, etc.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 10:22
@coderNoob Use event delegation for the buttons http://jqfundamentals.com/chapter/events
Alex
@cod7alex
Oct 16 2015 10:23
@coderNoob you dont need that is the thing
<input type="button" value="1" id='num' data-number="1">
<input type="button" value="2" id='num' data-number="2">
<input type="button" value="3" id='num' data-number="3">

var s = $(this).data(data-number);
//work with s
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:25
@cod7alex :+1:
@coderNoob $(this) will automatically take data-number value of clicked element
marzelin
@marzelin
Oct 16 2015 10:29
@coderNoob you can't give the same id to more than one element. Id must be unique
use class instead of id
Aleksandar B.
@aleksandar-b
Oct 16 2015 10:32
@abhisekp when I use [].slice.call() I could turn everything into an array with that?
Prashanth Chandra
@prashcr
Oct 16 2015 10:41

Does anyone have experience with using the GitHub API? I'm trying to create a repo using curl.
I tried this, but all I get is 404

curl -u "<username>" -d '{"name": "test-repo"}' https://api.github.com/users/repos

Docs:
https://developer.github.com/guides/getting-started/

Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:14
@samosale sure! :+1:
Ankit Panwar
@coderNoob
Oct 16 2015 11:14
@cod7alex Didn't work.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:16

@samosale You can turn this into an array too :D

var samosaleObj = {
    length: 20,
    19: 'Sale',
    15: 'Samo'
}
var samosaleArr = [].slice.call(samosaleObj);

njoy! ;) https://repl.it/BRFH

Blauelf
@Blauelf
Oct 16 2015 11:17
Does this give holes or does it give undefineds?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:20
@Blauelf holes. undefined is given by Array.from method.
Blauelf
@Blauelf
Oct 16 2015 11:21
Just tested it, yes, holes :D
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:22
@Blauelf undefined is shown when something (or someone :P ) manually writes each and every index till the length. Too slow. Too bad. :(
Blauelf
@Blauelf
Oct 16 2015 11:24
It's good to know, as some structures iterate over undefineds, just not over holes. There's reasoning for both, depending on situation.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:25
@Blauelf well, holes are undefined too.
Blauelf
@Blauelf
Oct 16 2015 11:26
They evaluate to undefined, but they do not represent properties.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:26
@Blauelf yep! only when someone would use for...in or for...of on arrays!
Roy
@CruelCoin
Oct 16 2015 11:26

Hi Guys, Could i get a little help with this please?

function bouncer(arr)
{
  for (var i = 0; i < arr.length(); i++)
  {
     if (arr[i] === false || null || 0 || "" || undefined || NaN)
     {
        return false;
     }
     else
     {
     return true;
     }
  }
}

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

My thinking is to pass the array to the filter function, loop through it, and declare true/false for each entry in the array

Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:27
@CruelCoin
Hint: NaN is not equal to NaN
Blauelf
@Blauelf
Oct 16 2015 11:27
@abhisekp Just tested with forEach, it will run on undefineds, not on holes.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:27
@CruelCoin this doesn't work that way (arr[i] === false || null || 0 || "" || undefined || NaN)
Blauelf
@Blauelf
Oct 16 2015 11:30
@CruelCoin You would have to use separate tests for the different falsy values (and isNaN() for testing on NaN). But you can easily avoid all that, as all these falsy values are treated the same when you simply put them into an if, like in if(arr[i])
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:31
@Blauelf :beers:
Probably forEach uses Object.keys
nope! it doesn't or maybe. idk! :P
Roy
@CruelCoin
Oct 16 2015 11:36

Hi Guys

function bouncer(arr)
{
  for (var i = 0; i < arr.length(); i++)
  {
     if (arr[i] === false || null || 0 || "" || undefined || isNaN())
     {
        return false;
     }
     else
     {
     return true;
     }
  }
}

var myArray = [7, "ate", "", false, 9];

var filtered = myArray.filter(bouncer);

Am i a little closer with this?

Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:36
@CruelCoin :point_up: October 16, 2015 5:00 PM
Roy
@CruelCoin
Oct 16 2015 11:37
@abhisekp I though i did have them in an if? "if (arr[i] === false || null || 0 || "" || undefined || isNaN())"
Roy
@CruelCoin
Oct 16 2015 11:43
@abhisekp Thanks for the advice.
I Got it. Just filtered by Boolean.
function bouncer(arr) {
  // Don't show a false ID to this bouncer.
  return arr.filter(Boolean);
}

bouncer([7, "ate", "", false, 9]);
CamperBot
@camperbot
Oct 16 2015 11:43
cruelcoin sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 596 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:43
@CruelCoin why did you do so? :angry:
@CruelCoin where did you get the solution may i ask?
@CruelCoin Did you understand why this doesn't work?
if (arr[i] === false || null || 0 || "" || undefined || isNaN())
Alexander Bayoh
@Abayoh
Oct 16 2015 11:46
var code;
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:46
code = null;
Alexander Bayoh
@Abayoh
Oct 16 2015 11:47
function where(collection, source) {
  var arr = [];
  // What's in a name?
  var prop = Object.keys(source);
  var propLen = prop.length;

  for(var i = 0, j = collection.length; i < j; i++){
    var hasProperty = true;
    for(var x =0; hasProperty && x < propLen; x++)
      hasProperty = collection[i].hasOwnProperty(prop[x]);


    if(hasProperty){

       arr.push(collection[i]);
    }
  }

  return arr;
}

where([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:48
@Abayoh what happen?
Alexander Bayoh
@Abayoh
Oct 16 2015 11:48
this is my code please and im stuck
the error i have is this
where() should return an array of objects.
all the below are checked
but accept the first requirement
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:53
bf where art thou
CamperBot
@camperbot
Oct 16 2015 11:53

:fire:Bonfire: Where art thou :link:

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

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

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

more info:  bf details | bf links | hint

Roy
@CruelCoin
Oct 16 2015 11:54
@abhisekp The Boolean constructor is also a function, and it checks each value passed to it for whether or not its atrue or false value. E.g: filled string is true, empty string is false, etc.
@abhisekp I'm not entirely sure why the other did not work
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:55
@CruelCoin nice! :+1: for the Booleantrick
@CruelCoin but you seriously need to know why the other didn't work. Please don't progress unless you do. It's very very imp.
Roy
@CruelCoin
Oct 16 2015 11:56
@abhisekp Actually, did it not work because TRUE or FALSE is equal to TRUE regardless?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:56
ummm... what?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 11:57
@CruelCoin :point_up: October 16, 2015 5:09 PM
@CruelCoin after reading those links, if you get to know why it didn't work, then thats gr8. You're genius. Otherwise, we're always here to help. :D
Ankit Panwar
@coderNoob
Oct 16 2015 12:04

@abhisekp

$('button').click(function(event){
  var s = $(this).data(data-number);
  $('#ans').val($('#ans').val()+s);
});

Still doesn't work.

Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:05
@coderNoob If you wanna run the same function for each and every button, then use EventDelegation jqfundamentals.com/chapter/events
Blauelf
@Blauelf
Oct 16 2015 12:05
Have you tried putting "data-number" in "" (or '')?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:06
@coderNoob btw, what you trying to achieve?
Ankit Panwar
@coderNoob
Oct 16 2015 12:07
@abhisekp Just did. Changed $('#num').click(function(){ to
$('button').click(function(event){ after I read the document whose link you provided.
@Blauelf Yea tried that too. Didn't work.
Blauelf
@Blauelf
Oct 16 2015 12:08
@coderNoob data-number means value of data minus value of number, so you probably meant something like 'data-number'
Ankit Panwar
@coderNoob
Oct 16 2015 12:10
@abhisekp What I'm trying to achieve is to call a single function every time a button is clicked instead of making a $().click(function(){}) for every individual button.
I'm trying to make a calculator. I'm on the basic front end Zipline.
Roy
@CruelCoin
Oct 16 2015 12:10
function destroyer(arr, arg1, arg2) {
  // Remove all the values
  var arrArg1 = arr.filter(arg1);
  var arrArg2 = arrArg1.filter(arg2);
  return arrArg2;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Still having issue with the Filter
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:11
@coderNoob :point_up: October 16, 2015 5:35 PM
@CruelCoin :point_up: October 16, 2015 5:25 PM
Kiy-Hong Tang
@kiytang
Oct 16 2015 12:11

Bonfire: Confirm the Ending

function end(str, target) {
  if (str.substr(-target.length) === target)
    return true;
  else
    return false;
}

Hi, I would like help in understanding how (str.substr(-target.length) === target) works. From my understanding, the -target means that we begin extracting characters from end of target. However, does it mean that the match is based on length only so that string such as "that" and "abcd" would return true based on character count. Would appreciate some help as I have been trying all day with out avail.

CamperBot
@camperbot
Oct 16 2015 12:11
Sorry, can't find a bonfire called confirm the endingfunction endstr target if strsubstr-targetlength target return true else return falsehi i would like help in understanding how strsubstr-targetlength target works from my understanding the -target means that we begin extracting characters from end of target however does it mean that the match is based on length only so that string such as that and abcd would return true absed on character count would appreciate some help as i have been trying all day with out avail . [ Check the map? ]
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:11
bf confirm
CamperBot
@camperbot
Oct 16 2015 12:11

:fire:Bonfire: Confirm the Ending :link:

function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  return str;
}

end('Bastian', 'n');

Check if a string (first argument) ends with the given target string (second argument).

more info:  bf details | bf links | hint

Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:12
explain format
CamperBot
@camperbot
Oct 16 2015 12:12

: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 16 2015 12:12
@kiytang :point_up: October 16, 2015 5:42 PM
Ankit Panwar
@coderNoob
Oct 16 2015 12:14
@abhisekp Like I said, it's not working
My CodePen
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:15
@coderNoob Did you completely read this pg.? jqfundamentals.com/chapter/events
Ankit Panwar
@coderNoob
Oct 16 2015 12:16
@abhisekp Yes. I took baby steps and tried to implement for a single button at first. Didn't work. Was hoping you could tell me what is wrong with the code.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:18
@coderNoob damn! I was trying and codepen went for maintenance. Use http://jsbin.com
Ankit Panwar
@coderNoob
Oct 16 2015 12:19
Link
@abhisekp
John Power
@powerjohn
Oct 16 2015 12:23
I have had a problem the last few days with bootstrap cdn not loading so anyone know how much less efficeint is it to have a ccs file with your code rather than link to an external cdn css?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:23
This message was deleted
Marcus Eisele
@eiselems
Oct 16 2015 12:24
@powerjohn it is just additional load for your server/users, by using a cdn the assets get delivered by another server and the user (if it is a popular cdn) may already have the file in its local cache
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:25
@coderNoob Remove the redundant onclick in HTML and add either a class or id of num for each number input.
Alex
@cod7alex
Oct 16 2015 12:25
@coderNoob you need to use $(this).data('number') instead of $(this).data('data-number')
Ankit Panwar
@coderNoob
Oct 16 2015 12:28
@abhisekp onClick was to just get started. Anyway I removed all of it and still it is not working.
@cod7alex Tried and didn't work.
:(
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:28
@coderNoob bcoz there are no button.
There are input
@coderNoob bcoz it's .data('number'); not .data('data-number'); as @cod7alex says
@coderNoob bcoz you didn't have jquery loaded. :P
Ankit Panwar
@coderNoob
Oct 16 2015 12:33
@abhisekp Yea. I had it in Codepen. Guess have to try it tomorrow when it is up again. Thanks for the help.
@cod7alex
CamperBot
@camperbot
Oct 16 2015 12:33
codernoob sends brownie points to @abhisekp and @cod7alex :sparkles: :thumbsup: :sparkles:
:star: 597 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 106 | @cod7alex | http://www.freecodecamp.com/cod7alex
Abhijeet De
@iamads
Oct 16 2015 12:33
topics
Marcus Eisele
@eiselems
Oct 16 2015 12:33
Is it me or seems the CSS height-scaling to be a nightmare?
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:34
it's the CSS
blame others and stay safe
explain git blame
CamperBot
@camperbot
Oct 16 2015 12:34

:point_right: git blame [wiki]

Shows what revision and author last modified each line of a file and blame them.

:point_right: :no_good: — :see_no_evil: :hear_no_evil: :speak_no_evil:

Reference: https://git-scm.com/docs/git-blame

:pencil: read more about git blame on the FCC Wiki

Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:34
Hi , Does anyone want to pair
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:34
@FakhruddinAbdi where is the issue?
which bf?
Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:35
@abhisekp Bonfire: Factorialize a Number
Marcus Eisele
@eiselems
Oct 16 2015 12:35
just wondering how hard it is to make a website with 10% header, 20% bottom and the rest filled by a large image :D
Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:35
I'm stuck at this waypoint
And i want to test how to pairing work
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:36
bf fact
CamperBot
@camperbot
Oct 16 2015 12:36

:fire:Bonfire: Factorialize a Number :link:

function factorialize(num) {
  return num;
}

factorialize(5);

Return the factorial of the provided integer.

more info:  bf details | bf links | hint

Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:37
Yes. This one. how to solve? @camperbot
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:37
@eiselems
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.header {
    height: 20%
}
Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:38
Comparebot is a robot :)
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:38
@FakhruddinAbdi have you written any code?
Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:38
Yes, I'm web developer @abhisekp
But it don't allow to use any loop operations
I didn't try much, as i said, just want to check pairing
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:41
@FakhruddinAbdi well, if you wanna try pairing, i'm a bit reluctant. So... someone else might.
Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:41
So what's your suggestion to solve the bf @abhisekp
Marcus Eisele
@eiselems
Oct 16 2015 12:42
@abhisekp thanks i just wonder how to implement it all
CamperBot
@camperbot
Oct 16 2015 12:42
eiselems sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 598 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:42
@FakhruddinAbdi can't say anything till i see how much you done already.
and what's freezing your further development
Marcus Eisele
@eiselems
Oct 16 2015 12:44
already setup a simple website which serves images provided by angular-gallery (basically it renders thumbnails and provides access to the thumbs and images via json)
i already bound a method which changes the "big image"'s source to the clicked thumbs full version
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:46
@eiselems nice :+1: Hope you complete it soon enough
Marcus Eisele
@eiselems
Oct 16 2015 12:46
at the moment i'm looking for a sort of navigation (carousel) element
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:46
@FakhruddinAbdi hey! You can ask for pairing here https://gitter.im/FreeCodeCamp/LetsPair
Marcus Eisele
@eiselems
Oct 16 2015 12:46
think the albums will get some how huge and i need a way to lazy load the thumbnails
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:47
@eiselems don't get so lazy :P
Fakhruddin Abdi
@FakhruddinAbdi
Oct 16 2015 12:47
Thanks @abhisekp
CamperBot
@camperbot
Oct 16 2015 12:47
fakhruddinabdi sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 599 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 16 2015 12:48
k. bye :wave: everyone
I'm going to watch a movie.
I feel like watching a movie from beneath my stomach.
Roy
@CruelCoin
Oct 16 2015 12:51

Hi guys, i'm having a little trouble with this:

function destroyer(arr, arg1, arg2)
{
  for (var i = arr.length - 1; i > 0; i--)
  {
      if (arr[i] === arg1 || arg2)
      {
         arr.splice(i, 1);
      }
  }
  return arr;
}

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

Inside the if() it should be splicing the element in the array at point i if it matches either of the arguments (arg1/arg2) but it seems to be splicing every entry?

Blauelf
@Blauelf
Oct 16 2015 12:56
It's if (arr[i] === arg1 || arr[i] === arg2)
Michael Bomholt
@bomholtm
Oct 16 2015 12:58
@Blauelf i dont think so
i had a problem with the test with 3 arguments that way if i remember correctly
i would use arr[i] and arguments[j] @CruelCoin
because with the update they added a test with 3 arguments
you could use === arg3 but that wouldnt work when a new argument is added again
Blauelf
@Blauelf
Oct 16 2015 13:03
@CruelCoin has a problem in understanding the comparison, that's what I wanted to point out.
@bomholt, you are right, the correct way to use an arbitrary number of arguments is using the arguments object or, in an ES6 setting, rest parameters.
Rest parameters and functional programming can make this a one-liner.
(without rest parameters, it's still a two-liner when using filter() and one of some() or every())
Michael Bomholt
@bomholtm
Oct 16 2015 13:05
@Blauelf i never thought of it that way but yea you are right
i used one for loop for running through the arguments and pushing everything into a array
Roy
@CruelCoin
Oct 16 2015 13:07
@Blauelf Thanks for that, i'm at least getting some tests passed now.
I've always had an issue with those manual pages, as its always a wall of technical gibberish.
CamperBot
@camperbot
Oct 16 2015 13:07
cruelcoin sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 366 | @blauelf | http://www.freecodecamp.com/blauelf
Michael Bomholt
@bomholtm
Oct 16 2015 13:07
so that i have to arrays
and then i did a second for loop comparing them with indexOf
works like a charm but maybe a bit inconvenient
Roy
@CruelCoin
Oct 16 2015 13:09
For an indeterminate amount of arguments, how would i add them all to an array?
I.e: I'd like to pass to my destroyer two arrays (arr, args)
Michael Bomholt
@bomholtm
Oct 16 2015 13:11
var arg = [];

    for(var i = 1; i < arguments.length; i++) {
        arg.push(arguments[i]);
    }
while arr is equal to arguments[0]
so you have arr and arg.. two arrays to compare
@Blauelf are you german?
Roy
@CruelCoin
Oct 16 2015 13:14
@bomholt Oh ok, so i don't need to specific the arguments like so:
function destroyer(arr, arg1, arg2)
If i don't specify, anything following the array is assumed to be an argument?
Michael Bomholt
@bomholtm
Oct 16 2015 13:16
function destroyer(arr, arg1, arg2) this function also works for 4 arguments.. so there is no need to specify it
i think if you added arg3 for example
you could call argument 4 by arg3 (array is a argument too) is the only benefit of editing it i think
im not sure though
but i works totally fine.. but you have to use arguments[] then instead having a variable for every argument
maybe @Blauelf could confirm that :P
Roy
@CruelCoin
Oct 16 2015 13:25
This is how its standing right now, still only passing the first two tests:
function destroyer(arr, arg1, arg2)
{
  var args = [];
  for (var i = 1; i < arguments.length; i++)
  {
      args.push(arguments[i]);
  }

  for (var i = arr.length - 1; i > 0; i--)
  {
      for (var j = 0; j < args.length; j++)
      {
          if (arr[i] === args[j])
          {
              arr.splice(i, 1);
          }
      }
  }
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Coira Ellison
@Coira
Oct 16 2015 13:30
@CruelCoin this line here for (var i = arr.length - 1; i > 0; i--) you need to change one thing to get it to pass
and if you were quick, you may have noticed i accidentally pasted the corrected code instead of your code :p
Lasynsec
@Lasynsec
Oct 16 2015 13:33
hello world
CamperBot
@camperbot
Oct 16 2015 13:33

welcome to FreeCodeCamp @Lasynsec!

Lasynsec
@Lasynsec
Oct 16 2015 13:34
Needing a little help on how to think through finders keepers on the bonefire part
can anybody help ?
Jason Wood
@catapixel
Oct 16 2015 13:37
@Lasynsec hello. What's your question?
Lasynsec
@Lasynsec
Oct 16 2015 13:39
hello @catapixel
Jason Wood
@catapixel
Oct 16 2015 13:40
greetings. Did you still have a questionon finders keepers?
Lasynsec
@Lasynsec
Oct 16 2015 13:40
I don't know how to return the right value in the array not any boolean value
Roy
@CruelCoin
Oct 16 2015 13:40
@Coira Hi Coira, didn't spot it. Any tips?
Jason Wood
@catapixel
Oct 16 2015 13:41
what does your code look like at this point? Can you paste it in?
wiki format
CamperBot
@camperbot
Oct 16 2015 13:41

: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

Lasynsec
@Lasynsec
Oct 16 2015 13:41
sorry for my english iam not a native english speaker
Jason Wood
@catapixel
Oct 16 2015 13:41
that is ok. Can I see your code?
Coira Ellison
@Coira
Oct 16 2015 13:43
@CruelCoin i > 0 this part here, what happens to arr[0]?
Lasynsec
@Lasynsec
Oct 16 2015 13:44
This message was deleted
This message was deleted
function find(arr, func) 
{

   var result = arr.some(func),
       resultArray = [];

   if(result)
   {
      for(var i = 0; i < arr.length; i++)
      {
        if(arr[i] % 2 === 0)
        {
          resultArray.push(arr[i]);
        }
      }
   }
  return result[0];
}
@catapixel here is my code.
Raji von Arx
@kemosabe73
Oct 16 2015 13:49

Guys I need some help.

My problem is with Bonfire: Steamroller. A task which I am asked to Flatten a nested array. I must account for varying levels of nesting.

Lasynsec
@Lasynsec
Oct 16 2015 13:50
sorry for being so long
Raji von Arx
@kemosabe73
Oct 16 2015 13:51

Guys I need some help.

My problem is with Bonfire: Steamroller. A task which I am asked to Flatten a nested array. I must account for varying levels of nesting.

function steamroller(arr) {
  // I'm a steamroller, baby

  var len = arr.length;
  for(var i = 0; i < len; i++)
    {
      if(Array.isArray(arr[i]))
        {
          steamroller(arr[i]);
        }
      else
        {
          newArr.push(arr[i]);
        }
    }

  return newArr;
}
var newArr = [];
steamroller([1, {}, [3, [[4]]]]);

My response seems to be correct but they are marked wrong. What am I doing wrong?

Jason Wood
@catapixel
Oct 16 2015 13:52
@Lasynsec it looks like you're storing your "good" value in an array called resultArray but you are returning the result array. Try fixing this and see if your code passes
Lasynsec
@Lasynsec
Oct 16 2015 13:54
that was it, thanks @catapixel
CamperBot
@camperbot
Oct 16 2015 13:54
lasynsec sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 459 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Oct 16 2015 13:55
@Lasynsec you are welcome
Roy
@CruelCoin
Oct 16 2015 13:55
@Coira I can't loop to -1, so should i be using a while loop instead?
Coira Ellison
@Coira
Oct 16 2015 13:56
@CruelCoin i >= 0 (add in the =)
Abhisek Pattnaik
@abhisekp
Oct 16 2015 13:57
@CruelCoin After completing it using normal for loop, also try to complete using functional programming style using Array.prototype.filter method
Hugo
@hugoender
Oct 16 2015 13:59

I need help with one of the learnyounode challenges. It is passing three url's to my module and asking that I print the contents in the order in which the url's are passed in. I thought that my code waited for one response to end before carrying out the next response by using a for loop but it seems as though that is not the case. Here is my code:

var http  = require('http');
var urlArr = [];
urlArr.push(process.argv[2]);
urlArr.push(process.argv[3]);
urlArr.push(process.argv[4]);
//var url2 = process.argv[3];
//var url3 = process.argv[4];
//console.log(urlArr);


function callback(response){
    var arr = [];
    var str = '';

    response.setEncoding('utf8');
    response.on("data", function (data){
        //console.log(data);
        arr.push(data); 
    });

    response.on("end", function (){
        str = arr.join('');
        //console.log(str.length);
        console.log(str);
    });
}

urlArr.forEach(function (url){
    http.get(url, callback);
});

Any hint or tid bit of knowledge would be helpful.

Roy
@CruelCoin
Oct 16 2015 13:59
Its still only passing the first two tests:
function destroyer()
{
  var myArray = arguments[0];

  var args = [];
  for (var i = 1; i < arguments.length; i++)
  {
      args.push(arguments[i]);
  }

  for (var i = myArray.length - 1; i >= 1; i--)
  {
      for (var j = 0; j < args.length; j++)
      {
          if (myArray[i] === args[j])
          {
              myArray.splice(i, 1);
          }
      }
  }
  return myArray;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3)
Coira Ellison
@Coira
Oct 16 2015 14:00
@CruelCoin i >= 0
Roy
@CruelCoin
Oct 16 2015 14:00
@Coira ugh. I am a dumb
Coira Ellison
@Coira
Oct 16 2015 14:00
because otherwise, you're completely ignoring whatever's in arr[0]
Roy
@CruelCoin
Oct 16 2015 14:00
Thank you for the help @Coira
CamperBot
@camperbot
Oct 16 2015 14:00
cruelcoin sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 278 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Oct 16 2015 14:00
np :)
Roy
@CruelCoin
Oct 16 2015 14:01
@Coira I get that now, thanks.
CamperBot
@camperbot
Oct 16 2015 14:01
cruelcoin sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:warning: cruelcoin already gave coira points
Valenchak
@Valenchak
Oct 16 2015 14:02
@camperbot
Coira Ellison
@Coira
Oct 16 2015 14:02
when you get a chance, try it with filter like @abhisekp said. once you work out how it works, it's just so much easier :)
Jason Wood
@catapixel
Oct 16 2015 14:02
@hugoender I'm double checking my code but I believe you need to add a collector that waits until it's equal to "3" before you call your print the contents
Hugo
@hugoender
Oct 16 2015 14:03
@catapixel awesome! thank you. didn't know about collector
CamperBot
@camperbot
Oct 16 2015 14:03
hugoender sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 461 | @catapixel | http://www.freecodecamp.com/catapixel
Hugo
@hugoender
Oct 16 2015 14:03
will look it up
@catapixel so can you explain why a for loop doesnt work? is it that in node it doesnt wait for a callback to finish before moving on to the next loop item?
Jason Wood
@catapixel
Oct 16 2015 14:06
@hugoender basically. It's because it's all happening asynchronously. It doesn't wait before beginning your for loop.
Hugo
@hugoender
Oct 16 2015 14:06
interesting
@catapixel alright so i just need to keep a counter in the callback
and not print out data unless its the final callback
Jason Wood
@catapixel
Oct 16 2015 14:08
@hugoender remind me what this learnyounode step is called...yes, hold a counter and when the counter reaches the number of items you expect then call your function to write everything out to console. That's the easiest way I found to do it...
Hugo
@hugoender
Oct 16 2015 14:09
@catapixel JUGGLING ASYNC challenge 9 of 13
Jason Wood
@catapixel
Oct 16 2015 14:11
@hugoender Ah yes I see it now. I built a function I called complete() that printed everything out to the console and then I did this if (urls.length === counter) complete(); to keep checking my counter
Hugo
@hugoender
Oct 16 2015 14:11
@catapixel yep thats what im doing as we speak. thanks again!
CamperBot
@camperbot
Oct 16 2015 14:11
hugoender sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:warning: hugoender already gave catapixel points
Jason Wood
@catapixel
Oct 16 2015 14:12
@hugoender no problem.
Aleksandar B.
@aleksandar-b
Oct 16 2015 14:12
@catapixel is this the case for promises?
what @hugoender is trying to solve.
Jason Wood
@catapixel
Oct 16 2015 14:13
@samosale what I'm describing is not a promise but yes, that's why you'd use a promise from what I understand. I'm still learning :wink:
Hugo
@hugoender
Oct 16 2015 14:26
@catapixel hmmm its still not working for me... where do you check the count value?
inside the callback?
Adam Schmidt
@Chimasu
Oct 16 2015 14:26
@CruelCoin you're looping through myArray incorrectly
Hugo
@hugoender
Oct 16 2015 14:26
@catapixel i am checking it inside the response.on("end"..) function
mchouse
@housewar
Oct 16 2015 14:27
@Jepz I've completed it... where are you at?
Hugo
@hugoender
Oct 16 2015 14:30
oh i think i know what i did wrong
Region2
@Region2
Oct 16 2015 14:35
Hi, I just started FreeCodeCamp, yesterday, but I created an infinite loop by mistake in my original code. I couldn't load the page to fix it, but when I used incognito mode on chrome it allowed me to reset, but when I go back to visit the code, it saves my original (non-incognito) code and stays frozen. Does anyone know a way I can reset it?
Alex
@cod7alex
Oct 16 2015 14:37
@Region2 disable javascript and visit that page maybe?
Coira Ellison
@Coira
Oct 16 2015 14:38
wiki storage
CamperBot
@camperbot
Oct 16 2015 14:38

:point_right: clear your browser's local storage [wiki]

Removing all your locally stored challenges will solve many problems related to the browser crashing on FreeCodeCamp

In Chrome:

  • On 'freecodecamp.com' open your console
    • Windows: Ctrl + Shift + J
    • Mac OS: Cmd + Opt + J
  • Go to resources tab(chrome).
    • There click on the localStorage link in the nav bar on the right.
  • Delete all the entries on the right side.
  • See if this solves your issue

Alternatively, if you are having issues with a specific challenge freezing your browser, find the name of that challenge in local storage and delete just that one.
:pencil: read more about clear your browsers local storage on the FCC Wiki

Coira Ellison
@Coira
Oct 16 2015 14:38
@Region2
Region2
@Region2
Oct 16 2015 14:43
@Coira thanks for the tip! I'll see if that helps solve the problem
CamperBot
@camperbot
Oct 16 2015 14:43
region2 sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 279 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Oct 16 2015 14:43
@Region2 np, camperbot did most of the work :)
Region2
@Region2
Oct 16 2015 14:44
It took a few tries to get even the resources to load. That must have been one terrible piece of code.
leemurdock
@leemurdock
Oct 16 2015 14:54
Just want to brag for a sec, I completed if (slotOne==slotTwo==slotThree) {
return number;
} else {
return null;
}
nvm, brag doesn't work if can't type correctly
Hugo
@hugoender
Oct 16 2015 15:01
@catapixel I still cannot get this to work. any hint as to what I am doing wrong?
var http  = require('http');
var urlArr = [];
var strArr = [];
urlArr.push(process.argv[2]);
urlArr.push(process.argv[3]);
urlArr.push(process.argv[4]);
var urlNum = -1;
var count = urlArr.length;

function printResponse (){
    strArr.forEach(function(val){
       console.log(val); 
    });
}

function callback(response){
    var arr = [];
    var str = '';
    response.setEncoding('utf8');
    response.on("data", function (data){
        arr.push(data); 
    });

    response.on("end", function (){
        urlNum++;
        str = arr.join('');
        strArr[urlNum] = str;
        if (--count <= 0){
            printResponse();
        }
    });
}

urlArr.forEach(function (url){
    http.get(url, callback);
});
this is still for the learnyounode challenge 9 of 13 (\"Juggling Async")
Sawredjet
@sawredjet
Oct 16 2015 15:02
I cant figure out how to use the Lobster font, even though I have put the link into my code.
Aleksander Gębicki
@Takumar
Oct 16 2015 15:08
@sawredjet you have to add style of font-family: Lobster; to your text.
Justin Owings
@jrowings
Oct 16 2015 15:11
how do i Nest the text input element within a form element.

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

<p>Things cats love:</p>

<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

<p>Top 3 things cats hate:</p>

<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

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

<form action="/submit-cat-photo"></form>

Aleksander Gębicki
@Takumar
Oct 16 2015 15:12
@jrowings you have to put your <input> tag between opening <form> and closing </form> tags.
Justin Owings
@jrowings
Oct 16 2015 15:13
i figured it out.
Aleksander Gębicki
@Takumar
Oct 16 2015 15:13
@jrowings but in you pasted code you have form after input.
Justin Owings
@jrowings
Oct 16 2015 15:13
i totatlly was spaced out for a second.

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

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

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

<p>Things cats love:</p>

<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>

<p>Top 3 things cats hate:</p>

<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>

<form action="/submit-cat-photo"><input type="text" placeholder="cat photo URL"> </form>

thanks man
CamperBot
@camperbot
Oct 16 2015 15:14
if you want to thank someone, put an @ before their name!
Justin Owings
@jrowings
Oct 16 2015 15:14
thanks @Takumar
CamperBot
@camperbot
Oct 16 2015 15:14
jrowings sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 487 | @takumar | http://www.freecodecamp.com/takumar
Karolis
@Luomint
Oct 16 2015 15:16
bf steamroller
CamperBot
@camperbot
Oct 16 2015 15:16

:fire:Bonfire: Steamroller :link:

function steamroller(arr) {
  // I'm a steamroller, baby
  return arr;
}

steamroller([1, [2], [3, [[4]]]]);

Flatten a nested array. You must account for varying levels of nesting.

more info:  bf details | bf links | hint

Karolis
@Luomint
Oct 16 2015 15:16
hint
CamperBot
@camperbot
Oct 16 2015 15:16
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
AnbuKakashi
@AnbuKakashi
Oct 16 2015 15:17
need some help with header scaling img in bootstrap
anyoen can help?
Adam Sickmiller
@progmacattack
Oct 16 2015 15:37
can anyone help me with this question? I think it is a question of scope. I'm trying to fill a variable with some information from a JSON source. I'm having trouble accessing the variable outside of the success function. See below variable "theLink"
var theLink //this is my variable
function getWikiLink(itemTitle) {
        $.ajax({
          //see variables defined above. only itemTitle is sent
          url: urlBase + requestLinkPrefix + itemTitle + urlSuffix,
          dataType: 'json',
          type: 'POST',
          headers: {
            'Api-User-Agent': 'Wikipedia Search Tool for FreeCodeCamp challenge/0.1; contact progmacattack at GitHub'
          },
          success: function(data) {
            $.each(data.query.pages, function(i, item) {
              theLink = item.fullurl; //the variable is defined here
              console.log (theLink); //defined here
            })
          }
        })
        console.log(theLink); //but here it is undefined
      }
okay now that i asked the question i realize it undefined because the ajax thing happens after the "second" console.log
hmmm
how could i return something from the success: function(data) so that i could use it elsewhere?
that's my new question
Jason Wood
@catapixel
Oct 16 2015 15:42
@hugoender sorry. Had to step away for a meeting. Are you still having issues?
Adam Sickmiller
@progmacattack
Oct 16 2015 15:44
function getWikiLink(itemTitle) {
        $.ajax({
          //see variables defined above. only itemTitle is sent
          url: urlBase + requestLinkPrefix + itemTitle + urlSuffix,
          dataType: 'json',
          type: 'POST',
          headers: {
            'Api-User-Agent': 'Wikipedia Search Tool for FreeCodeCamp challenge/0.1; contact progmacattack at GitHub'
          },
          success: function(data) {
            $.each(data.query.pages, function(i, item) {
              theLink = item.fullurl;
              console.log (theLink);
              return theLink; //where does this go???
            })
          }
        })
      }
Okay, here is my question in a sensible format: given the code above, imagine i want to call getWikiLink and have it return theLink. It doesn't work as written.
Moisés Man
@moigithub
Oct 16 2015 15:48
@progmacattack is undefined on the other example.. cuz async...
Evan
@evanpizzolato
Oct 16 2015 15:49
hey im at Waypoint: Clone an Element Using jQuery and trying to clone #target5 to append to left-well but not working...this is the code im currently running which is not working..
<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("left-well");

  });
</script>
Moisés Man
@moigithub
Oct 16 2015 15:49
ajax.. executes... (send petition to server) and code keep executing
so while.. server is processing.. u console.log(theLink) but since server still working.. its undefined,.. only way to make sure it have data.. is INSIDE the callback
Mamadou Badiane
@diango
Oct 16 2015 15:52

Hi everybody i have a problem with this waypoint Declare javascript objet as variables//Here is a sample Object
var car = {
"wheels":4,
"engines":1,
"seats":5
};

//Now Let's make a similar Object called motorBike
//Give it two wheels, one engine and one seat
var motorBike = {
// Only change code below this line.
"wheels": 2,
"engine":1,
"seat": 1
// Only change code above this line.
};

(function() {return JSON.stringify(motorBike);})();

Adam Sickmiller
@progmacattack
Oct 16 2015 15:52
@moigithub so if i want to request a second set of external data, i guess i would do that within the first callback? what i have is one url gives me a bunch of page titles and then for each of those titles i need to refer to a second url. i think i can work it out
Evan
@evanpizzolato
Oct 16 2015 15:53
lol forgot the #
my bad
Moisés Man
@moigithub
Oct 16 2015 15:54
@progmacattack yes
Blauelf
@Blauelf
Oct 16 2015 15:54
@diango Variable name is still "seats", not "seat", even if it is just one. Same for "engines".
Jason Wood
@catapixel
Oct 16 2015 15:55
Nice catch @Blauelf I was just starting to look at that one for him :wink2:
Mamadou Badiane
@diango
Oct 16 2015 15:55
@Blauelf Thanks
CamperBot
@camperbot
Oct 16 2015 15:55
diango sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 367 | @blauelf | http://www.freecodecamp.com/blauelf
Coira Ellison
@Coira
Oct 16 2015 15:55
@moigithub @progmacattack you're ahead of me so i may be wrong, but what about using jquery promises?
leemurdock
@leemurdock
Oct 16 2015 15:56
@diango maybe it's because you put wheels before engines?
Region2
@Region2
Oct 16 2015 15:56
@evanpizzolato look at (left-well), you're miss the "#"
Adam Sickmiller
@progmacattack
Oct 16 2015 15:56
@Coira i've never used those. but i think you're on to something
@Coira my only experience with jquery is those few waypoints
Jason Wood
@catapixel
Oct 16 2015 15:56
@Region2 no, it's because he put seat instead of seats and did the same for engine vs engines
leemurdock
@leemurdock
Oct 16 2015 15:56
Anyone mind giving me a clue on Waypoint: Make Object Properties Private?
Mamadou Badiane
@diango
Oct 16 2015 15:56
No i miss "s" for engines and seats
Region2
@Region2
Oct 16 2015 15:57
@catapixel I was referring to an earlier question about css, not at diango's question. Sorry if it was answered, all this text just jumped
Coira Ellison
@Coira
Oct 16 2015 15:57
@progmacattack this helped me understand deferred & promises when I was doing the weather app http://odetocode.com/blogs/scott/archive/2012/06/18/geolocation-geocoding-and-jquery-promises.aspx
Jason Wood
@catapixel
Oct 16 2015 15:58
@leedmurdock what's your question about it?
leemurdock
@leemurdock
Oct 16 2015 15:59
@catapixel I'm struggling to figure out which of "myBike.speed", "myBike.addUnit", and "myBike.getSpeed" are already present in the prepopulated code
Adam Sickmiller
@progmacattack
Oct 16 2015 16:00
thanks @Coira!
CamperBot
@camperbot
Oct 16 2015 16:00
progmacattack sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 280 | @coira | http://www.freecodecamp.com/coira
Jason Wood
@catapixel
Oct 16 2015 16:00
@leedmurdock because they are only wanting you to adjust whether they are public or private. This is controlled by the keyword this
CamperBot
@camperbot
Oct 16 2015 16:00
:trollface: troll problems? notify admins here
Coira Ellison
@Coira
Oct 16 2015 16:05
@progmacattack my best guess: instead of getPosition, wrap your ajax in an outer function, set up deferred.resolve in the ajax's success function, and return the deferred from the outer function. you won't need to assign anything to theLink as .when() will automatically pass whatever was returned from the ajax call to .pipe(some_func) or .when(some_func)
phew!
leemurdock
@leemurdock
Oct 16 2015 16:09
thanks @catapixel
CamperBot
@camperbot
Oct 16 2015 16:09
leedmurdock sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 462 | @catapixel | http://www.freecodecamp.com/catapixel
Adam Sickmiller
@progmacattack
Oct 16 2015 16:10
@Coira sounds like exactly what i need thanks
CamperBot
@camperbot
Oct 16 2015 16:10
progmacattack sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:warning: progmacattack already gave coira points
leemurdock
@leemurdock
Oct 16 2015 16:32
If anyone has time, I'm stumped on "Waypoint: Make Instances of Objects with a Constructor Function" as well.
Blauelf
@Blauelf
Oct 16 2015 16:35
So what's your problem?
leemurdock
@leemurdock
Oct 16 2015 16:39
@Blauelf if you're talking to me, I'm unable (yet) to figure out how to create instances of an object using a constructor.
Blauelf
@Blauelf
Oct 16 2015 16:40
That code should be in the supplied code. It's a line like var myCar = new Car();
myCar now holds an instance of Car.
Colleen Heidenreich
@liesel63
Oct 16 2015 16:57
I'm just starting out here & am in the very beginning of the HTML lessons ... I'm supposed to change my h2 style from inline to CSS, and the font should be blue... I'm typing the following but getting the error code " your h2 should be blue." ?? Here's what I typed: <style>h2 {color: blue;}</style>
any advice on what i'm doing wrong??
Jason Wood
@catapixel
Oct 16 2015 16:59
@liesel63 can you paste in the rest of your code? You paste code in line this
wiki format
CamperBot
@camperbot
Oct 16 2015 16:59

: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

Colleen Heidenreich
@liesel63
Oct 16 2015 17:00
<style>h2{color: blue;}</style>
leemurdock
@leemurdock
Oct 16 2015 17:00
@liesel63 it looks like you may have your ";" and "}" backwards
Colleen Heidenreich
@liesel63
Oct 16 2015 17:01
<style>h2{color: blue};</style>
that doesn't work either?
Blauelf
@Blauelf
Oct 16 2015 17:01
@liesel63 Are you sure you don't have an inline style attribute left? Inline is stronger than CSS.
Colleen Heidenreich
@liesel63
Oct 16 2015 17:01
It's a step by step tutorial and i only have what i entered above on the line....
m-farooqui
@m-farooqui
Oct 16 2015 17:02
i am in module 17 and i am trying to reimage the cat photo i have tried many different ways but i am still having the same problem of reimaging can someone help please?
Blauelf
@Blauelf
Oct 16 2015 17:02
What does your h2 element look like?
Jason Wood
@catapixel
Oct 16 2015 17:02
@liesel63 Which waypoint specifically? The ones I'm seeing all say to make the text "red"
Colleen Heidenreich
@liesel63
Oct 16 2015 17:03
Waypoint: Use CSS Selectors to Style Elements
Blauelf
@Blauelf
Oct 16 2015 17:03
Did you follow the steps, I mean, did you remove the style attribute from the h2 element?
Colleen Heidenreich
@liesel63
Oct 16 2015 17:04
yes i did ...
m-farooqui
@m-farooqui
Oct 16 2015 17:04
on waypoint 17 i put down <img src="https://bit.ly/fcc-relaxing-cat"> <style> smaller-image width: 400px; } </style>
Jason Wood
@catapixel
Oct 16 2015 17:04
@liesel63 is your <style>h2{color: blue};</style> at the top of your code? Also, like @Blauelf said, make sure to remove the inline style part style="color: red" from the h2
m-farooqui
@m-farooqui
Oct 16 2015 17:04
but it's not shrinking the photo of the kitten
Colleen Heidenreich
@liesel63
Oct 16 2015 17:05
@catapixel yes, it's at the very top of the code ... there is nothing else there at all
do i need a closing h2 at the end somewhere?
Erik
@erik-cutsor
Oct 16 2015 17:05
So I just figured out Bonfire #3: Factorialize a Number after numerous failed attempts. Once I figured it out I looked up other solutions online for the same Bonfire to compare my solution to others. Can someone explain to me the differences between these two solutions? What I mean by that is, does one solution provide better practices to follow than the other? I want to make sure I'm not just writing correct code, but proper code.
Blauelf
@Blauelf
Oct 16 2015 17:05
@liesel63 Could you paste the whole of your code?
Erik
@erik-cutsor
Oct 16 2015 17:05
function factorialize(num) {
  var total = 1
  for(var i = 1; i <= num; i++) {
    total *= i;
  };
  return total;
};

factorialize(5);


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

factorialize(5);
Jason Wood
@catapixel
Oct 16 2015 17:05
@liesel63 paste all of you code here since it's short. Your code passes for me...I want to make sure you don't have typos
tva10
@tva10
Oct 16 2015 17:05
@m-farooqui do you write class like this? <style> .smaller-image {width: 400px; } </style>
m-farooqui
@m-farooqui
Oct 16 2015 17:06

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

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

h2 {
font-family: Lobster, Monospace;
}

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

<h2 class="red-text">CatPhoto<App</h2>

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

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

oops sorry
<img src="https://bit.ly/fcc-relaxing-cat"><style> smaller-image width: 100px; } </style>
tva10
@tva10
Oct 16 2015 17:06
@m-farooqui so and you need to add this class to your image like this <img class='className' src='....'>
Colleen Heidenreich
@liesel63
Oct 16 2015 17:07
@Blauelf here is my entire code: <style>h2{color: blue;}</style>
@catapixel <style>h2{color: blue;}</style>
Jason Wood
@catapixel
Oct 16 2015 17:07
@liesel63 This is what your code should look like based on what you've said
<style>h2{color: blue};</style>

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Blauelf
@Blauelf
Oct 16 2015 17:07
@liesel63 All of the code. Including the line with the h2.
Jason Wood
@catapixel
Oct 16 2015 17:07
@liesel63 The code I pasted passes all tests...
Colleen Heidenreich
@liesel63
Oct 16 2015 17:08
So the semicolon is after the closed bracket, not inside?
Jason Wood
@catapixel
Oct 16 2015 17:08
@liesel63 no it should be inside but it passes either way
@liesel63 corrected it looks like this:
<style>h2{color: blue;}</style>

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Colleen Heidenreich
@liesel63
Oct 16 2015 17:11
@catapixel BINGO! oh my gosh, i'm retarded: i left out the entire second line .... jeez. thank you!!
CamperBot
@camperbot
Oct 16 2015 17:11
liesel63 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 463 | @catapixel | http://www.freecodecamp.com/catapixel
m-farooqui
@m-farooqui
Oct 16 2015 17:11
still giving the error
Jason Wood
@catapixel
Oct 16 2015 17:11
@liesel63 No problem. Glad you figured it out
Colleen Heidenreich
@liesel63
Oct 16 2015 17:11
thank you @catapixel and @Blauelf !
CamperBot
@camperbot
Oct 16 2015 17:11
liesel63 sends brownie points to @catapixel and @blauelf :sparkles: :thumbsup: :sparkles:
m-farooqui
@m-farooqui
Oct 16 2015 17:11
<img class = 'cat' img src="https://bit.ly/fcc-relaxing-cat">
<style> smaller-image width: 500px; } </style>.
CamperBot
@camperbot
Oct 16 2015 17:11
:warning: liesel63 already gave catapixel points
:star: 371 | @blauelf | http://www.freecodecamp.com/blauelf
m-farooqui
@m-farooqui
Oct 16 2015 17:12
it's not shrining the image
Jason Wood
@catapixel
Oct 16 2015 17:13
@m-farooqui you have an extra img in your image tag line
m-farooqui
@m-farooqui
Oct 16 2015 17:13
@catapixel so what do you type exactly to get the imag eto shrink?
tva10
@tva10
Oct 16 2015 17:14
@m-farooqui
<img class = 'smaller-iamge' src="https://bit.ly/fcc-relaxing-cat">
Blauelf
@Blauelf
Oct 16 2015 17:14
<img class = "smaller-image" src="https://bit.ly/fcc-relaxing-cat">
<style> .smaller-image { width: 500px; } </style>
tva10
@tva10
Oct 16 2015 17:14
@m-farooqui
<style> .smaller-image{ width: 500px; } </style>
Jason Wood
@catapixel
Oct 16 2015 17:14
@m-farooqui Your style needs to have opening and closing curly braces and be named with a dot "." if it's a class. Look at what @Blauelf just wrote ^
tva10
@tva10
Oct 16 2015 17:15
@m-farooqui Check examples in task... there is some examples how to create class, and add that class to your tag/
duan walker
@duanwalker
Oct 16 2015 17:17
good afternoon you guys!
Barna Farkas
@bearbox
Oct 16 2015 17:17
afternoon!
Blauelf
@Blauelf
Oct 16 2015 17:17
If it has no dot, it's the element type. If it has a dot, it is referring to a class, if it has a hash (#) in front, it is referring to an ID. That dot or hash is not part of the classes name or the ID! (I made that mistake when copy&pasting, in Germany that is a so-called "Guttenbug")
m-farooqui
@m-farooqui
Oct 16 2015 17:17
@catapixel Ok that worked forgot about the class
@catapixel thanks
CamperBot
@camperbot
Oct 16 2015 17:17
m-farooqui sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 464 | @catapixel | http://www.freecodecamp.com/catapixel
duan walker
@duanwalker
Oct 16 2015 17:17
anybody here finish the local weather app yet?
could you give this a try and see if it wrks for u?
i could nvr actually get the convert btn to toggle
Jason Wood
@catapixel
Oct 16 2015 17:21
@duanwalker The temp is about right but the location is off about 40 miles or so
Hugo
@hugoender
Oct 16 2015 17:22
@catapixel no i havent figured it out
@catapixel there is something fundamental im missing
duan walker
@duanwalker
Oct 16 2015 17:22
@catapixel are you on your home ntwrk or public? it pulls location data based on your IP
Blauelf
@Blauelf
Oct 16 2015 17:24
Oh, not very precise, must use IP and not browser API. At least the country is right, facebook login alerts are usually far more off.
Jason Wood
@catapixel
Oct 16 2015 17:24
@duanwalker At work
duan walker
@duanwalker
Oct 16 2015 17:24
@catapixel your ntwrk may be based somewhere else then
@catapixel thanks
CamperBot
@camperbot
Oct 16 2015 17:25
duanwalker sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 465 | @catapixel | http://www.freecodecamp.com/catapixel
Blauelf
@Blauelf
Oct 16 2015 17:25
For me, there's an undefined under the wind speed.
Wind:3.1 knots undefined
Becky
@martinbeks
Oct 16 2015 17:29
In this code, what is the property? I'm trying to swap what I'm supposed to do with the example (below), and it's not making any sense to me.
var Car = function() {
   this.wheels = 4;
};
Hugo
@hugoender
Oct 16 2015 17:30
@martinbeks the property of the Object Car is wheels
adding this. in front of it makes it public
let me rephrase that... wheels is a public property of the object Car
Blauelf
@Blauelf
Oct 16 2015 17:31
It's not exactly a property of Car, but a property Car() gives all objects created by new Car().
Hugo
@hugoender
Oct 16 2015 17:31
yes that is more correct... Car is a constructor
that constructs objects with the properties in Car
Becky
@martinbeks
Oct 16 2015 17:32
Okay, maybe you guys can tell me what I'm doing wrong, then. The instructions say The property engines of myCar should be a number, and when In put this code in, it brings up an error. I'm looking at the entire page, and I don't know what I'm doing wrong.
var myCar = new Car();
  this.engines = 1
tva10
@tva10
Oct 16 2015 17:33
@martinbeks Nope, first name of variable
Blauelf
@Blauelf
Oct 16 2015 17:33
You do not want to add engines to this, but to myCar.
tva10
@tva10
Oct 16 2015 17:33
myCar.engines=1
Blauelf
@Blauelf
Oct 16 2015 17:33
this in the constructor is not this in another context.
Becky
@martinbeks
Oct 16 2015 17:33
@tva10 Ah! Okay.
@tva10 @hugoender @Blauelf THank you!
CamperBot
@camperbot
Oct 16 2015 17:34
martinbeks sends brownie points to @tva10 and @hugoender and @blauelf :sparkles: :thumbsup: :sparkles:
:star: 315 | @tva10 | http://www.freecodecamp.com/tva10
:star: 270 | @hugoender | http://www.freecodecamp.com/hugoender
:star: 372 | @blauelf | http://www.freecodecamp.com/blauelf
tva10
@tva10
Oct 16 2015 17:34
@martinbeks or something like this myCar['engines']=1
Hugo
@hugoender
Oct 16 2015 17:34
@martinbeks is a brownie baking machine!
Becky
@martinbeks
Oct 16 2015 17:34
lol
I keep thinking there has to be a way that the instructions can be more clear, but people in this group have been immensely helpful. :)
Hugo
@hugoender
Oct 16 2015 17:36
@martinbeks remember that these waypoints are written by people that are already good programmers
theyve long forgotten what its like to be completley new
;)
Becky
@martinbeks
Oct 16 2015 17:37
@hugoender That explains a lot. :(
Blauelf
@Blauelf
Oct 16 2015 17:38
@duanwalker There is no wind direction for 230°, that's why I get undefined.
Also, people come with a different background. Some might know a bit of Arduino-style C, others VBA, or something completely different, or nothing at all.
So no way there could be a one-size-fits-all tutorial.
duan walker
@duanwalker
Oct 16 2015 17:44
@Blauelf thanks. yeah i was just fishing for some ideas on how to make the btn toggle without actually copy/pasting someone elses project
CamperBot
@camperbot
Oct 16 2015 17:44
duanwalker sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 373 | @blauelf | http://www.freecodecamp.com/blauelf
Matt Anderson
@MDAWebDev
Oct 16 2015 17:45
Do the setup instructions for basejumps no longer work?

It looks like Yeoman has added some more questions and I get an error after this one:

? What would you like to write tests with? Jasmine
You're using the fantastic NgComponent generator.

Initializing yo-rc.json configuration.

events.js:72
throw er; // Unhandled 'error' event
^
TypeError: Object [object Object] has no method 'isAbsolute'
at Generator.processDirectory (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/util.js:110:19)
at Generator.generateProject (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/app/generator.js:399:14)
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:429:16
at processImmediate [as _immediateCallback] (timers.js:354:15)
mdawebdev@basejump:~/workspace $

Ademola Adegbuyi
@ooade
Oct 16 2015 17:52
Hello ya 'all. whenever i push updates to heroku, i get an application error.
Abhisek Pattnaik
@abhisekp
Oct 16 2015 17:53
@marhyorh what error?
Ademola Adegbuyi
@ooade
Oct 16 2015 17:54
https://votepush.herokuapp.com/
An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.
@abhisekp, it worked at first deploy , i made some changes then pushed it back to heroku
@MDAWebDev yeah
Abhisek Pattnaik
@abhisekp
Oct 16 2015 18:00

@marhyorh well,

try again in a few moments

Matt Anderson
@MDAWebDev
Oct 16 2015 18:03
How is everyone else doing the basejumps? Should I just wait until the instructions get rewritten?
Ademola Adegbuyi
@ooade
Oct 16 2015 18:06
@MDAWebDev do u have nvm installed?
Anders Bengtsson
@anders462
Oct 16 2015 18:07
@michaelkebe The elegant solution Michael, I solved by using recursion as well but not that compact. Thanks for sharing!
CamperBot
@camperbot
Oct 16 2015 18:07
anders462 sends brownie points to @michaelkebe :sparkles: :thumbsup: :sparkles:
:star: 228 | @michaelkebe | http://www.freecodecamp.com/michaelkebe
Hans van Riet
@hansinla
Oct 16 2015 18:07
@MDAWebDev No it has been broken for a while
Matt Anderson
@MDAWebDev
Oct 16 2015 18:22
I'm not sure, is npm included in the command rm -rf * && echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc && npm install -g yo grunt grunt-cli generator-angular-fullstack && yo angular-fullstack
or by default in Cloud9
The result of executing my code says myArray.push(..) is not a function
I only added : myArray.push(["dog", 3])
noobstar
@namsir
Oct 16 2015 18:31
wiki format
CamperBot
@camperbot
Oct 16 2015 18:31

: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 16 2015 18:36
@MDAWebDev don't run that command in any important directory!!! :warning:
@MDAWebDev node comes by default either as system install or with nvm in C9
Bill
@kirah1314
Oct 16 2015 18:42
@torsionpeg did you add it right between the comments?
// Only change code below this line.


// Only change code above this line.
@torsionpeg and you're missing a ; at the end also
Hans van Riet
@hansinla
Oct 16 2015 18:49
@torsionpeg If it says that .push() is not a function, chances are that myArray is not really an array. You can check by console.logging typeof.
Fibinse Xavier`
@fx86
Oct 16 2015 18:49
@kirah1314 In the end, it was the semicolon that got me. Thank you, adding it worked!
CamperBot
@camperbot
Oct 16 2015 18:50
torsionpeg sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:star: 287 | @kirah1314 | http://www.freecodecamp.com/kirah1314
Josh Bowe
@joshbowe
Oct 16 2015 19:02
How do I copy my code to this comment box?
Hugo
@hugoender
Oct 16 2015 19:02
help format
CamperBot
@camperbot
Oct 16 2015 19:02

: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

Meghan
@MeghanG
Oct 16 2015 19:04
@samosale I got it to work! Sorry I bailed this morning, I was at work and had to run. Thank you so much for your time and help!
CamperBot
@camperbot
Oct 16 2015 19:04
meghang sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 382 | @samosale | http://www.freecodecamp.com/samosale
Barna Farkas
@bearbox
Oct 16 2015 19:05

This might be a dumb question, but... I'm having this problem in the Truncate a string bonfire:
'''
function truncate(str, num) {
if (str.length<=num) {
return str;
} else {
var sliced = str.slice(0,num-2);
var final = sliced + "...";
return final;
}
}

truncate("Peter Piper picked a peck of pickled peppers", 14) //=> "Peter Piper ..."
// Should be "Peter Piper..."

'''

CamperBot
@camperbot
Oct 16 2015 19:05
:bulb: to format code use backticks! ``` more info
Barna Farkas
@bearbox
Oct 16 2015 19:05
whoops
Fibinse Xavier`
@fx86
Oct 16 2015 19:05
@hansinla Its probably the evaluating code that acted up ?
Barna Farkas
@bearbox
Oct 16 2015 19:06
function truncate(str, num) {
if (str.length<=num) {
return str;
} else {
var sliced = str.slice(0,num-2);
var final = sliced + "...";
return final;
}
}
truncate("Peter Piper picked a peck of pickled peppers", 14) //=> "Peter Piper ..."
// Should be "Peter Piper..."
^ having a problem with that last space, and just realized I have no idea how to easily get rid of it
Hans van Riet
@hansinla
Oct 16 2015 19:09
@torsionpeg You said it’s working now?
Fibinse Xavier`
@fx86
Oct 16 2015 19:11
@hansinla yes it is. With the semicolon at the end like @kirah1314 suggested
Barna Farkas
@bearbox
Oct 16 2015 19:11
@moigithub thanks a lot! Didn't know about trim yet!
CamperBot
@camperbot
Oct 16 2015 19:11
bearbox sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 376 | @moigithub | http://www.freecodecamp.com/moigithub
Hans van Riet
@hansinla
Oct 16 2015 19:11
@torsionpeg Great. Yes, it won’t pass if you don’t follow ECMAscript standard in some cases.
JVCS
@jvagnercs
Oct 16 2015 19:13
'''
CamperBot
@camperbot
Oct 16 2015 19:13
:bulb: to format code use backticks! ``` more info
Fibinse Xavier`
@fx86
Oct 16 2015 19:26
@hansinla Thanks for the tip! Loving this gitter.im
CamperBot
@camperbot
Oct 16 2015 19:26
torsionpeg sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 538 | @hansinla | http://www.freecodecamp.com/hansinla
engstromx
@engstromx
Oct 16 2015 19:36
Hey there. I'm having a problem with "Waypoint: Target the same element with multiple jQuery Selectors"
Use the $("button") selector.
Use the $(".btn") selector.
Use the $("#target1") selector.
Only add one class with each of your three selectors.
Your #target1 element should have the classes animated‚ shake and btn-primary.
Only use jQuery to add these classes to the element.
That's the output after running the test and I've got ticks for the 1st three
Blauelf
@Blauelf
Oct 16 2015 19:37
We know that one. We should have a FAQ for it :D
engstromx
@engstromx
Oct 16 2015 19:37
,,,
<script>
$(document).ready(function() {
$("button").addclass("animated");
$(".btn").addclass("shake");
$("#target1").addclass("btn-primary");
});
</script>
That's what I've added.
'''
CamperBot
@camperbot
Oct 16 2015 19:38
:bulb: to format code use backticks! ``` more info
Blauelf
@Blauelf
Oct 16 2015 19:38
Backticks are those ```
engstromx
@engstromx
Oct 16 2015 19:38
'''<script>
$(document).ready(function() {
$("button").addclass("animated");
$(".btn").addclass("shake");
$("#target1").addclass("btn-primary");
});
</script>'''
CamperBot
@camperbot
Oct 16 2015 19:38
:bulb: to format code use backticks! ``` more info
engstromx
@engstromx
Oct 16 2015 19:39
d'oh
<script>
  $(document).ready(function() {
$("button").addclass("animated");
$(".btn").addclass("shake");  
$("#target1").addclass("btn-primary");
  });
</script>
Finally! :-)
Blauelf
@Blauelf
Oct 16 2015 19:40
Mind the Caps.
It's addClass() (camelCase)
Abhisek Pattnaik
@abhisekp
Oct 16 2015 19:41
@engstromx JS is very case-sensitive. Don't touch it! :P
engstromx
@engstromx
Oct 16 2015 19:42
Crikey! Thanks ("Shame!" /rings bell)
CamperBot
@camperbot
Oct 16 2015 19:42
if you want to thank someone, put an @ before their name!
engstromx
@engstromx
Oct 16 2015 19:43
I didn't appreciate the caps aspect.
Thanks @Blauelf and @abhisekp
CamperBot
@camperbot
Oct 16 2015 19:43
engstromx sends brownie points to @blauelf and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 376 | @blauelf | http://www.freecodecamp.com/blauelf
:star: 600 | @abhisekp | http://www.freecodecamp.com/abhisekp
Abhisek Pattnaik
@abhisekp
Oct 16 2015 19:44
@engstromx well, caps help you distinguish words and read out the vars when you're looking at 600+ lines of JS codes!
Luis Felipe López G.
@luishendrix92
Oct 16 2015 19:48
JS and other languages aren't exactly SQL where you can SELECT fRoM campers WherE language = 'Javascript';
So Case Sensitive is very important, also having in mind "a" !== "A", you'd have to either use regExp or checking uppercase
bruglesco
@bruglesco
Oct 16 2015 20:11
Is anyone here proficient with css3 flexbox?
Tyler Moeller
@TylerMoeller
Oct 16 2015 20:16
Is there a site like imgur.com for hosting fonts? I've been putting them on one of my Digital Ocean VPSs, but would rather use a public service.
loftyrama
@loftyrama
Oct 16 2015 20:19
Hello People. Got a question to a JavaScript function which returns a random number between a min and a max
Abhisek Pattnaik
@abhisekp
Oct 16 2015 20:20
find random
loftyrama
@loftyrama
Oct 16 2015 20:20
anyone who might help me?
Number 2 from the bot is actually the one I can't wrap my head around
this one: Math.floor(Math.random() * (max - min + 1)) + min
Hans van Riet
@hansinla
Oct 16 2015 20:22
@loftyrama Math.random generates a float between 0 (including) and 1 (excluding). Math.floor rounds down. The other variables are to create the range that you’re looking for.
loftyrama
@loftyrama
Oct 16 2015 20:23
@hansinla yeah! I just don't understand why the ...(max-min+1))+min part does what it does
I mean it works ok, I'd just really like to understand it why :-/
Hans van Riet
@hansinla
Oct 16 2015 20:25
@loftyrama Well, if you wouldn’t have that, you would always round down to 0 (because of Math.floor). So if your minimum desired is 1, you need to add one to your result. If the maximum desired is 50, you need to multiple the result of the Math.random function by 50.
loftyrama
@loftyrama
Oct 16 2015 20:28
@hansinla makes sense I guess
I guess what irritates me is that you have Math.random() times (max-min+1))+min is, because Math.random() could be 0.22 and 0.11 or 0.99
but that's what the function is supposed to do
oh man, logic is hard. Guess it will take a while to sink in. Thanks again @hansinla
CamperBot
@camperbot
Oct 16 2015 20:29
loftyrama sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 539 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Oct 16 2015 20:33
@loftyrama no problem. Other programming languages make it a little easier and let you specify the range of random numbers that you’re looking for. For example Python has: random.randrange(start, stop[, step])
YI JIANG
@meet999
Oct 16 2015 20:41

function welcomeToBooleans() {

// Only change code below this line.

return false;

// Only change code above this line.
}

welcomeToBooleans() {

return true
;
}

what is it?
how to write
Michael Kebe
@michaelkebe
Oct 16 2015 20:41
help format @meet999
CamperBot
@camperbot
Oct 16 2015 20:41
no wiki entry for: format @meet999
:pencil: click here to create one now!after creating your page type update to reload it here
Michael Kebe
@michaelkebe
Oct 16 2015 20:42
help format
help format
CamperBot
@camperbot
Oct 16 2015 20:42

: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

B
@bealearnscode
Oct 16 2015 20:51
I'm having trouble with the conditional logic waypoint. I think I understand the theory, but cannot get my code right
if (flip = 0) {
    return "heads";
  } else {
    return "tails";
  }
Tyler Moeller
@TylerMoeller
Oct 16 2015 20:53
@bealearnscode You may want to read up a little more on Javascript Operators. Specifically, comparison operators: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Identity
Michael Kebe
@michaelkebe
Oct 16 2015 20:56
@bealearnscode A single equals sign is an assignment. For comparision use three: ===
Tyler Moeller
@TylerMoeller
Oct 16 2015 20:56
Or you can just give the answer ;)
Michael Kebe
@michaelkebe
Oct 16 2015 20:57
:P
B
@bealearnscode
Oct 16 2015 20:57
@TylerMoeller @michaelkebe I don't want to be given the answer. I've learned about JS operators before and initially tried ===, but it didn't work.
Matt D
@dephora
Oct 16 2015 20:58
blob
Hello. So I'm having major issues with Bonfire : Seek and Destroy. I'm having difficulties figuring out how to use the arguments as filters
Michael Kebe
@michaelkebe
Oct 16 2015 20:59
@bealearnscode What didn't work? The code you pasted will always return "tails"
Ariel
@ArielLeslie
Oct 16 2015 20:59
@bealearnscode = is an assignment. It isn't checking anything
Matt D
@dephora
Oct 16 2015 21:00
I've used slice to store them as their own array but can't figure out how to use that array (more than once) . For example I can filter it with args1 and args[2] but using a loop with args[i] - I always get wacky results
YI JIANG
@meet999
Oct 16 2015 21:01
hi help

var firstNameLength = 0;
var lastNameLength = 8;
var firstName = "Ada";

firstNameLength = firstName.length;

var lastName = "Lovelace";

// Only change code below this line.

lastNameLength = lastName;
var lastNameLength = lastname.length;

Ariel
@ArielLeslie
Oct 16 2015 21:01
explain format
CamperBot
@camperbot
Oct 16 2015 21:01

: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

Ariel
@ArielLeslie
Oct 16 2015 21:01
@meet999 :point_up_2:
@Dephora Not much advice we can give without seeing your code
YI JIANG
@meet999
Oct 16 2015 21:03
QQ截图20151016140219.png
Singh Harpal
@harry9656
Oct 16 2015 21:04
which algorithm should i use for my tic-tac-toe computer player?
YI JIANG
@meet999
Oct 16 2015 21:05
how to write below?
Matt D
@dephora
Oct 16 2015 21:06
Nevermind on my request, I didn't know there was a hint system. My failure was not using indexOf()
Ariel
@ArielLeslie
Oct 16 2015 21:07
explain format
CamperBot
@camperbot
Oct 16 2015 21:07

: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

Ariel
@ArielLeslie
Oct 16 2015 21:08
@meet999 :point_up_2:
noobstar
@namsir
Oct 16 2015 21:08
codepen died again
Johnathan Brown
@Legend28469
Oct 16 2015 21:10
r.i.p codepen
Ariel
@ArielLeslie
Oct 16 2015 21:10
@namsir When it comes back up, I would copy your code to a repo ASAP.
noobstar
@namsir
Oct 16 2015 21:10
moving it to local project.
YI JIANG
@meet999
Oct 16 2015 21:10
HELP ME BB
CamperBot
@camperbot
Oct 16 2015 21:10
no wiki entry for: me bb
:pencil: click here to create one now!after creating your page type update to reload it here
Ariel
@ArielLeslie
Oct 16 2015 21:13
@meet999 You haven't pasted your code in here or asked any specific questions.
i just paste the code
Ariel
@ArielLeslie
Oct 16 2015 21:18
@meet999 You just overwrote the help page of the wiki
Brian K
@BKtheDAD
Oct 16 2015 21:21
help chunky monkey
CamperBot
@camperbot
Oct 16 2015 21:21

:point_right: bonfire chunky monkey [wiki]

Explanation

Our goal for this bonfire is to split arr (first argument) into smaller chunks of arrays with the length provided by size (second argument). There are 4 green checks (objectives) our code needs to pass in order to complete this bonfire:

  1. (['a', 'b', 'c', 'd'], 2) is expected to be [['a', 'b'], ['c', 'd']]
  2. ([0, 1, 2, 3, 4, 5], 3) is expected to be [[0, 1, 2], [3, 4, 5]]
  3. ([0, 1, 2, 3, 4, 5], 2) is expected to be [[0, 1], [2, 3], [4, 5]]
  4. ([0, 1, 2, 3, 4, 5], 4) is expected to be [[0, 1, 2, 3], [4, 5]]

Click More information under the bonfire title and read the helpful links if you haven't yet.

:pencil: read more about bonfire chunky monkey on the FCC Wiki

what should i write?
Ariel
@ArielLeslie
Oct 16 2015 21:25
@meet999 STOP EDITING THE WIKI
Freddy
@Lemony-Andrew
Oct 16 2015 21:27
@ArielLeslie they deleted the page, I remade it.
Ariel
@ArielLeslie
Oct 16 2015 21:27
@Lemony-Andrew I deleted it. It supposed to be deleted
if you look at the history, you can see @meet999 created the page
Freddy
@Lemony-Andrew
Oct 16 2015 21:27
@ArielLeslie Oh you're right I see.
opencircles
@opencircles
Oct 16 2015 21:28

function palindrome(str) {

str_2 = "";
str = str.toLowerCase();
str = str.replace(" ", "");
str = str.replace(/[.,-\/#!$%\^&*;:{}=-_`~()]/g,"");
str_1 = str;

var array = [];
array = str.split("");
array = array.reverse();
//str_2 = array.join("");

if (array.join("") == str_1) {

  return true;

}

}

palindrome("race car");

Ariel
@ArielLeslie
Oct 16 2015 21:28
explain format
CamperBot
@camperbot
Oct 16 2015 21:29

: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

opencircles
@opencircles
Oct 16 2015 21:29
I don't know why this palindrome code is wrong
please help
Ariel
@ArielLeslie
Oct 16 2015 21:29
@opencircles :point_up_2:
opencircles
@opencircles
Oct 16 2015 21:29
Thanks Ariel
CamperBot
@camperbot
Oct 16 2015 21:29
if you want to thank someone, put an @ before their name!
opencircles
@opencircles
Oct 16 2015 21:29

''' function palindrome(str) {

str_2 = "";
str = str.toLowerCase();
str = str.replace(" ", "");
str = str.replace(/[.,-\/#!$%\^&*;:{}=-_`~()]/g,"");
str_1 = str;

var array = [];
array = str.split("");
array = array.reverse();
//str_2 = array.join("");

if (array.join("") == str_1) {

  return true;

}

}

palindrome("race car");
'''

CamperBot