These are chat archives for FreeCodeCamp/Help

19th
Sep 2015
DTing
@dting
Sep 19 2015 00:01
@Legalyze comment out a line? Usually you wouldnt leave commented out code in a file. You might temporarily do it for debugging but it is usually bad practice to just leave commented lines of code in your codebase
@BalachandraTejas no, not really
wiki brownie
CamperBot
@camperbot
Sep 19 2015 00:03

:point_right: brownie points [wiki]

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

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

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

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

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

Konrad Kale
@MrKale38
Sep 19 2015 00:17
@dting , .delete() or .remove() why use this rather than just deleting the code?\
Andrés Pérez
@Oxyrus
Sep 19 2015 00:33
Could someone explain me what's wrong with this? $(".target:odd").addClass("animated shake");
It doesn't complete:
All the target elements that computer considers even should shake.
You should use the :even function to modify these elements.
But I don't understand
Nevermind, figured out what was wrong
vaggelis-composer
@vaggelis-composer
Sep 19 2015 00:50
Hi all, I'm currently creating my portfolio page and I'm currently looking for some good background images.
I was wondering if any of you know a website with good backgrounds
Brandon Stapleton
@waterlooSunset
Sep 19 2015 01:00
@vaggelis-composer stocksnap.io is cool
unsplash.com is also good
Rich Churcher
@richchurcher
Sep 19 2015 01:08
@vaggelis-composer also creative commons search on flickr often has some good stuff
Ray
@LayfonBushin
Sep 19 2015 01:12
hey room
Curious If I could get a bit of help with the tutorial on css image resizing I cant seem to figure it out
Rich Churcher
@richchurcher
Sep 19 2015 01:14
sure @LayfonBushin
Ray
@LayfonBushin
Sep 19 2015 01:15
cool yea So I guess I'm suppose to resize the given image of a cat...( of course).. to 100 pixels..
says to make an class for it.. I tried putting it into a <style> class with the image but still no goo
Rich Churcher
@richchurcher
Sep 19 2015 01:18
You'd probably need to show a bit of code so we can see
vaggelis-composer
@vaggelis-composer
Sep 19 2015 01:18
thanks @waterlooSunset
CamperBot
@camperbot
Sep 19 2015 01:18
vaggelis-composer sends brownie points to @waterloosunset :sparkles: :thumbsup: :sparkles:
:star: 190 | @waterloosunset | http://www.freecodecamp.com/waterloosunset
Rich Churcher
@richchurcher
Sep 19 2015 01:18
help format
CamperBot
@camperbot
Sep 19 2015 01:18

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

vaggelis-composer
@vaggelis-composer
Sep 19 2015 01:18
thanks @richchurcher
CamperBot
@camperbot
Sep 19 2015 01:18
vaggelis-composer sends brownie points to @richchurcher :sparkles: :thumbsup: :sparkles:
:star: 304 | @richchurcher | http://www.freecodecamp.com/richchurcher
Ray
@LayfonBushin
Sep 19 2015 01:18

<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;
}
img { width: 100px;}
</style>

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

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

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

that's what I have so far
got the image down to 100 pixel..
Rich Churcher
@richchurcher
Sep 19 2015 01:19
ok, so what are you trying to do now?
Ray
@LayfonBushin
Sep 19 2015 01:20
well this tutorial wants me to make a specific class using . smaller-image
I think its a bit silly since I was able to get the image resized by putting the img code within the original <style> code
Rich Churcher
@richchurcher
Sep 19 2015 01:21
Cool. So do what you did for .red-text, only give it another name
Ray
@LayfonBushin
Sep 19 2015 01:21
Ah.. iight
Rich Churcher
@richchurcher
Sep 19 2015 01:21
Yes, but what happens if you have more than one image and you don't want both of them to change size? ;)
In CSS, being specific is good... lets you have more control over each individual element
Ray
@LayfonBushin
Sep 19 2015 01:23
I see... So since I'm pulling the image from the web I was tryn to set the <style> around the image reference but that isn't working quite right..
Rich Churcher
@richchurcher
Sep 19 2015 01:24
aha. Nope, <style></style> just sets aside an area for you to put style definitions into, like your .red-text above
You don't surround elements like <img> with it
Ray
@LayfonBushin
Sep 19 2015 01:24
OOOK
let me try something
Rich Churcher
@richchurcher
Sep 19 2015 01:24
Try giving your <img> a class
Similar to the way you gave your <p> elements a class
schnedler
@schnedler
Sep 19 2015 01:25

Okay, so after Googling I learned that NaN === NaN returns false, which is why this code returns NaN in my finalArr. But how do I get it to not push NaN to my finalArr then :worried: ?
‘’'
function bouncer(arr) {
var falsy = [false, null, 0, "", undefined, NaN];
var finalArr = [];

// Don't show a false ID to this bouncer.
for (i=0; i<arr.length; i++) {
console.log(i);
if (falsy.indexOf(arr[i]) == -1) {
finalArr.push(arr[i]);
//console.log(i);
}
}
console.log(finalArr);
return finalArr;
}

