These are chat archives for FreeCodeCamp/Help

28th
Aug 2015
Mohamed A. Farouk
@captainmoha
Aug 28 2015 00:00
@araedavis paste your code here
explain format
CamperBot
@camperbot
Aug 28 2015 00:01

: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

``` ⇦ Type 3 backticks, 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

Allison Davis
@araedavis
Aug 28 2015 00:02

`function palindrome(str) {
if(str.toLowerCase().replace(" ", "").replace(", ", "").replace(". ", "") == str.toLowerCase().replace(" ", "").replace(", ", "").replace(". ", "").split('').reverse().join('')){
return true;
} else {
return false;
}
}

palindrome("eye");

palindrome("A man, a plan, a canal. Panama");

palindrome("this is not a palindrome");`

crap.

```function palindrome(str) {
if(str.toLowerCase().replace(" ", "").replace(", ", "").replace(". ", "") == str.toLowerCase().replace(" ", "").replace(", ", "").replace(". ", "").split('').reverse().join('')){
return true;
} else {
return false;
}
}

palindrome("eye");

palindrome("A man, a plan, a canal. Panama");

palindrome("this is not a palindrome");```

ugh, what am i doing wrong in the markdown. sorry, v new at this
Mohamed A. Farouk
@captainmoha
Aug 28 2015 00:06
@araedavis no problem. Use three of this then paste your code then three more of this
Allison Davis
@araedavis
Aug 28 2015 00:07
@captainmoha is it just three ``` ? tried that and it didn't format
cblauwkamp
@cblauwkamp
Aug 28 2015 00:09
@araedavis I've had better luck getting it to work when I do shift-enter after the ```
tepeyak
@tepeyak
Aug 28 2015 00:12

Hi, I'm having issues "Adding Borders Around Elements" I can't see where my error is. }
.thick-green-border {
border-width: 10px; border-style: solid; border-color: green;
}
</style>

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

<img class="smaller-image" class="thick-green-border" src="https://bit.ly/fcc-relaxing-cat">
Instructions: Create a class called thick-green-border that puts a 10-pixel-wide green border with a style of solid around an HTML element, and apply that class to your cat photo.

Can someone help me see the error of my code? ^_^ Thx!
CamperBot
@camperbot
Aug 28 2015 00:12
if you want to thank someone, put an @ before their name!
Allison Davis
@araedavis
Aug 28 2015 00:14
@captainmoha @cblauwkamp thanks for markdown help! think i've got the bonfire issue sorted too.
CamperBot
@camperbot
Aug 28 2015 00:14
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Hans van Riet
@hansinla
Aug 28 2015 00:19

@tepeyak Did you try to wrap it in one line:

border: solid 10px green;

It shouldn’t make a difference, but maybe the test is designed for this.

@hansinla Also both classes should be combined in a class=“”, separated by a space.
tepeyak
@tepeyak
Aug 28 2015 00:25
@hansinla I've tried all those options, and when the code is run, it only registers that I've created the style (solid) successfully, but nothing else
Moisés Man
@moigithub
Aug 28 2015 00:28
<img class="smaller-image" class="thick-green-border"
should be
<img class="smaller-image thick-green-border"
tepeyak
@tepeyak
Aug 28 2015 00:29
ah, i see. so in the class creations, all elements stay within the same quotations, separated by a space. correct?
Moisés Man
@moigithub
Aug 28 2015 00:30
ye
Danny Fritz
@dannyfritz
Aug 28 2015 00:30
in HTML, you can only have each attribute listed once per element
DoctorCoder
@DoctorCoder
Aug 28 2015 00:30
hi all...i'm stuck on the 2nd bonfires. there is no hints or examples. hoping the rest of the bonfires aren't like this...Bonfire: Reverse a String = can someone help? i have no idea what to do.
tepeyak
@tepeyak
Aug 28 2015 00:30
Thank you so much @moigithub!
CamperBot
@camperbot
Aug 28 2015 00:31
tepeyak sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star: 262 | @moigithub | http://www.freecodecamp.com/moigithub
Moisés Man
@moigithub
Aug 28 2015 00:31
"hello" reversed should be "olleh"
bf reverse
CamperBot
@camperbot
Aug 28 2015 00:31

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

Moisés Man
@moigithub
Aug 28 2015 00:31
bf details
CamperBot
@camperbot
Aug 28 2015 00:31

: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:
DoctorCoder
@DoctorCoder
Aug 28 2015 00:31
yes, i clicked the "helpful links" but they didnt seem helpful.
Danny Fritz
@dannyfritz
Aug 28 2015 00:31
@DoctorCoder it looks like there are hints. :P
well, let's take a look at what each individual function does
DoctorCoder
@DoctorCoder
Aug 28 2015 00:32
i guess, but we havent learned how to turn a string into an array?
the other waypoints at least explained how to do things. i feel very discouraged.
Moisés Man
@moigithub
Aug 28 2015 00:33
u not really need to turn a string to an array in this case....
and.. also.. a string characters can be accessed as IF it were an array
so
"hello"[0] <-- will give u "h"
DoctorCoder
@DoctorCoder
Aug 28 2015 00:35
@dannyfritz i looked at the console link. not sure how it all fits together...new to this, and i guess i'll need to do some off site research. kinda defeats the point/purpose of the website if i am learning how to do stuff elsewhere.
Danny Fritz
@dannyfritz
Aug 28 2015 00:36
@DoctorCoder the left side is the JS code, the right side is what it outputs.
DoctorCoder
@DoctorCoder
Aug 28 2015 00:37
@moigithub it is just not basic enough for me. especially with no examples or better instruction on the bonfire page. @dannyfritz thanks man = i don't know how they expect someone to know that....gonna quit for the day. it's been easy up til now = feel like i've been thrown in the deep in without being told how to swim. ty all for your help. too bummed atm.
CamperBot
@camperbot
Aug 28 2015 00:37
doctorcoder sends brownie points to @moigithub and @dannyfritz :sparkles: :thumbsup: :sparkles:
:star: 90 | @dannyfritz | http://www.freecodecamp.com/dannyfritz
:star: 263 | @moigithub | http://www.freecodecamp.com/moigithub
Mateja Trifunovski
@Matko95
Aug 28 2015 00:45
Anyone here finished Zipline: Build a Personal Portfolio Webpage? I need to ask a question
Aaron Freidus
@shadowfool
Aug 28 2015 00:48
go for it @Matko95
Mateja Trifunovski
@Matko95
Aug 28 2015 00:50
@shadowfool What is exactly my task? To build a simple portfolio page, or to mimic the functionality of the given example?
Ian Wang
@ianw3214
Aug 28 2015 00:56
@Matko95 I think you just have to build a simple portfolio page that mimics the basic functionalities, but not necessarily all of it
there should be user stories they provide as a guide
and you dont have to do the bonus ones if you dont want to
Mateja Trifunovski
@Matko95
Aug 28 2015 00:57
@ianw3214 Well I want to do everything, just not sure if I'm capable yet, but I'll give it my best, thanks for the answer :)
CamperBot
@camperbot
Aug 28 2015 00:57
matko95 sends brownie points to @ianw3214 :sparkles: :thumbsup: :sparkles:
:star: 266 | @ianw3214 | http://www.freecodecamp.com/ianw3214
Brice Djilo
@bricedjilo
Aug 28 2015 01:06
@moigithub
Accessing a string as if it were an array is not safe; therefore it should be avoided
@camperbot
function reverseString(str) {
  return str.split('').reverse().join('');
}
reverseString('hello');
anthonygallina1
@anthonygallina1
Aug 28 2015 01:20
So it would be all right to not put the circle photo that allways seems to be in the wrong place when I make it phone size? On the portfolio
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 01:20
im stuck on the slots javascript challenge... how would i start off the code?
slotOne Math.floor(Math.random() * (3 - 1 + 1)) + 1; ?
Brice Djilo
@bricedjilo
Aug 28 2015 01:23
@ArmandoHGarduno
var slotOne = Math.floor(Math.random()*(3-1+1))+1;
    var slotTwo = Math.floor(Math.random()*(3-1+1))+1;
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 01:23
ah
ok
i thought the if statement
thanks @bricedjilo
CamperBot
@camperbot
Aug 28 2015 01:23
armandohgarduno sends brownie points to @bricedjilo :sparkles: :thumbsup: :sparkles:
:star: 173 | @bricedjilo | http://www.freecodecamp.com/bricedjilo
Brice Djilo
@bricedjilo
Aug 28 2015 01:25
@ArmandoHGarduno
with the if statement
if(slotOne === slotTwo || slotTwo === slotThree || slotThree === slotOne) {
        return true;
    }
Geri Escandor
@geriesc
Aug 28 2015 01:38
Hi, I need help with waypoint: manipulate arrays with shift.
Chandra Wijaya
@chandrawe
Aug 28 2015 01:46
Hi everyone. I'm stuck on JavaScript Waypoint 40, styling the slot machine with images. I wrote down three lines of codes, one for each of the slot machine.
But I ended up not fulfilling the first request, which is "Use the provided code three times. One for each slot". Any ideas?
This message was deleted
CamperBot
@camperbot
Aug 28 2015 01:48
:bulb: to format code use backticks! ``` more info
Chandra Wijaya
@chandrawe
Aug 28 2015 01:48
Here's the code
$($(".slot")[0]).html('<img src = "' + images[slotOne-1] + '">');
$($(".slot")[1]).html('<img src = "' + images[slotTwo-1] + '">');
$($(".slot")[2]).html('<img src = "' + images[slotThree -1] + '">');
Adam Doyle
@Adoyle2014
Aug 28 2015 01:51
@geriesc whatcha need
Geri Escandor
@geriesc
Aug 28 2015 01:51
@Adoyle2014 I feel like my code is missing something...
Adam Doyle
@Adoyle2014
Aug 28 2015 01:52
wheres your code
Geri Escandor
@geriesc
Aug 28 2015 01:52

var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.

var myRemoved = ["John"]; // This should be ["John"] and myArray should now be [23, ["dog", 3]]
myArray.shift();

Adam Doyle
@Adoyle2014
Aug 28 2015 01:52
var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.

var myRemoved = ["John"]; // This should be ["John"] and myArray should now be [23, ["dog", 3]]
myArray.shift();
@geriesc what is wrong. it seems to work
Matt Yamamoto
@MattYamamoto
Aug 28 2015 01:54
@chandrawe remove the space in the last line: images[slotThree-1]
Geri Escandor
@geriesc
Aug 28 2015 01:54
how did you bring the black background?
Adam Doyle
@Adoyle2014
Aug 28 2015 01:54
help display code
CamperBot
@camperbot
Aug 28 2015 01:54
no wiki entry for: display code
:pencil: click here to create one now!after creating your page type update to reload it here
Geri Escandor
@geriesc
Aug 28 2015 01:54
I get this message: myRemoved should contain "John"
Adam Doyle
@Adoyle2014
Aug 28 2015 01:55
help ```
CamperBot
@camperbot
Aug 28 2015 01:55

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

Basic Commands:

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

:speech_balloon: meet CamperBot in this room!

:pencil: read more about camperbot on the FCC Wiki

Adam Doyle
@Adoyle2014
Aug 28 2015 01:55
find code
Matt Yamamoto
@MattYamamoto
Aug 28 2015 01:55
help format
CamperBot
@camperbot
Aug 28 2015 01:55

: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

``` ⇦ Type 3 backticks, 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

Adam Doyle
@Adoyle2014
Aug 28 2015 01:55
nice
Moisés Man
@moigithub
Aug 28 2015 01:55
shift extract/remove the first elem of the array @geriesc
var removed = urarray.shift();
Geri Escandor
@geriesc
Aug 28 2015 01:57
... let me process this.
Moisés Man
@moigithub
Aug 28 2015 01:57
@chandrawe code seems ok.. try to refresh the page or test on another browser ?
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:03
having some trouble with reversing a string

function reverseString(str) {
return str;
}

reverseString('hello');

Geri Escandor
@geriesc
Aug 28 2015 02:03
Oh my God. It's so simple, but I overcomplicated it. Thanks @moigithub & @Adoyle2014
CamperBot
@camperbot
Aug 28 2015 02:03
geriesc sends brownie points to @moigithub and @adoyle2014 :sparkles: :thumbsup: :sparkles:
:star: 212 | @adoyle2014 | http://www.freecodecamp.com/adoyle2014
:star: 264 | @moigithub | http://www.freecodecamp.com/moigithub
Adam Doyle
@Adoyle2014
Aug 28 2015 02:03
@ArmandoHGarduno where is the code you have written?
Geri Escandor
@geriesc
Aug 28 2015 02:03
I got it. Moving on now...
Amy Rutherford
@amyruth
Aug 28 2015 02:05
Good evening everyone! I'm starting over with the new fcc and wanted to make myself known :smile:
Geri Escandor
@geriesc
Aug 28 2015 02:05
Good evening! @amyruth
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:06

i tried
function reverseString(str) {
return str;
}

reverseString('hello');

var myArray =

daniellew1234
@daniellew1234
Aug 28 2015 02:07
.gray-background {
background-color: gray
}
.gray-background {
background-color: gray;
}
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:07
var myArray = ["hello"];
myArray.reverse
cblauwkamp
@cblauwkamp
Aug 28 2015 02:07
help format
CamperBot
@camperbot
Aug 28 2015 02:07

: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

``` ⇦ Type 3 backticks, 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

daniellew1234
@daniellew1234
Aug 28 2015 02:08
on number 37 of the first HTML CSS section, I am getting an error because I am putting a semicolon after the background-color: gray;
Amy Rutherford
@amyruth
Aug 28 2015 02:08
Hi @geriesc what are you working on?
Adam Doyle
@Adoyle2014
Aug 28 2015 02:08
@ArmandoHGarduno Use console.log() to verify what is happening
console.log(myArray); and see what that gives you
daniellew1234
@daniellew1234
Aug 28 2015 02:08
is this just glitchy
Adam Doyle
@Adoyle2014
Aug 28 2015 02:09
@ArmandoHGarduno You are on the right path with turning it into an array and then reversing it
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:09
im on the FCC website on the bonfire challenge
no i have no idea how to start it
Adam Doyle
@Adoyle2014
Aug 28 2015 02:10
@Adoyle2014 you did start it
@ArmandoHGarduno
var myArray  = ["hello"]; 
myArray.reverse
is almost correct
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:10
is that correct?
whats wrong with it?
Adam Doyle
@Adoyle2014
Aug 28 2015 02:10
@ArmandoHGarduno dont use "hello"
Brice Djilo
@bricedjilo
Aug 28 2015 02:11
@ArmandoHGarduno
function reverseString(str) {
  return str.split('').reverse().join('');
}
reverseString('hello');
Adam Doyle
@Adoyle2014
Aug 28 2015 02:11
@bricedjilo i was trying to actually help
not give the answer
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:12
thats different from creating var
so is that how it should look?
Brice Djilo
@bricedjilo
Aug 28 2015 02:12
sorry.. I will shut up next time
André Botelho
@andrefcbotelho
Aug 28 2015 02:13
Hello guys. Anyone know how can my twitter share button fetch random generated text?
Adam Doyle
@Adoyle2014
Aug 28 2015 02:13
CamperBot
@camperbot
Aug 28 2015 02:13
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:13
Bonfire: Reverse a String
CamperBot
@camperbot
Aug 28 2015 02:13