bouncer([7, "ate", "", false, 9, NaN], "”);
‘''

´´´
function bouncer(arr) {
var falsy = [false, null, 0, "", undefined, NaN];
var finalArr = [];

// Don't show a false ID to this bouncer.
for (i=0; i<arr.length; i++) {
console.log(i);
if (falsy.indexOf(arr[i]) == -1) {
finalArr.push(arr[i]);
//console.log(i);
}
}
console.log(finalArr);
return finalArr;
}

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

Sorry for that code mess!
function bouncer(arr) {
    var falsy = [false, null, 0, "", undefined, NaN];
    var finalArr = [];

  // Don't show a false ID to this bouncer.
    for (i=0; i<arr.length; i++) {
        console.log(i);
        if (falsy.indexOf(arr[i]) == -1) {
            finalArr.push(arr[i]);
            //console.log(i);
        }
    }
  console.log(finalArr);
    return finalArr;
}

bouncer([7, "ate", "", false, 9, NaN], "”);
there :)
murphytimothyl
@murphytimothyl
Sep 19 2015 01:26
any chance i could get some help on this challenge. when i call the function for pairwise([1,1,1],2); I am running into an error
function pairwise( arr, arg) {
  var i = 0;
  var c = 0;
  var values = [];

  while(i < arr.length) {
      a = arr[i];
      var b = arr[i+1];
      for(j = (i+1); j < arr.length; j++){

        if((a + b) === arg){
        if(values.indexOf(i) < 0) values.push(i);
        if(values.indexOf(j) < 0) values.push(j);

        }
        b = arr[j+1];
        if(b === undefined) {
        break;}


      }
      i++;
  }
  arg = values.reduce(function(a,b) {
  return a+b;}); 
  return arg;


}
pairwise([1,4,2,3,0,5], 7);
the results say it fail because the value returned is 3 but i think that should be right
Rich Churcher
@richchurcher
Sep 19 2015 01:27
@schnedler you don't seem to ever check the argument arr in your function
my bad, you do...
schnedler
@schnedler
Sep 19 2015 01:29
yeah, in this line:
if (falsy.indexOf(arr[i]) == -1) {
Rich Churcher
@richchurcher
Sep 19 2015 01:29
what would happen if you simply asked JavaScript to determine true or false? if (arr[i]) { ...
Ray
@LayfonBushin
Sep 19 2015 01:29
@richchurcher thanks
CamperBot
@camperbot
Sep 19 2015 01:29
layfonbushin sends brownie points to @richchurcher :sparkles: :thumbsup: :sparkles:
:star: 305 | @richchurcher | http://www.freecodecamp.com/richchurcher
Rich Churcher
@richchurcher
Sep 19 2015 01:29
yw
schnedler
@schnedler
Sep 19 2015 01:30
But I have to check it against the falsy array, to see if it is a falsy value
or….yeah okay...
Rich Churcher
@richchurcher
Sep 19 2015 01:31
Why? If it evaluates to false, JS won't run the code block :)
schnedler
@schnedler
Sep 19 2015 01:31
hmm, wil try that. Forgot that!
Rich Churcher
@richchurcher
Sep 19 2015 01:31
This way is less error-prone, because you let JS do all the heavy lifting and you don't have to explicitly state all the possible 'false' values
schnedler
@schnedler
Sep 19 2015 01:32
So simple! Thank you richhurcher
CamperBot
@camperbot
Sep 19 2015 01:32
if you want to thank someone, put an @ before their name!
schnedler
@schnedler
Sep 19 2015 01:32
Thank you @richchurcher
CamperBot
@camperbot
Sep 19 2015 01:32
schnedler sends brownie points to @richchurcher :sparkles: :thumbsup: :sparkles:
:star: 306 | @richchurcher | http://www.freecodecamp.com/richchurcher
Rich Churcher
@richchurcher
Sep 19 2015 01:32
yw
@murphytimothyl I thought pairwise was quite a confusingly-worded challenge :)
let's see here
I think for [1, 1, 1], 2 the solution is 1
because it's array indices 0 + 1
and you're supposed to return the smallest result
Dwight Norris
@legend911
Sep 19 2015 01:36
i need help find out how to parse data from my http request during the "local weather app"
Kameron Robinson
@RobinsonKameron
Sep 19 2015 01:36
such wow
Im lrnin javascript
such excite
Dwight Norris
@legend911
Sep 19 2015 01:37
I thought I was receiving JSON, but stuff i find online not working
murphytimothyl
@murphytimothyl
Sep 19 2015 01:38
@richchurcher but that does not make since because the indices of 0 + 1 and indices 1 + 2 both add up to 2 so the result would be the addition of indices 0, 1, and 2.
Dwight Norris
@legend911
Sep 19 2015 01:38
the line "document.getElementById("output").innerHTML=xmlhttp.responseText;" prints the server request on the webpage
murphytimothyl
@murphytimothyl
Sep 19 2015 01:39
@legend911 which api are you using to pull in the weather data?
Hans van Riet
@hansinla
Sep 19 2015 01:39
@legend911 You get the data, you just have to parse the response and make it look pretty on the DOM
Dwight Norris
@legend911
Sep 19 2015 01:39
openweathermap.org
the parsing i tried wasn't working so i erased it
var json = xmlhttp.responseText,
obj = JSON && JSON.parse(json) || $.parseJSON(json);
Rich Churcher
@richchurcher
Sep 19 2015 01:40
@murphytimothyl I think you might be misunderstanding the meaning of 'index'/'indicies'
it's not the value of the array element they're talking about, rather its index (what position it's in)
Dwight Norris
@legend911
Sep 19 2015 01:41
I'll look around more
murphytimothyl
@murphytimothyl
Sep 19 2015 01:42
@richchurcher i got that. The first index is 0, the second is 1, and the third is 2. adding the indices would be 3
Rich Churcher
@richchurcher
Sep 19 2015 01:42
so in [1, 1, 1], '0' is the first index, '1' is the second... 0 + 1 = 1
murphytimothyl
@murphytimothyl
Sep 19 2015 01:43
@legend911 are you including your api key when you make the request?
Rich Churcher
@richchurcher
Sep 19 2015 01:43
you only add the indices of the numbers that can be added together to make up the second argument
Hans van Riet
@hansinla
Sep 19 2015 01:43

@legend911 You get this object back

[Log] {"coord":{"lon":-118.13,"lat":34.19},"weather":[{"id":800,"main":"Clear","description":"sky is clear","icon":"01n"}],"base":"cmc stations","main":{"temp":301.37,"pressure":1008,"humidity":40,"temp_min":295.37,"temp_max":306.15},"wind":{"speed":4.6,"deg":200},"clouds":{"all":1},"dt":1442626060,"sys":{"type":1,"id":383,"message":0.0063,"country":"US","sunrise":1442669906,"sunset":1442714016},"id":5323525,"name":"Altadena","cod":200} (index.html, line 74)

so you take take the properties of the object and display them

Rich Churcher
@richchurcher
Sep 19 2015 01:43
@murphytimothyl although I agree, the wording is very confusing
so what you want is to answer the question, "can any two of these numbers be added together to equal the second argument"?
"and if so, what's the sum of their indices?"
(and if there's more than one right answer, pick the lowest)
Dwight Norris
@legend911
Sep 19 2015 01:44
yes thats what i get
Rich Churcher
@richchurcher
Sep 19 2015 01:45
and then because you can't re-use any of the '1's in that array
only one pair qualifies
Dwight Norris
@legend911
Sep 19 2015 01:45
its the "taking the properties" that is confusing me right now for some reason @hansinla
murphytimothyl
@murphytimothyl
Sep 19 2015 01:45
@richchurcher humm! let me go back to the drawing board since I got the correct response in the first 2 iterations ,but perhaps by the wrong methodology. I interpreted not reusing it as not reusing the indices
Dwight Norris
@legend911
Sep 19 2015 01:46
actually wait let me try something
Rich Churcher
@richchurcher
Sep 19 2015 01:46
well, you won't re-use the indices. But honestly, I think it's a weird question and I'm not any too happy with the solution I came up with either ;)
Hans van Riet
@hansinla
Sep 19 2015 01:47
@legend911 so if you call this Object ‘currWeather’, then you access the weather prop as currWeather.weather You want to parse further, say the description will be currWeather.weather.description etc.
Dwight Norris
@legend911
Sep 19 2015 01:47
ah object notation... javascript object notation
jSON
Samantha Maturen
@slmaturen
Sep 19 2015 01:48
:p
murphytimothyl
@murphytimothyl
Sep 19 2015 01:52
@legend911 you are getting data back, you just need to clean it up and post it in a manner that is user friendly. The way you currently have it, it is parsing everything you are pulling back into the element on the page. Try drilling further down into the specific elements that you want to display on the page. Try specifying only the specific items you want to display
Dwight Norris
@legend911
Sep 19 2015 01:53
thanks for the help @murphytimothyl and @hansinla
CamperBot
@camperbot
Sep 19 2015 01:53
legend911 sends brownie points to @murphytimothyl and @hansinla :sparkles: :thumbsup: :sparkles:
:star: 269 | @murphytimothyl | http://www.freecodecamp.com/murphytimothyl
:star: 373 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Sep 19 2015 02:01
@legend911 you got it
Dwight Norris
@legend911
Sep 19 2015 02:02
still working
document.getElementById("output").innerHTML=xmlhttp.responseText.weather.main;
Dwight Norris
@legend911
Sep 19 2015 02:07
any reason why that does nothing?
Liz Rezes
@queenlizo
Sep 19 2015 02:08
Hey, all. I had this zipline working, but now it's not at all. Do any of you gurus see anything wrong with my code? Thanks! http://codepen.io/queenlizo/pen/Mawpyx
CamperBot
@camperbot
Sep 19 2015 02:08
if you want to thank someone, put an @ before their name!
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:11
@legend911 I think you need to use JSON.parse(xmlhttp.response) in order to turn the response object text into an actual object. then use dot notation on that.
Richard Lee
@kaashin
Sep 19 2015 02:12

can anyone help me, I'm at this bonfire: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy, and my code should pass all the tests cause the returned values is exactly what it said it should be. but none of them are passing i'm confused.

function destroyer(arr) {
// Remove all the values
returnArray = [];

function filterByValue (value, index) {
for (var i=0;i<this.length;i++){
if (value === this[i]) {
return false;
}
}
return true;
}
var checkArray = [];

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

returnArray = arr.filter(filterByValue, checkArray);

return returnArray;
}

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

CamperBot
@camperbot
Sep 19 2015 02:12
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
DTing
@dting
Sep 19 2015 02:14
This message was deleted
Dwight Norris
@legend911
Sep 19 2015 02:16
woohoo i got the temperature in Kelvin thanks @hansinla
CamperBot
@camperbot
Sep 19 2015 02:16
legend911 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:warning: legend911 already gave hansinla points
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:16
@queenlizo did you look at the console? You're getting an error on your parsed_json object when for some of your calls. I don't think the api is returning what you think it's returning right now.
Dwight Norris
@legend911
Sep 19 2015 02:16
i mean thanks @MattYamamoto
CamperBot
@camperbot
Sep 19 2015 02:16
legend911 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 333 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:17
haha...no problem.
DTing
@dting
Sep 19 2015 02:17
@kaashin you have an extra -1 in your for loop
Liz Rezes
@queenlizo
Sep 19 2015 02:17
@MattYamamoto I did. The problem is that I didn't change those parts of the code. They used to work before I added the if/else if statement
DTing
@dting
Sep 19 2015 02:17
  for (var i=1;i<arguments.length-1;i++) { //  should be arguments.length
    checkArray.push(arguments[i]);
  }// ; not needed
Richard Lee
@kaashin
Sep 19 2015 02:18
Ooops forgot to take that-1 out. Thanks @dting!
CamperBot
@camperbot
Sep 19 2015 02:18
kaashin sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1210 | @dting | http://www.freecodecamp.com/dting
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:19
@queenlizo hmm... well I threw in a console.log(parsed_json) at the top of your success function to see what was there, and I don't see a current_observation property. I'm not familiar with the weather underground's api, but I think you need to make another call to their api to get the acutal weather info.
Liz Rezes
@queenlizo
Sep 19 2015 02:20
@MattYamamoto the call is in the URL: http://api.wunderground.com/api/cdc6ab057308c2a7/geolookup/q/autoip.json
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:22
@queenlizo I can see that's the URL you're making your request to, but that doesn't seem to return any actual weather info.
Liz Rezes
@queenlizo
Sep 19 2015 02:23
@MattYamamoto so weird. It used to
@MattYamamoto I think that i'm going to leave it for tonight.
Thanks @MattYamamoto
CamperBot
@camperbot
Sep 19 2015 02:24
queenlizo sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 334 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:24
@queenlizo yeah, I dunno. Like I said, I'm not familiar with that API. I thnk you're just going to have to take that geo lookup info and use that to make another call
CamperBot
@camperbot
Sep 19 2015 02:24
mattyamamoto sends brownie points to @queenlizo :sparkles: :thumbsup: :sparkles:
:star: 249 | @queenlizo | http://www.freecodecamp.com/queenlizo
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:25
well good look.
whoa... that was weird
oh, I typed thnk... strange
CamperBot
@camperbot
Sep 19 2015 02:25
if you want to thank someone, put an @ before their name!
Liz Rezes
@queenlizo
Sep 19 2015 02:25
Huh. What happend there?
Andrés Del Carpio
@AndrsDC
Sep 19 2015 02:45
Waypoint: Make Instances of Objects with a Constructor Function
i'm stuck
var Car = function() {
   this.wheels = 4;
};

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

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


// Only change code above this line.
could anyone help me?
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:47
@adc39 you need to add the property 'engines' to your myCar object
you can add/set properties with dot notation
Andrés Del Carpio
@AndrsDC
Sep 19 2015 02:49
myCar = function() {
  this.engines = 1;
};
doesn't work and i've tried various times with different code
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:51
@adc39 even simplier
var obj = {}

obj.name = 'Fred' //creates the name property on obj and sets it to 'Fred'
cryptobird
@cryptobird
Sep 19 2015 02:51
I'm having trouble with the Slot Machine
This is the code that I have
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
$($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '"/>');
$($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '"/>');
$($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
    $($('.slot')[1]).html('<img src = "' + images[slotTwo-1] + '"/>');
    $($('.slot')[2]).html('<img src = "' + images[slotThree-1] + '"/>');
And that's the code it's asking for
Andrés Del Carpio
@AndrsDC
Sep 19 2015 02:53
@MattYamamoto yeah that worked
@MattYamamoto myCar.engines = 1;
to be more specific
@MattYamamoto thanks a lot
CamperBot
@camperbot
Sep 19 2015 02:54
adc39 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 335 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:54
sure thing
cryptobird
@cryptobird
Sep 19 2015 02:55
anybody have any idea why my code isn't passing
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:56
@ParrotCaws try refreshing the page maybe
cryptobird
@cryptobird
Sep 19 2015 02:57
figured it out
i put slashes
Matt Yamamoto
@MattYamamoto
Sep 19 2015 02:59
ah..good eye
Kevin Diem
@kgdiem
Sep 19 2015 03:07

for some reason this is returning 1, can anyone tell me why? ``` function where(arr, num) {
// Find my place in this sorted array.
arr.push(num);
arr = arr.sort();
ans = arr.indexOf(num);

return ans;
}
where([5, 3, 20, 3], 3) ```

for some reason this is returning 1, can anyone tell me why?
``` function where(arr, num) {
// Find my place in this sorted array.
arr.push(num);
arr = arr.sort();
ans = arr.indexOf(num);

return ans;
}
where([5, 3, 20, 3], 3) ```

Sorry not sure why it isn't formatting?
for some reason this is returning 1, can anyone tell me why?
function where(arr, num) {
  // Find my place in this sorted array.
  arr.push(num);
  arr = arr.sort();
  ans = arr.indexOf(num);

  return ans;
}
where([5, 3, 20, 3], 3)
Hans van Riet
@hansinla
Sep 19 2015 03:13
@kgdiem ‘cause the index of 3 in that array is 1. arrays start at 0
John Oksasoglu
@oksas
Sep 19 2015 03:21
I'm using the twitch api as I start my zipline for that and I'm running into something weird... if on document load I make an ajax request with jquery to the twitch api, it returns data fine. but if, after the page loads, I try to make another ajax call using the contents of a form on my page, I get blocked because of CORS. anyone know what causes this? some sort of security thing having to do with forms? I've reviewed the code a few times and based on both it and the console's error message, there's nothing wrong with my syntax or anything like that, I think
Matt Yamamoto
@MattYamamoto
Sep 19 2015 03:22
@oksas do you have link to your code?
Hans van Riet
@hansinla
Sep 19 2015 03:22
@kgdiem Your sornt routine works now on unicode, not what you’re expecting. If you want to sort numerically, you’ll have to do something like:
arr = arr.sort(function(a,b){
     if (a <  b) {
         return -1;
     } else if (a > b) {
         return 1;
     } else return 0;
 });
John Oksasoglu
@oksas
Sep 19 2015 03:23
@MattYamamoto why yes I do! http://codepen.io/oksas/pen/MaydKz
Kevin Diem
@kgdiem
Sep 19 2015 03:24
@hansinla thx for the callback; why is it that if you call array.sort() 10, 20, etc are < 1,2,3,4?
CamperBot
@camperbot
Sep 19 2015 03:24
kgdiem sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 374 | @hansinla | http://www.freecodecamp.com/hansinla
Kevin Diem
@kgdiem
Sep 19 2015 03:24
it is pretty annoying
Hans van Riet
@hansinla
Sep 19 2015 03:26
@kgdiem This behavior is well documented. The shortcut to what you want is:
 arr = arr.sort(function(a,b){
     return a - b;
 });
Jesse
@jctm30
Sep 19 2015 03:27
hi guys, can anyone give insight on what a "!" would mean next to a declared variable?
e.g. !variable
Kevin Diem
@kgdiem
Sep 19 2015 03:28
@hansinla I'll try to remember that in the future, have seen a callback like that before for array.sort()
Hans van Riet
@hansinla
Sep 19 2015 03:29
@jctm30 it means not. if variable = true then !variable is not true i.e. false
fald
@fald
Sep 19 2015 03:36
I have a feeling I'm going to kick myself, but I can't find out why the following program is telling me there's an unexpected token (the closing '}') on line 9:
var port = process.argv[2];
var file = process.argv[3];
var http = require("http");
var fs = require("fs");
var server = http.createServer( function(request, response ) {
    var contents = fs.createReadStream(file);
    contents.pipe(response);
});
line 8*
Hans van Riet
@hansinla
Sep 19 2015 03:40
@fald Can it be something earlier in the code?
fald
@fald
Sep 19 2015 03:44
Nope; that's the entire file :/
I only get the syntax error after trying to verify it in
learnyounode, not within the file itself
Which is weird
Matt Everson
@matteverson
Sep 19 2015 03:48
@fald Just to break that problem down, I'd give that function a name rather than using it anonymously.
Matt Yamamoto
@MattYamamoto
Sep 19 2015 04:17
@oksas you still there?
John Oksasoglu
@oksas
Sep 19 2015 04:20
aye!
@MattYamamoto
Matt Yamamoto
@MattYamamoto
Sep 19 2015 04:21
oh, good... so, I can't really explain the why, but remove the <form> tags in your html and just replace them with divs
I noticed your document ready was being called again after pressing the button... figured it had to do something with the form submission. finally just removed the tags and it seems to work. Why there was a CORS issues the second time around is beyond me. And why you're not getting a CORS issue as is right now (since you commented out the JSONP) is also beyond me.
John Oksasoglu
@oksas
Sep 19 2015 04:24
wow hahaha. that is weird. what in the world
and I was also confused about that
Matt Yamamoto
@MattYamamoto
Sep 19 2015 04:25
yeah, it was too weird to not stop looking into it! haha... I'm going to have to try to read up on what exactly was going on later, but at least it seems to be working now.
John Oksasoglu
@oksas
Sep 19 2015 04:25
I was typing in all the data for the ajax stuff, and was about to put the jsonp stuff in last, when I saw the preview update indicating that it had worked already, before I'd even added the jsonp stuff. so I just added it and commented it out, just in case. I've been having trouble lately understanding jsonp a bit haha so this doesn't help
@MattYamamoto thanks so much for all your help though, really appreciate it
CamperBot
@camperbot
Sep 19 2015 04:26
oksas sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 336 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Matt Yamamoto
@MattYamamoto
Sep 19 2015 04:27
I feel like the JSONP stuff was why there was an issue the when you pressed the button (the ajax call was working then, just throwing an error)..... but I can't say for sure since that didn't seem to actually help anything.
John Oksasoglu
@oksas
Sep 19 2015 04:28
yeah. iirc I tried putting the jsonp stuff back in because of that but indeed it didn't seem to actually do anything. really bizarre
but yeah, at least the call seems to work now. it doesn't do exactly what I want it to still for some reason, but the call is getting through. many thanks again for your help
CamperBot
@camperbot
Sep 19 2015 04:29
if you want to thank someone, put an @ before their name!
Matt Yamamoto
@MattYamamoto
Sep 19 2015 04:31
@oksas no problem. I forked your project so I can look into it more!
John Oksasoglu
@oksas
Sep 19 2015 04:32
scratch that, works perfectly. I was being silly. and alright cool, no worries if you don't though. I'll try and investigate the problem further at some point too probably
(not to say additional help would be unwelcome)
Matt Yamamoto
@MattYamamoto
Sep 19 2015 04:33
haha, I'll send you a message should I ever figure it out...although it's not necessarily at the top of my list. I'm just intelectually interested into what the heck is going on.
John Oksasoglu
@oksas
Sep 19 2015 04:33
hahaha ok. sounds good :p
Terry
@terryrey
Sep 19 2015 05:09
Bonfire Pairwise
CamperBot
@camperbot
Sep 19 2015 05:09

:fire:Bonfire: Pairwise :link:

function pairwise(arr, arg) {
  return arg;
}

pairwise([1,4,2,3,0,5], 7);

Return the sum of all indices of elements of 'arr' that can be paired with one other element to form a sum that equals the value in the second argument 'arg'. If multiple sums are possible, return the smallest sum. Once an element has been used, it cannot be reused to pair with another.

more info:  bf details | bf links | hint

Terry
@terryrey
Sep 19 2015 05:10
Bonfire Pairwise hint
CamperBot
@camperbot
Sep 19 2015 05:10
Sorry, can't find a bonfire called pairwise hint. [ Check the map? ]
Terry
@terryrey
Sep 19 2015 05:11
bf Pairwise hint
CamperBot
@camperbot
Sep 19 2015 05:11
Sorry, can't find a bonfire called pairwise hint. [ Check the map? ]
Matt Yamamoto
@MattYamamoto
Sep 19 2015 05:11
@terryrey The first thing to be aware of is that the Bonfire is asking you to sum the indicies, not that actual values.
Terry
@terryrey
Sep 19 2015 05:13
Thanks. I'm just struggling to get my head around how the array reduce function is used in this context. I can see it's value for summing numbers and one or two other scenarios but can't see how it is used in this case.
CamperBot
@camperbot
Sep 19 2015 05:13
if you want to thank someone, put an @ before their name!
Terry
@terryrey
Sep 19 2015 05:18
OK, got it now!
Mateja Trifunovski
@Matko95
Sep 19 2015 05:21
@terryrey you don't have to use reduce
use whatever you feel like using
Matt Yamamoto
@MattYamamoto
Sep 19 2015 05:22
@terryrey good. @Matko95 it does suggest using reduce. . .although, I agree with you... do what works!
Mateja Trifunovski
@Matko95
Sep 19 2015 05:23
@MattYamamoto Well since FCC is an open source project, you never know who made that bonfire, and within the guidelines for making bonfires it is only recommended to put a link to some function on MDN which might help with the bonfire
CamperBot
@camperbot
Sep 19 2015 05:23
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Terry
@terryrey
Sep 19 2015 05:25
I checked the spoiler and realised I was taking it too literally. I thought it expected you to only use the reduce method and couldn't see how this was possible.....I've now seen the error of my way :) Thanks @Matko95 and @Matko95
CamperBot
@camperbot
Sep 19 2015 05:25
terryrey sends brownie points to @matko95 and @matko95 :sparkles: :thumbsup: :sparkles:
:star: 323 | @matko95 | http://www.freecodecamp.com/matko95
:star: 323 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 19 2015 05:25
@terryrey .reduce is one of the hardest thing to understand here :D
Terry
@terryrey
Sep 19 2015 05:26
Having spent the past day reading about it, I agree with you.
Jelani Thompson
@JelaniThompson
Sep 19 2015 06:45
Hey guys, anyone here familiar with using smooth scrolling on their web pages?
I needed a bit of help implementing one in my FCC project and I've looked around for hours, yet no solution I find seems to work, haha
Here's my project in-progress right now by the way
jojacino
@jojacino
Sep 19 2015 07:26
@JelaniThompson try setting your background-attachment: fixed;
fjurcev
@fjurcev
Sep 19 2015 08:07
@JelaniThompson how do you think, it seems good to me
Micheal Hall
@michealhall
Sep 19 2015 08:09
@queenlizo That doesn't look like the correct API call to be making. That only returns a list of locations - there is no current_observation object in that returned JSON data. According to the API docs, you need to be making a call like this: http://api.wunderground.com/api/Your_Key/conditions/q/CA/San_Francisco.json ... replacing "Your_Key" with your API key value and of course the city and state with those appropriate to you.
Ali-Haider5
@Ali-Haider5
Sep 19 2015 08:18
Bonfire: Repeat a string repeat a string
CamperBot
@camperbot
Sep 19 2015 08:18

:fire:Bonfire: Repeat a string repeat a string :link:

function repeat(str, num) {
  // repeat after me
  return str;
}

repeat('abc', 3);

Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.

more info:  bf details | bf links | hint

Jeremiah
@jerrydtm
Sep 19 2015 08:27
Bonfire: Reverse a string
CamperBot
@camperbot
Sep 19 2015 08:27

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

Jeremiah
@jerrydtm
Sep 19 2015 08:27
'bf details'
CamperBot
@camperbot
Sep 19 2015 08:27

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');
Reverse the provided string.
You may need to turn the string into an array before you can reverse it.
Your result must be a string.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Florian Peninon
@florianpnn
Sep 19 2015 08:28
Where can I report improvement to be made on a BonFire?
DTing
@dting
Sep 19 2015 08:31
Screen Shot 2015-09-19 at 1.30.52 AM.png
@florianpnn you can create an issue using that button
Florian Peninon
@florianpnn
Sep 19 2015 08:34
@dting Done! thanks!
CamperBot
@camperbot
Sep 19 2015 08:34
florianpnn sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1211 | @dting | http://www.freecodecamp.com/dting
Jeremiah
@jerrydtm
Sep 19 2015 08:34
okay so i am putting in the string as needed and using what i thought to be the proper code to do what i need but cant seem to put 2 and 2 together...any help?

'function reverseString(str) {
return str;
}

var str = ('hello', 'Howdy', 'Greetings from Earth');
var strReverse = str.split(' ').reverse().join(' ');'

`function reverseString(str) {
return str;
}

var str = ('hello', 'Howdy', 'Greetings from Earth');
var strReverse = str.split(' ').reverse().join(' ');`

Rich Churcher
@richchurcher
Sep 19 2015 08:36
@jerrydtm looks like you're trying to split on spaces. Try it like this: str.split('').reverse().join('');
(nothing in between the quotes)
Jeremiah
@jerrydtm
Sep 19 2015 08:37
okay standby
returns undefined
Paweł
@ridlez
Sep 19 2015 08:38
guys could somebody help me? idk how to use simpleweather.js
i need to make a button to change temp in C to F and vice versa, in documentation there is alt.temp but i have no idea how to use it
Rich Churcher
@richchurcher
Sep 19 2015 08:39
Uh, your definition of str looks kinda odd too. str shouldn't need to be defined within your function... just return the result of your split / reverse/ join
return str.split('').reverse().join('');
something like that
Jeremiah
@jerrydtm
Sep 19 2015 08:41
omg thank you so much thanks @richchurcher
CamperBot
@camperbot
Sep 19 2015 08:41
jerrydtm sends brownie points to @richchurcher :sparkles: :thumbsup: :sparkles:
:star: 307 | @richchurcher | http://www.freecodecamp.com/richchurcher
Rich Churcher
@richchurcher
Sep 19 2015 08:42
yw
Rich Churcher
@richchurcher
Sep 19 2015 08:48
@ridlez I don't use simpleweather, but it looks like you can access that value using weather.alt.temp from the docs
Paweł
@ridlez
Sep 19 2015 08:49
@richchurcher $('button').click(function () {
$('#weather.alt.temp').toggle();
});
something like that?
but it still does not work ;/
Rich Churcher
@richchurcher
Sep 19 2015 08:50
no, it looks from the documentation that there's a callback that gets passed weather
$(document).ready(function() {
  $.simpleWeather({
    location: 'Austin, TX',
    woeid: '',
    unit: 'f',
    success: function(weather) {
CamperBot
@camperbot
Sep 19 2015 08:51
if you want to thank someone, put an @ before their name!
Rich Churcher
@richchurcher
Sep 19 2015 08:51
if you console.log that weather object you'll be able to see all the information it has in it in the developer console
Paweł
@ridlez
Sep 19 2015 08:55
@richchurcher thank you :)
CamperBot
@camperbot
Sep 19 2015 08:55
ridlez sends brownie points to @richchurcher :sparkles: :thumbsup: :sparkles:
:star: 308 | @richchurcher | http://www.freecodecamp.com/richchurcher
Rich Churcher
@richchurcher
Sep 19 2015 08:55
yw
Ravi
@RavindraWani
Sep 19 2015 09:31
Hello World!
CamperBot
@camperbot
Sep 19 2015 09:31

welcome to FreeCodeCamp @RavindraWani!

galacticfan
@galacticfan
Sep 19 2015 09:36
Has anybody completed the pairwise bonfire challenge? Really stuck and would love some help
Max
@gash83733
Sep 19 2015 09:40
can anyone help me?
return Math.random();
Math.floor(Math.random() * (max - min + 1)) + min
It say The random number that's generated by myFunction should be an integer
yuval barel
@yuvalbra
Sep 19 2015 09:45

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

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

why not red color?
galacticfan
@galacticfan
Sep 19 2015 09:47
I think it's you're spacing, which for some reason is having an effect @yuvalbra
<style>
.red-text { color: red; }
</style>
<h2 class="red-text">CatPhotoApp</h2>
galacticfan
@galacticfan
Sep 19 2015 09:54
@gash83733 Does your code read in the order that you wrote in the chat?
Marcus Eisele
@eiselems
Sep 19 2015 10:14
after almost finishing most of the fcc tutorials. I got introduced to the MEAN Stack (MongoDB, ExpressJS, AngularJS, Nodejs). Just for comprehension: Is it best to setup a REST-API (Backend) by using Nodejs + expressjs + mongoDB and then connect an angularJS UI to it?
azaleas
@azaleas
Sep 19 2015 10:55
can someone guide me on zipline 2 - adding a tweet functionality?
Juan Riquelme
@soulchainer
Sep 19 2015 11:12
There is all you should need, @azaleas https://dev.twitter.com/web/tweet-button/web-intent
lauratalaat
@lauratalaat
Sep 19 2015 11:20
bf : Truncate a string
CamperBot
@camperbot
Sep 19 2015 11:20

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

lauratalaat
@lauratalaat
Sep 19 2015 11:20
hint
CamperBot
@camperbot
Sep 19 2015 11:20
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Robert Means
@BoDonkey
Sep 19 2015 11:23
This message was deleted
x34passenger
@x34passenger
Sep 19 2015 11:45
I am able to display a new quote however, I don't know how to format it to look like pure html text. http://codepen.io/x34passenger/pen/jbqdrp
Comfort
@freecodecomfort
Sep 19 2015 11:55
hello! has anyone done the zipline: Stylize Stories on Camper News Incomplete
??
Robert Means
@BoDonkey
Sep 19 2015 12:24
dumb question, on bonfire: Symmetric Differences the function called is sym(args) and the first test is sym([1, 2, 3] , [5, 2, 1, 4]). If I console.log (args) I get back [1, 2, 3]. If I console.log(arguments) I get back ([array3], [array4]). I don't get it, why do I need to use arguments to get the entire object passed in? Is (args) a special declaration? What if it was sym(theArrays)- would I still need to get them all with console.log(arguments)?
Coira Ellison
@Coira
Sep 19 2015 13:13
hey @BoDonkey did you get an answer to your question?
Robert Means
@BoDonkey
Sep 19 2015 13:19
@Coira no, I didn't
@Coira huh, notifications aren't coming through-I think my browser is acting up
Coira Ellison
@Coira
Sep 19 2015 13:20
Robert Means
@BoDonkey
Sep 19 2015 13:21
@Coira so it doesn't matter what you name them in the function?
@Coira def function sym (Doesn'tReallyMatter)
Coira Ellison
@Coira
Sep 19 2015 13:22
yeah, kinda
Robert Means
@BoDonkey
Sep 19 2015 13:22
@Coira thanks, I'll have to read up on this a little more
CamperBot
@camperbot
Sep 19 2015 13:22
bodonkey sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 222 | @coira | http://www.freecodecamp.com/coira
Coira Ellison
@Coira
Sep 19 2015 13:22
you use arguments like an array, so if we have sym(firstValue, secondValue), you can access firstValue like this arguments[0]
or you can just use the var firstValue, both will be the same
Robert Means
@BoDonkey
Sep 19 2015 13:23
cool
Coira Ellison
@Coira
Sep 19 2015 13:23
but it's real use is when we don't know how many values we're passing into sym()
Robert Means
@BoDonkey
Sep 19 2015 13:24
sort of like a splat in ruby?
Coira Ellison
@Coira
Sep 19 2015 13:24
so if I declared sym like this function sym(mustHaveValue), but it can also use optional values, you would have to use arguments to access the optional values
I've never used ruby, let me see
seems like it, what a funny name, splat!
Robert Means
@BoDonkey
Sep 19 2015 13:26
yeah-i agree!
Coira Ellison
@Coira
Sep 19 2015 13:27
yeah like splat, except you don't have to add arguments to function, it's just always there
x34passenger
@x34passenger
Sep 19 2015 13:34
I am able to display a new quote however, I don't know how to format it to look like pure html text. http://codepen.io/x34passenger/pen/jbqdrp
Moisés Man
@moigithub
Sep 19 2015 13:50

@x34passenger u printing the object itself.. u should print
Object.Property to show each object elements...

"quoteText":"Either I will find a way, or I will make one. ",
"quoteAuthor":"Philip Sidney",
"senderName":"",
"senderLink":"",
"quoteLink":"http://forismatic.com/en/d8c2061c7c/

ie. $('#response').html(response.quoteText);
$('#response').html(response.quoteText + "<p>"+response.quoteLink+"</p>");
@x34passenger

Pete McPherson
@StartupDino
Sep 19 2015 14:12
Bonfire: Return Largest Numbers in Arrays
CamperBot
@camperbot
Sep 19 2015 14:12

:fire:Bonfire: Return Largest Numbers in Arrays :link:

function largestOfFour(arr) {
  // You can do this!
  return arr;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Return an array consisting of the largest number from each provided sub-array. For simplicity, the provided array will contain exactly 4 sub-arrays.

more info:  bf details | bf links | hint

Pete McPherson
@StartupDino
Sep 19 2015 14:12
hint
CamperBot
@camperbot
Sep 19 2015 14:12
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Liz Rezes
@queenlizo
Sep 19 2015 14:15
Thanks @michealhall
CamperBot
@camperbot
Sep 19 2015 14:15
queenlizo sends brownie points to @michealhall :sparkles: :thumbsup: :sparkles:
:star: 219 | @michealhall | http://www.freecodecamp.com/michealhall
Pedro Hernández
@PedroJS
Sep 19 2015 14:24
bf Slasher Flick
CamperBot
@camperbot
Sep 19 2015 14:24

:fire:Bonfire: Slasher Flick :link:

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

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

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

more info:  bf details | bf links | hint

Pedro Hernández
@PedroJS
Sep 19 2015 14:33
help slasher flick
CamperBot
@camperbot
Sep 19 2015 14:33

:point_right: bonfire slasher flick [wiki]

The problem

Return the remaining elements of an array after chopping off n elements from the head. Factorials are often represented with the shorthand notation n!

For example: slasher([1, 2, 3], 2); must return [3]

:pencil: read more about bonfire slasher flick on the FCC Wiki

x34passenger
@x34passenger
Sep 19 2015 14:46
@moigithub I've modified the javascript so it is displaying the quote and the author but I don't know how to format the text for the "quote" and the "author". I don't know how to make it nice with a text area that contains the quote and author?
Moisés Man
@moigithub
Sep 19 2015 14:47
thats css
Jordan Robertson
@Jordanson
Sep 19 2015 14:48

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

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

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

Moisés Man
@moigithub
Sep 19 2015 14:48
add some class or id to ur div/container element.. then apply some styles
x34passenger
@x34passenger
Sep 19 2015 14:48
@moigithub how do I make the white text area for the quote and author?
Hans van Riet
@hansinla
Sep 19 2015 14:49
@x34passenger Use an id or class
yuluska
@yuluska
Sep 19 2015 14:50
Bonfire: Check for Palindromes
CamperBot
@camperbot
Sep 19 2015 14:50

:fire:Bonfire: Check for Palindromes :link:

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



palindrome("eye");

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

more info:  bf details | bf links | hint

bioparoks
@bioparoks
Sep 19 2015 14:50
hint
CamperBot
@camperbot
Sep 19 2015 14:50
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
yuluska
@yuluska
Sep 19 2015 14:51
hint
CamperBot
@camperbot
Sep 19 2015 14:51
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jordan Robertson
@Jordanson
Sep 19 2015 14:54
how do i paste code?
johnnycooper
@johnnycooper
Sep 19 2015 14:54
hint
CamperBot
@camperbot
Sep 19 2015 14:54
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Markus Legner
@mlegner
Sep 19 2015 14:56
@Jordanson press ctrl + alt + m for help
or click on the button on the lower right corner (m)
naxty
@naxty
Sep 19 2015 15:03
Bonfire: Convert HTML Entities
CamperBot
@camperbot
Sep 19 2015 15:03

:fire:Bonfire: Convert HTML Entities :link:

function convert(str) {
  // &colon;&rpar;
  return str;
}

convert('Dolce & Gabbana');

Convert the characters "&", "<", ">", '"' (double quote), and "'" (apostrophe), in a string to their corresponding HTML entities.

more info:  bf details | bf links | hint

naxty
@naxty
Sep 19 2015 15:03
hint
CamperBot
@camperbot
Sep 19 2015 15:03
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
x34passenger
@x34passenger
Sep 19 2015 15:03
@hansinla I'm having trouble centering the quote and the author. http://codepen.io/x34passenger/pen/jbqdrp
Hans van Riet
@hansinla
Sep 19 2015 15:06
@x34passenger in your quote class lose the around center.
x34passenger
@x34passenger
Sep 19 2015 15:07
@hansinla I can't center the author
Hans van Riet
@hansinla
Sep 19 2015 15:08
@x34passenger then give the author a different class and give that the style property text-align: right;
@x34passenger
.author{
  text-align: right;
}
<div class="author" id="responseAuthor"></div>
Paul Simon Ongpin
@mochiii
Sep 19 2015 15:11
can somebody help me out I cant center the button tag with margin: 0 auto or text-center class http://codepen.io/mochiii/pen/YyqmJP?editors=110
Hans van Riet
@hansinla
Sep 19 2015 15:13
@mochiii wrap it in a div and give that div the text-align: center; property
Jordan Robertson
@Jordanson
Sep 19 2015 15:13
<style>".red-text"{ color: red;}</style>
<h2 class="red-text">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Hans van Riet
@hansinla
Sep 19 2015 15:14
@mochiii
<div class="center">
    <button class="btn btn-default quote-btn">Generate Quote</button>
  </div>
.center{
  text-align: center;
}
Jordan Robertson
@Jordanson
Sep 19 2015 15:14
I dont understand what is wrong with my html/css. I'm doing activity 10 in html.
Paul Simon Ongpin
@mochiii
Sep 19 2015 15:15
@hansinla yeah It just also came into my mind by the time you mention it thanks man! awesome!!!!
CamperBot
@camperbot
Sep 19 2015 15:15
mochiii sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 377 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Sep 19 2015 15:15
@Jordanson show your code and tell us what you’re trying to accomplish
Jordan Robertson
@Jordanson
Sep 19 2015 15:16

```

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

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

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

@hansinla
Hans van Riet
@hansinla
Sep 19 2015 15:17
@Jordanson in your style tag the class name should not be in quotes
Jordan Robertson
@Jordanson
Sep 19 2015 15:17
I tried that but it doesn't work @hansinla
<style>.red-text{ color: red;}</style>
<h2 class="red-text">CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Hans van Riet
@hansinla
Sep 19 2015 15:18
@Jordanson Did you try to refresh the page? Doesn’t that h2 header turn red?
Jordan Robertson
@Jordanson
Sep 19 2015 15:19
it is supposed to but it won't. i'll refresh and try again @hansinla
@hansinla no bueno
The html/css is correct, no?
Nnxoxo
@Nnxoxo
Sep 19 2015 15:24
hi, is there somebody who uses Gulp?
Cristián Berríos
@crisberrios
Sep 19 2015 15:25
I do sometimes
Chris
@Shifthawke
Sep 19 2015 15:27
@Jordanson It looks right.
Copy your code and refresh the page.
Nnxoxo
@Nnxoxo
Sep 19 2015 15:27
@crisberrios have u ever used watcher on js files?
Jordan Robertson
@Jordanson
Sep 19 2015 15:28
I've tried but it has no effect :( @Shifthawke
Vanesa Villafana Liñan
@DeniseDesu
Sep 19 2015 15:28
There's something weird happening to your .red-text{color: red;} block. I copy it to test it, but it doesn't work but when I type it myself, it works. Weird
Hans van Riet
@hansinla
Sep 19 2015 15:29
@Jordanson I had problems getting it to work, your code looks right. Try this:
<style type="text/css">
    .red-text{
        color: red;
    }
    </style>
Vanesa Villafana Liñan
@DeniseDesu
Sep 19 2015 15:29
Try to delete that and write it again
Chris
@Shifthawke
Sep 19 2015 15:30
wait
replace your " with '
I typically use " but it's got mine laid with ' and it works.
<style>
  .red-text {
    color: red;
  }

</style>

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

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
Cristián Berríos
@crisberrios
Sep 19 2015 15:32
@Nnutthowze yes, both with gulp.watch and watchify
MladenLo
@MladenLo
Sep 19 2015 15:32
Hello boys and girls :)
Chris
@Shifthawke
Sep 19 2015 15:32
Hello @MladenLo
MladenLo
@MladenLo
Sep 19 2015 15:32
i need help :)
Hans van Riet
@hansinla
Sep 19 2015 15:32
@DeniseDesu I had the same thing when copying his code
Nnxoxo
@Nnxoxo
Sep 19 2015 15:33
@crisberrios could u tell me why gulp isn't workig in such situation?
gulp.task('js-minify', function() {
    gulp.src('.private/scripts/**/*.js')
    //gulp.src('private/scripts/*.js')
        .pipe(concat('app.min.js'))
        .pipe(uglify())
        .pipe(gulp.dest('public/js'));
});

gulp.task('js-minify:watch', function() {
    gulp.watch('private/scripts/**/*.js', ['js-minify']);
});
Chris
@Shifthawke
Sep 19 2015 15:33
What is it/ @MladenLo
Did you figure it out @Jordanson
MladenLo
@MladenLo
Sep 19 2015 15:34
ok, i am doing this now
Zipline: Build a Personal Portfolio Webpage
Jordan Robertson
@Jordanson
Sep 19 2015 15:34
how do i give brownie points?
Chris
@Shifthawke
Sep 19 2015 15:34
thanks @Jordanson
CamperBot
@camperbot
Sep 19 2015 15:34
shifthawke sends brownie points to @jordanson :sparkles: :thumbsup: :sparkles:
:star: 11 | @jordanson | http://www.freecodecamp.com/jordanson
Chris
@Shifthawke
Sep 19 2015 15:34
thank and click their name.
CamperBot
@camperbot
Sep 19 2015 15:34
if you want to thank someone, put an @ before their name!
Cristián Berríos
@crisberrios
Sep 19 2015 15:34
@Nnutthowze should be ./private....
Chris
@Shifthawke
Sep 19 2015 15:34
wiki silence bot
CamperBot
@camperbot
Sep 19 2015 15:34
no wiki entry for: silence bot
:pencil: click here to create one now!after creating your page type update to reload it here
MladenLo
@MladenLo
Sep 19 2015 15:34
after i finished everything, website is not properly shown in mobile devices
Cristián Berríos
@crisberrios
Sep 19 2015 15:35
@Nnutthowze relative to gulpfile location of course, it may vary
Nnxoxo
@Nnxoxo
Sep 19 2015 15:35
@crisberrios so the problem is that gulp adds only one file to app.min.js
Chris
@Shifthawke
Sep 19 2015 15:35
I haven't gotten there yet, so I cannot really answer. Is it not working at all? Or not displaying properly?
Nnxoxo
@Nnxoxo
Sep 19 2015 15:36
@crisberrios he doesn't want to add the second one dunno why
Chris
@Shifthawke
Sep 19 2015 15:36
I like that background. @MladenLo
MladenLo
@MladenLo
Sep 19 2015 15:36
thanks :)
CamperBot
@camperbot
Sep 19 2015 15:36
if you want to thank someone, put an @ before their name!
Chris
@Shifthawke
Sep 19 2015 15:36
np. ^_^
MladenLo
@MladenLo
Sep 19 2015 15:36
problem is that its not showing properly in mobile devices, i see whole website
Jordan Robertson
@Jordanson
Sep 19 2015 15:36
@Shifthawke
Did you get any @Shifthawke ?
Nnxoxo
@Nnxoxo
Sep 19 2015 15:37
@crisberrios I think I found a bug, thanks, for ur reply
CamperBot
@camperbot
Sep 19 2015 15:37
nnutthowze sends brownie points to @crisberrios :sparkles: :thumbsup: :sparkles:
Jordan Robertson
@Jordanson
Sep 19 2015 15:37
@hansinla
CamperBot
@camperbot
Sep 19 2015 15:37
:star: 162 | @crisberrios | http://www.freecodecamp.com/crisberrios
Chris
@Shifthawke
Sep 19 2015 15:37
you have to put thank infront of the name.
CamperBot
@camperbot
Sep 19 2015 15:37
if you want to thank someone, put an @ before their name!
Chris
@Shifthawke
Sep 19 2015 15:37
You can also tag everyone all at once.
thanks @camperbot @Jordanson @Nnutthowze @MladenLo
CamperBot
@camperbot
Sep 19 2015 15:37
shifthawke sends brownie points to @camperbot and @jordanson and @nnutthowze and @mladenlo :sparkles: :thumbsup: :sparkles:
:warning: shifthawke already gave camperbot points
:warning: shifthawke already gave jordanson points
:star: 276 | @mladenlo | http://www.freecodecamp.com/mladenlo
:star: 315 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
Jordan Robertson
@Jordanson
Sep 19 2015 15:38
thanks @Shifthawke
CamperBot
@camperbot
Sep 19 2015 15:38
jordanson sends brownie points to @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 200 | @shifthawke | http://www.freecodecamp.com/shifthawke
Jordan Robertson
@Jordanson
Sep 19 2015 15:38
yay
Chris
@Shifthawke
Sep 19 2015 15:38
yay for brownie points!
Jordan Robertson
@Jordanson
Sep 19 2015 15:38
thanks @hansinla
CamperBot
@camperbot
Sep 19 2015 15:38
jordanson sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
MladenLo
@MladenLo
Sep 19 2015 15:38
i have no idea what is this lol
CamperBot
@camperbot
Sep 19 2015 15:38
:star: 378 | @hansinla | http://www.freecodecamp.com/hansinla
Nnxoxo
@Nnxoxo
Sep 19 2015 15:38
@Shifthawke lol thanks ahaha
CamperBot
@camperbot
Sep 19 2015 15:38
nnutthowze sends brownie points to @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 201 | @shifthawke | http://www.freecodecamp.com/shifthawke
Chris
@Shifthawke
Sep 19 2015 15:38
What is what? @MladenLo
<3 Brownie points for everyone!
MladenLo
@MladenLo
Sep 19 2015 15:39
those points you gave :D
Chris
@Shifthawke
Sep 19 2015 15:39
-Tosses brownie points like candy-
They tell people how awesome you are.
wiki brownie points
CamperBot
@camperbot
Sep 19 2015 15:39

:point_right: brownie points [wiki]

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

A user profile picture next to a with Brownie Points score

There are three ways you can get Brownie Points:

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

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

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

x34passenger
@x34passenger
Sep 19 2015 15:39
@hansinla thank you
CamperBot
@camperbot
Sep 19 2015 15:39
x34passenger sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 379 | @hansinla | http://www.freecodecamp.com/hansinla
Jordan Robertson
@Jordanson
Sep 19 2015 15:41
@Shifthawke so do you think that was an issue with the editor or what?
Chris
@Shifthawke
Sep 19 2015 15:42
It can be sometimes. Did it ultimately work? What did you do?
Come back I have to know lol
Jordan Robertson
@Jordanson
Sep 19 2015 15:48
i copy and pasted what you and @hansinla provided and they both work :D
Chris
@Shifthawke
Sep 19 2015 15:49
YEah sometimes it needs a refresh lol. I was thinking your code looked fine. But then again it didn't work in mine either.
Sometimes it can get real pissy about spaces.
Like officers and their Sirs'.
I apologize to any officers btw. I know some officers can get offended. Especially Naval officers.
x34passenger
@x34passenger
Sep 19 2015 15:53
@hansinla I am not sure how to have my title within my background image. http://codepen.io/x34passenger/pen/OyXLOz
Jelani Thompson
@JelaniThompson
Sep 19 2015 16:12
Hey guys, how would I be able to go about centering my social buttons here?
float doesn't seem to be working, haha
Mateja Trifunovski
@Matko95
Sep 19 2015 16:14
@x34passenger http://codepen.io/Matko95/pen/jbrNpX here have a look
Ravi
@RavindraWani
Sep 19 2015 16:17
@x34passenger : @Matko95 I have used relative property
x34passenger
@x34passenger
Sep 19 2015 16:20
thanks @Matko95
CamperBot
@camperbot
Sep 19 2015 16:20
x34passenger sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 326 | @matko95 | http://www.freecodecamp.com/matko95
Jelani Thompson
@JelaniThompson
Sep 19 2015 16:22
@Matko95 Thank you! What changes were made in the code? I'm only seeing a difference in the margin, haha
CamperBot
@camperbot
Sep 19 2015 16:22
jelanithompson sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 327 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 19 2015 16:23
@JelaniThompson display: inline-block; instead of display:block and i centered it in your .section#intro part
ami-linish
@ami-linish
Sep 19 2015 16:23
hello.. i am on the jquery challenge and not able to solve this one: Your #target1 element should have the classes animated‚ shake and btn-primary... can some one please help
x34passenger
@x34passenger
Sep 19 2015 16:25
@Matko95 I am not sure what javascript weather api I need to use. http://codepen.io/x34passenger/pen/OyXLOz
Mateja Trifunovski
@Matko95
Sep 19 2015 16:25
@x34passenger http://openweathermap.org/api this one is cool
x34passenger
@x34passenger
Sep 19 2015 16:27
@Matko95 There does not seem to be any javascript code examples, I don't know how to write the javascript
ami-linish
@ami-linish
Sep 19 2015 16:28
this is what u did.. is this wrong?$("#target1").addClass("animated shake btn-primary");
Mateja Trifunovski
@Matko95
Sep 19 2015 16:29
@x34passenger try something like this https://www.youtube.com/watch?v=fEYx8dQr_cQ
Ravi
@RavindraWani
Sep 19 2015 16:32
@ami-linish : The statement you have given is correct..May be you have deleted some any previous code from the page. Please check
Jordan Robertson
@Jordanson
Sep 19 2015 16:45
<style>
.red-text {color: red;} 
.font-size {font-size: 16px; }
</style>

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

<p class="font-size" 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>
<p2 class="font-size">kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p2>
x34passenger
@x34passenger
Sep 19 2015 16:45
@Matko95 not getting the temperature. http://codepen.io/x34passenger/pen/OyXLOz
Jordan Robertson
@Jordanson
Sep 19 2015 16:46

my first p class isn't red after adding the font size. is it set up incorrectly?
```

<style>
.red-text {color: red;}
.font-size {font-size: 16px; }
</style>

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

<p class="font-size" 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>

<p2 class="font-size">kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p2>

ugh ```
omg
```
<style>
.red-text {color: red;} 
.font-size {font-size: 16px; }
</style>

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

<p class="font-size" 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>
<p2 class="font-size">kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p2>
marzelin
@marzelin
Sep 19 2015 16:48
@Jordanson there can be only one class attribute. If you want to add more than one class to an element, do this: class="class1 class2"
Jordan Robertson
@Jordanson
Sep 19 2015 16:51
thanks @marzelin but it still wont proceed. it is html exercise 12
CamperBot
@camperbot
Sep 19 2015 16:51
jordanson sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:star: 226 | @marzelin | http://www.freecodecamp.com/marzelin
Ravi
@RavindraWani
Sep 19 2015 16:53
@Jordanson : Here is the code
<style>
  .red-text {
    color: red;
    font-size: 16px;
  }
</style>

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

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">kitty ipsum 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>
ami-linish
@ami-linish
Sep 19 2015 16:54
@RavindraWani : thanks a ton.. you were right.. :smile:
CamperBot
@camperbot
Sep 19 2015 16:54
ami-linish sends brownie points to @ravindrawani :sparkles: :thumbsup: :sparkles:
:star: 175 | @ravindrawani | http://www.freecodecamp.com/ravindrawani
Ravi
@RavindraWani
Sep 19 2015 16:55
@ami-linish :+1:
marzelin
@marzelin
Sep 19 2015 16:57
@Jordanson remove 2 from the <p2> as shown in @RavindraWani code, paragraphs are tagged by <p></p>elements
Chris
@Shifthawke
Sep 19 2015 16:58
Mysterious p2s
x34passenger
@x34passenger
Sep 19 2015 16:58
Can anyone help me. I am not able to get the weather data. http://codepen.io/x34passenger/pen/OyXLOz
Jordan Robertson
@Jordanson
Sep 19 2015 17:00
thanks @RavindraWani why won't the first p change to 16 font?
<style>
.red-text {color: red;} 
.font-size {font-size: 16px; }
</style>

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

<p class="red-text" class2="font-size">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="font-size">kitty ipsum 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>
CamperBot
@camperbot
Sep 19 2015 17:00
jordanson sends brownie points to @ravindrawani :sparkles: :thumbsup: :sparkles:
:star: 176 | @ravindrawani | http://www.freecodecamp.com/ravindrawani
galacticfan
@galacticfan
Sep 19 2015 17:01
@x34passenger you need to append your code so that you are using the object received from the API call and then you can access that object's properties
Will Moody
@willmoody
Sep 19 2015 17:01

Hey guys, I feel like a dumbass for having to ask, but does anybody know why my for loop below doesn't seem to be running?

function sumAll(arr) {
  for (var i = Math.min(arr); i < Math.max(arr); i++) {
    var storage = []
    storage.push(i);
    console.log(i);
  };
  console.log('what');
}

sumAll([1, 4]);

seems to log "what", but none of the i's?

galacticfan
@galacticfan
Sep 19 2015 17:02
bonfire sumAll
CamperBot
@camperbot
Sep 19 2015 17:02
Sorry, can't find a bonfire called sumall. [ Check the map? ]
x34passenger
@x34passenger
Sep 19 2015 17:02
@galacticfan can you show a javascript example, not sure what you are saying?
galacticfan
@galacticfan
Sep 19 2015 17:02
@x34passenger give me a min
marzelin
@marzelin
Sep 19 2015 17:03
bf sum
CamperBot
@camperbot
Sep 19 2015 17:03

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

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

sumAll([1, 4]);

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

more info:  bf details | bf links | hint

galacticfan
@galacticfan
Sep 19 2015 17:03
@fractal-mind Remember that you need to be returning the sum of all the numbers between the min and max
@fractal-mind You also need to make sure that you include the max number in the sum
Coira Ellison
@Coira
Sep 19 2015 17:03
@fractal-mind Math.min/max takes in a number of values rather than an array, use apply like in here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max
Will Moody
@willmoody
Sep 19 2015 17:04
@galacticfan Yes, but I haven't reached that yet, haha. Right now I'm just trying to build an array that I can .reduce()
@Coira Ahh, I see. Thanks!
CamperBot
@camperbot
Sep 19 2015 17:04
fractal-mind sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
:star: 223 | @coira | http://www.freecodecamp.com/coira
Alexandros Darras
@DrosRas
Sep 19 2015 17:04
guys anyone here using the pair system?
Coira Ellison
@Coira
Sep 19 2015 17:05
np!
Mateja Trifunovski
@Matko95
Sep 19 2015 17:05
and between you need to dynamically change the lat and lon in the api URL request
Ravi
@RavindraWani
Sep 19 2015 17:08
@Jordanson Two separate class attribute not required. Please remove class2 and add font property in CSS first class itself
.red-text{
color: red;
font-size: 16px;
}
galacticfan
@galacticfan
Sep 19 2015 17:12
haha, hold on
x34passenger
@x34passenger
Sep 19 2015 17:14
I've changed the lat and lon but the temperature is not changing. http://codepen.io/x34passenger/pen/OyXLOz
Jordan Robertson
@Jordanson
Sep 19 2015 17:14
thanks @marzelin good on ya m8
CamperBot
@camperbot
Sep 19 2015 17:14
jordanson sends brownie points to @marzelin :sparkles: :thumbsup: :sparkles:
:warning: jordanson already gave marzelin points
Derrick
@Derricksr
Sep 19 2015 17:14
Hell everyone I'm new here. I am doing the beginning Waypoint on import google font. I know some html and the challenge was to add the font-family lobster from google as the font for the h2. My only way to get it to work was to make a header tag in the page. The problem with this is the lesson never covered this tag yet. So a real beginner would not know to add that tag. Just by observation. Maybe they could change that lesson to talk about headers before they start linking fonts.
Ravi
@RavindraWani
Sep 19 2015 17:19
@Derricksr If you are complete beginners and not aware of all present codes then I would suggest if you could come back to this course by completing some other course like..Learn HTML and CSS from Scratch
x34passenger
@x34passenger
Sep 19 2015 17:20
How do you find the lat and lon for a specific city?
Ravi
@RavindraWani
Sep 19 2015 17:21
@Derricksr Its video series so there won't be any problem to get through. smile:
Mateja Trifunovski
@Matko95
Sep 19 2015 17:23
@x34passenger i took an example, you need to use a location API aswell
x34passenger
@x34passenger
Sep 19 2015 17:24
@Matko95 I don't see any location api at http://openweathermap.org/api
Mateja Trifunovski
@Matko95
Sep 19 2015 17:25
@x34passenger http://ipinfo.io/
x34passenger
@x34passenger
Sep 19 2015 17:27
@Derricksr From doing this up to this point, it does not seem to be for beginners. I have absolutely no web development experience but I feel very comfortable with OOP. I believe RavindraWani is correct.
Ravi
@RavindraWani
Sep 19 2015 17:30
@x34passenger :smile: Correct. Even I am struggling to understand from the Basic Algorithm Scripting Tutorials
x34passenger
@x34passenger
Sep 19 2015 17:31
@Matko95 I'm assuming I have to use jsonp, but that api only returns the ip address, how do I get the lat and lon?
@RavindraWani The basic algorithm scripting does not seem to be basic at all :)
Ravi
@RavindraWani
Sep 19 2015 17:32
hahahahaha
x34passenger
@x34passenger
Sep 19 2015 17:33
They should call it intermediate or advanced basic
Ravi
@RavindraWani
Sep 19 2015 17:36
yes of course. Each time I refer many other courses and come back to move ahead...at least that will help to reach on 800 Hours of  Real World Work Experience :smile:
Shoumya Kanti Das
@shoumyadas
Sep 19 2015 17:39
anyone did the piglatin bonfire?
bf pig
CamperBot
@camperbot
Sep 19 2015 17:39

:fire:Bonfire: Pig Latin :link:

function translate(str) {
 return str;
}

translate("consonant");

Translate the provided string to pig latin.

more info:  bf details | bf links | hint

Mateja Trifunovski
@Matko95
Sep 19 2015 17:40
@x34passenger if you look at the json format you will see that you have this line "loc": "44.0000,21.0000", where you have lat and lon
Shoumya Kanti Das
@shoumyadas
Sep 19 2015 17:40
i'm failing one test "glove" should change to "lovegay" right?
x34passenger
@x34passenger
Sep 19 2015 17:41
I don't see that in http://ipinfo.io/developers @Matko95
Mateja Trifunovski
@Matko95
Sep 19 2015 17:41
@shoumyadas I didn't understand that one aswell
Matt Yamamoto
@MattYamamoto
Sep 19 2015 17:41
@shoumyadas oveglay
x34passenger
@x34passenger
Sep 19 2015 17:42
@Matko95 I don't see that in http://ipinfo.io/developers
Mateja Trifunovski
@Matko95
Sep 19 2015 17:42
@x34passenger
$ curl ipinfo.io/8.8.8.8
{
  "ip": "8.8.8.8",
  "hostname": "google-public-dns-a.google.com",
  "loc": "37.385999999999996,-122.0838",
  "org": "AS15169 Google Inc.",
  "city": "Mountain View",
  "region": "California",
  "country": "US",
  "phone": 650
}
Shoumya Kanti Das
@shoumyadas
Sep 19 2015 17:42
@MattYamamoto why? g is consonant so only it should be appended at the back isnt it?
Mateja Trifunovski
@Matko95
Sep 19 2015 17:42
third parameter
x34passenger
@x34passenger
Sep 19 2015 17:42
@Matko95 That I believe is a command line for unix, I don't know how to use that or make that call from javascript?
Shoumya Kanti Das
@shoumyadas
Sep 19 2015 17:43
@MattYamamoto "glove"-> love+g+ay= lovegay
Matt Yamamoto
@MattYamamoto
Sep 19 2015 17:43
@shoumyadas takes the first consonant (or consonant cluster)
the spereation occurs at the fisrt vowel
Mateja Trifunovski
@Matko95
Sep 19 2015 17:43
@x34passenger it's just an example for an API, you do the same thing you did with the weather api, only now you get this JSON
Matt Yamamoto
@MattYamamoto
Sep 19 2015 17:45
@shoumyadas so you want the first cluster of consonants.... glove => gl ove => ove gl ay = oveglay
Mateja Trifunovski
@Matko95
Sep 19 2015 17:46
@x34passenger you can do something like this
function getLocation() {
    $.get("http://ipinfo.io", function(location) {

      $('.location').append(location.city + ",").append(location.country);
      var location = location.loc

    }, "jsonp");

  }
Shoumya Kanti Das
@shoumyadas
Sep 19 2015 17:47
@MattYamamoto okkay! i figured it was just the first consonant.. :smile:
thanks @MattYamamoto
CamperBot
@camperbot
Sep 19 2015 17:47
shoumyadas sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 337 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Jesse
@jctm30
Sep 19 2015 18:23
@wontoan @alanbuchanan thanks guys
CamperBot
@camperbot
Sep 19 2015 18:23
jctm30 sends brownie points to @wontoan and @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 306 | @wontoan | http://www.freecodecamp.com/wontoan
:star: 370 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Jordan Robertson
@Jordanson
Sep 19 2015 18:24
Hey, everyone. I just started FreeCodeCamp. I'm wondering if I should be taking breaks to retain the information more effectively? Maybe take a break and review every few exercises? I know the difficulty will increase the further along I get therefore I'll the time spent on each exercise will increase substantially so maybe I won't need to break for those purposes and only just to rest? Thoughts?
Don Price
@KingHippo
Sep 19 2015 18:26
I'm having a little trouble with the palindrome bonfire. I am passing all the tests except the ones that contain commas or numbers. I'm thinking it might be my regular expression.
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:33

Can someone tell me why...when I put this number: "01000001" into and online binary-to-decimal converter I get 65.....but when I do this:

var num = 01000001;
var test = parseInt(num,10);

I get 262145

??

Don Price
@KingHippo
Sep 19 2015 18:37
parseInt is for parses a string and returns an integer
Sorry for the typo
Hans van Riet
@hansinla
Sep 19 2015 18:40
@TheHighPriestess make num into s string and change parseInt to a base of 2.
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:42
@hansinla I tried that...but it came back NaN
how can it parse a string?
Don Price
@KingHippo
Sep 19 2015 18:42
put the 01000001 in quotes
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:43
@KingHippo isn't that the same thing?
Don Price
@KingHippo
Sep 19 2015 18:43
var num = "01000001"; is a string and var num = 01000001; is an integer
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:44
ok..hold on
Clayton
@cjg040103
Sep 19 2015 18:44
what is wrong here? i'm trying to return the factorial of the given number.
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:44
Has anyone done the Twitch TV challenge?
Clayton
@cjg040103
Sep 19 2015 18:44
function factorialize(num) {
  for(var i = 1; i < num; i++) {
  var a = num;
  var b = i;
  var c = a * b;
  }
  return c;
}

factorialize(5, '');
@thomasvaeth say wha?
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:45
var num = 01000001;
var n = num.toString();
typeof n;
var test = parseInt(n,2);
console.log(test);
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:45
@cjg040103 You're not up to it yet if you are on factorialize.
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:45
comes back NaN
Clayton
@cjg040103
Sep 19 2015 18:45
kk
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:46
@thomasvaeth I did
Clayton
@cjg040103
Sep 19 2015 18:46
well technically i am just redoing it. @thomasvaeth
Don Price
@KingHippo
Sep 19 2015 18:46
@TheHighPriestess hmmm... did you change 10 to 2?
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:46
@TheHighPriestess Is your search wher you can type in "camp" and FreeCodeCamp comes up?
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:46
@KingHippo Yes...that code I just pasted...comes back NaN
Jesse
@jctm30
Sep 19 2015 18:46
hi guys, i asked this last night but got bombarded with all the chats after leaving the computer for a couple hours.
Question: what does "!" do after a declared variable?
e.g. !variable
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:46
@thomasvaeth I didn't add that feature to it
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:47
Hello everyone. I have a problem with fcc 171 - Bonfire: Reverse a String
can anyone help me?
Clayton
@cjg040103
Sep 19 2015 18:47
@aykutkaskaya absolutely!
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:47
@cjg040103 I see what you're doing wrong if you need help.
Clayton
@cjg040103
Sep 19 2015 18:47
@thomasvaeth yes
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:48
@cjg040103 there is a string and i need to turn it to an array. How can I do it?
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:48
@cjg040103 Let me make sure the challenge wasn't updated.
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:49
@KingHippo I'm stumped. From what I've read.....it should return a number.
Clayton
@cjg040103
Sep 19 2015 18:49
well first you need to turn the string into an array so "var a = str.split('');" because it needs to have a variable assigned to it for it to work with my version of the solution
Matt Yamamoto
@MattYamamoto
Sep 19 2015 18:50
@jctm30 that's the logical NOT operator. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators and scroll down about halfway
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:50
@cjg040103 The challenge changed. It didn't have 0 before. You could just throw in an if num === 0 return 1 else do the for loop.
Clayton
@cjg040103
Sep 19 2015 18:50
kk @thomasvaeth
Don Price
@KingHippo
Sep 19 2015 18:51
@TheHighPriestess i'm playing with the code now, I thought the quotes would have fixed it for sure.
Clayton
@cjg040103
Sep 19 2015 18:51
well first you need to turn the string into an array so "var a = str.split('');" because it needs to have a variable assigned to it for it to work with my version of the solution @aykutkaskaya
then you should reverse it with "var b = a.reverse();"
finally you should put it back together by doing "var c = b.join('');"
then return c
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:52
@KingHippo Yeah...i thought it seemed rather easy...and then when I tried it....
Clayton
@cjg040103
Sep 19 2015 18:52
This message was deleted
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:53
I got it @cjg040103 . the problem was the last line (.join)
@cjg040103 Thanks a lot!
CamperBot
@camperbot
Sep 19 2015 18:53
aykutkaskaya sends brownie points to @cjg040103 :sparkles: :thumbsup: :sparkles:
:star: 239 | @cjg040103 | http://www.freecodecamp.com/cjg040103
Clayton
@cjg040103
Sep 19 2015 18:53
no prob! :smile:
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:54
@KingHippo I saw this: "If the first character cannot be converted to a number, parseInt() returns NaN."
Hans van Riet
@hansinla
Sep 19 2015 18:54
@cjg040103 You’re instantiating your variables inside the for…loop, so nothing gets retained while you’re iterating over the loop.
Clayton
@cjg040103
Sep 19 2015 18:54
@thomasvaeth now what?
function factorialize(num) {
  if(num = 0) {
    return 1;
  } else {
      for(var i = 1; i < num; i++) {
  var a = num;
  var b = i;
  var c = a * b;
  }
  return c;
  }
}

factorialize(5, '');
returns undefined
?
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:56
@cjg040103 i think we are at the same question. do you need help?
Clayton
@cjg040103
Sep 19 2015 18:56
yes
above is my current code
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:56
@cjg040103 can i suggest you a shorter code?
Clayton
@cjg040103
Sep 19 2015 18:56
k
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:57
@cjg040103 Well it should be === 0 instead of = 0
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:57

function factorialize(num) {

var tot=1;

for(i=1;i<=num;i++){
tot=i*tot;
}

return tot;

}

factorialize(5, '');

Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 18:58

@KingHippo If you go here and paste that binary number in..it will return 65:

http://www.binaryhexconverter.com/binary-to-decimal-converter

Christoffer92
@Christoffer92
Sep 19 2015 18:58
Hi i need help on the sum all primes :)
Clayton
@cjg040103
Sep 19 2015 18:58
@aykutkaskaya wow i feels stoopid
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 18:59
no you should not!
Christoffer92
@Christoffer92
Sep 19 2015 18:59
//Bonfire: Sum All Primes
function numIsPrime(num){
  var isPrime = false;

  for(i = 1; i<=num-1; i++) {
    //console.log("i =", i);
    if ((num == 2) || ((num % i != 0) && (num % 2 != 0) && (num != i))){

        isPrime = true;
      console.log(num, "==", isPrime);  
      //Log: 2 == true, 3 == true, 5 == true, 7 == true, 9 == true;
    }
    else {
      isPrime = false;
    }
  }
  return isPrime;
  }

function sumPrimes(num) {

  var sum = 0;

  for (var i = 2; i<num-1; i++){
    if(numIsPrime(i) == true)
      sum += i;
  }

  return numIsPrime(9); //my numIsPrime function dose not work as intented as 9 is not a prime Number.
}
sumPrimes(10);
//numIsPrime's test succeed: 1, 2, 3, 4, 5, 6, 7, 8.
//Christoffer92
I dont know why isNumPrime(9) returns true :s Bonfire: Sum All Primes
CamperBot
@camperbot
Sep 19 2015 18:59
Sorry, can't find a bonfire called sum all primesfunction numisprimenum var isprime false fori 1 inum-1 i consolelogi i if num 2 num i 0 num 2 0 num i isprime true consolelognum isprime log 2 true 3 true 5 true 7 true 9 true else isprime false return isprime function sumprimesnum var sum 0 for var i 2 inum-1 i ifnumisprimei true sum i return numisprime9 my numisprime function dose not work as intented as 9 is not a prime numbersumprimes10numisprimes test succeed 1 2 3 4 5 6 7 8christoffer92i dont know why isnumprime9 returns true s bonfire sum all primes. [ Check the map? ]
Thomas Vaeth
@thomasvaeth
Sep 19 2015 18:59
function factorialize(num) {
    var total = num;
    if (num === 0) {
        return 1;
    } else {
        for (var i = num - 1; i > 0; i--) {
            total *= i;
        }
        return total;
    }
}

factorialize(5, '');
Don Price
@KingHippo
Sep 19 2015 19:00
@TheHighPriestess try this
var num = "01000001"
var test = parseInt(num, 2);
console.log(test);
Hans van Riet
@hansinla
Sep 19 2015 19:01
@Christoffer92 The best way to tackle prime problems is the use of Erasthothenes sieve. Do a search on that and see if that will help.
Don Price
@KingHippo
Sep 19 2015 19:01
forgot the semicolon on the first line
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:02
@KingHippo yeah..that works
wonder why it doesn't work when it's saved to a variable though
Don Price
@KingHippo
Sep 19 2015 19:03
@TheHighPriestess cool! I'm not sure, that's kinda weird.
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:03
welll..that's not what I mean...
Christoffer92
@Christoffer92
Sep 19 2015 19:03
@hansinla Ohh okay, i did use the ineffective Trial Division from http://www.wikihow.com/Check-if-a-Number-Is-Prime. As it seemed the easiest one to understand :)
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:03
I mean...when it's turned INTO a string
Don Price
@KingHippo
Sep 19 2015 19:05
@TheHighPriestess I think parseInt only works with strings
Christoffer92
@Christoffer92
Sep 19 2015 19:05
@hansinla But thanks, im just minor annoyed that my isNumPrime function gives out true on 9. when clearly 8 % 2 = 0.
CamperBot
@camperbot
Sep 19 2015 19:05
christoffer92 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 380 | @hansinla | http://www.freecodecamp.com/hansinla
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:06
@KingHippo yeah...but does this: var n = num.toString(); ...turn num to a string?
@KingHippo thank you for your help, btw
CamperBot
@camperbot
Sep 19 2015 19:06
thehighpriestess sends brownie points to @kinghippo :sparkles: :thumbsup: :sparkles:
:star: 177 | @kinghippo | http://www.freecodecamp.com/kinghippo
Clayton
@cjg040103
Sep 19 2015 19:06
i need help with Bonfire: Mutations
CamperBot
@camperbot
Sep 19 2015 19:06
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:06
and i even checked that it was a string...using typeof
Clayton
@cjg040103
Sep 19 2015 19:06
bonfire mutations
CamperBot
@camperbot
Sep 19 2015 19:06

:fire:Bonfire: Mutations :link:

function mutation(arr) {
  return arr;
}

mutation(['hello', 'hey']);

Return true if the string in the first element of the array contains all of the letters of the string in the second element of the array.

more info:  bf details | bf links | hint

Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:06
it came back "string"
weird
maybe one cannot convert a binary number to a string?
tommyosh
@tommyosh
Sep 19 2015 19:09
im just starting bonfiress :/
Bonfire: Sum All Numbers in a Range
CamperBot
@camperbot
Sep 19 2015 19:09

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

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

sumAll([1, 4]);

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

more info:  bf details | bf links | hint

Don Price
@KingHippo
Sep 19 2015 19:09
@TheHighPriestess yeah that is weird. I'm wondering if it's some kind of problem with the two functions communicating with each other
Hans van Riet
@hansinla
Sep 19 2015 19:15
@Christoffer92 Keep in mind that you need to consider num as well, right now you stop your loop at num-1
@tommyosh You want to use a loop that starts at the first number in the array and ends with the last number in the array.
Elizabeth Hatleli
@TheHighPriestess
Sep 19 2015 19:18
@KingHippo it is weird....i'm still searching to see if it's even possible to use a variable name instead
Robert Means
@BoDonkey
Sep 19 2015 19:19
I was working on a bonfire and put in some code, hit run tests and it seemed like it went into an infinite loop with the page crashing. I reloaded the page with the intention of troubleshooting. Everything was locked up. Tried hitting reset, no go. Shut down chrome and restarted, went back to that bonfire, still locked up. Any thoughts/ideas?
Jhonnathan
@jhonnathan78
Sep 19 2015 19:20
Hello every one
Hans van Riet
@hansinla
Sep 19 2015 19:20
@jhonnathan78 hi
Jhonnathan
@jhonnathan78
Sep 19 2015 19:21
can any one please help me out
I am trying to understand the following
Math.floor(Math.random() * (3 - 1 + 1)) +1;
I understand what floor does
and random
what I do no understand is the numbers at the end
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 19:21
'''code test'''
CamperBot
@camperbot
Sep 19 2015 19:21
:bulb: to format code use backticks! ``` more info
Christoffer92
@Christoffer92
Sep 19 2015 19:22
@hansinla well because a number divided by itself will allways be divided into a whole number, leaving 0 in reaminder. So in this case i only want to go to num-1
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 19:22
code test
:) ok
Bonfire: Find the Longest Word in a String
CamperBot
@camperbot
Sep 19 2015 19:22

:fire:Bonfire: Find the Longest Word in a String :link:

function findLongestWord(str) {
  return str.length;
}

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

Return the length of the longest word in the provided sentence.

more info:  bf details | bf links | hint

Hans van Riet
@hansinla
Sep 19 2015 19:22
@jhonnathan78 The other calculation defines the range of integersb that random will return, since random returns a float between 0 and 1.
@Christoffer92 I’m talking about your bottom loop.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 19:23
I wrote a code for Bonfire: Find the Longest Word in a String
Is there any short method?
function findLongestWord(str) {
var a = str.split(' ');
  var max=0;
  for(i=0;i<a.length;i++){

    if(a[i].length<max) continue;

    else max=a[i].length;
  }
  console.log(max);

  return max;
}

findLongestWord("The quick brown fox jumped over the lazy dog");
Jhonnathan
@jhonnathan78
Sep 19 2015 19:23
i get what it does I just don't understand the math at the end
Hans van Riet
@hansinla
Sep 19 2015 19:24
@jhonnathan78 It establishes the minimum (in your case the last +1) and the maximum.
@aykutkaskaya There is, you will get to that when you encounter functional javascript.
Christoffer92
@Christoffer92
Sep 19 2015 19:25
@hansinla oh yeah your right, didnt paid much attention to it, sense the isNumPrime function still doesnt work.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 19:26
@hansinla how can I do that?
Hans van Riet
@hansinla
Sep 19 2015 19:26
@aykutkaskaya Do you want me to send you the code privately?
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 19:27
@hansinla sure
Jhonnathan
@jhonnathan78
Sep 19 2015 19:27
(3 - 1 + 1)) +1
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 19:29
thank you @hansinla
CamperBot
@camperbot
Sep 19 2015 19:29
aykutkaskaya sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 381 | @hansinla | http://www.freecodecamp.com/hansinla
Hans van Riet
@hansinla
Sep 19 2015 19:29
@jhonnathan78 (3 - 1 + 1) is to establish the max value. Math.random generates up to 1 (not including) so by multiplying by 3, you generate up to 3
Jhonnathan
@jhonnathan78
Sep 19 2015 19:32
yeah but how does it work Math.floor(Math.random() * (3 - 1 + 1)) +1;
(3-1+1) would equal 3
Hans van Riet
@hansinla
Sep 19 2015 19:32

@jhonnathan78 from the mozilla dev website:

// Returns a random integer between min (included) and max (included)
// Using Math.round() will give you a non-uniform distribution!
function getRandomIntInclusive(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

Yes, it would for 1, but not if your minimum is 2.

Jhonnathan
@jhonnathan78
Sep 19 2015 19:33
and then (3) + 1 would equal what
Hans van Riet
@hansinla
Sep 19 2015 19:34
@jhonnathan78 The first expression is multiplied with the result of Math.random
Jhonnathan
@jhonnathan78
Sep 19 2015 19:35
so then Math.random * (3)
why the + 1 at the end
Hans van Riet
@hansinla
Sep 19 2015 19:35
@jhonnathan78 To set a minimum of 1, otherwise the minimum would be 0
Jhonnathan
@jhonnathan78
Sep 19 2015 19:37
but would math random which returns a decimal between 0 and 1 times (3) equal a random decimal number
and then if you add + 1 then it would equal more than 3
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:38
@jhonnathan78 note that Math.random 3 gives you numbers greater than and including zero, and less than, but not including three. So if you were to floor that Math.floor(Math.random() 3) you would get integers 0, 1, and 2
Jhonnathan
@jhonnathan78
Sep 19 2015 19:39
still don't get it
Math random returns a number between 0 and 1 right?
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:40
but never 1 iteslf
just 0.999999...
Jake Bryant
@jbryant8706
Sep 19 2015 19:40
var skillArray = {
    'php':'html', 
    'javascript':'python'
}
skillArray.push(' ');
console.log(skillArray);
It could not notice the push seemed not function at all
Jhonnathan
@jhonnathan78
Sep 19 2015 19:40
exactly
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:40
@jbryant8706 skillArray is an object, not an array
@jhonnathan78 so if you use floor on Math.random (not mutiplied by anything) you will always get 0.
Jake Bryant
@jbryant8706
Sep 19 2015 19:41
That's why push could not notice it
@MattYamamoto How can I create proper array?
Jhonnathan
@jhonnathan78
Sep 19 2015 19:42
ok so Math.floor(Math.random() (3 - 1 + 1)) +1; is like saying Match.floor(0.99999 (3)) + 1
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:43
@jbryant8706 Arrays use [ ] square brackets. But they don't have name value pairs like you are using. You can add to objects using dot notation skillArray.newName = newValue
Hans van Riet
@hansinla
Sep 19 2015 19:43
@jhonnathan78 Math.floor(Math.random() * 3 ) +1 Math.random is anything between 0 (inclusive) and 1 (exclusive).
Jhonnathan
@jhonnathan78
Sep 19 2015 19:43
but then if you multiply 0.9999 * 3 + 1 you get more than 3
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:44
@jhonnathan78 yes, but then you floor that and you get 3 exactly
3.9999 rounded down is 3
Hans van Riet
@hansinla
Sep 19 2015 19:44
@jhonnathan78 Look at the parentheses though.
x34passenger
@x34passenger
Sep 19 2015 19:45
Bonfire: Search and Replace - I can't seem to replace with upper case
function myReplace(str, before, after) {
  var firstChar = '';
  var newAfter = '';
  firstChar = before.charAt(0);

  if(firstChar == firstChar.toUpperCase())
  {
    newAfter = after.toUpperCase();
  }
  else
  {
    newAfter = after;
  }

  var afterStr = str.replace(before, newAfter)
  return afterStr;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
CamperBot
@camperbot
Sep 19 2015 19:45
Sorry, can't find a bonfire called search and replace - i cant seem to replace with upper casefunction myreplacestr before after var firstchar var newafter firstchar beforecharat0 iffirstchar firstchartouppercase newafter aftertouppercase else newafter after var afterstr strreplacebefore newafter return afterstrmyreplacea quick brown fox jumped over the lazy dog jumped leaped. [ Check the map? ]
Jhonnathan
@jhonnathan78
Sep 19 2015 19:45
oh that is why it remains at 3
got it
thank you MattYamamoto
CamperBot
@camperbot
Sep 19 2015 19:45
if you want to thank someone, put an @ before their name!
Jhonnathan
@jhonnathan78
Sep 19 2015 19:45
got it
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:46
@jhonnathan78 yeah, it's a little confusing and very easy to mess up
Jhonnathan
@jhonnathan78
Sep 19 2015 19:46
now I get it
Hans van Riet
@hansinla
Sep 19 2015 19:46
@jhonnathan78 You’re welcome
Jhonnathan
@jhonnathan78
Sep 19 2015 19:47
thanks to you as well @hansinla
CamperBot
@camperbot
Sep 19 2015 19:47
jhonnathan78 sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 382 | @hansinla | http://www.freecodecamp.com/hansinla
Jhonnathan
@jhonnathan78
Sep 19 2015 19:48
the explanation for this waypoint is not very detail
Math.floor(Math.random() (3 - 1 + 1)) +1; so basically this can be done the following way as well am I correct? Math.floor(Math.random() (3)) +1;
x34passenger
@x34passenger
Sep 19 2015 19:50
Bonfire: Search and Replace - I can't seem to replace with upper case
function myReplace(str, before, after) {
  var firstChar = '';
  var newAfter = '';
  firstChar = before.charAt(0);

  if(firstChar == firstChar.toUpperCase())
  {
    newAfter = after.toUpperCase();
  }
  else
  {
    newAfter = after;
  }

  var afterStr = str.replace(before, newAfter)
  return afterStr;
}

myReplace("A quick brown fox jumped over the lazy dog", "jumped", "leaped");
CamperBot
@camperbot
Sep 19 2015 19:50
Sorry, can't find a bonfire called search and replace - i cant seem to replace with upper casefunction myreplacestr before after var firstchar var newafter firstchar beforecharat0 iffirstchar firstchartouppercase newafter aftertouppercase else newafter after var afterstr strreplacebefore newafter return afterstrmyreplacea quick brown fox jumped over the lazy dog jumped leaped. [ Check the map? ]
Jhonnathan
@jhonnathan78
Sep 19 2015 19:50
we do not need the subtraction plus the addition in the parenthesis
Matt Yamamoto
@MattYamamoto
Sep 19 2015 19:51
@jhonnathan78 yes, the extra stuff in there is as a generic formula for when you need a set of random numbers within a given range.
But you can always just do that part in your head.
Hans van Riet
@hansinla
Sep 19 2015 19:51
@jhonnathan78 Yes, but again if the minimum value is 2 or higher, you should use the Mozilla code that I posted above.
Jhonnathan
@jhonnathan78
Sep 19 2015 19:53
why
Kim Still
@twomoredays
Sep 19 2015 19:54
bonfire check for palindromes
CamperBot
@camperbot
Sep 19 2015 19:54

:fire:Bonfire: Check for Palindromes :link:

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



palindrome("eye");

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

more info:  bf details | bf links | hint

Jhonnathan
@jhonnathan78
Sep 19 2015 19:54
what is the question @daksh844
Kim Still
@twomoredays
Sep 19 2015 19:54
hint
CamperBot
@camperbot
Sep 19 2015 19:54
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Hans van Riet
@hansinla
Sep 19 2015 19:55
@jhonnathan78 Because it will no longer be 3-1+1, but 3-2+1 etc
the mozilla documentation really explains it all
Deepanshu Kaushik
@daksh844
Sep 19 2015 19:56
blob
here is my code @jhonnathan78
Jhonnathan
@jhonnathan78
Sep 19 2015 19:57
@hansinla I get that that is a better way since you can pass any numbers in the function
I just don't get why we need to do the math in the parenthesis why just not state the number we want to multiply by the math random
?
@daksh844 flips should equal 0
that is what the directions are asking you to do
Deepanshu Kaushik
@daksh844
Sep 19 2015 19:59
Oh I took this in boolean manner
as 0 is also false thus
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:00
@jhonnathan78 well you have to think that through is all... the formula just avoids the thinking part. If you want a random number between 25 and 32 then you have to think, okay that's a range of 8 numbers (if we include the endpoints) so that's math.random 8 then I need to scale up to 25 so +25. but if you use the formula it's a no brainer. floor(math.random (32 - 25 +1) ) + 25
Deepanshu Kaushik
@daksh844
Sep 19 2015 20:00
never mind thanks @jhonnathan78
CamperBot
@camperbot
Sep 19 2015 20:00
daksh844 sends brownie points to @jhonnathan78 :sparkles: :thumbsup: :sparkles:
:star: 38 | @jhonnathan78 | http://www.freecodecamp.com/jhonnathan78
Jhonnathan
@jhonnathan78
Sep 19 2015 20:02
yeah but wouldn't (32 - 25 + 1) always equal out to the same
?
8
so where is the formula producing a random number?
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:04
@jhonnathan78 yes, I'm just saying that it helps avoid using the brain. I'm with you though, I'll just simplify it and keep it as one number... looks weird othewise
Jhonnathan
@jhonnathan78
Sep 19 2015 20:05
sorry I still don't get why it is done like this
Math.floor(Math.random() * (3 - 1 + 1)) +1;
why do we need to do 3-1+1
if it will always be 3
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:06
It's what @hansinla posted earlier and what's on that bonfire page
// Returns a random integer between min (included) and max (included)
// Using Math.round() will give you a non-uniform distribution!
function getRandomIntInclusive(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
Luis Felipe López G.
@luishendrix92
Sep 19 2015 20:06
@jhonnathan78 Because it's easier to understand for beginners, I guess.
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:06
I say you understand it enough and don't bother with why that formula
Luis Felipe López G.
@luishendrix92
Sep 19 2015 20:07
But I say that it looks more confusing
lol
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:07
Checking again if anyone has done the Twitch TV challenge.
Hans van Riet
@hansinla
Sep 19 2015 20:07
@thomasvaeth yes
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:07
@thomasvaeth what did you need?
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:08
I need help with the search function. Currently it only works if I type the letters in order. Like freecodecamp only comes up if I start with f. But I want it to come up if I search like camp or something. @hansinla @MattYamamoto
Luis Felipe López G.
@luishendrix92
Sep 19 2015 20:09
the -1 (inside) and the +1 (outside) are supposed to represent the value. The +1 inside represents the control number to avoid reducing to 1 the expected top number (which is 3)
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:09
  $('input').keyup(function() {
    var valThis = $(this).val();
    $('li').each(function() {
      var text = $(this).text().toLowerCase();
        (text.indexOf(valThis) == 0) ? $(this).show() : $(this).hide(); 
    });
  });
Hans van Riet
@hansinla
Sep 19 2015 20:11
@thomasvaeth I made the input string into a regex re and filter using channel.name.match(re)
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:11
I think you want your indexOf to be >= 0
But I agree with @hansinla, I used a regex too
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:11
@MattYamamoto >= 0 worked! Thank you.
CamperBot
@camperbot
Sep 19 2015 20:11
thomasvaeth sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 338 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:12
Could you two link me to your projects? Curious what it looks like with Regex.
Luis Felipe López G.
@luishendrix92
Sep 19 2015 20:13
It looks like a finder (in a ul element) with an input box. It's damn easy with new Regexp()
Hans van Riet
@hansinla
Sep 19 2015 20:13
@thomasvaeth I don’t have the final version on codepen, this is the link:
http://www.hansvanriet.com/portfolio/twitch/index.html
Luis Felipe López G.
@luishendrix92
Sep 19 2015 20:13
And even easier with Angular filters
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:13
@luishendrix92 They switched the order of the projects. I don't think we're supposed to use Angular on this one.
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:14
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:14
@hansinla Nice! I like the red and green colors. I'm currently using icons instead.
Hans van Riet
@hansinla
Sep 19 2015 20:15
@thomasvaeth Bootstrap to the rescue!
Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:16
@MattYamamoto Nice! You added a lot of extras.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:16
Bonfire: Confirm the Ending
any help or pair
CamperBot
@camperbot
Sep 19 2015 20:16
Sorry, can't find a bonfire called confirm the ending any help or pair. [ Check the map? ]
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:16
Bonfire: Confirm the Ending
CamperBot
@camperbot
Sep 19 2015 20:16

: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

Thomas Vaeth
@thomasvaeth
Sep 19 2015 20:16
@hansinla Hah yeah. I'm trying to do this one without Bootstrap. The first 4 I used all Bootstrap.
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:17
@thomasvaeth yeah, I went a little crazy... I tend to do that.
Hans van Riet
@hansinla
Sep 19 2015 20:18
@thomasvaeth I hear you, I keep coming back to it.
dormouss
@dormouss
Sep 19 2015 20:23

Some help would be appreciated. I'm trying to get the buttons at the bottom of this page to work, and they are just refusing to cooperate. I click on them, and nothing happens. What am I doing wrong? (I've only completed the links for two, so I know two them have # as the link)

http://codepen.io/dormouss/pen/RWRwOd

Hans van Riet
@hansinla
Sep 19 2015 20:24
@dormouss you have target=‘_blank’ so they’re not linking to anything
dormouss
@dormouss
Sep 19 2015 20:25
@hansinla Hmm. I included that because the codepen documentation said to. Something about the iframes.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:25
any help ?
Bonfire: Confirm the Ending
CamperBot
@camperbot
Sep 19 2015 20:25

: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

sickachu
@sickachu
Sep 19 2015 20:26
I'm working on confirm the ending too, what's the problem
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:27
@sickachu for me?
sickachu
@sickachu
Sep 19 2015 20:27
@aykutkaskaya yes
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:28
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
var a=str.split(' ');
  var b= a.length-1;
  console.log(a);
  if(a[b]==target)
  return true;

  else return false;
}

end("Bastian", "n", "");
when i change var a=str.split(' ');
to var a=str.split('');
Hans van Riet
@hansinla
Sep 19 2015 20:28
This message was deleted
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:28
it works only for one words
but this code also work except one word str
I got stuck
sickachu
@sickachu
Sep 19 2015 20:29
@aykutkaskaya you need something to deal with the sentences right? I did this
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:29
yep
sickachu
@sickachu
Sep 19 2015 20:29

@aykutkaskaya ```function end(str, target) {
//pass str through split by (" ");
//if str.length = 1, then split by ("");
//check if target is end of str (or at array str[str.length - 1]);
//boolean str return true if there, return false else case.
var boolStr = true;
var strArray = str.split(" ");
if(strArray.length = 1){
strArray = str.split("");
}
if(strArray[(strArray.length - 1)] != target){
boolStr = false;
}
else
boolStr = true;
return boolStr;
}

end("Bastian", "n", "");

Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:29
@dormouss yeah, you do want to target -blank. I thnk the issue is that those are buttons and not links. For the button you'd want a click handler I think.
CamperBot
@camperbot
Sep 19 2015 20:29
mattyamamoto sends brownie points to @dormouss :sparkles: :thumbsup: :sparkles:
:star: 288 | @dormouss | http://www.freecodecamp.com/dormouss
Matt Yamamoto
@MattYamamoto
Sep 19 2015 20:29
or make that a link
whoops..typo of think
dormouss
@dormouss
Sep 19 2015 20:30
Well, thanks right back at you @MattYamamoto. :smile:
CamperBot
@camperbot
Sep 19 2015 20:30
dormouss sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 339 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
Hans van Riet
@hansinla
Sep 19 2015 20:31
@dormouss
<a href="http://www.github.com" target='_blank'><button class='btn btn-block' >GitHub</button></a>
sickachu
@sickachu
Sep 19 2015 20:31
@aykutkaskaya sorry messed up the message. anyways there's an if checking if its a sentence or a single word.
I can't make it pass the 'name' sentence though.
dormouss
@dormouss
Sep 19 2015 20:33
Thanks @hansinla.
CamperBot
@camperbot
Sep 19 2015 20:33
dormouss sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 383 | @hansinla | http://www.freecodecamp.com/hansinla
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:34
@sickachu I solvev with this way
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor

var wordCount=str.split(' ').length;
  if (wordCount==1){
var a=str.split('');
  var b= a.length-1;
  if(a[b]==target)
  return true;

  else return false;

  }
else {    
var a=str.split(' ');
  var b= a.length-1;
  console.log(wordCount);
  if(a[b]==target)
  return true;

  else return false;
}
}
thank you @sickachu
CamperBot
@camperbot
Sep 19 2015 20:34
aykutkaskaya sends brownie points to @sickachu :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sickachu
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:35
@sickachu thank you
CamperBot
@camperbot
Sep 19 2015 20:35
aykutkaskaya sends brownie points to @sickachu :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for sickachu
Pete McPherson
@StartupDino
Sep 19 2015 20:35
Bonfire: Confirm the Ending
CamperBot
@camperbot
Sep 19 2015 20:35

: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

Pete McPherson
@StartupDino
Sep 19 2015 20:35
hint
CamperBot
@camperbot
Sep 19 2015 20:35
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:35
@StartupDino I wrote my code just above
Rich Churcher
@richchurcher
Sep 19 2015 20:38
@StartupDino @aykutkaskaya the hint about using substr() is a good one, well worth reading about that function ;)
sickachu
@sickachu
Sep 19 2015 20:38
So I'm doing it the hard way haha
Rich Churcher
@richchurcher
Sep 19 2015 20:38
heh well maybe?
sickachu
@sickachu
Sep 19 2015 20:39
Thanks @StartupDino @aykutkaskaya
CamperBot
@camperbot
Sep 19 2015 20:39
sickachu sends brownie points to @startupdino and @aykutkaskaya :sparkles: :thumbsup: :sparkles:
:star: 180 | @aykutkaskaya | http://www.freecodecamp.com/aykutkaskaya
:star: 178 | @startupdino | http://www.freecodecamp.com/startupdino
Rich Churcher
@richchurcher
Sep 19 2015 20:39
the trick is to find out how long the second argument is, then take a substring of that length from the end of the first argument and compare the two
var str = "foo";
console.log(str.substr(1)); // "oo"
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:46
Bonfire: Truncate a string
CamperBot
@camperbot
Sep 19 2015 20:46

:fire:Bonfire: Truncate a string :link:

function truncate(str, num) {
  // Clear out that junk in your trunk
  return str;
}

truncate('A-tisket a-tasket A green and yellow basket', 11);

Truncate a string (first argument) if it is longer than the given maximum string length (second argument). Return the truncated string with a '...' ending.

more info:  bf details | bf links | hint

Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:46
Is there any problem at this bonfire?
function truncate(str, num) {
  // Clear out that junk in your trunk
  var a=str.split(' ');

  if(str.length>num){
    str=a[0] + "...";
  }
  console.log(str);
  return str;
}

truncate("Peter Piper picked a peck of pickled peppers", 14, "");
here is my code
Rory Smith
@alanbuchanan
Sep 19 2015 20:47
@aykutkaskaya the result has to be 14 chars long
Rich Churcher
@richchurcher
Sep 19 2015 20:47
so if I'm understanding your code correctly, if the string is longer than 14 chars it'll be truncated to the first word plus '...'
Hans van Riet
@hansinla
Sep 19 2015 20:47
@aykutkaskaya You take the first word in the string.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:48
@alanbuchanan oh i see
Rich Churcher
@richchurcher
Sep 19 2015 20:48
You don't really want to use split here
it's not about words, it's about length in characters
(and I believe you also need to allow three spaces for the '...' ;) )
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:48
@alanbuchanan but there is a message like this
assert(truncate("A-tisket a-tasket A green and yellow basket", 11) === "A-tisket...", '"A-tisket a-tasket A green and yellow basket", 1 should return "A-tisket...".');
Rory Smith
@alanbuchanan
Sep 19 2015 20:49
yes, because you pass in 11, and the result is 11 chars long @aykutkaskaya
Pete McPherson
@StartupDino
Sep 19 2015 20:49
Bonfire: Repeat a string repeat a string
CamperBot
@camperbot
Sep 19 2015 20:49

:fire:Bonfire: Repeat a string repeat a string :link:

function repeat(str, num) {
  // repeat after me
  return str;
}

repeat('abc', 3);

Repeat a given string (first argument) n times (second argument). Return an empty string if n is a negative number.

more info:  bf details | bf links | hint

Pete McPherson
@StartupDino
Sep 19 2015 20:49
hint
CamperBot
@camperbot
Sep 19 2015 20:49
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jesse
@jctm30
Sep 19 2015 20:49
function destroyer(arr) {
    var result = [];
    for (var i = 0; i < arr.length; i++) {
        var current = arr[i];
        var destroy = false;
        for (var j = 1; !destroy && j < arguments.length; j++) {
            if (current === arguments[j]) {
                destroy = true;
            }
        }
        if (!destroy) {
            result.push(current);
        }
    }
    return result;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
hello folks, im doing seek and destroy. above is my code.
I guess im not fully understanding the necessity of the variable "destroy"
Juan Riquelme
@soulchainer
Sep 19 2015 20:49
Or better, use the ellipsis … char and only use one position ;).
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:49
okay there should be "num" chars at the output
Rory Smith
@alanbuchanan
Sep 19 2015 20:49
@aykutkaskaya yep
Rory Smith
@alanbuchanan
Sep 19 2015 20:50
Screen Shot 2015-09-19 at 21.42.01.png
does anyone know how to get webstorm to give a dropdown of css files in the link element, like this?
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:50
function truncate(str, num) {
  // Clear out that junk in your trunk
   if(str.length>num){
    str=str.slice(0,num-3) + "...";
  }
  console.log(str);
  return str;
}

truncate("Peter Piper picked a peck of pickled peppers", 14, "");
that's work
thank you @alanbuchanan
CamperBot
@camperbot
Sep 19 2015 20:51
aykutkaskaya sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 371 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 19 2015 20:51
@aykutkaskaya :thumbsup:
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:51
I always choose the long way :)
Rory Smith
@alanbuchanan
Sep 19 2015 20:51
the scenic route :)
Juan Riquelme
@soulchainer
Sep 19 2015 20:52
… ← ellipsis, one char. ... ← three dots, 3 chars.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:52
@soulchainer is that for me?
Juan Riquelme
@soulchainer
Sep 19 2015 20:53
I guess, yes.
Aykut KAŞKAYA
@aykutkaskaya
Sep 19 2015 20:53
thank you
CamperBot
@camperbot
Sep 19 2015 20:53
if you want to thank someone, put an @ before their name!
Daulis Gonzalez
@Daulisg
Sep 19 2015 20:58
hi, everyone! can some one tell me whats the best resolution to use as an img bg?
for my wbsite bg i mean
Luis Felipe López G.
@luishendrix92
Sep 19 2015 20:59
@Daulisg Something in 1080p using background-size: cover
highly optimized and downgradable to 720p (if you have a built-in resolution detector)
Daulis Gonzalez
@Daulisg
Sep 19 2015 21:01
im just trying to build my personal website but i see that many people have different ideas on what to use! @luishendrix92 Thanks, for the quick answer
CamperBot
@camperbot
Sep 19 2015 21:01
daulisg sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 368 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Chris
@Shifthawke
Sep 19 2015 21:27
-pulls up chair and sits down- I have a questioned about the updated FCC.
Anyone familiar with new and old?
I had taken some time off and it released while I was gone. So when I looked at the map, I had a bunch of it checked off and a bunch of it not. (expected.) But looking at jquery, none of it is checked off. So did a whole bunch of it chance resulting in unchecked way points?
Rich Churcher
@richchurcher
Sep 19 2015 21:34
I believe they stopped outsourcing much of their content to Codecademy, so what you're seeing is probably the in-house exercises
Aaron Davis
@danger1300
Sep 19 2015 21:39
I have a question regarding waypoint 20 under basic javascript. I was able to get a correct solution and continue on, but i don't know that i achieved the solution the example was going for. Would someone be willing to take a look my solution? I do not want to spoil it for others who may not have done it yet.
Imran Ismail
@imranismail
Sep 19 2015 21:39
anyone free to take a lookat my express app?
Juan Riquelme
@soulchainer
Sep 19 2015 21:42
If you want, you're free to PM me, @danger1300
Aaron Davis
@danger1300
Sep 19 2015 21:42
@soulchainer thank you, i will
CamperBot
@camperbot
Sep 19 2015 21:42
danger1300 sends brownie points to @soulchainer :sparkles: :thumbsup: :sparkles:
:star: 282 | @soulchainer | http://www.freecodecamp.com/soulchainer
Rory Smith
@alanbuchanan
Sep 19 2015 21:58
thanks for the help with webstorm @Adoyle2014
CamperBot
@camperbot
Sep 19 2015 21:58
alanbuchanan sends brownie points to @adoyle2014 :sparkles: :thumbsup: :sparkles:
:star: 305 | @adoyle2014 | http://www.freecodecamp.com/adoyle2014
naxty
@naxty
Sep 19 2015 21:59
bonfire symmetric
CamperBot
@camperbot
Sep 19 2015 21:59

:fire:Bonfire: Symmetric Difference :link:

function sym(args) {
  return arguments;
}

sym([1, 2, 3], [5, 2, 1, 4]);

Create a function that takes two or more arrays and returns an array of the symmetric difference of the provided arrays.

more info:  bf details | bf links | hint

naxty
@naxty
Sep 19 2015 21:59
hint
CamperBot
@camperbot
Sep 19 2015 21:59
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Vivek Kumar
@leocder-07
Sep 19 2015 22:07
when i try to add a script element
it shows chai is not defined
can anyone help
Michael Tang
@MichaelATang
Sep 19 2015 22:14
@MichaelATang
anyone getting problems with Waypoint: Get Set for Basejumps
? all goes as planned but there is a new option " What would you like to write tests with?" that crashes the script
Chris
@Shifthawke
Sep 19 2015 22:17
wiki chai
CamperBot
@camperbot
Sep 19 2015 22:17

:point_right: chai assert [wiki]

assert(expression, message)

  • @param{ Mixed }expressionto test for truthiness
  • @param{ String }messageto display on error

Write your own test expressions.

assert('foo' !== 'bar', 'foo is not bar');
assert(Array.isArray([]), 'empty arrays are arrays');

details: http://chaijs.com/api/assert/

:pencil: read more about chai assert on the FCC Wiki

Chris
@Shifthawke
Sep 19 2015 22:18
wiki crash
CamperBot
@camperbot
Sep 19 2015 22:18
no wiki entry for: crash
:pencil: click here to create one now!after creating your page type update to reload it here
Chris
@Shifthawke
Sep 19 2015 22:18
wiki crashing script
CamperBot
@camperbot
Sep 19 2015 22:18
no wiki entry for: crashing script
:pencil: click here to create one now!after creating your page type update to reload it here
Chris
@Shifthawke
Sep 19 2015 22:18
@leocder-07 check the first wiki from camperbot
Alex Lebedev
@alexey-broadcast
Sep 19 2015 22:22
Hi everyone! Just finished weather app zipline. Can you watch and say if there are any mistakes? http://t.co/ndcirTwzuu
Chris
@Shifthawke
Sep 19 2015 22:22
I'll check it give me a sec.
That @alexey-broadcast THAT is very Purdy.
It works great for me. Only took me two seconds to find the c/f.
Alex Lebedev
@alexey-broadcast
Sep 19 2015 22:25
@Shifthawke thanks!
CamperBot
@camperbot
Sep 19 2015 22:25
alexey-broadcast sends brownie points to @shifthawke :sparkles: :thumbsup: :sparkles:
:star: 203 | @shifthawke | http://www.freecodecamp.com/shifthawke
ninjatron
@ninjatron
Sep 19 2015 22:26
does anyone know Angular?
Chris
@Shifthawke
Sep 19 2015 22:26
np ^_^
Moisés Man
@moigithub
Sep 19 2015 22:26
@ninjatron very basic
naxty
@naxty
Sep 19 2015 22:33
bonfire exact
CamperBot
@camperbot
Sep 19 2015 22:33

:fire:Bonfire: Exact Change :link:

function drawer(price, cash, cid) {
  var change;
  // Here is your change, ma'am.
  return change;
}

// Example cash-in-drawer array:
// [['PENNY', 1.01],
// ['NICKEL', 2.05],
// ['DIME', 3.10],
// ['QUARTER', 4.25],
// ['ONE', 90.00],
// ['FIVE', 55.00],
// ['TEN', 20.00],
// ['TWENTY', 60.00],
// ['ONE HUNDRED', 100.00]]

drawer(19.50, 20.00, [['PENNY', 1.01], ['NICKEL', 2.05], ['DIME', 3.10], ['QUARTER', 4.25], ['ONE', 90.00], ['FIVE', 55.00], ['TEN', 20.00], ['TWENTY', 60.00], ['ONE HUNDRED', 100.00]]);

Design a cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument.

more info:  bf details | bf links | hint

naxty
@naxty
Sep 19 2015 22:33
hint
CamperBot
@camperbot
Sep 19 2015 22:33
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jhonnathan
@jhonnathan78
Sep 19 2015 22:34
Hello everyone I need help understanding why the -1 at the end of this $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
anyone?
Jordan Murphy
@jordmur
Sep 19 2015 22:37
Hi, this might be a very basic question, and I'll understand if this doesn't quite make sense, but in the Javascript Slot Machine Section, you select each individual slot and add an image to it. You pick the slot using a jq selector. I can see the .slot in the CSS, but I can't see anything corresponding to it in the HTML. I'm just trying to make sure I know how the code selects that section since I can't quite trace it out. This is the exercise I'm referring to: http://www.freecodecamp.com/challenges/waypoint-give-your-javascript-slot-machine-some-stylish-images. Also, snippet I'm referring to is in what @jhonnathan78 posted right above me. Specifically, I don't get how the .slot is selected correctly.
@jhonnathan78 I believe the -1 is so that it corresponds to the correct index number. Instead of it being 1,2,3, we need it to be 0, 1, 2, hence the -1.
Jhonnathan
@jhonnathan78
Sep 19 2015 22:41
I am not sure that is the answer
see at that point we are inside the images array
and then we are grabbing the random number from slotOne and doing a -1 but why?
can we just do the slotOne by itself
Coira Ellison
@Coira
Sep 19 2015 22:42
hey @jhonnathan78 @jordmur
Jhonnathan
@jhonnathan78
Sep 19 2015 22:42
since it is already figuring out a random number a the top of the code
?
Jordan Murphy
@jordmur
Sep 19 2015 22:42
Take Slot 1 for instance. It is only going to generate a number 1-3
Jhonnathan
@jhonnathan78
Sep 19 2015 22:42
Hi @Coira
Jordan Murphy
@jordmur
Sep 19 2015 22:42
Hi!
If it generates 3, there isn't an image in the array for it
Coira Ellison
@Coira
Sep 19 2015 22:43
@jordmur is correct, the array index goes from 0 to 2
Jordan Murphy
@jordmur
Sep 19 2015 22:43
so it would return undefined.
Jhonnathan
@jhonnathan78
Sep 19 2015 22:43
oh that is why ok
i see
Coira Ellison
@Coira
Sep 19 2015 22:44
i think you've worked out the solutions to your questions?
Jhonnathan
@jhonnathan78
Sep 19 2015 22:44
thanks
CamperBot
@camperbot
Sep 19 2015 22:44
if you want to thank someone, put an @ before their name!
Jhonnathan
@jhonnathan78
Sep 19 2015 22:45
Thanks @jordmur
CamperBot
@camperbot
Sep 19 2015 22:45
jhonnathan78 sends brownie points to @jordmur :sparkles: :thumbsup: :sparkles:
:star: 176 | @jordmur | http://www.freecodecamp.com/jordmur
Jordan Murphy
@jordmur
Sep 19 2015 22:47
No problem, seems we are right around the same place. :)
Thomas Vaeth
@thomasvaeth
Sep 19 2015 23:25
I'm having trouble adding links to images if anyone can help me.
  var userIcon = document.createElement('img');
  userIcon.className = 'user-icon';
  userIcon.setAttribute('src', icon);
  user.appendChild(userIcon);