:fire:Bonfire: Reverse a String :link:

function reverseString(str) {
  return str;
}

reverseString('hello');

Reverse the provided string.

more info:  bf details | bf links | hint

ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:14
thanks @Adoyle2014
CamperBot
@camperbot
Aug 28 2015 02:14
armandohgarduno sends brownie points to @adoyle2014 :sparkles: :thumbsup: :sparkles:
:star: 213 | @adoyle2014 | http://www.freecodecamp.com/adoyle2014
Adam Doyle
@Adoyle2014
Aug 28 2015 02:14
@bricedjilo You dont have to shut up, just maybe help someone learn. Not just give them the answer
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:14
thanks @bricedjilo
CamperBot
@camperbot
Aug 28 2015 02:14
armandohgarduno sends brownie points to @bricedjilo :sparkles: :thumbsup: :sparkles:
:warning: armandohgarduno already gave bricedjilo points
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:14
yeah i mean i like your approch doyle
that way i can figure it out
brice wont always be there
Adam Doyle
@Adoyle2014
Aug 28 2015 02:15
no he won't
use google
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:15
but why is his answer not have var
Amy Rutherford
@amyruth
Aug 28 2015 02:15
I have problems keeping my string methods and array methods straight. I have to look them up all the time and it feels like I should have a few memorized by now.
ArmandoHGarduno
@ArmandoHGarduno
Aug 28 2015 02:16
youre tell me lol
this stuff is confusing
André Botelho
@andrefcbotelho
Aug 28 2015 02:19
Anyone know how can I make my twitter share button fetch random generated text?
Matt Yamamoto
@MattYamamoto
Aug 28 2015 02:21
@chourico do you already have the text?
André Botelho
@andrefcbotelho
Aug 28 2015 02:22
farosFreed
@farosFreed
Aug 28 2015 02:23
Anyone else getting a lot of unresponsive script errors once you get to the 2nd set of bonfires? I'm running my script in a chrome javascript console and it's working, but when I submit it to code camp it times out.
farosFreed
@farosFreed
Aug 28 2015 02:26

``` //array breaker
function steamroller(arr){

var flatArr = [];

//helper function
function roller(arr){

for(i = 0; i < arr.length; i++){
    if (Array.isArray(arr[i])) {
        roller(arr[i]);
    } else {
        flatArr.push(arr[i]);
    }
    }
}

roller(arr);
return flatArr;

}

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

Patrick McWilliams
@patrickmac110
Aug 28 2015 02:26
can anyone see why my profilePic isn't showing up?
Matt Yamamoto
@MattYamamoto
Aug 28 2015 02:27
@chourico you need to append the text to the url with ?text=
the example they use is:
<a class="twitter-share-button"
  href="https://twitter.com/intent/tweet?text=Hello%20world">
Tweet</a>
SalesforceTechy
@Raghuver666
Aug 28 2015 02:29

function largestOfFour(arr) {
// You can do this!
var largest = 0;
var array = [];
for(i = 0; i < arr.length; i++)
{
for(j = 0; j < arr[i].length; j++)
{
if(largest < arr[i][j])
{

    largest = arr[i][j];

  }
}

}
return array;
}

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

can some one help me how to return an array
Robert
@rc242
Aug 28 2015 02:32
explain format
CamperBot
@camperbot
Aug 28 2015 02:32

:point_right: code formatting [wiki]

Inline code

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

Code Block

``` ⇦ Type 3 backticks, 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

Brice Djilo
@bricedjilo
Aug 28 2015 02:32

@Raghuver666

function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  var array = [];
  for(i = 0; i < arr.length; i++)
  {
    for(j = 0; j < arr[i].length; j++)
    {
      if(largest < arr[i][j])
      {
        largest = arr[i][j];

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

can some one help me how to return an array

farosFreed
@farosFreed
Aug 28 2015 02:32
#2794 trying to figure out why this code times out. It's working for me in a local javascript console.
function steamroller(arr){

    var flatArr = [];

    //helper function
    function roller(arr){

    for(i = 0; i < arr.length; i++){
        if (Array.isArray(arr[i])) {
            roller(arr[i]);
        } else {
            flatArr.push(arr[i]);
        }
        }
    }

    roller(arr);
    return flatArr;

}

steamroller([1, [2], [3, [[4]]]]);
SalesforceTechy
@Raghuver666
Aug 28 2015 02:33
function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  var array = [];
  for(i = 0; i < arr.length; i++)
  {
    for(j = 0; j < arr[i].length; j++)
    {
      if(largest < arr[i][j])
      {
        largest = arr[i][j];

      }
    }
  }
  return array;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
@rc242 didn't knew how to paste code. Thanks for that.
CamperBot
@camperbot
Aug 28 2015 02:34
raghuver666 sends brownie points to @rc242 :sparkles: :thumbsup: :sparkles:
:star: 183 | @rc242 | http://www.freecodecamp.com/rc242
SalesforceTechy
@Raghuver666
Aug 28 2015 02:34
@bricedjilo got you.
Robert
@rc242
Aug 28 2015 02:35
@Raghuver666 you're currently doing nothing with largest variable. maybe you want to assign it to something?
Chandra Wijaya
@chandrawe
Aug 28 2015 02:36
@MattYamamoto It actually works!! Thanks alot! That was frustrating to figure out..
@moigithub It actually works, but because I put a space in between the code turned it to be error.
CamperBot
@camperbot
Aug 28 2015 02:36
chandrawe sends brownie points to @mattyamamoto and @moigithub :sparkles: :thumbsup: :sparkles:
:star: 315 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 265 | @moigithub | http://www.freecodecamp.com/moigithub
SalesforceTechy
@Raghuver666
Aug 28 2015 02:37
@rc242 yeah I am trying now
Matt Yamamoto
@MattYamamoto
Aug 28 2015 02:39
@chandrawe sure thing. I didn't look at your array of quotes, but one thing to watch out for is punctuations. You need to pass those in as html character codes: &amp; for &, etc
but if that's not an issue, then don't worry about it for now
SalesforceTechy
@Raghuver666
Aug 28 2015 02:40
function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  var array = [];
  for(i = 0; i < arr.length; i++)
  {
    for(j = 0; j < arr[i].length; j++)
    {
      if(largest < arr[i][j])
      {
        largest = arr[i][j];
        array[i] = largest;
      }
    }
  }
  return array;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
This works fine for two and shows wrong for one combination
Brice Djilo
@bricedjilo
Aug 28 2015 02:43

@Raghuver666
You might just use push()

array.push(largest);

This way you don't have to worry about indexing

DTing
@dting
Aug 28 2015 02:43
@Raghuver666 you declare largest outside of your outside for loop
@Raghuver666 this cause the value to carry over for each sub array
chriscrosscutler
@chriscrosscutler
Aug 28 2015 02:44
zl portfolio
SalesforceTechy
@Raghuver666
Aug 28 2015 02:45
@bricedjilo you mean Instead of
DTing
@dting
Aug 28 2015 02:45
function largestOfFour(arr) {
  var largest = 0; // this needs to be moved
  var array = [];
  for(i = 0; i < arr.length; i++)
  {
    // here
    for(j = 0; j < arr[i].length; j++)
    {
      if(largest < arr[i][j])
      {
        largest = arr[i][j];
        array[i] = largest;
      }
    }
  }
  return array;
}
SalesforceTechy
@Raghuver666
Aug 28 2015 02:45
@dting moved inside for loop?
DTing
@dting
Aug 28 2015 02:48
Try logging your current code and see what the difference is.
function largestOfFour(arr) {
  var largest = 0; // this needs to be moved
  var array = [];
  for(i = 0; i < arr.length; i++)
  {
    console.log(i, largest);
    for(j = 0; j < arr[i].length; j++)
    {
      if(largest < arr[i][j])
      {
        largest = arr[i][j];
        array[i] = largest;
      }
    }
    console.log(i, largest);
  }
  return array;
}
chriscrosscutler
@chriscrosscutler
Aug 28 2015 02:52
can someone help me with my zipline portfolio?
Brice Djilo
@bricedjilo
Aug 28 2015 02:53

@Raghuver666
Ok.. there were a few bugs. This is my attempt; it works fine.

function largestOfFour(arr) {
  // You can do this!
  var largest = 0;
  var array = [];
  for(i = 0; i < arr.length; i++)
  {
    largest = arr[i][0];
    for(j = 0; j < arr[i].length; j++)
    {
      if(largest < arr[i][j])
      {
        largest = arr[i][j];
      }
    }
    array.push(largest);
  }
  return array;
}

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

every time you are done looping through an internal array, you need to reinitialize largest to a value of the array you are about to loop through

Patrick McWilliams
@patrickmac110
Aug 28 2015 02:54
can anyone help figure out why margin: auto; isn't working here on my profilePic:
http://codepen.io/patrcikmac110/pen/xwKXdm
im having trouble linking my nav to the pages and also if you view the page in full screen there are / above each link and i dont know why?
SalesforceTechy
@Raghuver666
Aug 28 2015 02:56
@bricedjilo I got it now. I see some changes in the code. what do you think I have made mistake.
ryana11
@ryana11
Aug 28 2015 02:57
return (Math.random());
Math.floor(Math.random() * 10);
What is wrong with my code here? http://freecodecamp.com/challenges/waypoint-generate-random-whole-numbers-with-javascript
SalesforceTechy
@Raghuver666
Aug 28 2015 02:57
@dting I am not sure where to run it
@ryana11 you need to put that second line inside the parenthesis of the first line (replace) not after the return
Tim Bell
@MindfulBell
Aug 28 2015 03:00
so with codepen, what do I have to make sure I link in the various HTML/CSS/JS pens?
Matt Yamamoto
@MattYamamoto
Aug 28 2015 03:00

@chriscrosscutler you need to add a # at the begining of the url in your href

A URL fragment is a name preceded by a hash mark (#), which specifies an internal target location (an ID) within the current document.

as for the / above the nav menu...I'm not sure
SalesforceTechy
@Raghuver666
Aug 28 2015 03:01

@dting

check this

0 0
0 5
1 5
1 27
2 27
2 39
3 39
3 1001
=> [ 5, 27, 39, 1001 ]

Brice Djilo
@bricedjilo
Aug 28 2015 03:02
@Raghuver666
With array.push(largest) inside the if statement, you will push a value inside the array whenever a number that exceeds the current largest value will be detected. This behavior is not what you want. You want to push a value inside the array after you have checked the entire array.
DTing
@dting
Aug 28 2015 03:03
@Raghuver666 see my example
you need to move largest inside your first forloop
Matt Yamamoto
@MattYamamoto
Aug 28 2015 03:03
@chriscrosscutler actually, remove the breadcrumb class from ul element
DTing
@dting
Aug 28 2015 03:03
and test those same arguments
@patrickmac110 margin auto doesnt work with fixed position see http://stackoverflow.com/questions/2005954/center-element-with-positionfixed
SalesforceTechy
@Raghuver666
Aug 28 2015 03:05
@bricedjilo gotcha!! that helps thanks.
CamperBot
@camperbot
Aug 28 2015 03:05
raghuver666 sends brownie points to @bricedjilo :sparkles: :thumbsup: :sparkles:
:star: 174 | @bricedjilo | http://www.freecodecamp.com/bricedjilo
Patrick McWilliams
@patrickmac110
Aug 28 2015 03:05
@dting so what's the best way to center a fixed element
SalesforceTechy
@Raghuver666
Aug 28 2015 03:05
@dting I see that now.
how does moving the largest into the first loop change everything
Adam Doyle
@Adoyle2014
Aug 28 2015 03:06
ninjatron
@ninjatron
Aug 28 2015 03:07
what's up butter buns
SalesforceTechy
@Raghuver666
Aug 28 2015 03:07
@Adoyle2014 looks great!!
Adam Doyle
@Adoyle2014
Aug 28 2015 03:07
@Raghuver666 thanks
CamperBot
@camperbot
Aug 28 2015 03:07
adoyle2014 sends brownie points to @raghuver666 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for raghuver666
Brice Djilo
@bricedjilo
Aug 28 2015 03:08
@Raghuver666
Thanks for the brownie points. Whenever you can, check this slick approach
function largestOfFour(arr) {
  var largest=[];
  arr.forEach(function(array){
    largest.push(array.sort(function(a, b){return b-a})[0]);
  });
  return largest;
}
largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
CamperBot
@camperbot
Aug 28 2015 03:08
bricedjilo sends brownie points to @raghuver666 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for raghuver666
chriscrosscutler
@chriscrosscutler
Aug 28 2015 03:09
@MattYamamoto Thanks! I fixed it. Any idea how I can get it to scroll to the right page when I click on the link?
CamperBot
@camperbot
Aug 28 2015 03:09
chriscrosscutler sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 316 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
ninjatron
@ninjatron
Aug 28 2015 03:10
@bricedjilo I don't think it's good code
DTing
@dting
Aug 28 2015 03:10
@patrickmac110 it's in that link. use left: 50%, margin-left: -<width of element>
@bricedjilo it works but sorting isnt efficient.
function largestOfFour(arr) {
  return arr.map(function(sub) {
    return Math.max.apply(null, sub);
  });
}
Patrick McWilliams
@patrickmac110
Aug 28 2015 03:11
sorry, thanks @dting
CamperBot
@camperbot
Aug 28 2015 03:11
patrickmac110 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 745 | @dting | http://www.freecodecamp.com/dting
Matt Yamamoto
@MattYamamoto
Aug 28 2015 03:11
@chriscrosscutler not sure, I was going to implement that for mine too... but since I haven't done that zipline yet, I haven't looked it up. Just try googling it... it should be pretty straight forward
Geri Escandor
@geriesc
Aug 28 2015 03:11
@amyruth Basic Javascript. What about you?
chriscrosscutler
@chriscrosscutler
Aug 28 2015 03:12
yeah I did, but it's not working. any suggestions @dting?
DTing
@dting
Aug 28 2015 03:13
@chriscrosscutler what do you mean?
ninjatron
@ninjatron
Aug 28 2015 03:13
@dting can you explain the code above in two sentences
Thomas Vaeth
@thomasvaeth
Aug 28 2015 03:13
I need help with jQuery #16.
I tried $(".well:nth-child(2)").addClass("animated bounce"); and $(".well:nth-child(2)").addClass("bounce");
Neither are working.
DTing
@dting
Aug 28 2015 03:14
@thomasvaeth you need a space between .well and :nth-child
Amy Rutherford
@amyruth
Aug 28 2015 03:14
@geriesc The same. I'm just trying to get to know people for when the work gets heavy
Thomas Vaeth
@thomasvaeth
Aug 28 2015 03:15
@dting The example doesn't have that.
@dting I don't know where to put the space.
DTing
@dting
Aug 28 2015 03:15
.well :nth-child
@ninjatron map returns an array where the callback function is called on each element of the array it is called on. Math.max.apply returns the max vaule of the array in second argument.
Thomas Vaeth
@thomasvaeth
Aug 28 2015 03:17
@dting Thanks. I'll report a bug because the example on the page doesn't have a space.
CamperBot
@camperbot
Aug 28 2015 03:17
thomasvaeth sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 746 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 28 2015 03:17
well the example has .target:nth-child
which also works
the stack overflow link explains it
Patrick McWilliams
@patrickmac110
Aug 28 2015 03:28
can someone see why my pane1 <div> isn't showing up: i've tried top: 500px; which is the height of my fixed element with the big picture...:
DTing
@dting
Aug 28 2015 03:31
@patrickmac110 you probably need to set a position type in the css
Patrick McWilliams
@patrickmac110
Aug 28 2015 03:32
what position would i use?
DTing
@dting
Aug 28 2015 03:34
depends on what you are trying to do with the page
but probably not static
Patrick McWilliams
@patrickmac110
Aug 28 2015 03:35
I eventually want this huge top banner to shrink when scrolled down and then start showing the other panes
to shrink the banner to normal banner size with a badge and links and stuff
11bkerr
@11bkerr
Aug 28 2015 03:36

Hey all. I'm doing the chunky monkey bonfire; where you make a function with array + desired length, and it returns a number of sub arrays of the desired length.

function chunk(arr, size) {
  // Break it up.
  var splitArray = new Array;
  stepNumber=0;

  for(i=0;i<size;i++){
   for(j=0;j<arr.length/size;j++){
     splitArray[i]+=(arr[i+j+stepNumber]);    
   }
    stepNumber++;
}
  return splitArray;
}

chunk(['a', 'b', 'c', 'd'], 2);

This is the code I'm using, and I'm getting output: ["undefinedab","undefinedcd"]

So the proper output but with undefined in the first iteration for both, not sure why @_@
Ian Wang
@ianw3214
Aug 28 2015 03:46
@11bkerr for one thing you didnt put var in front of stepNumber
hakimnasir
@hakimnasir
Aug 28 2015 03:47
can someone help me with a resume question
Justin Crawford
@JCrawford1122
Aug 28 2015 03:51
I did this through experimenting and am having trouble understanding why it works
function slasher(arr, howMany) {
  arr = arr.splice(howMany);
  return arr;

}

slasher([1, 2, 3], 2);
I can try. Depends how advanced of a question it is.
@titans8pride
MD Arefin Saad
@arefinsaaad
Aug 28 2015 03:54
hlw everyone
gd morning to all
Justin Crawford
@JCrawford1122
Aug 28 2015 03:55
Hi
MD Arefin Saad
@arefinsaaad
Aug 28 2015 03:55
how call two classes in same img tag ...which declare in <style> tag ??
how to call two classes in same img tag ...which declare in <style> tag ??
mema
@mebamba
Aug 28 2015 03:59
Nesting an Anchor Element within a Paragraph I wrote the following code <p>Click here for <a href="http://<catphotoapp.com"> cat photos</a></p> but get the error "Your a element should be nested within your new p element." any hint?
MD Arefin Saad
@arefinsaaad
Aug 28 2015 04:04
i declare to class .... like 'A' and 'B' in css . Now how do i call both A and B in same img tag ???
i declare two class .... like 'A' and 'B' in css . Now how do i call both A and B in same img tag ???
i declare two classes .... like 'A' and 'B' in css . Now how do i call both A and B in same img tag ???
ninjatron
@ninjatron
Aug 28 2015 04:06
so i solved pairwise bonfire
but i'd like to see other's solutions
11bkerr
@11bkerr
Aug 28 2015 04:06
@ianw3214 dont have to, declaring a global object
Brice Djilo
@bricedjilo
Aug 28 2015 04:06
This message was deleted
ninjatron
@ninjatron
Aug 28 2015 04:06
is it possible to solve it without making it too complicated and without removing values from the array?
mine does this
if (arr[i] + arr[j] === arg) {
         total += (i + j);
         arr[i] = arr[j] = ' ';
         break;
       }
MD Arefin Saad
@arefinsaaad
Aug 28 2015 04:07
okey.... i got my solution from google
n thnx a lot
CamperBot
@camperbot
Aug 28 2015 04:07
if you want to thank someone, put an @ before their name!
ninjatron
@ninjatron
Aug 28 2015 04:07
while it works i don't like the fact that i remove values
MD Arefin Saad
@arefinsaaad
Aug 28 2015 04:07
everyone
thnx All
CamperBot
@camperbot
Aug 28 2015 04:07
if you want to thank someone, put an @ before their name!
MD Arefin Saad
@arefinsaaad
Aug 28 2015 04:08
yeah .... i know
but nxt time ..i'll
ninjatron
@ninjatron
Aug 28 2015 04:08
@arefinsaaad you getting mad at him aref?
MD Arefin Saad
@arefinsaaad
Aug 28 2015 04:09
:D
ninjatron
@ninjatron
Aug 28 2015 04:09
:D
MD Arefin Saad
@arefinsaaad
Aug 28 2015 04:09
may be :D
ninjatron
@ninjatron
Aug 28 2015 04:10
it's not a real person in case you think it is
it's a bot
Carl Springer
@haironfire
Aug 28 2015 04:12
bonfire largestoffour
CamperBot
@camperbot
Aug 28 2015 04:12
Sorry, can't find a bonfire called largestoffour. [ Check the map? ]
joshroxu
@joshroxu
Aug 28 2015 04:59
bonfire mutations
CamperBot
@camperbot
Aug 28 2015 04:59

: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

joshroxu
@joshroxu
Aug 28 2015 04:59
hint
CamperBot
@camperbot
Aug 28 2015 04:59
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
DJ
@qualitymanifest
Aug 28 2015 05:02
anyone want to compare chunky monkey solutions so we can learn different methods? i just got it, took me longer than most of them
Nnxoxo
@Nnxoxo
Aug 28 2015 05:02
@qualitymanifest ok, show it
bf chunky monkey
CamperBot
@camperbot
Aug 28 2015 05:03

:fire:Bonfire: Chunky Monkey :link:

function chunk(arr, size) {
  // Break it up.
  return arr;
}

chunk(['a', 'b', 'c', 'd'], 2);

Write a function that splits an array (first argument) into groups the length of size (second argument) and returns them as a multidimensional array.

more info:  bf details | bf links | hint

DJ
@qualitymanifest
Aug 28 2015 05:03
This message was deleted
This message was deleted
This message was deleted
function chunk(arr, size) {
  // create empty array
  var arrays = [];
  // j is so that you can add to array by 1, rather than size
  var j = 0
  // i stops at arr length and iterates by size
  for (var i = 0; i < arr.length; i += size ) {
    arrays[j] = arr.slice(i, i + size);
    j = j + 1;
  }
  return arrays;
}
took me a while to get my formatting right haha
Nnxoxo
@Nnxoxo
Aug 28 2015 05:06
@qualitymanifest
function chunk(arr, size) {
  // Break it up.
  var temp = [];
  for(var i = 0; i < arr.length; i += size) {
    temp.push(arr.slice(i, i + size));
  }
  return temp;
}

chunk(['a', 'b', 'c', 'd', 'e'], 2);
DJ
@qualitymanifest
Aug 28 2015 05:07
wow , looks like we did the nearly the same thing @Nnutthowze
DTing
@dting
Aug 28 2015 05:07
function chunk(arr, size) {
  var narr = [];
  for (var i = 0; i < arr.length / size; i++) 
    narr.push(arr.slice(i*size, i*size+size));
  return narr;
}
DJ
@qualitymanifest
Aug 28 2015 05:10
interesting. still similar, although your slice methods are a little different, i'll have to look into that, thanks @dting @Nnutthowze
CamperBot
@camperbot
Aug 28 2015 05:10
qualitymanifest sends brownie points to @dting and @nnutthowze :sparkles: :thumbsup: :sparkles:
:star: 294 | @nnutthowze | http://www.freecodecamp.com/nnutthowze
:star: 749 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 28 2015 05:13
i actually like @Nnutthowze solution more. they are all effectively the same but mine performs more math ops. =(
DJ
@qualitymanifest
Aug 28 2015 05:15
yeah, his is basically the same as mine except i used an extra variable instead of using .push
(therefore his is better)
DJ
@qualitymanifest
Aug 28 2015 05:21
either of you know why most of my code came out colored wrong? it worked and i'm pretty sure i used the backticks right...
Nnxoxo
@Nnxoxo
Aug 28 2015 05:23
function chunk(arr, size) {
  // create empty array
  var arrays = [];
  // j is so that you can add to array by 1, rather than size
  var j = 0
  // i stops at arr length and iterates by size
  for (var i = 0; i < arr.length; i += size ) {
    arrays[j] = arr.slice(i, i + size);
    j = j + 1;
  }
  return arrays;
}
DTing
@dting
Aug 28 2015 05:26
i'm guessing the parser couldn't determine the type of code you wrote and defaulted to the wrong language
DJ
@qualitymanifest
Aug 28 2015 05:29
alright, that's the only reason that makes sense to me
DTing
@dting
Aug 28 2015 05:37
function chunk(arr, size) {
  var arrays = [];
  var j = 0
  for (var i = 0; i < arr.length; i += size ) {
    arrays[j] = arr.slice(i, i + size);
    j = j + 1;
  }
  return arrays;
}
hmm i guess the comments throw it off
Haremantra
@haremantra
Aug 28 2015 05:48
@hansinla thank you for the help
CamperBot
@camperbot
Aug 28 2015 05:48
haremantra sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 325 | @hansinla | http://www.freecodecamp.com/hansinla
Haremantra
@haremantra
Aug 28 2015 05:48
who here has completed all the courses
DJ
@qualitymanifest
Aug 28 2015 05:50
@dting weird, because i've seen comments not change things, and they show up as gray. only difference was the successful comments had the first letter capitalized
```
function chunk(arr, size) {
  // Create empty array
  var arrays = [];
  // J is so that you can add to array by 1, rather than size
  var j = 0
  // I stops at arr length and iterates by size
  for (var i = 0; i < arr.length; i += size ) {
    arrays[j] = arr.slice(i, i + size);
    j = j + 1;
  }
  return arrays;
}
```
okay so capitalization doesnt help
oh well! night all
Pierrette Mimi Poinsett MD
@drmimipoinsett
Aug 28 2015 05:55
I tried last week to ask for help- did not get a response
On the same HTML problem for a several days- have gone through stack overflow, 10 pages on teh GitHub bug page
how do I ask for help on here?
Abhisek Pattnaik
@abhisekp
Aug 28 2015 06:01
@drmimipoinsett umm...just ask?
Omar
@oab00
Aug 28 2015 06:01
@drmimipoinsett which waypoint u're having trouble with? and what is the problem?
Pierrette Mimi Poinsett MD
@drmimipoinsett
Aug 28 2015 06:01
@abhisekp I have before and not even a peep
This dang cat app
Abhisek Pattnaik
@abhisekp
Aug 28 2015 06:01
@drmimipoinsett try now
Pierrette Mimi Poinsett MD
@drmimipoinsett
Aug 28 2015 06:02
putting the green border around the photo
Here is the code I have put in
Abhisek Pattnaik
@abhisekp
Aug 28 2015 06:02
explain javascript fundamental
CamperBot
@camperbot
Aug 28 2015 06:02

:point_right: javascript fundamental [wiki]

First do it, then do it right, then do it better. This is one fundamental I always keep in mind when developing anything.
If you're a developer wishing to learn something new, regardless of skill-level, remember that as important as it is to read, it's equally as important to get out there and do.
Create a new gist or JSBin, pop open the console and experiment. It's effing fun.
Addy Osmani
:pencil: read more about javascript fundamental on the FCC Wiki
Pierrette Mimi Poinsett MD
@drmimipoinsett
Aug 28 2015 06:03
Now having trouble at the bottom of this chat page- is there a way to refresh
Abhisek Pattnaik
@abhisekp
Aug 28 2015 06:04
@drmimipoinsett Ctrl + F5 ??
Binny Kim
@removed~BinnyK
Aug 28 2015 07:04
I've created an endless loop... now my screen gets frozen everytime I open this bonfire haha... what do i do?
DTing
@dting
Aug 28 2015 07:07
clear the browser cache
@BinnyK
Abhisek Pattnaik
@abhisekp
Aug 28 2015 07:22
@BinnyK Press F12 and goto the tab shown in the image and delete the concerned bf.
Daniel O'Mahony
@OMahonyD
Aug 28 2015 07:41
Hey all, anyone having issues with codepen? Looks like the save option has disappeared from my screen.
@drmimipoinsett Are you in chat mode or compose mode?
Binny Kim
@removed~BinnyK
Aug 28 2015 08:40
@dting @abhisekp ok thanks guys
CamperBot
@camperbot
Aug 28 2015 08:40
binnyk sends brownie points to @dting and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 324 | @abhisekp | http://www.freecodecamp.com/abhisekp
:star: 754 | @dting | http://www.freecodecamp.com/dting
vanityinsanity
@vanityinsanity
Aug 28 2015 08:40
I am stuck at check for palindrome. http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes Need Help.....
Unable to figure out the code
Abhisek Pattnaik
@abhisekp
Aug 28 2015 08:41
@vanityinsanity what's your curr. soln?
vanityinsanity
@vanityinsanity
Aug 28 2015 08:41

function palindrome(str) {
// Good luck!
if (str === str.split("").reverse().join("")){
return true
} else {
return false;
}
}

palindrome("eye");

I am unable to think more than this
Abhisek Pattnaik
@abhisekp
Aug 28 2015 08:41
explain format
CamperBot
@camperbot
Aug 28 2015 08:41

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Abhisek Pattnaik
@abhisekp
Aug 28 2015 08:41
@vanityinsanity :point_up: August 28, 2015 2:11 PM
mattcoder
@MattWebCoder
Aug 28 2015 08:41
explain html
CamperBot
@camperbot
Aug 28 2015 08:41

:point_right: waypoint target html elements with selectors using jquery [wiki]

Target HTML Elements with Selectors Using jQuery

After we have created our document ready function we can now have code that will run after the page loads. This will assure that your code does not run before the HTML is rendered to avoid bugs.

jQuery often selects an HTML element with a selector, then does something to that element.

The following code will make the buttons have a bouncy animation on page load.

<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
  });
</script>

:pencil: read more about waypoint target html elements with selectors using jquery on the FCC Wiki

mattcoder
@MattWebCoder
Aug 28 2015 08:42
explain css
CamperBot
@camperbot
Aug 28 2015 08:42

:point_right: waypoint change the css of an element using jquery [wiki]

Change the CSS of an Element Using jQuery

We can also change the CSS of an HTML element directly with jQuery.

Query has a function called .css() that allows you to change the CSS of an element.

<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");

  });
</script>

:pencil: read more about waypoint change the css of an element using jquery on the FCC Wiki

mattcoder
@MattWebCoder
Aug 28 2015 08:42
explain free code camp
CamperBot
@camperbot
Aug 28 2015 08:42

:point_right: free code camp's privacy policy [wiki]

Free Code Camp is committed to respecting the privacy of visitors to our web sites and web applications. The guidelines below explain how we protect the privacy of visitors to FreeCodeCamp.com and its features.

Personally Identifiable Information

Free Code Camp protects the identity of visitors to FreeCodeCamp.com by limiting the collection of personally identifiable information.

Free Code Camp does not knowingly collect or solicit personally identifiable information from or about children under 13, except as permitted by law. If we discover we have received any information from a child under 13 in violation of this policy, we will delete that information immediately. If you believe Free Code Camp has any information from or about anyone under 13, please email us at team@freecodecamp.com.

All personally identifiable information you provide to us is used by Free Code Camp and its team to process and manage your account, analyze the demographic of our users, or to deliver services through the site.

If you choose to provide personally identifiable information to us, you may receive occasional emails from us that are relevant to Free Code Camp, getting a job, or learning to code in general.
Free Code Camp may also use other third-party providers to facilitate the delivery of the services described above, and these third-party providers may be supplied with or have access to personally identifiable information for the sole purpose of providing these services, to you on behalf of Free Code Camp.

Free Code Camp may also disclose personally identifiable information in special legal circumstances. For instance, such information may be used where it is necessary to protect our copyright or intellectual property rights, or if the law requires us to do so.

Anonymous Information

Anonymous aggregated data may be provided to other organizations we associate with for statistical purposes. For example, we may report to an organization that a certain percentage of our site's visitors are adults between the ages of 25 and 35.

Cookies and Beacons—Use by Free Code Camp; Opting Out

We use cookies and software logs to monitor the use of FreeCodeCamp.com and to gather non-personal information about visitors to the site. Cookies are small files that Free Code Camp transfers to the hard drives of visitors for record-keeping purposes. These monitoring systems allow us to track general information about our visitors, such as the type of browsers (for example, Firefox or Internet Explorer), the operating systems (for instance, Windows or Macintosh), or the Internet providers (for instance, Comcast) they use. This information is used for statistical and market research purposes to tailor content to usage patterns and to provide services requested by our customers. To delete these cookies, please see your browser's privacy settings.
:pencil: read more about free code camps privacy policy on the FCC Wiki

vanityinsanity
@vanityinsanity
Aug 28 2015 08:44
I am done with factorial bonfire. I am to check here for palindrome. how should I proceed? http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes
Soumya Rauth
@soumyaRauth
Aug 28 2015 08:46
what does temperature 300 mean? how do i convert it into ferenheit and celcius..??? zipline weather... please help
Abhinav Mathur
@abhinavmathur
Aug 28 2015 08:56
```

function translate(str) {
if((/^[aeiou]/).test(str)) {
return str + "way";
}
else {
var firstLetter = str.substring(0,1);
var ros = str.substring(1);
return ros + firstLetter + "ay";
}
}

translate("consonant");

need help with piglatin
It fails on "glove"
Davis
@ajdavis56
Aug 28 2015 08:58
in the second Zipline, I issued this request method=getQuote&key=457653&format=xml&lang=en to the server
but I just get a response that says: Wrong method.
but the API clearly specifies getQuote as the method name.
anyidea where i'm screwing up?
Costas Chaitas
@CostasChaitas
Aug 28 2015 09:11
guys do you know how can i upload a foto to the internest so i can use it for a example on codepen!
i want to use them on my portfolio zipline as images of the projects
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:14
In Local weather zipline I get temperature like 298.5 . How can i convert it to degree Celsius? Or Fahrenheit.
Costas Chaitas
@CostasChaitas
Aug 28 2015 09:15
with math
google it
how many Farenheit is 1 Celsius
and so
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:17
@rasakos you can upload it anywhere so that you can search it from google image. then you go to google search result> image> view image. then copy and paste the link. You can also shorten the link it from bit.ly
@rasakos 298.5 is not in Fahrenheit i guess. That is the problem i am facing.
When I fetch data from openweather.com then I find temperature something like 298.5 or so. How can I convert it to Celsius or Fahrenheit.
Aleksandar B.
@aleksandar-b
Aug 28 2015 09:23
@soumyaRauth use paramether method=imperial for F and method=metric for C
DTing
@dting
Aug 28 2015 09:23
@soumyaRauth 298.5 sounds like kelvin
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:23
@dting ok.
@samosale I don't know how to use it exactly. Can u plz help me with it.
Aleksandar B.
@aleksandar-b
Aug 28 2015 09:25
@soumyaRauth yes
Aleksandar B.
@aleksandar-b
Aug 28 2015 09:26
use this api
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:26
@samosale can i have a pair prog?
Aleksandar B.
@aleksandar-b
Aug 28 2015 09:26
@soumyaRauth yes i am using teamviewer
DTing
@dting
Aug 28 2015 09:27
or ya just add &units=imperial or &units=metric to your request
Antun Badurina
@Namdeus
Aug 28 2015 09:27
Hi! I'm stuck at http://freecodecamp.com/challenges/bonfire-spinal-tap-case , I don't know how to approach it. Should I make it so I make cases for all the tests or try to find a more universal solution (because I don't see one, and test are a bit random)?
Aleksandar B.
@aleksandar-b
Aug 28 2015 09:28
@Namdeus you must use some regex backreference for that
DTing
@dting
Aug 28 2015 09:28
you dont have to use back references but ya that's one way to do it
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:28
@dting i used these in request. I don't know y it didn't work?
DTing
@dting
Aug 28 2015 09:29
link your codepen
Antun Badurina
@Namdeus
Aug 28 2015 09:30
@samosale Ty, I'll try to find something.
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:32
@dting Did u get the Codepen link?
DTing
@dting
Aug 28 2015 09:32
@soumyaRauth you had your weather request outside of the location request callback:
    $(document).ready(function() {
      var lati;
      var long;
      var tempCelcius;
      var tempFerenheit;
      $.getJSON("http://www.telize.com/geoip?callback=?",
        function(json) {
          lati = json.latitude;
          long = json.longitude;
          $.getJSON("http://api.openweathermap.org/data/2.5/weather?lat=" + lati + "&lon=" + long + "&units=metric",function(weather) {
            $('#temperature_celcius').text(weather.main.temp);
            $("#target1").text(weather.name);
            $("#target2").text(weather.weather[0].description);
            $("#target3").text("SE " + weather.wind.speed + " Knots");
          });
        }
      );
    });
you can either nest the weather request inside that callback or use location request promise. the getJSON calls are async so you were calling your second getJSON before you had any values for lati and long
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:38
@dting did u edit my codepen code???
DTing
@dting
Aug 28 2015 09:39
or using the promise:
    $(document).ready(function() {
      var lati;
      var long;
      var tempCelcius;
      var tempFerenheit;
      $.getJSON("http://www.telize.com/geoip?callback=?", function(json) {
        lati = json.latitude;
        long = json.longitude;
      }).then(function() {
        $.getJSON("http://api.openweathermap.org/data/2.5/weather?lat=" + lati + "&lon=" + long + "&units=metric", function(weather) {
          $('#temperature_celcius').text(weather.main.temp);
          $("#target1").text(weather.name);
          $("#target2").text(weather.weather[0].description);
          $("#target3").text("SE " + weather.wind.speed + " Knots");
        });
      });
    });
no?
thats not possible i dont think.
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:41
It just worked with the previous request.....!!! I just removed "units==="metric"; " unnoticed code..
@dting Thanks.
CamperBot
@camperbot
Aug 28 2015 09:42
soumyarauth sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 756 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 28 2015 09:43
well it kinda works except you get location earth.
you aren't getting your local weather.
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:44
ohhh!!!! i thought this 'Earth' problem is only for my location here. It is same there!!!!! :(
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:44
hi!
DTing
@dting
Aug 28 2015 09:44
i explained the problem above.
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:44
I'm stuck in Waypoint: Start a Nodejs Server
on Learn you a node, my file is failing on "Make it modular" test
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:46
@dting would you please take a look at the location now???
DTing
@dting
Aug 28 2015 09:46
i explained the problem above
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:46
anyone willing to help me out?
DTing
@dting
Aug 28 2015 09:47
sorry i dont remember that waypoint's specifics
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:49
:( think I asked in the wrong room
anyone please point me in the right direction
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:49
@ashraful-islam what are u stuck with?
DTing
@dting
Aug 28 2015 09:50
this is probably the right room. i just don't think there are a lot of people active at the moment.
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:50
here is the error
DTing
@dting
Aug 28 2015 09:50
@soumyaRauth i explained your problem above. scroll up
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:50
blob
here is my lovely lfbe
blob
var fs = require('fs'),
    path = require('path');


var read = function(fe,fp,fn){
  var fext_ = "." + fe,
      filteredFileList_;

  fs.readdir(fp, filterFileListByExt);


  function filterFileListByExt(err, data) {

    if(err) return fn(err);

    filteredFileList_ = data.filter(function(d) {
      return (path.extname(d) === fext_);
    });


    fn(null,filteredFileList_);
  }

};

module.exports = read;
not sure where that last error is coming
not sure what that "34" means
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:57
ah, got it, its "file path not found"
but still not sure why the test doesn't pass
module supposed to return callback with error if any
Soumya Rauth
@soumyaRauth
Aug 28 2015 09:58
@dting You wrote that " you had your weather request outside of the location request callback:".... But I did have two global variables 'lat' and 'long' and I was storing the current latitude and longitude in them.
DTing
@dting
Aug 28 2015 09:58
keep reading. i talk about how the getJSONs are async calls.
Ashraful Islam
@ashraful-islam
Aug 28 2015 09:59
@soumyaRauth nice weatherapp there. :) except the first box being null all is working for me :)
DTing
@dting
Aug 28 2015 09:59
@ashraful-islam i think you have your function arguments reversed
fe and fp
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:00
@dting thanks! but if I did that, it wouldn't pass the first series of tests
CamperBot
@camperbot
Aug 28 2015 10:00
ashraful-islam sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 758 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:01
see the initial tests says actuals are equal to expected
here is the snipped using the module
var fs = require('fs'),
    path = require('path'),
    lf = require('./lfbe');

// inputs
var fe = process.argv[3],
    fp = process.argv[2],
    cb = function(err, arr) {
      if(err) return console.log(err);//console.log("[ERR]\t" + err.message);

      arr.forEach(function(e){
        console.log(e);
      })
    };

// get file list using lf module
lf(fe,fp,cb);
Soumya Rauth
@soumyaRauth
Aug 28 2015 10:02
@dting I think it is working right now... Would you please take a look at it???
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:05
@soumyaRauth it doesn't work when adblocker is active
DTing
@dting
Aug 28 2015 10:05
@soumyaRauth it's kinda working. $("#target1").text(weather.sys.name); log that weather object. weather.sys.name is undefined
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:06
@soumyaRauth maybe you should add some notification requesting to disable adblock? :)
Michael Bomholt
@bomholtm
Aug 28 2015 10:07
hey guys. i wonder if there is a easy way to make a section come up instead of scrolling down to a section by pressing a menu link
so basicly if i have menu on top instead of scrolling down to the section
DTing
@dting
Aug 28 2015 10:08

@ashraful-islam

You must write a module file to do most of the work. The module must export a single function that takes three arguments: the directory name, the filename extension string and a callback function, in that order. The filename extension argument must be the same as what was passed to your program. Don't turn it into a RegExp or prefix with "." or do anything except pass it to your module where you can do what you need to make your filter work.

sorry that was supposed to be a pm
Michael Bomholt
@bomholtm
Aug 28 2015 10:09
this section and only this selected section should move from the screen bottom to the nav bar
Soumya Rauth
@soumyaRauth
Aug 28 2015 10:09
@dting could it be a problem with the api??? I also see FCC weather zipline example showing my location as null.....
DTing
@dting
Aug 28 2015 10:09
looks like your function is not in that order.
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:09
so, my module has to take args in that order?
I thought I could handle those things outside, the file that uses the modules should handle those
DTing
@dting
Aug 28 2015 10:11
@soumyaRauth theirs works for me
console.log the object you will see that name is not a property of weather.sys
and thats why you are getting null
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:11
@dting oh! :open_mouth:
it worked
DTing
@dting
Aug 28 2015 10:12
cool
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:12
thanks a bunch man, you saved me :+1:
CamperBot
@camperbot
Aug 28 2015 10:12
if you want to thank someone, put an @ before their name!
DTing
@dting
Aug 28 2015 10:12
was it the order?
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:12
yes
DTing
@dting
Aug 28 2015 10:12
ic
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:12
I shifted the order in module and it passed :o:
@dting thanks!
CamperBot
@camperbot
Aug 28 2015 10:12
ashraful-islam sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: ashraful-islam already gave dting points
DTing
@dting
Aug 28 2015 10:12
np
Prashanth
@dgprashanth
Aug 28 2015 10:12
@dting Could you help me out with something as well
I try to get a new twitter window to open, but a new tab opens instead! I can type out the code here...
DTing
@dting
Aug 28 2015 10:14
sure lets see what you got
Soumya Rauth
@soumyaRauth
Aug 28 2015 10:14
@dting Thanks... It was great help. It is working now. http://codepen.io/soumya_rauth/full/PqMvqZ/ Also how do I set the Icon.... I found icon code on json data. How do I set them???
CamperBot
@camperbot
Aug 28 2015 10:14
soumyarauth sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: soumyarauth already gave dting points
DTing
@dting
Aug 28 2015 10:15
@dgprashanth i dont believe you can control that tho
Clearwood
@Clearwood
Aug 28 2015 10:15
where's the problem here?
 function repeat(str, num) {
  // repeat after me
  if (num >= 0){ 
  return str.repeat(num);
  }
  else {
    str.repeat(0);
  }

}

repeat('abc', 3);
DTing
@dting
Aug 28 2015 10:15
bf repeat
CamperBot
@camperbot
Aug 28 2015 10:15

: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

DTing
@dting
Aug 28 2015 10:16
@Clearwood theres a range error if the number is negative
you need to handle that case
also your else block doesnt return a value
oh i guess you are handling that case sorry
ya your else block should return str.repeat(0)
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:17
string has a repeat method?
Clearwood
@Clearwood
Aug 28 2015 10:17
@dting thx see the problem
CamperBot
@camperbot
Aug 28 2015 10:17
clearwood sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 759 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:18
:open_mouth: I did that one with loop
:(
Prashanth
@dgprashanth
Aug 28 2015 10:18
@dting Okay, I have another issue with the twitter thing I mentioned earlier. I want the quote that has been generated to be added to the tweet
DTing
@dting
Aug 28 2015 10:18
@dgprashanth are you using the widget?
Prashanth
@dgprashanth
Aug 28 2015 10:19
@dting ah i'm not.. Will using that be easier?
DTing
@dting
Aug 28 2015 10:20
no
the widget cant handle dynamic changes the the text
thats why i asked
what's your code look like then
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:21
there supposed to be an url with /intent/?=[required tweet text] thing
I used that one
Paweł
@ridlez
Aug 28 2015 10:27
hi could someone help me? <body id="background">
<div class="container">
<h1>Random quote machine</h1>
<p id="showQuote"></p>
<div id="QuoteButton">
<button class="btn btn-primary btn-block" type="button">
Random quote
</button>
</div>
</div>
</body>
the btn-bloco deos not work
block*
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:28
<body id="background">
<div class="container">
<h1>Random quote machine</h1>
<p id="showQuote"></p>
<div id="QuoteButton">
<button class="btn btn-primary btn-block" type="button">
Random quote
</button>
</div>
</div>
</body>
Aleksandar B.
@aleksandar-b
Aug 28 2015 10:29
@ridlez it's working for me
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:29
I don't think there is a type=button for the button, only for input
but that shouldn't be the problem
@samosale I think he means click event?
Aleksandar B.
@aleksandar-b
Aug 28 2015 10:30
@ashraful-islam what click event?
DTing
@dting
Aug 28 2015 10:31
link your codepen
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:31
@samosale only thing that doesn't work there is may be the click event
Aleksandar B.
@aleksandar-b
Aug 28 2015 10:31
@ashraful-islam then he should give button id
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:32
am speculating
Paweł
@ridlez
Aug 28 2015 10:32
it work the link you posted
works*
but on my codepen same code does not work
maybe something with libraries?
Aleksandar B.
@aleksandar-b
Aug 28 2015 10:32
@ridlez you must include bootstrap
DTing
@dting
Aug 28 2015 10:32
link your pen?
Prashanth Chandra
@prashcr
Aug 28 2015 10:34
@ridlez What isn't working?
Aleksandar B.
@aleksandar-b
Aug 28 2015 10:34
@ridlez just delete QuoteButton
div
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:34
ah, he is firing click event on the div instead of the button itself
:(
DTing
@dting
Aug 28 2015 10:35
btn-blockmakes the button as wide as the parent div
Spatz
@Spatzerny
Aug 28 2015 10:35
@ridlez nice background
DTing
@dting
Aug 28 2015 10:35
your parent div is just that wide
Paweł
@ridlez
Aug 28 2015 10:35
@samosale thank you it works :D
CamperBot
@camperbot
Aug 28 2015 10:35
ridlez sends brownie points to @samosale :sparkles: :thumbsup: :sparkles:
:star: 237 | @samosale | http://www.freecodecamp.com/samosale
Paweł
@ridlez
Aug 28 2015 10:36
@Spatzerny thanks ;d
@dting thank u
CamperBot
@camperbot
Aug 28 2015 10:36
ridlez sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:36
@ridlez I don't like how the button is acting like a footer, stuck in the bottom
CamperBot
@camperbot
Aug 28 2015 10:36
:star: 761 | @dting | http://www.freecodecamp.com/dting
Aleksandar B.
@aleksandar-b
Aug 28 2015 10:36
@ridlez but you must change targeted click event in javascript
Spatz
@Spatzerny
Aug 28 2015 10:36
@ridlez I pozdrowienia z drugiego konca kraju :)
Prashanth
@dgprashanth
Aug 28 2015 10:36
@dting Here is my html code
   <a href="http://twitter.com/share?text=" target="_blank"><i></i><span class=" btn2">Share this quote!</span></a>
DTing
@dting
Aug 28 2015 10:37
link your pen
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:37
@dgprashanth nah, you need to generate the href dynamically
@ashraful-islam Oh.. I will try to look for ways to do that, then!
Paweł
@ridlez
Aug 28 2015 10:38
@Spatzerny rowniez pozdrawiam ;d
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:38
nice button! I like the animated birdy <3
@dgprashanth your href should be something like "https://twitter.com/intent/tweet?text={dynamically_injected_quote_text_here}"
^
then the new window will be populated with your quote text
:)
Prashanth
@dgprashanth
Aug 28 2015 10:40
@ashraful-islam Thanks :)
CamperBot
@camperbot
Aug 28 2015 10:40
dgprashanth sends brownie points to @ashraful-islam :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for ashraful-islam
Prashanth
@dgprashanth
Aug 28 2015 10:41
@ashraful-islam I tried multiple ways of adding the quote there.. did not work in the html part of it
Prashanth
@dgprashanth
Aug 28 2015 10:41
I tried href="htt..." + title.innerHTML
Soumya Rauth
@soumyaRauth
Aug 28 2015 10:42
is it working correctly... I haven't done the background stuff yet.
Prashanth
@dgprashanth
Aug 28 2015 10:42
and other combinations, but perhaps I should be doing that elsewhere.. as in the js I suppose
DTing
@dting
Aug 28 2015 10:43
@dgprashanth you can do something like this:
http://codepen.io/dting/pen/MagGWY
Clearwood
@Clearwood
Aug 28 2015 10:45
what am I doing wrong?
function truncate(str, num) {
  // Clear out that junk in your trunk
  if (str.length > num){
    var ll = str
    ll.substr(0,num);
    ll = ll + '...'
    return ll;
  }
  else {
  return str;
  }
  }

truncate('A-tisket a-tasket A green and yellow basket', 11);
DTing
@dting
Aug 28 2015 10:45
@Clearwood you need to take into account that '...' is 3 letters
also ll.subst doesnt mutate ll
ll.substr just returns the substr
strings are immutable.
Clearwood
@Clearwood
Aug 28 2015 10:46
@dting meaning what?
DTing
@dting
Aug 28 2015 10:47
var a = "hello";
a.substr(0,2);
console.log(a);
// "hello"
console.log(a.substr(0,2));
// "he"
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:47
@dgprashanth add this inside your change function
Soumya Rauth
@soumyaRauth
Aug 28 2015 10:47
http://codepen.io/soumya_rauth/full/PqMvqZ/ Please tell me what's the temperature it is showing
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:47
$('#btn-share').attr('href', 'http://twitter.com/share?text=' + Quotation[randomquote]);
here, am using #btn-share as the id of the "share with twitter" button
use whatever you like :)
DTing
@dting
Aug 28 2015 10:48
@Clearwood meaning you need to assign ll.substr(...) to something because ll doesnt change when you call substr it just returns a string
Clearwood
@Clearwood
Aug 28 2015 10:49
@dting ok i can't follow you there so how can i assign it to something else?
DTing
@dting
Aug 28 2015 10:49
var a = "hello";
var b = a.substr(0, 2);
or even:
var a = "hello";
a = a.substr(0, 2);
wiki immutable
CamperBot
@camperbot
Aug 28 2015 10:52

:point_right: js immutable [wiki]

Immutable means unchangeable i.e. you can't change.

Javascript has lots of immutable types e.g. string primitive type. Try this in your console.

s = "red";
console.log(s[1]); //→ "e"
s[1] = "x";
console.log(s) //→ "red"

the s didn't change! WAT!

:pencil: read more about js immutable on the FCC Wiki

Jesse Croxford
@Jcroxford
Aug 28 2015 10:52
hey everyone I am on basic algorithmic scripting exercise 4 and I can't figure out which regular expression to use to remove everything but the letters... can anyone help?
Clearwood
@Clearwood
Aug 28 2015 10:52
@dting thx
CamperBot
@camperbot
Aug 28 2015 10:52
clearwood sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: clearwood already gave dting points
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:53
Jesse Croxford
@Jcroxford
Aug 28 2015 10:53
regular expressions are still a bit confusing to me haha
this might help
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:55
@AuricSlayer /[^a-z0-9]/gi may catch all non-alphanumeric stuff in there
Jesse Croxford
@Jcroxford
Aug 28 2015 10:56
the problem is it has to catch only the letters so would you just remove 0-9?
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:56
ah
you want to keep letters or remove 'em?
not sure which exercise this one :)
Jesse Croxford
@Jcroxford
Aug 28 2015 10:57
its palindrome
DTing
@dting
Aug 28 2015 10:57
ya you can use /[^a-z]/gi
Jesse Croxford
@Jcroxford
Aug 28 2015 10:57
it needs everything removed except letters essentially
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:57
oh
DTing
@dting
Aug 28 2015 10:57
the tests aren't very strict on that one so you can leave in the letters and even _
so /\W/g even works
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:57
I'd maybe use \W
Jesse Croxford
@Jcroxford
Aug 28 2015 10:58
I tried \W but it includes numbers
Ashraful Islam
@ashraful-islam
Aug 28 2015 10:58
:(
the put in \d in there
:)
DTing
@dting
Aug 28 2015 10:59
bf palind
CamperBot
@camperbot
Aug 28 2015 10:59

: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

DTing
@dting
Aug 28 2015 10:59
bf details
CamperBot
@camperbot
Aug 28 2015 10:59

: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.
A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.
You'll need to remove punctuation and turn everything lower case in order to check for palindromes.
We'll pass strings with varying formats, such as "racecar", "RaceCar", and "race CAR" among others.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
DTing
@dting
Aug 28 2015 10:59
ya actually it doesnt say to remove numbers just punctuations
Jesse Croxford
@Jcroxford
Aug 28 2015 10:59
awesome there we go thanks!
CamperBot
@camperbot
Aug 28 2015 10:59
if you want to thank someone, put an @ before their name!
DTing
@dting
Aug 28 2015 10:59
there aren't any tests for them anyways
Jesse Croxford
@Jcroxford
Aug 28 2015 10:59
thanks @ashraful-islam and @dting
CamperBot
@camperbot
Aug 28 2015 10:59
auricslayer sends brownie points to @ashraful-islam and @dting :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for ashraful-islam
:star: 762 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@ashraful-islam
Aug 28 2015 11:00
:D
Prashanth
@dgprashanth
Aug 28 2015 11:02
@dting @ashraful-islam Thanks a ton guys! Been trying to crack this one for a couple of hours now!
CamperBot
@camperbot
Aug 28 2015 11:02
dgprashanth sends brownie points to @dting and @ashraful-islam :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for ashraful-islam
:star: 763 | @dting | http://www.freecodecamp.com/dting
Ashraful Islam
@ashraful-islam
Aug 28 2015 11:03
its pretty strange how camperbot says I don't exist :(
Prashanth Chandra
@prashcr
Aug 28 2015 11:04
@ashraful-islam what's your FCC profile page?
Ashraful Islam
@ashraful-islam
Aug 28 2015 11:05
iashraful
^
Prashanth Chandra
@prashcr
Aug 28 2015 11:05
Jesse Croxford
@Jcroxford
Aug 28 2015 11:05
camperbot has some bee with you haha
Prashanth Chandra
@prashcr
Aug 28 2015 11:05
It expects the same name for gitter and FCC I think
Ashraful Islam
@ashraful-islam
Aug 28 2015 11:05
ah, my github.username !== fcc.username
Sandeep Lakka
@asandyz
Aug 28 2015 11:18
hello anybody there
Tracey
@codewarrior15
Aug 28 2015 11:19
Hi Guys I am learning and am having problems with the waypoint on sizing the images. any suggestions would be appreciated
DTing
@dting
Aug 28 2015 11:21
post your code
Sandeep Lakka
@asandyz
Aug 28 2015 11:25
what does it mean by "@@ -1,6 +1,6 @@" in diff of committed file?
DTing
@dting
Aug 28 2015 11:28
@asandyz @@ from-file-line-numbers to-file-line-numbers @@
Tracey
@codewarrior15
Aug 28 2015 11:29

@dting if you were asking me for the code here it is. It wants my image to smaller and to use 100pixels<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

h2 {
font-family: Lobster, Monospace;
}

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

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

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

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

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

I am sorry if that was not the right way to put in the code. oops
DTing
@dting
Aug 28 2015 11:29
@codewarrior15 looks like oyu have an extra <style> before the .smaller-image
also you need to add the "smaller-image" class to the img tag <img src="https://bit.ly/fcc-relaxing-cat">
Tracey
@codewarrior15
Aug 28 2015 11:31
okay @dting i will try what you said. Thank you very much for your time. It is much appreciated. :-)
CamperBot
@camperbot
Aug 28 2015 11:31
codewarrior15 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 766 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 28 2015 11:33
@codewarrior15 nps
Prashanth
@dgprashanth
Aug 28 2015 11:34
Guys, the weather zipline example page does not seem to be working.. Is it a problem on my end?
works for me
Tracey
@codewarrior15
Aug 28 2015 11:39
@dting i did what you suggested and it took the picture away and has the copy of src="https://bit.ly/fcc-relaxing-cat"> in place of the kitty picture.
@dting here is the code
Prashanth
@dgprashanth
Aug 28 2015 11:40
@dting Is it working for you? I see 3 empty boxes and that's it
DTing
@dting
Aug 28 2015 11:40
i dont see the code @codewarrior15
Tracey
@codewarrior15
Aug 28 2015 11:40

<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;
}

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

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

<img class="smaller-image">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>

DTing
@dting
Aug 28 2015 11:40
@dgprashanth yes
@codewarrior15 you closed the tag before the src
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
@dgprashanth that site doesnt work with https tho
Tracey
@codewarrior15
Aug 28 2015 11:44
@dting It is amazing how one tiny sign can make it work or not work. Thanks again. I am learning and hope to get better soon. :clap: :smile :+1: @dting
CamperBot
@camperbot
Aug 28 2015 11:44
if you want to thank someone, put an @ before their name!
Tracey
@codewarrior15
Aug 28 2015 11:44
@dting That was suppose to be a :smile:
Atik Shaikh
@shaikhatik0786
Aug 28 2015 11:45
@codewarrior15 yup, thats how it is, even a tiny single mistakes results in something terrible
hey guys, I am getting problem with bootstap section, see how the buttons are coming up http://prntscr.com/89uesz
Sandeep Lakka
@asandyz
Aug 28 2015 11:47
i137^pimgpsh_thumbnail_win_distr.jpg
@dting
it's says @@ -1,6 +1,6 @@ for the diff
what shall i understand from that?
@dting sorry here's the image of the diff screenshot http://i.imgur.com/zcPZmXE.png
Davis
@ajdavis56
Aug 28 2015 12:06
can anyone walk me through how to make an API call?
or point me to an online resource?
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:09
http://codepen.io/soumya_rauth/full/PqMvqZ/ One bonus user story is still to be finished.
@ajdavis56 API for what?
Jepz
@Jepz
Aug 28 2015 12:12
HI Community! I'm on "Bonfire: Where art thou". having a hard time figure out how to use the .keys and hasOwnProperty functions. Anyone care to explain a little who I should proceed?
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:15
@Jepz I think i need to take a look at the problem definition.
Jepz
@Jepz
Aug 28 2015 12:15
@soumyaRauth Ok, shall i link to it or?
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:16
ok.
Remus Cicu
@RemusAndrei
Aug 28 2015 12:16
@soumyaRauth @Jepz i’m stuck also here
Jepz
@Jepz
Aug 28 2015 12:17
@RemusAndrei :)
Davis
@ajdavis56
Aug 28 2015 12:17
@soumyaRauth Zipline #2: forismatic.com
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:18
@Jepz taking a look at it...
Jepz
@Jepz
Aug 28 2015 12:18
@soumyaRauth super, thanks. Would be nice to get a hint on how i should think and use the suggested functions
CamperBot
@camperbot
Aug 28 2015 12:18
jepz sends brownie points to @soumyarauth :sparkles: :thumbsup: :sparkles:
:star: 226 | @soumyarauth | http://www.freecodecamp.com/soumyarauth
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:26
@Jepz Can I take a look at your code?
Jepz
@Jepz
Aug 28 2015 12:26
@soumyaRauth hahah it's none at the moment ^^
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:27
@Jepz ok... Have u read the gigen function's descriptions.... ?
Jepz
@Jepz
Aug 28 2015 12:27
@soumyaRauth I'm trying to get started in where to start, how to use the functions they recommend in the assigment
Remus Cicu
@RemusAndrei
Aug 28 2015 12:27
@soumyaRauth
function where(collection, source) {
  var arr = [];
  // What's in a name?  
    for(var i in collection) {
      if(collection.hasOwnProperty === source.hasOwnProperty) {
        arr[i] = collection[i];
      }
  }
  return arr;
}

where([{ first: 'Romeo', last: 'Montague' }, { first: 'Mercutio', last: null }, { first: 'Tybalt', last: 'Capulet' }], { last: 'Capulet' });
this is what i have so far
Jepz
@Jepz
Aug 28 2015 12:28
@soumyaRauth @RemusAndrei what I can understand, you have to find a last that is null. remove it and add what you have in source
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:30
@RemusAndrei @Jepz You have to return an array in the result...So u need to filter the first argument by calling the filter function.
Jepz
@Jepz
Aug 28 2015 12:30
@RemusAndrei instead of var i in collection, couldn't u use collection.length?
@soumyaRauth hmm.. okay, follow you there. via the filter, if anything is false (null should be false) filter it away
Remus Cicu
@RemusAndrei
Aug 28 2015 12:32
@Jepz nope, tryed to use it like that , dosen’t work and im not sure why
Jepz
@Jepz
Aug 28 2015 12:33
@RemusAndrei hmm ok ^^ I did it before on another bonfire
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:35
dot key functions returns the array with only the property names of an object. like this: var an_obj = { 100: 'a', 2: 'b', 7: 'c' };
console.log(Object.keys(an_obj)); // console: ['2', '7', '100']
Jepz
@Jepz
Aug 28 2015 12:35
@soumyaRauth so then "null" would be gone..
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:38
So now if u have an array with the property name of an object then you can compare it with the each object values of collection...
Blauelf
@Blauelf
Aug 28 2015 12:39
What is all that talking about null? When I did that bonfire, I did not evaluate any value, just compared them, so null was never a problem.
Jepz
@Jepz
Aug 28 2015 12:39
@Blauelf so what, when you found one that did not have a value you "just" added the one from source?
@soumyaRauth Ok... so like what @RemusAndrei was doing?
Blauelf
@Blauelf
Aug 28 2015 12:41
Umm... I used filter, and the function gave false if it found entries in the "source" without a match in the collection element.
Jepz
@Jepz
Aug 28 2015 12:42
aight, sounds interesting
Blauelf
@Blauelf
Aug 28 2015 12:43
I used the fact that JavaScript for a missing property returns undefined. I am not sure if there is a difference between a property set to undefined and a missing property.
At least that is how I think it worked ;)
egeogretmen
@egeogretmen
Aug 28 2015 12:44
hey guys, im having trouble making a cross domain get request by using jQuery.get for the Quote Generator Zipline. As far as i see, i need to make dataType: 'jsonp' to enable this but it returns the error callback. guess im missing something somewhere. anybody knows where?
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:45
Filter returns an array... So you have to set it to a array variable. Then inside filter you use Object.key() to take out the property name in " source". And run a loop from that array that u got from the key and compare it with the each object within "collection" array using Object.hasOwnProperty().
Emanuele Antonelli
@Em-Ant
Aug 28 2015 12:45
@egeogretmen try this
$.ajax({
          url : "http://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=?",
          dataType:'json',
          jsonp : 'jsonp',
    });
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:45
Object.hasOwnProperty() returns a boolean. If it returns true then the object should be filtered in the final array, otherwise not.
Jepz
@Jepz
Aug 28 2015 12:45
@soumyaRauth Thanks a lot! I'll give it a try.
CamperBot
@camperbot
Aug 28 2015 12:45
jepz sends brownie points to @soumyarauth :sparkles: :thumbsup: :sparkles:
:warning: jepz already gave soumyarauth points
Jepz
@Jepz
Aug 28 2015 12:46
@Blauelf also thanks to you for pitching in ;)
Emanuele Antonelli
@Em-Ant
Aug 28 2015 12:46
@egeogretmen forismatic needs the jsonp callback param in the query to be named jsonp, instead of the default callback
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:46
@Jepz you r welcome.
Tim P
@xTimpi
Aug 28 2015 12:47
@egeogretmen if you are using jsonp as your dataType you have to add a callback=? at the end of your request
Tracey
@codewarrior15
Aug 28 2015 12:48
how do I get one class not to override another class in html element?
Remus Cicu
@RemusAndrei
Aug 28 2015 12:49
@Jepz did you manage to do it ?
Jepz
@Jepz
Aug 28 2015 12:49
@RemusAndrei Hold your horses ^^Im no ninja ;) It will take me some time :D
Blauelf
@Blauelf
Aug 28 2015 12:49
@codewarrior15 All classes added will be applied. What do you want to do?
Jepz
@Jepz
Aug 28 2015 12:50
@RemusAndrei I'll add you as a chat for privat, If im able to do it i'll give you a shout. works for you?
Tracey
@codewarrior15
Aug 28 2015 12:51
@Blauelf my border is overriding my image size
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:51
@RemusAndrei Filter returns an array... So you have to set it to an array variable first. Then inside filter you use Object.key() to take out the property name in " source". And run a loop from that array that u got from the key and compare it with the each object within "collection" array using Object.hasOwnProperty().
Tracey
@codewarrior15
Aug 28 2015 12:52
@Blauelf here is the code <img class="thick-green-border" class="smaller-image" src="https://bit.ly/fcc-relaxing-cat">
minakasiin
@minakasiin
Aug 28 2015 12:52
@codewarrior15 you can do it like this indeed: <img class="thick-green-border smaller-image" src="https://bit.ly/fcc-relaxing-cat">
Blauelf
@Blauelf
Aug 28 2015 12:53
Elements can have only one attribute of a given name. So last definition wins.
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:53
@Jepz @RemusAndrei Please let me know when u are done.
Jepz
@Jepz
Aug 28 2015 12:54
Sure thing! @soumyaRauth I'll do the same with you then (chat). I'll be going offline for now so it might be awhile
minakasiin
@minakasiin
Aug 28 2015 12:54
You can have several names in your element, just the last one will usually override all others, if they have some similar code, like color
Tracey
@codewarrior15
Aug 28 2015 12:55
@Blauelf i will give it a try. Thanks
CamperBot
@camperbot
Aug 28 2015 12:55
codewarrior15 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 254 | @blauelf | http://www.freecodecamp.com/blauelf
egeogretmen
@egeogretmen
Aug 28 2015 12:55
@Em-Ant thanks dude, that worked but what i did not understand is -> does it mean that jquery does not inject the callback to the params when you give jsonp as one of the params or is just about forismatic?
@xTimpi unfortunately that did not work which i think is because of forismatic
how may i give some brownie points?
Soumya Rauth
@soumyaRauth
Aug 28 2015 12:58
@RemusAndrei r u done with Where art thou??
minakasiin
@minakasiin
Aug 28 2015 12:58
their name and thanks I believe @egeogretmen
CamperBot
@camperbot
Aug 28 2015 12:58
minakasiin sends brownie points to @egeogretmen :sparkles: :thumbsup: :sparkles:
:star: 92 | @egeogretmen | http://www.freecodecamp.com/egeogretmen
egeogretmen
@egeogretmen
Aug 28 2015 12:59
@Em-Ant thanks
thanks @Em-Ant
CamperBot
@camperbot
Aug 28 2015 12:59
egeogretmen sends brownie points to @em-ant :sparkles: :thumbsup: :sparkles:
Emanuele Antonelli
@Em-Ant
Aug 28 2015 12:59
@egeogretmen by default jquery injects a function when on the query string there is 'callback=?'. Forismatics want this parameter to be set to jsonp=functionName so you have to tell to jquery to create and inject a function. This is what the jsonp: 'jsonp' is in the config object
CamperBot
@camperbot
Aug 28 2015 12:59
:star: 292 | @em-ant | http://www.freecodecamp.com/em-ant
egeogretmen
@egeogretmen
Aug 28 2015 13:00
thanks @minakasiin
CamperBot
@camperbot
Aug 28 2015 13:00
egeogretmen sends brownie points to @minakasiin :sparkles: :thumbsup: :sparkles:
:star: 116 | @minakasiin | http://www.freecodecamp.com/minakasiin
minakasiin
@minakasiin
Aug 28 2015 13:01
No problem =)
Remus Cicu
@RemusAndrei
Aug 28 2015 13:01
@soumyaRauth nope , didn’t tryed to make your suggestion yet
Emanuele Antonelli
@Em-Ant
Aug 28 2015 13:03
@egeogretmen you're welcome
Blauelf
@Blauelf
Aug 28 2015 13:03
Umm... can one update solutions to bonfires? My solution to BF Where art thou is such a fast and dirty hack, with != where I should have used !==, and no formatting at all...
I submitted another version, just in my profile, it stays the same.
Soumya Rauth
@soumyaRauth
Aug 28 2015 13:06
need remarks on this... Also need suggestion on how can I change the background image with temperature...? http://codepen.io/soumya_rauth/full/PqMvqZ
minakasiin
@minakasiin
Aug 28 2015 13:08
@soumyaRauth turn temperature into a variable (i believe thats what they are called, haven't done js for long time) and then put that as color code somehow
Emanuele Antonelli
@Em-Ant
Aug 28 2015 13:10
@soumyaRauth if you want to use an image do $('body').css('background-image', 'url(url_to_image)')
Soumya Rauth
@soumyaRauth
Aug 28 2015 13:11
@minakasiin I did that... But i need something a bit more dynamic... Wish if the bg could be changed into a snow fall image when it is actually snowing outside....:)
@Em-Ant ya i used id....
minakasiin
@minakasiin
Aug 28 2015 13:12
Is it possible to do it as a intervals? like -40 to -20 it is certain color and -20 to 0 its another etc? I believe with if-else script it should be possible?
Emanuele Antonelli
@Em-Ant
Aug 28 2015 13:12
@minakasiin of course,
Soumya Rauth
@soumyaRauth
Aug 28 2015 13:12
@minakasiin yes it is posible with if else.
minakasiin
@minakasiin
Aug 28 2015 13:13
Oh I can't wait when I get to that far with my lessons :D
Blauelf
@Blauelf
Aug 28 2015 13:13
with if-else or ternary operator
Emanuele Antonelli
@Em-Ant
Aug 28 2015 13:13
This message was deleted
This message was deleted
Soumya Rauth
@soumyaRauth
Aug 28 2015 13:13
@Em-Ant that was a typo.... not "id"... It would be "it".... :)
Emanuele Antonelli
@Em-Ant
Aug 28 2015 13:16
@soumyaRauth you have to check for weather condition (generally APIs have a code associated with each condition) then switch the bg image. I switched the icon according to the weather condition on my zipline
Blauelf
@Blauelf
Aug 28 2015 13:20
@soumyaRauth Temperature conversion is a bit broken. Math.floor(9/5) equals 1 ;-)
Soumya Rauth
@soumyaRauth
Aug 28 2015 13:22
@Blauelf that is called a real help... :)
Spatz
@Spatzerny
Aug 28 2015 13:30
    var colors = {
        blue: '0x1d6b98',
        blueDark: '0x14546f',
        red: '0xdc322f',
        darkRed: '0xa42222'
    };
how's that colorcoding named?
Blauelf
@Blauelf
Aug 28 2015 13:31
It's hexadecimal numbers, you just can't use them this way in HTML
Spatz
@Spatzerny
Aug 28 2015 13:32
oh
0x for #
Blauelf
@Blauelf
Aug 28 2015 13:32
CSS will like them as "color: #1d6b98"
Spatz
@Spatzerny
Aug 28 2015 13:34
ohhh
so 0x is generally for what follows is a hexadecimal value
got it
@Blauelf thanks
CamperBot
@camperbot
Aug 28 2015 13:35
spatzerny sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star: 256 | @blauelf | http://www.freecodecamp.com/blauelf
Remus Cicu
@RemusAndrei
Aug 28 2015 13:52
@soumyaRauth thx for the help with my challeng ;)
CamperBot
@camperbot
Aug 28 2015 13:52
remusandrei sends brownie points to @soumyarauth :sparkles: :thumbsup: :sparkles:
:star: 227 | @soumyarauth | http://www.freecodecamp.com/soumyarauth
Soumya Rauth
@soumyaRauth
Aug 28 2015 13:54
@RemusAndrei you'r welcome :)
P Joshi
@papajo
Aug 28 2015 13:57
hey i was trying this challenge http://freecodecamp.com/challenges/bonfire-mutations need to figure out what's the issue with my code
blob
good morning to all
Prashanth Chandra
@prashcr
Aug 28 2015 13:59
could you post the code here?
wiki formatting
CamperBot
@camperbot
Aug 28 2015 13:59

: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

``` ⇦ Type 3 backticks, 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

Rabin Shrestha
@jyapujuju
Aug 28 2015 13:59
function truncate(str, num) {
  // Clear out that junk in your trunk
  if(str.length>num){
     str.slice(0,num)
    return str;
  }
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
plz help
Prashanth Chandra
@prashcr
Aug 28 2015 14:00
@jyapujuju you're returning the original string
str.slice returns a new string, it doesn't mutate the original string
Paul Motz
@paulmotz
Aug 28 2015 14:01
@papajo is your code case sensitive?
P Joshi
@papajo
Aug 28 2015 14:01
ah didnt check that lmc
Rabin Shrestha
@jyapujuju
Aug 28 2015 14:02
it equal to condition but cant pass
function truncate(str, num) {
  // Clear out that junk in your trunk
  var t=[];
  if(str.length>num){
     t=str.slice(0,num)
    return t;
  }
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
??
@prashcr
Prashanth Chandra
@prashcr
Aug 28 2015 14:04
slice doesn't take a length for second argument
it takes an ending position
use substr instead
Make sure you know what a function does before using it
ahmeddin
@ahmeddin
Aug 28 2015 14:06
  function sumFibs(num) {
  var n1=0;   var n2=1;   var fib=1;  var sum=0;   var temp;

  while(fib<num){

    if(fib%2!==0)
      {
        sum+=fib;
      }
      fib=n1+n2;

      n2+=n1;
      n1=fib-n2;


  }


  return sum;
}

sumFibs(4);
can anyone see why i get wrong output
John
@jk47
Aug 28 2015 14:08
anyone familiar with the learnyoumongo exercises?
Prashanth Chandra
@prashcr
Aug 28 2015 14:08
@ahmeddin Could you explain your algorithm for fibonacci numbers?
@jk47 try me
John
@jk47
Aug 28 2015 14:09
for the third exercise i need to connect to the db but am getting an error
let me get a screenshot
Paul Motz
@paulmotz
Aug 28 2015 14:09
@papajo Some other suggestions:
  1. if arguments is an array of arguments and the only argument is the array arr, what is the length of arguments
  2. len can be used in one of your for loops
  3. you may want to use === instead of ==. I have heard that it is a good practice.
    EDIT: typed ' instead of `to show code in Markdown
John
@jk47
Aug 28 2015 14:10
blob
blob
P Joshi
@papajo
Aug 28 2015 14:10
@paulmotz I convert to lowercase before comparing letters is that wrong?
Rabin Shrestha
@jyapujuju
Aug 28 2015 14:12
@prashcr but it suggest to use slice function
whats wrong here
ahmeddin
@ahmeddin
Aug 28 2015 14:13
@prashcr , i am trying like fib=1, for the first fibonacci in the loop, and it gets added in sum+=fib (checking if fib%2!=0), after that fib gets updated, fib=n1+n2, n2 updates to n1+n2, and n1 updates to fib-n2, and u go to next loop iteration...
Prashanth Chandra
@prashcr
Aug 28 2015 14:13
@ahmeddin Why do you need to check if fib%2 !==0?
ahmeddin
@ahmeddin
Aug 28 2015 14:14
i get answer for sumFibs(4) as 4, where as it should be 5,
so, only odd fibs get added...it is in the problem statement
Prashanth Chandra
@prashcr
Aug 28 2015 14:14
Ah okay
ahmeddin
@ahmeddin
Aug 28 2015 14:14
have u done the bonfire...
Paul Motz
@paulmotz
Aug 28 2015 14:14
@papajo I don't think so. My solution did not use any direct comparisons between the two strings (I used an additional boolean array to keep track of all characters that I'd seen in the strings since I didn't want to use a nested loop) so I can't say for sure though.
If you're curious, my method used the charCodeAt() method.
Jonny Morley
@morley92
Aug 28 2015 14:15
Could anybody give me a quick hand with the twitch api zipline if they have completed it?
Prashanth Chandra
@prashcr
Aug 28 2015 14:16
@ahmeddin really long ago
P Joshi
@papajo
Aug 28 2015 14:16
@paulmotz i know my method is primitive yet :) just trying to get thru some challenges for now before going all pro! thanks i'll try charAtCode way soon!
CamperBot
@camperbot
Aug 28 2015 14:16
papajo sends brownie points to @paulmotz :sparkles: :thumbsup: :sparkles:
:star: 192 | @paulmotz | http://www.freecodecamp.com/paulmotz
ahmeddin
@ahmeddin
Aug 28 2015 14:16
can u check your portfolio... and give me the solution..
Prashanth Chandra
@prashcr
Aug 28 2015 14:17
My portfolio got wiped unfortunately
ahmeddin
@ahmeddin
Aug 28 2015 14:17
how does that happen....
any way...
there is no delete my solutions button :(
Michael Bomholt
@bomholtm
Aug 28 2015 14:18
```
Paul Motz
@paulmotz
Aug 28 2015 14:19
@papajo That's definitely okay! Some of my solutions to some of the other exercises probably could have been better too. Just thought I'd share another idea....I hope you figure it out!
Moisés Man
@moigithub
Aug 28 2015 14:20
wiki storage
CamperBot
@camperbot
Aug 28 2015 14:20

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

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

In Chrome:

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

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

ahmeddin
@ahmeddin
Aug 28 2015 14:20
can anyone help me with sum odd fibonacci bonfire...
CamperBot
@camperbot
Aug 28 2015 14:20
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Michael Bomholt
@bomholtm
Aug 28 2015 14:20
how can i make a hidden div slide up from the bottom of the screen instead of going down from the top?
$(".overlay-icon").click(function () {
    $(".overlay").slideToggle("slow");
  });
Prashanth Chandra
@prashcr
Aug 28 2015 14:20
@jyapujuju Ah, slice can work too
Michael Bomholt
@bomholtm
Aug 28 2015 14:20
is use this jquery function but seems like it isnt as simple =)
Prashanth Chandra
@prashcr
Aug 28 2015 14:21
You need to account for the '...' like the question says
ahmeddin
@ahmeddin
Aug 28 2015 14:21
@prashcr , are u talking about my bonfire...
Prashanth Chandra
@prashcr
Aug 28 2015 14:26
@ahmeddin Wrote this just now
function sumFibs(num) {
  function fib(n) {
    if (n == 1) return 1;
    if (n == 2) return 1;
    return fib(n-1) + fib(n-2);
  }
  var sum = 0;
  var n = 1;
  while (fib(n) <= num) {
    if (fib(n)%2) sum += fib(n);
    n++;
  }
  return sum;

}

sumFibs(4);
@jk47 any luck?
RC Maples
@rcmaples
Aug 28 2015 14:30
Howdy all... Got my weather zipline mostly finished (minus a few bonus features I haven't worked on yet). Was hoping to get some feedback and maybe some help with making it more responsive friendly... http://codepen.io/rcmaples/full/rVXEXL/
minakasiin
@minakasiin
Aug 28 2015 14:32
@rcmaples add Celsius also =)
Prashanth Chandra
@prashcr
Aug 28 2015 14:33
@rcmaples Looks great dude, it's as responsive as it gets
RC Maples
@rcmaples
Aug 28 2015 14:33
@minakasiin I'm going to, but at the moment I'm not storing any of the weather data It's all coming in from the api and being displayed, so I can't do math on it and re-display I'll tackle it here in a few and come up with a way to pull the api in for celcius.
Prashanth Chandra
@prashcr
Aug 28 2015 14:33
And yeah, add celsius :P
minakasiin
@minakasiin
Aug 28 2015 14:34
Okay :P
But yea, looks awesome
RC Maples
@rcmaples
Aug 28 2015 14:34
Thanks @minakasiin and @prashcr :+1:
CamperBot
@camperbot
Aug 28 2015 14:34
rcmaples sends brownie points to @minakasiin and @prashcr :sparkles: :thumbsup: :sparkles:
:star: 131 | @minakasiin | http://www.freecodecamp.com/minakasiin
:star: 306 | @prashcr | http://www.freecodecamp.com/prashcr
P Joshi
@papajo
Aug 28 2015 14:36
@paulmotz so do you think checking for arguments length and pushing them onto a separate array isnt necessary? i only do it cos there are 2 diff. args and only one parm, any other idea to get to the second arg??
Prashanth Chandra
@prashcr
Aug 28 2015 14:36
@rcmaples Why can't you do the math on it? Calling the API again just for another unit is inefficient
dionneo
@dionneo
Aug 28 2015 14:38
Where do you start building the tic tac toe?
RC Maples
@rcmaples
Aug 28 2015 14:40
@prashcr I guess I could, but the data isn't being stored in an array and every refresh pulls the api again. Its probably not very efficient, but I suppose I could write another function to convert to celcius if needed before displaying the info.
Michael Bomholt
@bomholtm
Aug 28 2015 14:41
does anyone knows how i can let a hidden div slide in from the screen bottom?
justjoolz
@justjoolz
Aug 28 2015 14:52
any American's out there care to tell me what should be rejected in this phone number 0 (757) 622-7382
I mean what's wrong with it?
DTing
@dting
Aug 28 2015 14:53
it doesnt start with 1
justjoolz
@justjoolz
Aug 28 2015 14:53
thanks !
CamperBot
@camperbot
Aug 28 2015 14:53
if you want to thank someone, put an @ before their name!
justjoolz
@justjoolz
Aug 28 2015 14:53
hahahahahah
@dting thanks !
CamperBot
@camperbot
Aug 28 2015 14:54
justjoolz sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 770 | @dting | http://www.freecodecamp.com/dting
justjoolz
@justjoolz
Aug 28 2015 14:54
lolz @camperbot thanks !
CamperBot
@camperbot
Aug 28 2015 14:54
justjoolz sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 117 | @camperbot | http://www.freecodecamp.com/camperbot
justjoolz
@justjoolz
Aug 28 2015 14:54
hahaha
Lucas Vorsteveld
@Lucashv
Aug 28 2015 14:54
I have a question about modifying global variables. so I modify them in an ajax success function but they don't stay modified when i print them out afterwards does anyone know why that may be?
DTing
@dting
Aug 28 2015 14:54
the ajax call is probably async
it doesnt block. so if your log isnt inside the callback function, you are probably logging before you get the results
Lucas Vorsteveld
@Lucashv
Aug 28 2015 14:55
ohh, so do i need to put a delay in or something
DTing
@dting
Aug 28 2015 14:56
no, thats not reliable
Lucas Vorsteveld
@Lucashv
Aug 28 2015 14:56
hmm so i should do everything inside of the success function then?
DTing
@dting
Aug 28 2015 14:56
you should call from inside your function or use the promise your request probably returns
wiki promise
CamperBot
@camperbot
Aug 28 2015 14:58

:point_right: promises [wiki]

A new feature of ES6 to help with async programming.

:pencil: read more about promises on the FCC Wiki

DTing
@dting
Aug 28 2015 14:58
hmm thats not it
Lucas Vorsteveld
@Lucashv
Aug 28 2015 14:58
haha thank you @dting that was what i was about to ask
CamperBot
@camperbot
Aug 28 2015 14:58
lucashv sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 772 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Aug 28 2015 14:58
what are you using to make your request?
Lucas Vorsteveld
@Lucashv
Aug 28 2015 15:00
what do you mean? like jsonp or ajax?
Sk. Ahmar Mehtab
@mehtab01
Aug 28 2015 15:02
Waypoint: Target the Parent of an Element Using jQuery section:
Lucas Vorsteveld
@Lucashv
Aug 28 2015 15:02
i am pretty sure you mean which format right?
Sk. Ahmar Mehtab
@mehtab01
Aug 28 2015 15:02
i put
$("#left-well").parent().css("background-color","red")
;
but code not working
can anyone help me with this
Aleksandar B.
@aleksandar-b
Aug 28 2015 15:04
@mehtab01 instead of $("#left-well") you should write $("#target1")
DTing
@dting
Aug 28 2015 15:05
@Lucashv are you using jquery?
Lucas Vorsteveld
@Lucashv
Aug 28 2015 15:05
yes
or just call other functions from your callback
Paul Motz
@paulmotz
Aug 28 2015 15:08

@papajo It depends how the function is called. The tests all call it with a single array of two strings, which means that there is only one argument. However, in the screenshot you posted, the function is called with mutation('hello', 'hey') so there are two arguments.

So, to answer your question, I just used arr[0] and arr[1] to access the two arguments.

edit: accidentally pressed enter when typing.

Michael Bomholt
@bomholtm
Aug 28 2015 15:10
@oab00 thank you
CamperBot
@camperbot
Aug 28 2015 15:10
bomholt sends brownie points to @oab00 :sparkles: :thumbsup: :sparkles:
:star: 271 | @oab00 | http://www.freecodecamp.com/oab00
Michael Bomholt
@bomholtm
Aug 28 2015 15:10
@oab00 is it also possible to add something like bounceInUp with animate css?
so it bounces in and bounces out?
Lucas Vorsteveld
@Lucashv
Aug 28 2015 15:14
@dting yeah thats how I had it but then every time I did something I had to do the ajax request again and it seems sort of slow, I'm doing the twitch one, and i want to put each twitch profile from the api into an array so i don't have to recall the api overtime for a search or when toggling between online offline etc, promises look good, is that what they use in the original because I noticed it doesn't lag i think meaning its not reloading
Paweł
@ridlez
Aug 28 2015 15:22
hey how can I tweet out quotes from an array?
Lucas Vorsteveld
@Lucashv
Aug 28 2015 15:25
@dting and i almost forgot, thanks!
CamperBot
@camperbot
Aug 28 2015 15:25
lucashv sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: lucashv already gave dting points
Michael Bomholt
@bomholtm
Aug 28 2015 15:42
is there a easy way to disable the scrollbar? so you can scroll but i the scrollbar is hidden
basicly like its on mobile?
P Joshi
@papajo
Aug 28 2015 15:45
@paulmotz hey I did also try accessing with arr[0] and arr[1] but when i console logged them, showed 'h' and 'e' respectively. So that didnt work, thats why resorted to arguments way.
Paul Motz
@paulmotz
Aug 28 2015 16:01
@papajo I see, are you calling the function with two strings as arguments or with one array consisting of two strings? All the tests call with one array so arr[0] should be the first string and arr[1] the second.
Rohit Balasubramanian
@rohitknhs
Aug 28 2015 16:04
noob here
how do you change the font family of p elements in HTML?
P Joshi
@papajo
Aug 28 2015 16:04
@paulmotz with one array (i didnt touch the template) and thats when i found that arr[0] is pointing to the first string and ignores the rest
Vilva
@albertovilva
Aug 28 2015 16:05
@rohitknhs
p {
font-family: "Times New Roman", Georgia, Serif;
}
with CSS
Anyone knows why this throws: Cannot read propery "length" of undefined

function findLongestWord(str) {
var words = str.split(' '),
result = 5;

for ( i = 0 ; i < words.length ; i++){
}
if(words[i].length > result){
result = words[i].length;
}
//return str.length;
return result;
}

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

Rohit Balasubramanian
@rohitknhs
Aug 28 2015 16:06

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

p {
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>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Vilva
@albertovilva
Aug 28 2015 16:06
the error refers to the if
Rohit Balasubramanian
@rohitknhs
Aug 28 2015 16:07
Thanks @albertovilva and @papajo
CamperBot
@camperbot
Aug 28 2015 16:07
rohitknhs sends brownie points to @albertovilva and @papajo :sparkles: :thumbsup: :sparkles:
:star: 68 | @papajo | http://www.freecodecamp.com/papajo
:star: 48 | @albertovilva | http://www.freecodecamp.com/albertovilva
Vilva
@albertovilva
Aug 28 2015 16:08
thx :D
CamperBot
@camperbot
Aug 28 2015 16:08
if you want to thank someone, put an @ before their name!
Vilva
@albertovilva
Aug 28 2015 16:09
thx @rohitknhs
CamperBot
@camperbot
Aug 28 2015 16:09
albertovilva sends brownie points to @rohitknhs :sparkles: :thumbsup: :sparkles:
:star: 2 | @rohitknhs | http://www.freecodecamp.com/rohitknhs
P Joshi
@papajo
Aug 28 2015 16:10
thanks @rohitknhs
CamperBot
@camperbot
Aug 28 2015 16:10
papajo sends brownie points to @rohitknhs :sparkles: :thumbsup: :sparkles:
:star: 3 | @rohitknhs | http://www.freecodecamp.com/rohitknhs
Vilva
@albertovilva
Aug 28 2015 16:11
ok solved, syntax error :oops
Deep2322
@Deep2322
Aug 28 2015 16:19
(largestOfFour([[13, 27, 18, 26], [4, 5, 1, 3], [32, 35, 37, 39], [1000, 1001, 857, 1]])).should.eql([27,5,39,1001]);expected [ 27, 27, 39, 1001 ] to deeply equal [ 27, 5, 39, 1001 ]
Paweł
@ridlez
Aug 28 2015 16:19
does anyone know how can I make global variable in jquery? I have two variables that need to be global in order to have same quote on the page and to tweet it, but outside function it only works one time and stops
Deep2322
@Deep2322
Aug 28 2015 16:19
how to solve this..?
Vilva
@albertovilva
Aug 28 2015 16:24
@Deep2322 you must check for the biggest number of each sub array and print it into the result array
Deep2322
@Deep2322
Aug 28 2015 16:24
yes i did
but its still not taking me to next lesson..?
Jon Lucas
@jonslucas
Aug 28 2015 16:28
@Deep2322 it looks like the second position in your output is incorrect. It should be 5, but instead is 27. What is the code you have?
Rajendra kadam
@raju249
Aug 28 2015 16:29
I don't have a credit card to signup for heroku. What should I do? Please help asap
Deep2322
@Deep2322
Aug 28 2015 16:31

function largestOfFour(arr) {
var largest = 0;
var biggestArray = [];
for(i = 0; i<arr.length;i++){
for(h=0; h<arr[i].length;h++){
if(largest< arr[i][h]){
largest = arr[i][h];
}
biggestArray[i] = largest;
}
}
return biggestArray;
}

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

what is wrong in this code
?
Vilva
@albertovilva
Aug 28 2015 16:35
@Deep2322 declare largest = 0 inside the first for loop
before the second
Rajendra kadam
@raju249
Aug 28 2015 16:35
I don't have a credit card to signup for heroku. What should I do? Please help Please!
Vilva
@albertovilva
Aug 28 2015 16:35
@raju249 what for?
Atik Shaikh
@shaikhatik0786
Aug 28 2015 16:36
@raju249 you dont need a credit card to sign up
it gives you some free features
Rajendra kadam
@raju249
Aug 28 2015 16:37
In node.js and express.js We need to deploy it on heroku @shaikhatik0786 @albertovilva
OHkk @shaikhatik0786
Vilva
@albertovilva
Aug 28 2015 16:37
@raju249 just register for free
Rajendra kadam
@raju249
Aug 28 2015 16:37
Okai @albertovilva
Atik Shaikh
@shaikhatik0786
Aug 28 2015 16:37
@raju249 check here the free plan https://www.heroku.com/pricing
Rajendra kadam
@raju249
Aug 28 2015 16:37
Got it thanks @shaikhatik0786 thanks @albertovilva
CamperBot
@camperbot
Aug 28 2015 16:37
raju249 sends brownie points to @shaikhatik0786 and @albertovilva :sparkles: :thumbsup: :sparkles:
:star: 51 | @albertovilva | http://www.freecodecamp.com/albertovilva
:star: 90 | @shaikhatik0786 | http://www.freecodecamp.com/shaikhatik0786
Vilva
@albertovilva
Aug 28 2015 16:37
:thought_balloon:
:thumbsup:
Deep2322
@Deep2322
Aug 28 2015 16:39
why shouldn't i declare it outside
?
Jon Lucas
@jonslucas
Aug 28 2015 16:40
@Deep2322 Basically, you need to reset the largest variable value to 0
it's holding on to 27 and comparing that to all the elements in the second sub array, the one that should return 5
since none of those values are larger than 27, once it iterates through them all, it returns 27 again
so, @albertovilva is trying to say that it needs to be set to 0 for each sub array to avoid that error
does that make sense @Deep2322 ?
one way to 'see' it may be to put in a console.log(largest); inside of your inner for loop
Deep2322
@Deep2322
Aug 28 2015 16:46
yes thank you very much @jonslucas and @albertovilva ..thnks a lot
CamperBot
@camperbot
Aug 28 2015 16:46
deep2322 sends brownie points to @jonslucas and @albertovilva :sparkles: :thumbsup: :sparkles:
:star: 377 | @jonslucas | http://www.freecodecamp.com/jonslucas
:star: 52 | @albertovilva | http://www.freecodecamp.com/albertovilva
Jon Lucas
@jonslucas
Aug 28 2015 16:47
@Deep2322 You're welcome!
Jason Wood
@catapixel
Aug 28 2015 16:49
This message was deleted
Vilva
@albertovilva
Aug 28 2015 16:50
@Deep2322 Np!
Rita
@Romperss
Aug 28 2015 16:58
Not sure why this Chunky Monkey solution is not working. Any ideas?

Not sure why this Chunky Monkey solution is not working. Any ideas?
```function chunk(arr, size) {
var newArray[];
for (i = 0; i < arr.length; i += size) {
newArray.push(arr.slice(i, i + size));
}
return newArray;

}

chunk(['a', 'b', 'c', 'd'], 2);```

Den McHenry
@denmch
Aug 28 2015 17:00
Back ticks need to be on their own lines to display properly here.
Rita
@Romperss
Aug 28 2015 17:01
Not sure why this Chunky Monkey solution is not working. Any ideas?
function chunk(arr, size) {
  var newArray[];
  for (i = 0; i < arr.length; i += size) {
    newArray.push(arr.slice(i, i + size)); 
}
 return newArray;

}

chunk(['a', 'b', 'c', 'd'], 2);
@denmch thanks!
CamperBot
@camperbot
Aug 28 2015 17:01
romperss sends brownie points to @denmch :sparkles: :thumbsup: :sparkles:
:star: 372 | @denmch | http://www.freecodecamp.com/denmch
Den McHenry
@denmch
Aug 28 2015 17:02
You're going to kick yourself :)
Look at line two.
var newArray = []; not var newArray[];
Rita
@Romperss
Aug 28 2015 17:04
@denmch rock'n'roll, I go tit! thanks!!!! :-)
CamperBot
@camperbot
Aug 28 2015 17:04
romperss sends brownie points to @denmch :sparkles: :thumbsup: :sparkles:
:warning: romperss already gave denmch points
Den McHenry
@denmch
Aug 28 2015 17:05
Awesome :)
Bianca Mihai
@biancamihai
Aug 28 2015 17:11
@denmch long time no see ... how is it going?
Den McHenry
@denmch
Aug 28 2015 17:13
@biancamihai Not bad. Yourself?
Bianca Mihai
@biancamihai
Aug 28 2015 17:14
@denmch not bad :) was just browsing the chat a bit before I go back to work
Den McHenry
@denmch
Aug 28 2015 17:18
My kids are home today for a teacher in-service day.
But Ash is done on Monday, and starts kindergarten soon.
Exciting stuff.
Luis Felipe López G.
@luishendrix92
Aug 28 2015 17:30
When doing the chunk monkey, someone in the Spanish room said that if you pass 0 as an argument for the chunk size, it produces an infinite loop. That may be a bolstering point to make the function a tad better.
Bakulesh Singh
@bakulcsingh
Aug 28 2015 17:31

Is there a better way to do this?

function destroyer(arr) {
  // Remove all the values
var x=arguments.length;
  var args = Array.prototype.slice.call(arguments);
  function check(val){
  var y=true;
  for (var i=1;i<x;i++){
    if(val===args[i]){
      y=false;
    }
  }
return y;
}
  var newArr=arguments[0].filter(check);
  return newArr;
 }

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

Its the seek and destroy bonfire.

Manuel Niederl
@ManuelNiederl
Aug 28 2015 17:31
I was going to ask for a better solution for seek and destroy too haha
Mine is a lot less pretty.
Bakulesh Singh
@bakulcsingh
Aug 28 2015 17:32
Lol
lets see
put it up
Luis Felipe López G.
@luishendrix92
Aug 28 2015 17:33
@bakulcsingh The better solution is just an abbreviation (or a hack) of the low-level solution:
1- The solution is a nested for loop
2- The solution is to use the indexOf() method which in turn iterates through the array so it's the same thing as solution #1 but shorter and clever.
Manuel Niederl
@ManuelNiederl
Aug 28 2015 17:33
function destroyer(arr) {
  // Remove all the values
var value = arguments[1];
var value1 = arguments[2];
var arglen = arguments.length -1;  
var valarr = [];

  for (i=1; i <= arglen; i++) {
  valarr.push(arguments[i]);
  } 

function destroy(x) { 
  for (i=0; i< valarr.length; i++) {
 if (x == valarr[i] || x == valarr[i+1] || x == valarr[i+2]) {
  return false; }
  else {
    return true
  }
}
}

return arguments[0].filter(destroy);

}
destroyer([3, 5, 1, 2, 2], 2, 3, 5);
I cant get it to be pretty
Sorry : (
Luis Felipe López G.
@luishendrix92
Aug 28 2015 17:34
You missed 3 ` at the end and function destroyer() should be in a new line.
wiki format
CamperBot
@camperbot
Aug 28 2015 17:34

: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

``` ⇦ Type 3 backticks, 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

Bakulesh Singh
@bakulcsingh
Aug 28 2015 17:34
thank you @luishendrix92
It seems a lot like what i did @ManuelNiederl
CamperBot
@camperbot
Aug 28 2015 17:34
bakulcsingh sends brownie points to @luishendrix92 and @manuelniederl :sparkles: :thumbsup: :sparkles:
:star: 214 | @manuelniederl | http://www.freecodecamp.com/manuelniederl
:star: 158 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Manuel Niederl
@ManuelNiederl
Aug 28 2015 17:35
Thanks
CamperBot
@camperbot
Aug 28 2015 17:35
if you want to thank someone, put an @ before their name!
Manuel Niederl
@ManuelNiederl
Aug 28 2015 17:35
I missed the shift enter
Sorry for my noobness
Anyway, I don't like how my if condition works. I couldnt get it to work without cheating
@luishendrix92 Thanks for the formatting help
CamperBot
@camperbot
Aug 28 2015 17:36
manuelniederl sends brownie points to @luishendrix92 :sparkles: :thumbsup: :sparkles:
:star: 159 | @luishendrix92 | http://www.freecodecamp.com/luishendrix92
Bakulesh Singh
@bakulcsingh
Aug 28 2015 17:38
Umm...as an afterthought would the indexOf() work on arguments as its isnt really an array?
DTing
@dting
Aug 28 2015 17:39
@ManuelNiederl
function destroyer(arr) {
  // Remove all the values
  var value = arguments[1]; // this isn't needed
  var value1 = arguments[2]; // this isn't needed
  var arglen = arguments.length -1;  
  var valarr = [];

  for (i=1; i <= arglen; i++) { // using global i can lead to errors
    valarr.push(arguments[i]);
  } 

  function destroy(x) { 
    for (i=0; i< valarr.length; i++) { // same as above
      // this block always returns in the first iteration of the for loop. 
      if (x == valarr[i] || x == valarr[i+1] || x == valarr[i+2]) { // you already are looping over your valarr you dont need to check i+...
        return false; // matches should return false away.
      } else {  // don't return true until all values are checked (after this for loop)
        return true
      }
    }
  }
  return arguments[0].filter(destroy);
}
destroyer([3, 5, 1, 2, 2], 2, 3, 5);
hakimnasir
@hakimnasir
Aug 28 2015 17:40
any grammar masters here, I need little help with job description? Thanks
CamperBot
@camperbot
Aug 28 2015 17:40
if you want to thank someone, put an @ before their name!
Ayo
@ayondot
Aug 28 2015 17:43
@titans8pride any problems?
Manuel Niederl
@ManuelNiederl
Aug 28 2015 17:44
Thanks a lot @dting , I will consider all of that in the future! Will changing the else allow me to remove the || operators? I want to avoid putting x == 1 || x == 2 || x ==3, etc. and would like to have x ==vallarr[i] using a loop instead of several ||.
CamperBot
@camperbot
Aug 28 2015 17:44
manuelniederl sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 777 | @dting | http://www.freecodecamp.com/dting
hakimnasir
@hakimnasir
Aug 28 2015 17:45
@ayondot can I direct message you?
DTing
@dting
Aug 28 2015 17:45
@ManuelNiederl yes
Manuel Niederl
@ManuelNiederl
Aug 28 2015 17:45
Thanks a lot @dting !
CamperBot
@camperbot
Aug 28 2015 17:45
manuelniederl sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:warning: manuelniederl already gave dting points
Fernando Rodriguez
@Fernan24
Aug 28 2015 17:45
hey guys i need help in bonfire: check for palindromes
CamperBot
@camperbot
Aug 28 2015 17:45
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Ayo
@ayondot
Aug 28 2015 17:46
@titans8pride no problem
you can
Fernando Rodriguez
@Fernan24
Aug 28 2015 17:48
how do i write a regular expression that ignores punctuation marks?
rafaelvianna
@rafaelvianna
Aug 28 2015 17:49

hey guys, good afternoon!
someone here can help me with a little problem in jquery.

i have this html

<tr class="paciente">
<td class="info-nome">Leonardo</td>
<td class="info-peso" id="peso-1">57</td>
<td class="info-altura" id="altura-1">1.67</td>
<td class="info-imc" id="imc-1"></td>
</tr>
<tr class="paciente">
<td class="info-nome">Paulo</td>
<td class="info-peso" id="peso-2">100</td>
<td class="info-altura" id="altura-2">2.00</td>
<td class="info-imc" id="imc-2"></td>
</tr>

And this jquery code:

$("#calcula-imcs").click(function(){
var pesoVal = $(".info-peso").text();
var peso = parseFloat(pesoVal);

var altura = $(".info-altura").text();
var alturaParcial = parseFloat(altura);
var alturaFinal = alturaParcial * alturaParcial;

var contaFinal = peso / alturaFinal

$(".info-imc").html(contaFinal);

})

when i click on my button, the function work. But it's concatenating the results on the same td.
if i have 5 trs, the result of the 5 will be in every td.
do you know how can i stop this concatenating and put just the result of any td?

DorSarel
@DorSarel
Aug 28 2015 18:00
can anyone pls give me an expamle of how using the regex pattern in the palindrome challenge?
André Duarte
@clint74
Aug 28 2015 18:01
@rafaelvianna You are using class to retrive val and this is going to get wrong because you have more than one item for each value.
DJ
@qualitymanifest
Aug 28 2015 18:04
@DorSarel you need to replace all non-word characters. you can do this with just one regex metacharacter
DorSarel
@DorSarel
Aug 28 2015 18:05
@qualitymanifest i need to replace them with what?
DJ
@qualitymanifest
Aug 28 2015 18:05
with nothing
Yan Kozlovskiy
@YanKozlovskiy
Aug 28 2015 18:06
how can you disable the popup message after each challenge?
DorSarel
@DorSarel
Aug 28 2015 18:07
@qualitymanifest i need to write in the replace method /\W/?