Rich Churcher
@richchurcher
Sep 19 2015 23:32
@thomasvaeth that looks ok, assuming user is an <a> element
Thomas Vaeth
@thomasvaeth
Sep 19 2015 23:36
@richchurcher I'm trying to add links to the pictures in http://codepen.io/thomasvaeth/pen/EVyabe
Rich Churcher
@richchurcher
Sep 19 2015 23:37
ok so a user is an li
you can either handle a click event on the li itself, or wrap the images in an anchor (a) element
Thomas Vaeth
@thomasvaeth
Sep 19 2015 23:39
Yeah. I can't figure out how to wrap the images in an anchor.
I don't know where to put it at all.
Matt Yamamoto
@MattYamamoto
Sep 19 2015 23:41
@thomasvaeth I think add a link element, then add your icon inside of that.
Rich Churcher
@richchurcher
Sep 19 2015 23:41
var userIcon = document.createElement('img');
var userLink = document.createElement('a');
userLink.appendChild(userIcon);
Just an extension of what you've already done (not tested, but something similar will work)
obviously you'll need to set attributes for each element
Thomas Vaeth
@thomasvaeth
Sep 19 2015 23:44
I think I'm just blanking right now after working on this for a while. @MattYamamoto @richchurcher
Rich Churcher
@richchurcher
Sep 19 2015 23:45
Definitely take a break!
Comfort
@freecodecomfort
Sep 19 2015 23:46
hello, has anyone done the Manage Packages with NPM?
Jhonnathan
@jhonnathan78
Sep 19 2015 23:54
I need help solving this one
Jhonnathan
@jhonnathan78
Sep 19 2015 23:59
any one knows how to solve this one?