These are chat archives for FreeCodeCamp/Help

15th
Sep 2015
Kat
@Mystfreak
Sep 15 2015 00:00
@MattYamamoto I have to leave as well, ttyl
DJ Runas
@djrunas
Sep 15 2015 00:02
Right!
Hopefully that helped, @max77p :)
Using a -index would result in starting from the last index in a string
Instead of starting at the beginning :)
I just learned about this yeseterday as well
Kat
@Mystfreak
Sep 15 2015 00:04
I thought I had all ticks but I am having technical issues
"1 eye for of 1 eye." is not a palindrome: expected true to equal false.
I keep getting that task unticked
eventhough it is true
DJ Runas
@djrunas
Sep 15 2015 00:05
Mind posting your regular expression again, @Mystfreak ?
Just want to double check.
Kat
@Mystfreak
Sep 15 2015 00:05
str = str.toLowerCase().replace(/[\s\.,?0_0(:/-\:)0-0]/g, '');
@djrunas it looks messy
DJ Runas
@djrunas
Sep 15 2015 00:06
You’re getting true for that palindrome?
It should be false, correct?
Kat
@Mystfreak
Sep 15 2015 00:07
yes
Jose M Viloria
@josevill
Sep 15 2015 00:07
@Mystfreak If i'm correct. There's no need to put up those 0_0 0-0 in there
I mean, the number 0
Only the characters will do
Kat
@Mystfreak
Sep 15 2015 00:07
okay
@josevill it is not working now
DJ Runas
@djrunas
Sep 15 2015 00:09
Is that the only palindrome not working?
Kat
@Mystfreak
Sep 15 2015 00:10
yeah the eye for eye thing
Jose M Viloria
@josevill
Sep 15 2015 00:10
@Mystfreak wait up, i'll fix that formula
@Mystfreak [\s\.,?_\\/(:\/\-\:)-]
Kat
@Mystfreak
Sep 15 2015 00:12
str = str.toLowerCase().replace(/[\s\.,?0_0(:/-\:)0-0]/g, '');
it works
Jose M Viloria
@josevill
Sep 15 2015 00:12
@Mystfreak That's the messy way to do it
Kat
@Mystfreak
Sep 15 2015 00:12
but one task is not passing
Jose M Viloria
@josevill
Sep 15 2015 00:12
Really?
What
Kat
@Mystfreak
Sep 15 2015 00:12
@josevill eventhough it is messy, it works for me
@josevill what do i get rid of in "1 eye for of 1 eye."
do i get rid of the 1?
Jose M Viloria
@josevill
Sep 15 2015 00:13
Only the .
And whitespaces maybe
Kat
@Mystfreak
Sep 15 2015 00:14
still not passing
Jose M Viloria
@josevill
Sep 15 2015 00:14
Show me your code
Kat
@Mystfreak
Sep 15 2015 00:15
function palindrome(str){
  // Good luck!
  str = str.toLowerCase().replace(/[\s\.,?0_0(:/-\:)0-0.]/g, '');
  var palindrome = str.split('').reverse().join('');
  if (palindrome === str) {
    return true;
  }
  else {
    return false;
  }
}

palindrome("0_0 (: /-\ :) 0-0");
@josevill I think there is a bug because it says it is not equal to true
but it does equal to true when i run the code
@josevill are you able to pair with me
Jose M Viloria
@josevill
Sep 15 2015 00:18
@Mystfreak do you have screenhero installed?
Kat
@Mystfreak
Sep 15 2015 00:18
wait i spotted the mistake
DJ Runas
@djrunas
Sep 15 2015 00:18
Do tell.
Kat
@Mystfreak
Sep 15 2015 00:18
in eye for eye
it wants me to return false not true
DJ
@qualitymanifest
Sep 15 2015 00:19
yes, because it's not a palindrome
DJ Runas
@djrunas
Sep 15 2015 00:19
^
Oh, I thought you caught that lol
Kat
@Mystfreak
Sep 15 2015 00:20
now I did that, another task is unticked
DJ Runas
@djrunas
Sep 15 2015 00:20
Let us know!
Kat
@Mystfreak
Sep 15 2015 00:20
"My age is 0, 0 si ega ym." is a palindrome: expected false to equal true
DJ Runas
@djrunas
Sep 15 2015 00:20
So this palindrome should equal true.
Remove the punctuation, and the whitespace.
You should be solid.
Jose M Viloria
@josevill
Sep 15 2015 00:21
I'm afraid it's a regexp thing
DJ Runas
@djrunas
Sep 15 2015 00:21
Problem with her regexp?
Kat
@Mystfreak
Sep 15 2015 00:22
now i did that eye for eye is unticked again
DJ Runas
@djrunas
Sep 15 2015 00:22
In my opinion, I think it’s definitely worth taking the time and learning regular expressions @Mystfreak
DJ
@qualitymanifest
Sep 15 2015 00:22
yeah, read up on regex. there's a very concise way to replace all non-word characters.
DJ Runas
@djrunas
Sep 15 2015 00:22
Take some time and do the exercises on here, and then go back to the palindrome bonfire.
^^ Very simple, very fast.
Kat
@Mystfreak
Sep 15 2015 00:23
@djrunas I don't have the time to study and recap but I do wanna finish this task todday
today
Jose M Viloria
@josevill
Sep 15 2015 00:23
@Mystfreak It will take you 10 mins
Kat
@Mystfreak
Sep 15 2015 00:24
but I will study after I pass this test
Aaron Freidus
@shadowfool
Sep 15 2015 00:24
@djrunas from talking to several programer friends most of them say they brush up or just google solutions if they ever need to use regex. I wouldn't bother commiting it to memory past understanding how to read simple combinations
DJ Runas
@djrunas
Sep 15 2015 00:24
Oh, regexone is very short.
Took me about 5-10 minutes.
DJ
@qualitymanifest
Sep 15 2015 00:24
as in you don't want to read a page on regex? because that's really going to be the easiest way to get your problem solved unless you just want the answer, in which case you're not really going to learn much
DJ Runas
@djrunas
Sep 15 2015 00:24
And after completing it, it helped me finish that exercise immediately.
Kat
@Mystfreak
Sep 15 2015 00:24
i don't understand what I am doing wrong
DJ Runas
@djrunas
Sep 15 2015 00:24
Oh, really, @shadowfool
Interesting.
Kat
@Mystfreak
Sep 15 2015 00:25
if you studied it then maybe you could give me a reason why my god don't work
code
lol
DJ
@qualitymanifest
Sep 15 2015 00:25
because you're getting rid of the wrong things.
Jose M Viloria
@josevill
Sep 15 2015 00:25
Regexp can sometimes be a pain in the arse..
Aaron Freidus
@shadowfool
Sep 15 2015 00:25
@djrunas that being said I actually made flash cards because I was having so much trouble understanding how the different expresions interact.
DJ Runas
@djrunas
Sep 15 2015 00:25
^^
Aaron Freidus
@shadowfool
Sep 15 2015 00:25
so I guess it's up to you
Kat
@Mystfreak
Sep 15 2015 00:26
in one task it needs a full stop and in another it doesn't need a fullstop
DJ Runas
@djrunas
Sep 15 2015 00:26
I read up a lot on the documentation.
Aaron Freidus
@shadowfool
Sep 15 2015 00:26
Yeah, that's key
looks like your function is only trying one case?
DJ
@qualitymanifest
Sep 15 2015 00:26
you're not forcing things to be palindromes. you're just verifying if they are palindromes.
Aaron Freidus
@shadowfool
Sep 15 2015 00:27
@Mystfreak myst can you post your code again?
DJ
@qualitymanifest
Sep 15 2015 00:27
@shadowfool they only show one test on the code, but they test it against several things.
Aaron Freidus
@shadowfool
Sep 15 2015 00:27
yes, but her function only is accounting for that one code I beleive
one test
Kat
@Mystfreak
Sep 15 2015 00:28
function palindrome(str){
  // Good luck!
  str = str.toLowerCase().replace(/[\s\,?0_0(:/-\:)0-0.]/g, '');
  var palindrome = str.split('').reverse().join('');
  if (palindrome === str) {
    return true;
  }
  else {
    return false;
  }
}

palindrome("1 eye for of 1 eye.");
DJ
@qualitymanifest
Sep 15 2015 00:28
@shadowfool ah, i see what you're saying now
Aaron Freidus
@shadowfool
Sep 15 2015 00:28
str = str.toLowerCase().replace(/[\s\,?0_0(:/-\:)0-0.]/g, ''); what are you trying to acomplish with that?
DJ Runas
@djrunas
Sep 15 2015 00:28
What you want to get rid of in your regexp is any non-alphanumeric character as well as some whitespace.
Kat
@Mystfreak
Sep 15 2015 00:28
How do I make that flase
false
DJ Runas
@djrunas
Sep 15 2015 00:29
She’s removing those characters to make the last test in the bonfire work.
DJ
@qualitymanifest
Sep 15 2015 00:29
@Mystfreak you're getting rid of the entire line it's testing.
max77p
@max77p
Sep 15 2015 00:29
function repeat(str, num) {
  var i=1;
  if (num==0){
    return 1;
  }
  else if(num<0)
  {
    return (" ");
  }


    for(i;i<=num;i++)
    {
    return (str);
    }

}

repeat('abc', 3);
need help with this, how do i get the for loop to repeat 3 times?
DJ Runas
@djrunas
Sep 15 2015 00:29
PM me, @max77p
max77p
@max77p
Sep 15 2015 00:29
i can do it with console.log but can't seem to figure out with return
DJ Runas
@djrunas
Sep 15 2015 00:29
I’ll help you out with that one.
Kat
@Mystfreak
Sep 15 2015 00:30
you guys are too focused on the messy code, whereas I just want to pass
palindrome("1 eye for of 1 eye.");
how do I make this palindrome false
DJ
@qualitymanifest
Sep 15 2015 00:30
hahaha okay. you wanna pass? here ya go!

function palindrome(str){
  // Good luck!
  str = str.toLowerCase().replace(/\W/g, '');
  var palindrome = str.split('').reverse().join('');
  if (palindrome === str) {
    return true;
  }
  else {
    return false;
  }
}

palindrome("1 eye for of 1 eye");
in the time you spent insisting you dont have time to study you could have read up on regex and figured that out.
Jose M Viloria
@josevill
Sep 15 2015 00:32
@Mystfreak Not trying to be rude or something.. But you could've really learned what you needed in the past 10 mins you've been asking us what was wrong :/
Kat
@Mystfreak
Sep 15 2015 00:32
ok
the last task is not ticked
Jose M Viloria
@josevill
Sep 15 2015 00:33
/[\W_]/g
Use that one
Kat
@Mystfreak
Sep 15 2015 00:33
@josevill i thought I could get the answer quicker, I just want to pass
so I can go sleep
Jose M Viloria
@josevill
Sep 15 2015 00:34
@Mystfreak You can use /[\W_]/g or /[^A-Z0-9]/gas well
DJ Runas
@djrunas
Sep 15 2015 00:34
Either of those will work.
Sorry, for not giving the answer straight away.
It’s just more valuable to sort of guide you in the right direction.
Kat
@Mystfreak
Sep 15 2015 00:35
yeah but it is hard to guide someone who has no idea on how to use regular expressions
lol sorry for wasting your time, I am going to recap and study more about expressions tomorrow
Jose M Viloria
@josevill
Sep 15 2015 00:36
This is totally not wasted time.
But you should undestand our intentions.
Good night :)
Kat
@Mystfreak
Sep 15 2015 00:37
I thought you guys were getting impatient on me
Jose M Viloria
@josevill
Sep 15 2015 00:37
No way
Kat
@Mystfreak
Sep 15 2015 00:37
goodnight thank you so much for your help, I appreciate it
CamperBot
@camperbot
Sep 15 2015 00:37
if you want to thank someone, put an @ before their name!
Kat
@Mystfreak
Sep 15 2015 00:38
@josevill thanks
Jose M Viloria
@josevill
Sep 15 2015 00:38
But if you're going to look out for a developer job, you gotta be patient and study the documentations :)
Not like rushing something like that, go easy in your learning steps
So your foundation becomes strong :)
Kat
@Mystfreak
Sep 15 2015 00:39
I am not looking for a dev job just yet, I am thinking of going university next
DJ Runas
@djrunas
Sep 15 2015 00:39
:)
Rest easy though, @Mystfreak !
Kat
@Mystfreak
Sep 15 2015 00:39
is it hard to get a dev job without university?
Jose M Viloria
@josevill
Sep 15 2015 00:41
@Mystfreak As a freelance, not at all. If you're looking for a full-time. It can be tricky. But if you're good enough, someone will pick you up :)
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:43

Hi guys, It's seems that my toLowerCase(); isn't working here, why? (Any other advice or working codes on this bonfire not necessary :D)


function mutation(arr)
{

var hits = [];
arr[0].toLowerCase();
arr[1].toLowerCase();

var zero = arr[0].split("");
var one = arr[1].split("");
for (var i=0; i<one.length; i++)
{
var element = one[i];
var idx = zero.indexOf(element);

hits.push(idx);

   }

return hits;

}

mutation(['Mary', 'Army']);

// CONSOLE RETURNS : " [-1, 2, -1, 3] "

Jose M Viloria
@josevill
Sep 15 2015 00:44
@sebastianhew why dont you create your variables zero and one at first, with those arr[0] and [1] at first, then lowercase them, then split? :p
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:45
like : var zero = arr[0].toLowerCase().split(""); ? :>
DJ Runas
@djrunas
Sep 15 2015 00:46
:^)
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:46
wow, worked.
xd
sankyu!
DJ Runas
@djrunas
Sep 15 2015 00:46
You were in the right direction though :)
Keep it up!
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:47
why didn't it work my way? : /
Jose M Viloria
@josevill
Sep 15 2015 00:48
I think you can use toLower/UpperCase only with strings (outside of an array)
@sebastianhew Yep, it wont
I just tried
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:49
even when i refer to a specific element of an array? weird to me.
Jose M Viloria
@josevill
Sep 15 2015 00:49
So you'll need to pass it to an empty variable at first, then do any kind of modification you might need
Yes
Here's an example.
@sebastianhew https://repl.it/BIDq
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:53
seems clear, thanks
CamperBot
@camperbot
Sep 15 2015 00:53
if you want to thank someone, put an @ before their name!
Sebastian Hewelt
@sebhewelt
Sep 15 2015 00:55

And about the code, I just passed that one. Do you think this was a proper way to go? Because i sometimes get a green pass and then look at my code and feel ashamed xd

function mutation(arr)
{

var hits = [];

var zero = arr[0].toLowerCase().split("");
var one = arr1.toLowerCase().split("");
for (var i=0; i<one.length; i++)
{
var element = one[i];
var idx = zero.indexOf(element);
if (idx != -1)
hits.push(idx);

   }


return hits.length==one.length;

}

mutation(['Mary', 'Army']);

Jose M Viloria
@josevill
Sep 15 2015 00:57
help formatting
CamperBot
@camperbot
Sep 15 2015 00:57

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Jack Demynn
@infectiouscode
Sep 15 2015 00:58
Hey guys, not a coding question but everyone on here is really nice and im desperate for advice. I have a junior graphics design interview tomorrow, and upon preparing my portfolio my computer has decided to not print in great quality. Does anyone have a place where I can make an offline portfolio, or would anyone think its unproffessional to bring my laptop and present the logos and designs off of my computer?
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:00
This message was deleted
CamperBot
@camperbot
Sep 15 2015 01:00
:bulb: to format code use backticks! ``` more info
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:00
help formatting
CamperBot
@camperbot
Sep 15 2015 01:00

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Jose M Viloria
@josevill
Sep 15 2015 01:00
@infectiouscode I have a graphic designer friend, he had that issue once..
Jack Demynn
@infectiouscode
Sep 15 2015 01:00
What did he do to resolve the issue? @josevill
Yashaswi Yogeshwara
@yashaswiyogeshwara
Sep 15 2015 01:01

Regular Expressions need help!!
Can someone please explain me on what is the use of '.' as the 5th character in the regular expression. If some one can explain the flow of the Regular Expression in the above example that would be of great help.

function stripComments(code) { return code.replace(/\/\/.*|\/\*[^]*\*\//g, ""); } console.log(stripComments("1 + /* 2 */3")); // → 1 + 3 console.log(stripComments("x = 10;// ten!")); // → x = 10; console.log(stripComments("1 /* a */+/* b */ 1")); // → 1 1

Jose M Viloria
@josevill
Sep 15 2015 01:01
He did bring his laptop to show up his stuff to an interview, all cool.
He got the job, then quit because they weren't paying him enough :p
DJ Runas
@djrunas
Sep 15 2015 01:01
As long as you bring something.
Don’t be the guy that’s like, “I couldn’t print my shiet out."
Jack Demynn
@infectiouscode
Sep 15 2015 01:02
Haha, okay awesome thanks. I's gonna say, if a printer stops working there isn't anything you can do about it. And like @djrunas just said, I am bringing something
CamperBot
@camperbot
Sep 15 2015 01:02
infectiouscode sends brownie points to @djrunas :sparkles: :thumbsup: :sparkles:
:star: 189 | @djrunas | http://www.freecodecamp.com/djrunas
DJ Runas
@djrunas
Sep 15 2015 01:02
Good luck on your interview!
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:02
This message was deleted
CamperBot
@camperbot
Sep 15 2015 01:02
:bulb: to format code use backticks! ``` more info
Jack Demynn
@infectiouscode
Sep 15 2015 01:02
How should I word it then? And thankyou :)
Jose M Viloria
@josevill
Sep 15 2015 01:02
@infectiouscode It's weird.. But if you have an ipad or a tablet with an IPS display, that should do the trick too :)
It all comes down to how motivated you are, and how you show your motivation towards the interviewer.
@sebastianhew Backticks man haha
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:03
function mutation(arr) 
{

  var hits = [];

 var zero = arr[0].toLowerCase().split("");
  var one = arr[1].toLowerCase().split("");
 for (var i=0; i<one.length; i++)
       {
  var element = one[i];
  var idx = zero.indexOf(element);
 if (idx != -1)
   hits.push(idx);

       }


    return hits.length==one.length;

}

mutation(['Mary', 'Army']);
Jose M Viloria
@josevill
Sep 15 2015 01:03
There we go
DJ Runas
@djrunas
Sep 15 2015 01:03
Oh, hey!
He got it :^)
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:03
finally :D
Jack Demynn
@infectiouscode
Sep 15 2015 01:03
Im really motivated, ive wanted to be a designer since I finished my 3 year course, but how should I tell him im presenting on my laptop?
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:03
` and ' <-- too similar :C
Jose M Viloria
@josevill
Sep 15 2015 01:05
@infectiouscode Nah, it's more meaningful you tell him you had to improvise and made it like that :)
But keep your stuff already organizated.. You don't want to show them some messy stuff when looking for your demos :)
Jack Demynn
@infectiouscode
Sep 15 2015 01:06
I'll have it pre opened up for when I go in
isnt telling him i improvised worse than telling him my printer broke lol
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:09
Hi anyone any thoughts about my code up there? It passed with given arguments, but i wonder if my code covers every weird input
Sebastian Hewelt
@sebhewelt
Sep 15 2015 01:17
Ok, I'm going to sleep. If anyone would ever want to say something about that code, do it on private chat so i get a notification. See you guys tomorrow :)
Stefan Stokic
@StefanStokic
Sep 15 2015 01:56
Hey guys, where could I get a background image for header for a site like this: http://htmlpreview.github.io/?https://github.com/KingInTheNorth/SiteMaterial/blob/master/index.html
nehc02
@nehc02
Sep 15 2015 02:25
I have a question on bonfire #172.
function factorialize(num) {
if (num === 0)
{ return 1; }
else
{ return num factorialize( num - 1 ); }
}
factorialize(5);
It first run if num is equal to 0. No, it is 5. So it returns 5
(5-1)
this equals to 20. What happens next?
Does the value of num changed to 20? or still 5?
Federico Villanueva
@federico64
Sep 15 2015 02:37
what is wrong with this line? <h2 style="color: blue">CatPhotoApp</h2>
DJ Runas
@djrunas
Sep 15 2015 02:37
Nothing is wrong with that line federico.
Syntactically.
What kind of output do you need?
Federico Villanueva
@federico64
Sep 15 2015 02:38
said this "Your h2 element should be red."
DJ Runas
@djrunas
Sep 15 2015 02:39
So, you want to change the color from blue to red, @federico64
Federico Villanueva
@federico64
Sep 15 2015 02:40
tks
CamperBot
@camperbot
Sep 15 2015 02:40
if you want to thank someone, put an @ before their name!
Master Builder
@McGowanC
Sep 15 2015 02:40
@federico64 you got this!
@nehc02 it's still 5
Federico Villanueva
@federico64
Sep 15 2015 02:41
ok, tks @camperbot , tks @wcrm
CamperBot
@camperbot
Sep 15 2015 02:41
federico64 sends brownie points to @camperbot and @wcrm :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for wcrm
:star: 216 | @camperbot | http://www.freecodecamp.com/camperbot
Master Builder
@McGowanC
Sep 15 2015 02:42
since it's a recursive function it does 5 (5 -1) (4-1) etc
since every single time it calls factorialize it redoes the function with that new num
because factorialize contains factorialize inside itself, so it calls itself until num === 0 at which point it breaks the recursive loop and ends the function
Shaina Shockley
@sashockster
Sep 15 2015 02:59
@nehc02 you are missing what the math in the factorilize
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:04
Hi all. I have a quick question on Generate Random Whole Numbers within a Range
When we use
Math.floor(Math.random() * (max - min + 1)) + min
What are max and min referring to?
hollowc2
@hollowc2
Sep 15 2015 03:08
function destroyer(arr, xVal, yVal) {
var filtered = arr.filter(function(val){
return val != xVal || yVal ;
});
not working
Dayne Wright
@daynewright
Sep 15 2015 03:09
Anyone completed bonfire symmetric difference?
Could use some help…really striking out on it
a1rr0wh3ad
@a1rr0wh3ad
Sep 15 2015 03:15
@wannabecoding max and min are the highest and lowest numbers, respectively, that you want to generate.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:16
@a1rr0wh3ad okay, so it's relative to where it's being utilized then
?
a1rr0wh3ad
@a1rr0wh3ad
Sep 15 2015 03:16
@wannabecoding what do you mean?
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:17
@a1rr0wh3ad how does JavaScript know what are the highest and lowest numbers that I want to generate?
ahhh
a1rr0wh3ad
@a1rr0wh3ad
Sep 15 2015 03:18
@wannabecoding oh. you assign values to max and min
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:18
@a1rr0wh3ad yes lol just noticed that part of the program
:)
Jennifer Pazos
@jmb521
Sep 15 2015 03:26
anyone working on Managing Packages with NPM? I'm stuck on #4 Install a Module. When I try it says it fails saying it couldn't read from the remote repository
Bryon Miller
@bryonmiller
Sep 15 2015 03:27
@all Could someone tell me what this line of code does? I need a step by step explanation. Here is the line: your_array.map(Function.apply.bind(Math.max, Math))
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:28
@bryonmiller use the 3 backticks to enter your code ```
Bryon Miller
@bryonmiller
Sep 15 2015 03:28
'''your_array.map(Function.apply.bind(Math.max, Math))
CamperBot
@camperbot
Sep 15 2015 03:28
:bulb: to format code use backticks! ``` more info
Bryon Miller
@bryonmiller
Sep 15 2015 03:28
```your_array.map(Function.apply.bind(Math.max, Math))
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:28
your code
Bryon Miller
@bryonmiller
Sep 15 2015 03:28
lol
```js your_array.map(Function.apply.bind(Math.max, Math))
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:29
sorry, it's 3 backticks on the 1st line, your code on the 2nd line, and 3 backticks on the 3rd line
Bryon Miller
@bryonmiller
Sep 15 2015 03:29
ah ok
your_array.map(Function.apply.bind(Math.max, Math))
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:30
wow, that's above my Free Code Camp pay grade :)
Maybe someone else here knows
Bryon Miller
@bryonmiller
Sep 15 2015 03:31
@all So I ask again, code properly formatted, could someone tell me what this line of code does? I need a step by step explanation. Here is the line: ```jsyour_array.map(Function.apply.bind(Math.max, Math))
your_array.map(Function.apply.bind(Math.max, Math))
@wannabecoding Thanks anyway.
CamperBot
@camperbot
Sep 15 2015 03:32
bryonmiller sends brownie points to @wannabecoding :sparkles: :thumbsup: :sparkles:
:star: 233 | @wannabecoding | http://www.freecodecamp.com/wannabecoding
Bryon Miller
@bryonmiller
Sep 15 2015 03:32
Maybe I'll get the formatting down at least lol. Markdown isn't my strong suit.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:33
while I've learned markdown you've learned JavaScript, let's trade
Bryon Miller
@bryonmiller
Sep 15 2015 03:34
Haha I wouldn't go that far.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:34
neither would I lol, just learned the backticks and a few little things on Github
Bryon Miller
@bryonmiller
Sep 15 2015 03:35
I honestly can not figure out what's going on in that line of code. I get what .apply does. I somewhat understand what .bind does. I completely understand .map and Math.max...but put it together and I'm lost.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:36
is that a bonfire you're working on?
Bryon Miller
@bryonmiller
Sep 15 2015 03:37
Yes it is. It works. I just don't understand it lol.
It's the largestOfFour Bonfire.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:39
there's an explanation out there if you want to read it
sorry never mind, he doesn't have your solution
Bryon Miller
@bryonmiller
Sep 15 2015 03:45
Yeah. He did it the way I was supposed to lol. I'm just tinkering with other functions.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:56
I will dive into the bonfires tomorrow :)
Goodnight
Bryon Miller
@bryonmiller
Sep 15 2015 03:56
Good luck, man. If I can be of any help just shoot me a message.
Alejandro Tejada
@wannabecoding
Sep 15 2015 03:57
Appreciate it :+1:
Federico Villanueva
@federico64
Sep 15 2015 04:02
hello, the instruction is "Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide."

what is wrong with the next code <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>
<style>
.smaller-image {
width: 100px;
}
</style>

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

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

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

Sarah Stensberg
@ladystensberg
Sep 15 2015 04:14
Hey all - I'm on Bonfire 3 Factorial a Number. How does one factor a prime number? Wouldn't the answer be 5? I'm confused
Evan Davis
@davisec52
Sep 15 2015 04:17
@ladystensberg Hi. It is asking for the factorial of the number, in this case 5.
So, that would be 54321
Sorry, 5x4x3x2x1
Sarah Stensberg
@ladystensberg
Sep 15 2015 04:20
@davisec52 thanks :) i got it sorted
CamperBot
@camperbot
Sep 15 2015 04:20
ladystensberg sends brownie points to @davisec52 :sparkles: :thumbsup: :sparkles:
:star: 321 | @davisec52 | http://www.freecodecamp.com/davisec52
Evan Davis
@davisec52
Sep 15 2015 04:21
@ladystensberg great!

@someone Not being able to leave Zipline #3 alone, I decided
to add a form to capture weather data from whatever city location
you enter.

My question concerns the button that changes ºF to ºC. It only
partially works. For example, if you enter Paris, you get the
weather data for Paris and the button displays F and C on toggle
without problem. However, if you enter another city, it gathers
the weather data but the toggle will not display the ºC conversion.
Now, if you then enter any third location, it gathers
weather data and will now toggle between F and C.

And so it goes, the toggle button working for
every other city.

Anyone have any advice? My app is on Codepen
at http://codepen.io/davisec52/full/meVyaw/

DJ Runas
@djrunas
Sep 15 2015 04:52
Hey, so I’m working on the falsy bouncer bonfire.
I had a question about falsy values.
Is there a way to compare them all in one go? Or do you need to compare them one by one.
OverTheNeptune
@OverTheNeptune
Sep 15 2015 05:02
@djrunas Just finished that one up a little earlier and there is a way to do it all in one go using Array.filter(). Array.filter('function goes here') tests each element based on the function you define. It filters out any element that doesn't pass the test (returns false).
DJ Runas
@djrunas
Sep 15 2015 05:04
So if a value returns false in the test function, it gets filtered out?
OverTheNeptune
@OverTheNeptune
Sep 15 2015 05:05
@djrunas yeah. all you need to do is define a function that returns false when the element equates to false.
DJ Runas
@djrunas
Sep 15 2015 05:05
OHHHHH
OverTheNeptune
@OverTheNeptune
Sep 15 2015 05:06
@djrunas got it?
DJ Runas
@djrunas
Sep 15 2015 05:06
LOL, I just finished the exercise :)
That, for some reason, just completely clicked with me.
OverTheNeptune
@OverTheNeptune
Sep 15 2015 05:07
@djrunas Cool. That one's super easy once you see it.
DJ Runas
@djrunas
Sep 15 2015 05:12
Oh, also! Thanks @OverTheNeptune !
thanks @OverTheNeptune
CamperBot
@camperbot
Sep 15 2015 05:13
djrunas sends brownie points to @overtheneptune :sparkles: :thumbsup: :sparkles:
:star: 187 | @overtheneptune | http://www.freecodecamp.com/overtheneptune
DJ Runas
@djrunas
Sep 15 2015 05:13
There’s the brownies
OverTheNeptune
@OverTheNeptune
Sep 15 2015 05:16
@djrunas No problem. Glad I could help!
Debbie Brown
@astar9
Sep 15 2015 05:32
I 'm stuck on "Use Clockwise Notation to Specify the Padding of an Element" What I believe is the easy right answer won't run. I need help!
DTing
@dting
Sep 15 2015 05:33
post your code @astar9
help formatting
CamperBot
@camperbot
Sep 15 2015 05:33

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Debbie Brown
@astar9
Sep 15 2015 05:35
.green-box {
background-color: green;
padding: 40px 20px 20x 40px;
DTing
@dting
Sep 15 2015 05:39
@astar9 the order of the numbers should be top, right, bottom, left
hmm
@astar9 you are missing a p
after the 3rd number
px
Reggie
@Reggie01
Sep 15 2015 05:42

@davisec52 You need to take

$("#tem").click(function(){
             // console.log("hello");  Add this to see the issue.
            $("b").toggle();
          });

outside of your function getOtherWeather(){ //some code }. Not exactly sure how the problem is caused but you can undelete the console.log above and see the issue. The function is being called multiple times. You actually got lucky it worked in the first place. It was being called three times so toggle -untoggle - toggle. The problem cities it was being called twice toggle - untoggle. You can try San Francisco for a problem city. Orlando for a success.

Guess you were registering multiple click events every time you looked up a new city. So all odd amount of clicks would work and even amounts would'nt
Ali-Haider5
@Ali-Haider5
Sep 15 2015 06:15

Hi i am a beginner need some help on for loop here
```ourArray = [];
for(var i = 0; i < 5; i++){
ourArray.push(i);
}
var myArray = [];

// Only change code below this line.
for(var i = 0, i < 5, i++){
myArray.push(i);
}
// Push the numbers zero through four to myArray using a "for loop" like above.

// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myArray) !== "undefined"){(function(){return myArray;})();}

```

Ashraful Islam
@iashraful
Sep 15 2015 06:20
@Ali-Haider5 hello!
ourArray = [];
for(var i = 0; i < 5; i++){
    ourArray.push(i);
}
var myArray = [];
// Only change code below this line.
for(var i = 0, i < 5, i++){
    myArray.push(i);
}
// Push the numbers zero through four to myArray using a "for loop" like above.
// Only change code above this line.
// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
if(typeof(myArray) !== "undefined"){
    (function(){
        return myArray;
    })();
}
Ali-Haider5
@Ali-Haider5
Sep 15 2015 06:46
whats wrong with function to bring random number between two numbers
var min = 0;
var max = 9;
function myFunction() {
  // Make myFunction return a random number between zero and nine instead of a decimal
  // Only change code below this line.

  return Math.Floor(Math.random()*(max-min+1))+min;
}
DTing
@dting
Sep 15 2015 06:50
@Ali-Haider5 The floor function should not be capitalized. Math.floor
Ali-Haider5
@Ali-Haider5
Sep 15 2015 07:13
thanks @dting
CamperBot
@camperbot
Sep 15 2015 07:13
ali-haider5 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1171 | @dting | http://www.freecodecamp.com/dting
Ali-Haider5
@Ali-Haider5
Sep 15 2015 07:24
This message was deleted
This message was deleted
HELP
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".
 // Only change code below this line.
if
{flip=0;
  return "heads";

} else {

  return "tails";

}
Aniruddh Agarwal
@anrddh
Sep 15 2015 07:26
  1. You have a missing brace
DTing
@dting
Sep 15 2015 07:26
if // you need a condition for your if statement
{flip=0; // this assigns 0 to flip, comparisons are `==` loosely equals and `===` strictly equals
  return "heads";

} else {

  return "tails";

}
Aniruddh Agarwal
@anrddh
Sep 15 2015 07:27
the if statement must be like this
if(condition here) {
  //whatever
} else {
  //whatever again
}
Ali-Haider5
@Ali-Haider5
Sep 15 2015 07:28
WHAT ABOUT THIS ONE
var flip = Math.floor(Math.random() * (1 - 0 + 1)) + 0;
function myFunction(){
  // Create an if-else statement here to return "heads" if flip is 0. Otherwise return "tails".
 // Only change code below this line.
if (flip===0)
{
  return "heads";

} else {

  return "tails";

}
Aniruddh Agarwal
@anrddh
Sep 15 2015 07:28
That should work
You're not closing your myFunction though
you don't have a } for it
Ali-Haider5
@Ali-Haider5
Sep 15 2015 07:32
This message was deleted
CamperBot
@camperbot
Sep 15 2015 07:32
ali-haider5 sends brownie points to @awesomeaniruddh :sparkles: :thumbsup: :sparkles:
:star: 426 | @awesomeaniruddh | http://www.freecodecamp.com/awesomeaniruddh
Aniruddh Agarwal
@anrddh
Sep 15 2015 07:32
I'm just gonna thank @camperbot @Ali-Haider5 :P
Ali-Haider5
@Ali-Haider5
Sep 15 2015 07:32
HEHE
WHAT THE...
Why is it not getting redirected to twitter?
:/
Ashraful Islam
@iashraful
Sep 15 2015 08:15
@deltaC your twitter function is weird
:(
@deltaC
// hijacking anchor elements usual click behavior here
$(".btn-twitter").click(function(){ // instead of going to the link, it just updates the href??!!
    $(".tweet").attr('href',"https://twitter.com/intent/tweet?text="+randomQuote)
});
@deltaC
$(".button").click(function() {
  randomQuote = quotes[Math.floor(Math.random()*quotes.length)];   
    $("#quote").replaceWith("<p id=quote>" + randomQuote+"</p>");
    // update twitter button link
     $(".tweet").attr('href',"https://twitter.com/intent/tweet?text="+randomQuote)
});  
  /* REMOVE ANY TWITTER BUTTON EVENTS HERE */
@deltaC this works for me
$( document ).ready(function() {
....
 //QuoteGenerate
$(".button").click(function() {
  randomQuote = quotes[Math.floor(Math.random()*quotes.length)];   
    $("#quote").replaceWith("<p id=quote>" + randomQuote+"</p>");
    // update twitter button link
     $(".tweet").attr('href',"https://twitter.com/intent/tweet?text="+randomQuote)
});  
  //TwitterButton
  /* nothing here */
  });
Ashraful Islam
@iashraful
Sep 15 2015 08:22
in your html fix this too
<a class="tweet twitter-share-button"
  href="https://twitter.com/intent/tweet?text="
  target="_blank"><!-- notice this lovely target thing, codepen can't load other sites in its frame -->
<i class="fa fa-twitter"></i>
  Tweet</a>
@deltaC also, simply putting in the target="_blank" in your html works to without changing anything in your JS :)
my bad, I misunderstood
Rob Simpson
@pertrai1
Sep 15 2015 08:28
I asked this in LetsPair but no response. What apps are used for pair programming? I saw a couple mentioned the other day but can't seem to find that question anymore
Just got answer :-)
Ashraful Islam
@iashraful
Sep 15 2015 08:29
@pertrai1 screenhero?
Kiy-Hong Tang
@kiytang
Sep 15 2015 08:39
Can anyone help me understand the following:
  • reason for the single quote after img src
  • the function of the -1 in [slotIOne-1]
    $($('.slot')[0]).html('<img src = "' + images[slotOne-1] + '">');
    thank you
CamperBot
@camperbot
Sep 15 2015 08:39
if you want to thank someone, put an @ before their name!
Dealga McArdle
@zeffii
Sep 15 2015 08:48
@kiytang because it's joining two strings
first string is '<img src= "'
last string is '">'
and inbetween is a string which is defined by images[slotOne-1]
so this line '<img src = "' + images[slotOne-1] + '">' actually resolves to something like
'<img src = "http://www.somelink.png">'
Dealga McArdle
@zeffii
Sep 15 2015 08:56
@kiytang the -1 is to offset the value in slotOne..
the values given to slotOne, slotTwo, slotThree range betwen (1,2,3)
but because the url of the images is stored in an array, and indexing arrays start at 0, ..slotOne, slotTwo, slotThree must be negatively offset by one.
you are forgiven if that confuses you.
Kiy-Hong Tang
@kiytang
Sep 15 2015 09:06
Thank you @zeffii, not at all confused makes sense reagrding the -1, however I think I need to think more about the two string joining- still not very clear to me. Thanks for your time
CamperBot
@camperbot
Sep 15 2015 09:06
kiytang sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 350 | @zeffii | http://www.freecodecamp.com/zeffii
Dealga McArdle
@zeffii
Sep 15 2015 09:07
when you see ' " '
normally strings are defined using either " or '
but if you want to include a double qoute you should surround it with a single qoute .. thats's the easiest way.
so ' " ' ..
this is hard to explain :)
that line of code is really making a string inside a string..
DTing
@dting
Sep 15 2015 09:18
If you use " to denote a string literal start and end like "hello" but need to include a " inside the string "he said "hello"" it will think your string ended after the space after "said". You either can choose to use a single quote 'as your string literal start and end like 'he said "hello"' or you can escape the quote "he said \"hello\"" the first option is what people usually choose because it's easier to read
urvashi9
@urvashi9
Sep 15 2015 09:26
Hey Guys. I am on Bonfire 7, Return largest numbers in arrays
Dealga McArdle
@zeffii
Sep 15 2015 09:26
@dting, do you think that bonfire is a little silly... with the +1 offset and the -1 offset ?
it seems to just be an element of confusion.
urvashi9
@urvashi9
Sep 15 2015 09:26
bf Return Largest Numbers in Arrays
CamperBot
@camperbot
Sep 15 2015 09:26

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

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

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

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

more info:  bf details | bf links | hint

urvashi9
@urvashi9
Sep 15 2015 09:27
And I found a solution to the problem on here which is as follows:
function sortNumber(a,b)
{
  return a-b;  
}

function largestOfFour(arr) {
  // You can do this!
  var resultArray=[];
  for(var i=0;i<arr.length;i++)  
    {
      resultArray[i]=arr[i].sort(sortNumber).pop();
    }
  return resultArray;
}
largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
But I can't seem to understand it. Can anyone explain how it works??
DTing
@dting
Sep 15 2015 09:29
@zeffii i guess they could have included 0 as a possible outcome and it would have been simplified. People should be able to figure out the 0 indexed arrays tho. Maybe explain a bit more what the code is doing. I feel like most people just copy and paste the code and move on.
Kiy-Hong Tang
@kiytang
Sep 15 2015 09:29
@dting @zeffii Thank you both
CamperBot
@camperbot
Sep 15 2015 09:29
kiytang sends brownie points to @dting and @zeffii :sparkles: :thumbsup: :sparkles:
:warning: kiytang already gave zeffii points
:star: 1173 | @dting | http://www.freecodecamp.com/dting
DTing
@dting
Sep 15 2015 09:30
@urvashi9 they are using a for loop to iterate over each nested array. For each nested array they are sorting smallest to largest, then taking the last value (largest) and popping it off and storing it in the resultsArray. Then returning the results array
urvashi9
@urvashi9
Sep 15 2015 09:32
Oh my gosh! I just realized I was trying to do something completely different than what the problem is asking for. Oh my.
Thank you @dting
CamperBot
@camperbot
Sep 15 2015 09:32
urvashi9 sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1174 | @dting | http://www.freecodecamp.com/dting
Dealga McArdle
@zeffii
Sep 15 2015 09:32
@urvashi9 sorting each sublist is not very efficient
DTing
@dting
Sep 15 2015 09:33
There are a couple things that happen that might be undesirable when using that function. First you sort which is O(n log n) average case time complexity. Second you mutate the order of each sub array and third you remove an element from each nested array. After you solve that problem I have taken some notes https://github.com/dting/fccbonfires/blob/master/basic/Basic%2007%20-%20Return%20Largest%20Numbers%20in%20Arrays.ipynb if you want to take a look at them
Dealga McArdle
@zeffii
Sep 15 2015 09:34
sort() will hit each element more than 1 time.. but if you loop through each element and keep track of the highest value you found.. you only hit each element of the subarray 1 time.
urvashi9
@urvashi9
Sep 15 2015 09:35
I will take a look at it. thanks @dting and @zeffii
CamperBot
@camperbot
Sep 15 2015 09:35
urvashi9 sends brownie points to @dting and @zeffii :sparkles: :thumbsup: :sparkles:
:warning: urvashi9 already gave dting points
:star: 351 | @zeffii | http://www.freecodecamp.com/zeffii
Akira Laine
@AkiraLaine
Sep 15 2015 09:41

Hey guys, we just launched a Twitter account for FCC news! Follow it now: https://twitter.com/CamperNewsBot

PS: It's automated :D

urvashi9
@urvashi9
Sep 15 2015 10:16
This message was deleted
Can anyone tell me what's wrong with this code?
function end(str, target) {
  // "Never give up and good luck will find you."
  // -- Falcor
  string=str.replace("^[A-Za-z]+","");
  var a=str.substr(-1,1);
  var b=target;
  if(a==b)
    {
      return true;
    }
  else
    {
      return false;
    }
}

end("Bastian", "n", "");
Oh wait. I guess we need to match the last STRING. Doesn't have to be a letter.
Sorry!
Aniket Rao
@anik3tra0
Sep 15 2015 10:22
`function slotOne(){
  return Math.floor(Math.random() * (3 - 1 + 1)) + 1;

};

function slotTwo(){

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

};

function slotThree(){

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

};`
can any one help me understand where i am going wrong?
DTing
@dting
Sep 15 2015 10:23
you shouldnt be surrounding that code with functions
they just want you to assign a Math.floor(....) to slotOne, slotTwo, slotThree
urvashi9
@urvashi9
Sep 15 2015 10:24
just use var
Aniket Rao
@anik3tra0
Sep 15 2015 10:24
oooh okay thanks! just got confused
CamperBot
@camperbot
Sep 15 2015 10:24
if you want to thank someone, put an @ before their name!
urvashi9
@urvashi9
Sep 15 2015 10:24
@anik3tra0
Aniket Rao
@anik3tra0
Sep 15 2015 10:24
@urvashi9 & @dting thanks!
CamperBot
@camperbot
Sep 15 2015 10:24
anik3tra0 sends brownie points to @urvashi9 and @dting :sparkles: :thumbsup: :sparkles:
:star: 194 | @urvashi9 | http://www.freecodecamp.com/urvashi9
:star: 1176 | @dting | http://www.freecodecamp.com/dting
Ali-Haider5
@Ali-Haider5
Sep 15 2015 10:35
This message was deleted
<script>
  function runSlots(){
    var slotOne;
    var slotTwo;
    var slotThree;

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

    // Only change code below this line.
    var max=3:
    var min=1

    slotOne= Math.floor(Math.random()*(max-min+1))+min;
    slotTwo= Math.floor(Math.random()*(max-min+1))+min;
    slotThree= Math.floor(Math.random()*(max-min+1))+min;

    // Only change code above this line.

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

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

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

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

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

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

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

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

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

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

 .inset {
   -webkit-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
   -moz-box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
   box-shadow: inset 0px 0px 15px -2px rgba(0,0,0,0.75);
 }
</style>
Ali-Haider5
@Ali-Haider5
Sep 15 2015 10:40
@anik3tra0 maybe u should declare the values of all he slots as the formulas
This message was deleted
This message was deleted
  slotOne = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotTwo = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
    slotThree = Math.floor(Math.random() * (3 - 1 + 1)) + 1;
Aniket Rao
@anik3tra0
Sep 15 2015 10:47
@Ali-Haider5 thanks! I understood where i went wrong!
CamperBot
@camperbot
Sep 15 2015 10:47
anik3tra0 sends brownie points to @ali-haider5 :sparkles: :thumbsup: :sparkles:
:star: 158 | @ali-haider5 | http://www.freecodecamp.com/ali-haider5
Evan Davis
@davisec52
Sep 15 2015 10:55

@someone Good morning, everybody. Say, I posted this late
last night, but it was too late to get any traction.
I have finished Zipline #3 but decided
to add a form to capture weather data from whatever city location
you enter.

My question concerns the button that changes ºF to ºC. It only
partially works. For example, if you enter Paris, you get the
weather data for Paris and the button displays F and C on toggle
without problem. However, if you enter another city, it gathers
the weather data but the toggle will not display the ºC conversion.
Now, if you then enter any third location, it gathers
weather data and will now toggle between F and C.

And so it goes, the toggle button working for
every other city.

I'd appreciate any advide. My app is on Codepen
at http://codepen.io/davisec52/full/meVyaw/

Jonny Morley
@morley92
Sep 15 2015 11:08
@davisec52 Hi davisec, just a suggestion as it's what i did for my weather zipline, you could start by loading a default format (eg celcius), then add some on-click jquery which would just run the value it gives through a function such as 'toFarenheit' (the math is easily googleable). Then add some more on-click jquery which on every second click would run the number shown through a 'toCelcius' function
Evan Davis
@davisec52
Sep 15 2015 11:13
@morley92 Hi. Thank you. In this app, Farenheit loaded first from Openweathermap, I took the ºF variable converted it to ºC and then added the click functions and jquery to load it when clicked. Any idea why it only shows the C on every other click?
CamperBot
@camperbot
Sep 15 2015 11:13
davisec52 sends brownie points to @morley92 :sparkles: :thumbsup: :sparkles:
:star: 260 | @morley92 | http://www.freecodecamp.com/morley92
DTing
@dting
Sep 15 2015 11:13
@davisec52 The problem is that you are having is that you are adding a click handler to the button every time you search
so basically every other time you search you can toggle
because toggling twice will untoggle
so the first search adds the click handler so you can toggle.
the second search you add another click handler. so clicking the button will toggle it twice. so it seems like the button doesnt work.
searching a third time will add 3 click handlers to the button. and now toggling seems like it works again
etc
Evan Davis
@davisec52
Sep 15 2015 11:15
@dting Any suggestions on how to manage the click events?
DTing
@dting
Sep 15 2015 11:17
add them outside of your getotherweather function
  } /* -- fn getOtherWeather --*/

    $("#tem").click(function() {
      $("b").toggle();
    });
Evan Davis
@davisec52
Sep 15 2015 11:19
@dting aiya--I originally had them outside and then later on, for some reason, I put them back. I'll made the change...
DTing
@dting
Sep 15 2015 11:20
@morley92 is right to point out that you dont need to make another call to toggle the units. you can do that without making another request.
Evan Davis
@davisec52
Sep 15 2015 11:23
@dting Placing the button outside of the getOtherWeather() function solved that particular problem. However, I'm not sure that I understand about making the other calls when toggling units.
My intention was that the toggle would merely toggle views, not make additional function calls.
raykoff
@raykoff
Sep 15 2015 11:59
any first tips for the challenge Build a Random Quote Machine ?
Evan Davis
@davisec52
Sep 15 2015 12:07
@raykoff Well, you will need to sort out how you will make the API call if you are going to pull quotes from an online source such as forismatic. I believe forismatic has code samples.
raykoff
@raykoff
Sep 15 2015 12:12
@davisec52 thanks
CamperBot
@camperbot
Sep 15 2015 12:12
raykoff sends brownie points to @davisec52 :sparkles: :thumbsup: :sparkles:
:star: 322 | @davisec52 | http://www.freecodecamp.com/davisec52
Aniket Rao
@anik3tra0
Sep 15 2015 12:14

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

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

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

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

Can anyone help me with this?
Sean Campbell
@natac13
Sep 15 2015 12:26
Hey does anyone here know why I am getting a Segmentation fault (core dumped) when running gulp to launch the FCC app locally?
Joseph odhiambo
@Theonlysmartboy
Sep 15 2015 12:26
Can anyone help me with this code,

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

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

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

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

Evan Davis
@davisec52
Sep 15 2015 12:28
This message was deleted
Joseph odhiambo
@Theonlysmartboy
Sep 15 2015 12:30
var Car = function() {
   this.wheels = 4;
};

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

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


// Only change code above this line.
(function() {return JSON.stringify(myCar);})();
Jonny Morley
@morley92
Sep 15 2015 12:31
@Theonlysmartboy @anik3tra0 you can add a property using dot notation, so something like myCar.engines = 1; would work...
Joseph odhiambo
@Theonlysmartboy
Sep 15 2015 12:32
thanks @morley92
CamperBot
@camperbot
Sep 15 2015 12:32
theonlysmartboy sends brownie points to @morley92 :sparkles: :thumbsup: :sparkles:
:star: 262 | @morley92 | http://www.freecodecamp.com/morley92
Kiy-Hong Tang
@kiytang
Sep 15 2015 13:05

I managed to get the following to pass after spending some time. Reading the Docs from Mozilla and others, the standard practice seems to indicate creating an additional variable in addition to 'var array' to accommodate the mapping sequence. As such I was using

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

which would not pass. It was only that I noticed the (function() {return array;})(); that I realised that ‘var array’ had to be implemented again. It would be interesting to hear of others thoughts to see whether they encountered such an issue or if it is just my lack of experience. To me having two 'var array' adds some confusion.

//Use map to add three to each value in the array
var array = [1,2,3,4,5];
// Only change code below this line.
 var array = array.map(function(val){
    return val + 3;
});

// Only change code above this line.
(function() {return array;})();
Chris Nwasike
@chrisnwasike
Sep 15 2015 13:15
@kiytang I think u should loose the second one. That is delete the second "var array =". And replace it with another variable name. The reason for the double declaration is cause the alternative would leave array as [1,2,3,4,5] .
pheotter
@pheotter
Sep 15 2015 13:15
Hello~Can anyone tell me where the wrong is in Waypoint: Nest an Anchor Element within a Paragraph, thanks?
var code="<p>View more
<a href="http://freecodecamp.com">cat photos</a>
</p>"
CamperBot
@camperbot
Sep 15 2015 13:15
if you want to thank someone, put an @ before their name!
pheotter
@pheotter
Sep 15 2015 13:16
Hello~Can anyone tell me where the wrong is in Waypoint: Nest an Anchor Element within a Paragraph, thanks?
var code="<p>View more
<a href="http://freecodecamp.com">cat photos</a>
</p>";
Chris Nwasike
@chrisnwasike
Sep 15 2015 13:16
@kiytang let me explain further.
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 13:17
@pheotter can you post your code again? place ``` before and after you paste your code so we can see it
pheotter
@pheotter
Sep 15 2015 13:17
Hello~Can anyone tell me where the wrong is in Waypoint: Nest an Anchor Element within a Paragraph, thanks?
'''<p>View more
<a href="http://freecodecamp.com">cat photos</a>
</p>'''
CamperBot
@camperbot
Sep 15 2015 13:17
:bulb: to format code use backticks! ``` more info
pheotter
@pheotter
Sep 15 2015 13:18
<p>View more <a href="http://freecodecamp.com">cat photos</a> </p>
Jason Wood
@catapixel
Sep 15 2015 13:19
@pheotter The correct code would be: <p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>. Make sure there is a space after "more" and before your anchor tag starts.
Chris Nwasike
@chrisnwasike
Sep 15 2015 13:19
This message was deleted
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 13:19
@catapixel beat me to it
Jason Wood
@catapixel
Sep 15 2015 13:19
@pheotter No space after your anchor closes and the closing p tag
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 13:19
@pheotter but yeah. watch your spacing.
pheotter
@pheotter
Sep 15 2015 13:20
Thanks @catapixel
CamperBot
@camperbot
Sep 15 2015 13:20
pheotter sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 368 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Sep 15 2015 13:20
@pheotter :thumbsup:
Rory Smith
@alanbuchanan
Sep 15 2015 13:21
bf no repeats please
CamperBot
@camperbot
Sep 15 2015 13:21

:fire:Bonfire: No repeats please :link:

function permAlone(str) {
  return str;
}

permAlone('aab');

Return the number of total permutations of the provided string that don't have repeated consecutive letters.

more info:  bf details | bf links | hint

Rory Smith
@alanbuchanan
Sep 15 2015 13:22
can someone please point out to me the two permutations for aab so that i understand this?
Chris Nwasike
@chrisnwasike
Sep 15 2015 13:22
@kiytang var numbers = [1, 4, 9]; var roots = numbers.map(Math.sqrt); // roots is now [1, 2, 3], numbers is still [1, 4, 9]
Christoffer92
@Christoffer92
Sep 15 2015 13:30
Hi i dont get what the ask me to do in Bonfire: Sum All Numbers in a Range. They expect an array, [4, 1] to equal 10. Could someone please explain the exercise to me?
Rory Smith
@alanbuchanan
Sep 15 2015 13:35
4 + 3 + 2 + 1
Chris Nwasike
@chrisnwasike
Sep 15 2015 13:35
@Christoffer92 you are expected to add up all the numbers between 1 and 4, including 1 and 4. 1+2+3+4
Christoffer92
@Christoffer92
Sep 15 2015 13:35
Ahhh @alanbuchanan thanks :D So thats what in a range means, doh
CamperBot
@camperbot
Sep 15 2015 13:35
christoffer92 sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 346 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Christoffer92
@Christoffer92
Sep 15 2015 13:35
@chrisnwasike thanks
Jason Wood
@catapixel
Sep 15 2015 13:43
@alanbuchanan are you still looking for the permutations?
Rory Smith
@alanbuchanan
Sep 15 2015 13:43
@catapixel yeah
Jason Wood
@catapixel
Sep 15 2015 13:43
@alanbuchanan the acceptable permutations are both 'aba' with the a's switching positions...
MichaelWIkman
@MichaelWIkman
Sep 15 2015 13:45
Anyone online that could help me with a small issue, im sure im missing something super obvious
Rory Smith
@alanbuchanan
Sep 15 2015 13:45
@catapixel right, that makes sense
@catapixel so what are the 8 perms of aabb?
Chris Nwasike
@chrisnwasike
Sep 15 2015 13:46
@MichaelWIkman what is it?
Rory Smith
@alanbuchanan
Sep 15 2015 13:46
different combos of abab and baba?
Jason Wood
@catapixel
Sep 15 2015 13:46
@alanbuchanan yes
Rory Smith
@alanbuchanan
Sep 15 2015 13:46
@catapixel right. thanks for your help
CamperBot
@camperbot
Sep 15 2015 13:46
alanbuchanan sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
:star: 369 | @catapixel | http://www.freecodecamp.com/catapixel
Jason Wood
@catapixel
Sep 15 2015 13:48
@alanbuchanan I pulled out pen and paper for this one until I really understood all permutations and how they were created and then I solved it by creating a loop to grab all possible permutations and then used regex to test and return the number of acceptable candidates. This one took me a long time to get my head around...
MichaelWIkman
@MichaelWIkman
Sep 15 2015 13:48
@chrisnwasike huh, i resetted the code and entered the same thing and it worked, but thanks :)
CamperBot
@camperbot
Sep 15 2015 13:48
michaelwikman sends brownie points to @chrisnwasike :sparkles: :thumbsup: :sparkles:
:star: 184 | @chrisnwasike | http://www.freecodecamp.com/chrisnwasike
Rory Smith
@alanbuchanan
Sep 15 2015 13:50
@catapixel i got caught up assuming you had to take away characters from the string, as per what the link in the description describes
Jason Wood
@catapixel
Sep 15 2015 13:51
@alanbuchanan I did need to do that in my solution in order to build my array of permutations.
@alanbuchanan It's more a matter of building a "prefix" of letters as you consider the letters left to permute rather than actually taking them away...I can give you an example if that doesn't make sense...
Rory Smith
@alanbuchanan
Sep 15 2015 13:52
@catapixel i get the feeling this one's going to take a while :stuck_out_tongue:
@catapixel i might get back to you for that if i get stuck. i really like that idea of grabbing all possibilities and regexing them out
Jason Wood
@catapixel
Sep 15 2015 13:53
@alanbuchanan No problem. I'd be glad to help if I'm on the chats...
Briana
@LiathsAingeal
Sep 15 2015 14:03
blob
Can anybody help me? I can't figure out what I am doing wrong
Joshua Travis
@jktravis
Sep 15 2015 14:07
Hi, @LiathsAingeal. Look at the error messages to the bottom left. The first one says to add a class to the img element.
Paul Simon Ongpin
@mochiii
Sep 15 2015 14:07
please help me center the View Here button in portfolio section (.thumbnail>a in css) http://codepen.io/mochiii/pen/PPPKjK?editors=110
Jason Wood
@catapixel
Sep 15 2015 14:11
@LiathsAingeal did you get this sorted?
Joshua Travis
@jktravis
Sep 15 2015 14:13

@mochiii Try this?
```

<div class="thumbnail">
<img src="http://www.actorum.com/wp-content/uploads/2012/06/coming-soon-icon.png">
<h3>Work In Progress...</h3>
<div class="row"><div class="text-center"><a class="btn btn-warning" href="#">View Here</a></div></div>

                </div>
@mochiii
<div class="thumbnail">
    <img src="http://www.actorum.com/wp-content/uploads/2012/06/coming-soon-icon.png">
    <h3>Work In Progress...</h3>
    <div class="row">
        <div class="text-center">
            <a class="btn btn-warning" href="#">View Here</a>
        </div>
    </div>
</div>
I added a div.row>div.text-center around your a.
Graham Whitley
@lotusgraham
Sep 15 2015 14:14
Screenshot 2015-09-15 at 10.13.25 AM.png
i can't see what i'm doing wrong. i thought i had engine= a number
Paul Simon Ongpin
@mochiii
Sep 15 2015 14:15
@jktravis thanks i'll try it out
CamperBot
@camperbot
Sep 15 2015 14:15
mochiii sends brownie points to @jktravis :sparkles: :thumbsup: :sparkles:
:star: 199 | @jktravis | http://www.freecodecamp.com/jktravis
Manuel Niederl
@ManuelNiederl
Sep 15 2015 14:16
@mochiii I have used class = ' col-md-12 text-center' to center one of my buttons.
Paul Simon Ongpin
@mochiii
Sep 15 2015 14:17
@ManuelNiederl it works thanks guys awesome people!!!
Joshua Travis
@jktravis
Sep 15 2015 14:18
@lotusgraham Try myCar.engines = 1;
Manuel Niederl
@ManuelNiederl
Sep 15 2015 14:18

Can anyone help me with changing a variable with a button press? I want to use only javascript if possible. This is what I have so far:
JSS:

var temp = 'f';
function change(temp) {
if (temp == 'f') {temp = 'c';} 
else if (temp == 'c') {temp = 'f';} }
$('.btn').on('click', function() {
   change(); })

HTML:

<button class= "btn"> Toggle F/C </button>
Sorry for the formatting, something went wrong
Graham Whitley
@lotusgraham
Sep 15 2015 14:18
thanks, how did you know to do that @jktravis
CamperBot
@camperbot
Sep 15 2015 14:18
lotusgraham sends brownie points to @jktravis :sparkles: :thumbsup: :sparkles:
:star: 200 | @jktravis | http://www.freecodecamp.com/jktravis
Jason Wood
@catapixel
Sep 15 2015 14:20
@ManuelNiederl the way you've written your code the change function receives a parameter but when you call it you're not sending one....
Joshua Travis
@jktravis
Sep 15 2015 14:21
@lotusgraham I think it was to "add" properties to an already existing object rather than to create a new object with a new property. Doing so the other way looks to be creating a new object with property. ...I think.
Jason Wood
@catapixel
Sep 15 2015 14:22
@ManuelNiederl I think you just need function change() {...}
@ManuelNiederl Also, I'm not sure as I look at it why the change() function is there at all. Just move the code you wrote for it inside your onclick
Joshua Travis
@jktravis
Sep 15 2015 14:26
@ManuelNiederl Also, your function def takes temp as an arg, but no arg looks to be passed.
rbunz
@rbunz08
Sep 15 2015 14:29
Hello, I am building a website. In my code I have the navigation and heading of my site in the <body></body> tags. I then put in a background under body {} in my CSS. However there is a thin white line between the navigation bar and the background img. I have tried using margins and padding but it only moves the text or nothing at all. How do I get rid of this white line?
Aaron Peazzoni
@peazzoni1
Sep 15 2015 14:31
@ManuelNiederl I would try adding onclick="change(this)" in your button element . And remove the jquery from the JS. Also might be easier to assign a value of "c" or "f" to the button to toggle with.
Rory Smith
@alanbuchanan
Sep 15 2015 14:32

@catapixel for no repeats please, i kind of borrowed the recursive permutations function, but after that all i did was

return permutes.filter(function(perm){
    return hasConsecutiveRepeats(perm);
}).length;

i guess i could have worked out the perms function but i was determined not to spend all day on it...

Manuel Niederl
@ManuelNiederl
Sep 15 2015 14:32
Thanks @catapixel and @peazzoni1 , I'll try that right now.
CamperBot
@camperbot
Sep 15 2015 14:32
manuelniederl sends brownie points to @catapixel and @peazzoni1 :sparkles: :thumbsup: :sparkles:
:star: 371 | @catapixel | http://www.freecodecamp.com/catapixel
:star: 220 | @peazzoni1 | http://www.freecodecamp.com/peazzoni1
Joshua Travis
@jktravis
Sep 15 2015 14:33
@rbunz08 Do you have a link?
@jktravis also if you know how to get the navigation bar to look the same on mobile??
vincethebince
@vincethebince
Sep 15 2015 14:40
Does anyone know how to use a CSS Class to style an element
Manuel Niederl
@ManuelNiederl
Sep 15 2015 14:44
@peazzoni1 I tried assigning the value of c or f to the button and toggling it and it worked but I couldn't get the variable I use to accept that value.
Joshua Travis
@jktravis
Sep 15 2015 14:44
@rbunz08 It looks like it's the .navbar-default: border-color that needs updated to match your header.
rbunz
@rbunz08
Sep 15 2015 14:46
I have a background color to make the nav bar a brown??
@jktravis
Joshua Travis
@jktravis
Sep 15 2015 14:47
@rbunz08 You can try removing the border from the nav.
@rbunz08 Maybe something like .navbar-default { border: none;}?
rbunz
@rbunz08
Sep 15 2015 14:48
@jktravis thanks! that worked!
CamperBot
@camperbot
Sep 15 2015 14:48
rbunz08 sends brownie points to @jktravis :sparkles: :thumbsup: :sparkles:
:star: 201 | @jktravis | http://www.freecodecamp.com/jktravis
Joshua Travis
@jktravis
Sep 15 2015 14:48
Cool.
@rbunz08 Now to make it look good on mobile, you'll probably want to familiarize yourself with the various grid classes. http://getbootstrap.com/css/#grid
Aaron Peazzoni
@peazzoni1
Sep 15 2015 14:51
@ManuelNiederl try changing the variable 'temp' to 'button' in your change() parameter. And in your If statement use button.value instead of temp. I think you can also remove the temp var at the top.
rodaan
@rodaan
Sep 15 2015 14:51
who do I contact if I'm getting issues with frozen pages?
Ashish Gambhir
@ashishga
Sep 15 2015 14:57
hi i am getting issue
blob
please suggest
what wrong i am doing
?
Ariel
@ArielLeslie
Sep 15 2015 14:59
@ashishga Please post formatted code instead of screenshots
rbunz
@rbunz08
Sep 15 2015 14:59
@ashishga Im not sure if this will change anything but try changing .smaller-image to .img
Ariel
@ArielLeslie
Sep 15 2015 14:59
explain formatting
CamperBot
@camperbot
Sep 15 2015 14: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

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

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

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

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

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

rbunz
@rbunz08
Sep 15 2015 14:59
or just img
@ashishga or just img with no .
Rory Smith
@alanbuchanan
Sep 15 2015 14:59
@ashishga it's because your { is on the next line down
Joshua Travis
@jktravis
Sep 15 2015 15:00
@ashishga I don't know that this is it, but maybe try closing the img tag?
Ariel
@ArielLeslie
Sep 15 2015 15:00
@rbunz08 That would fail because the instructions tell you what class name to use
rbunz
@rbunz08
Sep 15 2015 15:00
@ArielLeslie o ok
@ArielLeslie @jktravis @alanbuchanan try doing what these other two have said combined? close your <img> with an </img> and put the { on the same line as .smaller-image
Rory Smith
@alanbuchanan
Sep 15 2015 15:01
yeah, and no space after width
Joshua Travis
@jktravis
Sep 15 2015 15:01
<img class="smaller-image" src="..." />
I think it's supposed to be self-closing. Don't know if that would make the test fail, but...
/shrug
rbunz
@rbunz08
Sep 15 2015 15:02
@jktravis to change for a cell phone... I alreayd have the div wrapped in a <div class = "container -fluid">
Ariel
@ArielLeslie
Sep 15 2015 15:02
@jktravis That won't matter
Joshua Travis
@jktravis
Sep 15 2015 15:02
lol.
Just a thought! :)
Ariel
@ArielLeslie
Sep 15 2015 15:03
@alanbuchanan code?
Rory Smith
@alanbuchanan
Sep 15 2015 15:03
@ArielLeslie which code?
Ariel
@ArielLeslie
Sep 15 2015 15:04
@alanbuchanan Your code. Are you going to share it?
Rory Smith
@alanbuchanan
Sep 15 2015 15:04
@ArielLeslie for this css one or for the bonfire?
Christopher Hinojosa
@Draxell
Sep 15 2015 15:05
can someone help me with a css problem?
Ashish Gambhir
@ashishga
Sep 15 2015 15:05

@ArielLeslie <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>

Ariel
@ArielLeslie
Sep 15 2015 15:05
explain formatting
CamperBot
@camperbot
Sep 15 2015 15:05

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Ariel
@ArielLeslie
Sep 15 2015 15:05
@ashishga :point_up_2:
Ashish Gambhir
@ashishga
Sep 15 2015 15:05
ok
i am checking that
Ariel
@ArielLeslie
Sep 15 2015 15:05
@Draxell Always feel free to just ask your question. If you ask to ask, you might not get a response.
Fabricio Leal
@pharaohlxvi
Sep 15 2015 15:05
Hi, guys, I'm new to pair programming and just got my first ever macbook. Still learning how to use it. What's the software/website used to pair program and how do I use it? I appreciate any advice. Thanks a lot.
I tried screenhero but it seems to be closed for new users...
Ariel
@ArielLeslie
Sep 15 2015 15:06
wiki screenhero
CamperBot
@camperbot
Sep 15 2015 15:06

:point_right: how to install screenhero [wiki]

Download for Mac

Download for Windows

You'll use Screenhero to pair program on the Bonfires and Zipline challenges.

Here are other alternatives to Screenhero as suggested by our fellow campers:

  • TeamViewer (also works for Linux)
  • Skype + ScreenLeap
  • Codeshare.io
  • Kobra.io
  • Google Hangouts

:pencil: read more about how to install screenhero on the FCC Wiki

Christopher Hinojosa
@Draxell
Sep 15 2015 15:06
I'm trying to set my background image opacity without affecting the content within the section any ideas?
Ariel
@ArielLeslie
Sep 15 2015 15:06
@pharaohlxvi :point_up_2: All you need is on the wiki
Fabricio Leal
@pharaohlxvi
Sep 15 2015 15:06
Thanks a lot. How to thank you properly by the way?
CamperBot
@camperbot
Sep 15 2015 15:06
if you want to thank someone, put an @ before their name!
Fabricio Leal
@pharaohlxvi
Sep 15 2015 15:07
Thank you @ArielLeslie
CamperBot
@camperbot
Sep 15 2015 15:07
pharaohlxvi sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 383 | @arielleslie | http://www.freecodecamp.com/arielleslie
Rory Smith
@alanbuchanan
Sep 15 2015 15:07
@rbunz08 all you need to do is take care that your css is in a consistent format
Christopher Hinojosa
@Draxell
Sep 15 2015 15:08
@ArielLeslie that's what I found too but it's making my text opaque as well
Yan Kozlovskiy
@YanKozlovskiy
Sep 15 2015 15:09
what happens to n in recursive fibonacci?
Ariel
@ArielLeslie
Sep 15 2015 15:09
@alanbuchanan BTW. Sorry about catching you instead of @ashishga earlier. (I hate the way Gitter works with mention lookups. I end up doing that at least once a day.)
@Draxell define the text as well and give it a color. That should override the transparency
(as in the example on w3schools)
Christopher Hinojosa
@Draxell
Sep 15 2015 15:11

body {
background-color: black;
}

section {

position: fixed;
width: 100%;
height: 100vh;
background-image: url("http://orig03.deviantart.net/716c/f/2012/305/f/3/realistic_hexagonal_colored_pokeball_by_snowfallprodutions-d5jmzco.jpg");
opacity: 0.2;
z-index: -1;
}

top {

opacity: 1;
margin-top: 150px;
margin-left: 140px;
color: yellow;
text-shadow: 1px 2px 2px red;
}

that's what I got and it's not working
Ariel
@ArielLeslie
Sep 15 2015 15:12
explain formatting
CamperBot
@camperbot
Sep 15 2015 15:12

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

Ariel
@ArielLeslie
Sep 15 2015 15:12
@Draxell :point_up_2:
Christopher Hinojosa
@Draxell
Sep 15 2015 15:12
ah

'<body {
background-color: black;
}

section {

position: fixed;
width: 100%;
height: 100vh;
background-image: url("http://orig03.deviantart.net/716c/f/2012/305/f/3/realistic_hexagonal_colored_pokeball_by_snowfallprodutions-d5jmzco.jpg");
opacity: 0.2;
z-index: -1;
}

top {

opacity: 1;
margin-top: 150px;
margin-left: 140px;
color: yellow;
text-shadow: 1px 2px 2px red;
}>'

nope didn't work
rbunz
@rbunz08
Sep 15 2015 15:13
@alanbuchanan I think the problem is the navbar at some point needs to be shown one on top of another... how do I change it so that it becomes a navbar where there is an img they click for a dropdown of the nav bar?
Ariel
@ArielLeslie
Sep 15 2015 15:13
Here is a bunch of stuff you can do with images and transparency http://www.corelangs.com/css/box/transparent.html
Christopher Hinojosa
@Draxell
Sep 15 2015 15:13

'body {
background-color: black;
}

section {

position: fixed;
width: 100%;
height: 100vh;
background-image: url("http://orig03.deviantart.net/716c/f/2012/305/f/3/realistic_hexagonal_colored_pokeball_by_snowfallprodutions-d5jmzco.jpg");
opacity: 0.2;
z-index: -1;
}

top {

opacity: 1;
margin-top: 150px;
margin-left: 140px;
color: yellow;
text-shadow: 1px 2px 2px red;
}'

still nope...
hold on
Ariel
@ArielLeslie
Sep 15 2015 15:13
explain formatting
CamperBot
@camperbot
Sep 15 2015 15:13

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

rodaan
@rodaan
Sep 15 2015 15:14
how do I a clear an exercise of past work? i made a bad while loop and now the page freezes whenever I enter it?
Ariel
@ArielLeslie
Sep 15 2015 15:14
@rodaan Clear you browser cache
Christopher Hinojosa
@Draxell
Sep 15 2015 15:14

`<body {
background-color: black;
}

section {

position: fixed;
width: 100%;
height: 100vh;
background-image: url("http://orig03.deviantart.net/716c/f/2012/305/f/3/realistic_hexagonal_colored_pokeball_by_snowfallprodutions-d5jmzco.jpg");
opacity: 0.2;
z-index: -1;
}

top {

opacity: 1;
margin-top: 150px;
margin-left: 140px;
color: yellow;
text-shadow: 1px 2px 2px red;
}>`

Ariel
@ArielLeslie
Sep 15 2015 15:14
explain formatting
CamperBot
@camperbot
Sep 15 2015 15:14

:point_right: code formatting [wiki]

Inline code

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

Code Block

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

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

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

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

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

rbunz
@rbunz08
Sep 15 2015 15:14
@ArielLeslie ```
<div class='container-fluid'>
    <nav class="navbar navbar-default navbar-fixed-top" role= "navigation">
      <div class="navbar-header">
        <a class="navbar-brand" href="#">Rebecca Bunz</a>
      </div>
    <div>
      <ul class="nav navbar-nav navbar-right" id = "nav-links">
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Portfolio</a></li> 
        <li><a href="#">Contact</a></li> 
      </ul>
    </div>
  </nav>
  </div>
This is the html
Christopher Hinojosa
@Draxell
Sep 15 2015 15:15

`body {
background-color: black;
}

section {

position: fixed;
width: 100%;
height: 100vh;
background-image: url("http://orig03.deviantart.net/716c/f/2012/305/f/3/realistic_hexagonal_colored_pokeball_by_snowfallprodutions-d5jmzco.jpg");
opacity: 0.2;
z-index: -1;
}

top {

opacity: 1;
margin-top: 150px;
margin-left: 140px;
color: yellow;
text-shadow: 1px 2px 2px red;
}`

Joshua Travis
@jktravis
Sep 15 2015 15:15
@rbunz08 Make sure that you add the bootstrap.js file to your project. I think there may be a class too.
Christopher Hinojosa
@Draxell
Sep 15 2015 15:15
I've tried both < > and code it's not working
Deep2322
@Deep2322
Sep 15 2015 15:15

function where(arr, num) {
arr.push(num);
arr.sort();
for(i = 0; i < arr.length; i++){
if(arr[i] === num){
return i;
}
}
}

where([40, 60], 50);

plz anyone help me with this
Christopher Hinojosa
@Draxell
Sep 15 2015 15:15
ok.....
Deep2322
@Deep2322
Sep 15 2015 15:16
i am not able to pass through
Ariel
@ArielLeslie
Sep 15 2015 15:16
@rbunz08 What issue are you having?
rodaan
@rodaan
Sep 15 2015 15:16
@ArielLeslie Thanks so much!
CamperBot
@camperbot
Sep 15 2015 15:16
rodaan sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 384 | @arielleslie | http://www.freecodecamp.com/arielleslie
Christopher Hinojosa
@Draxell
Sep 15 2015 15:16

` body {
background-color: black;
}

section {

position: fixed;
width: 100%;
height: 100vh;
background-image: url("http://orig03.deviantart.net/716c/f/2012/305/f/3/realistic_hexagonal_colored_pokeball_by_snowfallprodutions-d5jmzco.jpg");
opacity: 0.2;
z-index: -1;
}

top {

opacity: 1;
margin-top: 150px;
margin-left: 140px;
color: yellow;
text-shadow: 1px 2px 2px red;
} `

Ariel
@ArielLeslie
Sep 15 2015 15:16
@Deep2322 Waht do you mean by that?
Ashish Gambhir
@ashishga
Sep 15 2015 15:16

`<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>
`

Christopher Hinojosa
@Draxell
Sep 15 2015 15:16
nope ``` is not working for me
there
Ariel
@ArielLeslie
Sep 15 2015 15:17
explain rtfm
CamperBot
@camperbot
Sep 15 2015 15:17

:point_right: rtfm [wiki]

RTFM comments generally useless

If everybody read the fine manual, most of the questions asked on the internet would go away!

RTFM

"RTFM" is rude, no doubt about it. However, links to the manual in comments are perfectly acceptable, and sometimes the only appropriate response to a question.

So when posting a manual link, be smart. Drop the RTFM and use nicer wording so the link survives. Suggestions:

  • Check out the manual page: (link)
  • See the manual: (link)
  • This is explained in the manual: (link)

If the OP was really lazy:

Christopher Hinojosa
@Draxell
Sep 15 2015 15:17
you can see what I'm doing wrong there
Ariel
@ArielLeslie
Sep 15 2015 15:17
@Draxell Since all I can see is your results, no.
Deep2322
@Deep2322
Sep 15 2015 15:17
Screen Shot 2015-09-15 at 8.50.35 pm.png
Ariel
@ArielLeslie
Sep 15 2015 15:18
@Deep2322 Your function isn't performing as required for those two cases
Christopher Hinojosa
@Draxell
Sep 15 2015 15:18
@ArielLeslie click on edit this pen on the bottom left corner
rbunz
@rbunz08
Sep 15 2015 15:18
@ArielLeslie @jktravis when the screen gets small the nav bar changes so there is one word on each line... I want it to collapse
I think from what jktravis sent I need to "Change the point at which your navbar switches between collapsed and horizontal mode. Customize the @grid-float-breakpoint variable or add your own media query." but i dont know how to do that?
georgiel
@georgiel
Sep 15 2015 15:19
wikbonfire factorialize a number
Deep2322
@Deep2322
Sep 15 2015 15:19
(arr[i] === num) this returns the correct index...
georgiel
@georgiel
Sep 15 2015 15:19
wiki bonfire fatorialize a number
CamperBot
@camperbot
Sep 15 2015 15:19
no wiki entry for: bonfire fatorialize a number
:pencil: click here to create one now!after creating your page type update to reload it here
Joshua Travis
@jktravis
Sep 15 2015 15:19
@Deep2322 Pro-tip. If you have Node.js installed, you can work through your code locally and include console.log() statements, or even run it through a debugger. That's what I've had to do for some of the more complete bonfires.
georgiel
@georgiel
Sep 15 2015 15:20
help bonfire factorialize a number
CamperBot
@camperbot
Sep 15 2015 15:20

:point_right: bonfire factorialize a number [wiki]

The problem

Return the factorial of the provided integer. If the integer is represented with the letter n, a factorial is the product of all positive integers less than or equal to n.

Factorials are often represented with the shorthand notation n!

For example: 5! = 1 * 2 * 3 * 4 * 5 = 120f

:pencil: read more about bonfire factorialize a number on the FCC Wiki

Rory Smith
@alanbuchanan
Sep 15 2015 15:20
@rbunz08 i'm not too sure what you mean - could you copy and paste your code here?
rbunz
@rbunz08
Sep 15 2015 15:20
@alanbuchanan Which code the html or css
Deep2322
@Deep2322
Sep 15 2015 15:20
i have nodejs
Rory Smith
@alanbuchanan
Sep 15 2015 15:20
@rbunz08 both
rbunz
@rbunz08
Sep 15 2015 15:20
@alanbuchanan here is a link to the codepen
Joshua Travis
@jktravis
Sep 15 2015 15:21
@rbunz08 That's the LESS property if you were to build it. I think you may be able to override it in your css. Just not sure how to do it within codepen. =/
Deep2322
@Deep2322
Sep 15 2015 15:21
how to work locally using nodejs.?
Rory Smith
@alanbuchanan
Sep 15 2015 15:22
@rbunz08 like in this example when the window goes small? http://getbootstrap.com/examples/navbar/
Joshua Travis
@jktravis
Sep 15 2015 15:22
@Deep2322 Just create a new file, and run it. You can then add all the test cases that you need. Just wrap the calls in console.log(). If you have a tool from JetBrains, or other editor with a debugger, you can create breakpoints and really see what's going on.
Ariel
@ArielLeslie
Sep 15 2015 15:23
@Draxell
#top {
  background: rgba(255,255,255,.5);
  width:100%;
  height:100%;
  color: yellow;
  text-shadow: 1px 2px 2px red;
}
rbunz
@rbunz08
Sep 15 2015 15:23
Yea but I dont know how to do that
@alanbuchanan
Joshua Travis
@jktravis
Sep 15 2015 15:24
So, maybe vim test.js. Drop the code in from the bonfire. Save it, then node test.js from the commandline. @Deep2322
Rory Smith
@alanbuchanan
Sep 15 2015 15:25
@rbunz08 you could try taking this code and simply deleting the parts you don't need
Christopher Hinojosa
@Draxell
Sep 15 2015 15:25
@ArielLeslie that's not working either. thanks for trying. I'll mess around with it for a little bit and see if I can get it to work
CamperBot
@camperbot
Sep 15 2015 15:25
draxell sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:star: 385 | @arielleslie | http://www.freecodecamp.com/arielleslie
Rory Smith
@alanbuchanan
Sep 15 2015 15:25
@rbunz08 i did something similar but i remember it took forever http://codepen.io/alanbuchanan/pen/JdQXXP
Deep2322
@Deep2322
Sep 15 2015 15:26
@jktravis can u send me a link for downloading the tool
Joshua Travis
@jktravis
Sep 15 2015 15:26
@rbunz08 Inspect the code. You'll see the class added.
<div id="navbar" class="navbar-collapse collapse">
Christopher Hinojosa
@Draxell
Sep 15 2015 15:26
please forgive me if this doesn't work
#top { background: rgba(255,255,255,.5); width:100%; height:100%; color: yellow; text-shadow: 1px 2px 2px red; }
Ariel
@ArielLeslie
Sep 15 2015 15:26
@Draxell
blob
@Draxell You have to remove the opacity from the parent div
Joshua Travis
@jktravis
Sep 15 2015 15:28
@Deep2322 A debugger? Most people like https://www.jetbrains.com/webstorm/. It's not free, but there is a community version of IntelliJ IDEA (which is mostly java). It has the same features, and plugins for Node, I believe. https://www.jetbrains.com/idea/download/
Christopher Hinojosa
@Draxell
Sep 15 2015 15:28
ok thanks @ArielLeslie
CamperBot
@camperbot
Sep 15 2015 15:28
draxell sends brownie points to @arielleslie :sparkles: :thumbsup: :sparkles:
:warning: draxell already gave arielleslie points
Joshua Travis
@jktravis
Sep 15 2015 15:29
Gotta go. Meetings. :(
Deep2322
@Deep2322
Sep 15 2015 15:30
thanks @jktravis
CamperBot
@camperbot
Sep 15 2015 15:30
deep2322 sends brownie points to @jktravis :sparkles: :thumbsup: :sparkles:
:star: 203 | @jktravis | http://www.freecodecamp.com/jktravis
Ashish Gambhir
@ashishga
Sep 15 2015 15:30
@ArielLeslie

`<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>
`

Ariel
@ArielLeslie
Sep 15 2015 15:31
@ashishga That's still not working when you rerun the tests?
(also, please use markup formatting when you paste code)
Ashish Gambhir
@ashishga
Sep 15 2015 15:32
yes its not working ok i will use markup
its giving error that
image should be 100px
Rory Smith
@alanbuchanan
Sep 15 2015 15:33
@ashishga look at the format of the other selectors carefully
@ashishga they have to be the same format otherwise it won't work properly
Ashish Gambhir
@ashishga
Sep 15 2015 15:34
ok
@alanbuchanan ok i will check thanks
CamperBot
@camperbot
Sep 15 2015 15:34
ashishga sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 348 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
jkieberk
@jkieberk
Sep 15 2015 15:35
hey so are there ever any js functions that are disabled for bonfires? Trying to do the pig latin bonfire but I'm running into a: "str.shift is not a function"
function translate(str) {
  str = str.split('');
  console.log(JSON.stringify(str));
  if(str[0].match(/a|e|i|o|u/g)){
    str = str.shift();
    str = str.push("way");
  } else{
    str = str.push(str[0] + "ay");
    str = str.shift();
  }
  return str.join('');
}

translate("consonant");
Rory Smith
@alanbuchanan
Sep 15 2015 15:37
Screen Shot 2015-09-15 at 16.37.04.png
@jkieberk this is what is happening in your code
@jkieberk so you're actually trying to do shift on a number :)
lauratalaat
@lauratalaat
Sep 15 2015 15:39

Hi! Can anyone help me with: Bonfire: Truncate a string???
My code is:

function truncate(str, num) {
  // Clear out that junk in your trunk
  str.slice(num);
  var str2="...";
  str=str.concat(str2);
  return str;
}
truncate("A-tisket a-tasket A green and yellow basket", 11, "");

I don't know what it is wrong :((

jkieberk
@jkieberk
Sep 15 2015 15:41
oo @alanbuchanan didn't realize that was typecasting it to an int! So, is it always better to concat two strings using concat()?
Rory Smith
@alanbuchanan
Sep 15 2015 15:42
@lauratalaat you have to take num into account so that the result string is num characters long
@lauratalaat str.slice(num) is giving a substring starting from the 11th char
lauratalaat
@lauratalaat
Sep 15 2015 15:44
@alanbuchanan yes over 11th char i cut them
it isn't this what i must do?
Rory Smith
@alanbuchanan
Sep 15 2015 15:47
@jkieberk you should set your push separately to your str =
jkieberk
@jkieberk
Sep 15 2015 15:47
@alanbuchanan wow haha yeah just realized that... that's a dumb mistake haha
thanks! @alanbuchanan
CamperBot
@camperbot
Sep 15 2015 15:47
jkieberk sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 349 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
Rory Smith
@alanbuchanan
Sep 15 2015 15:48
@lauratalaat str.slice() on its own won't change the string. you have to reassign it with str = str.slice(). and if you do that in this case, str is
"tasket A green and yellow basket"
Arsalan Sabir
@aayanqazi
Sep 15 2015 15:50
Any one help me ??
lauratalaat
@lauratalaat
Sep 15 2015 15:50
@alanbuchanan now i understand
so how should i do?
Rory Smith
@alanbuchanan
Sep 15 2015 15:52
@lauratalaat you're nearly there. don't forget the RESULT has to be 11 chars long, so that's including the ...

from the docs

str.slice(beginSlice[, endSlice])

so you should specify the start and end indexes

Kiy-Hong Tang
@kiytang
Sep 15 2015 15:55
Hi @chrisnwasike thanks for chipping in. I think I may not have worded my post not to well, but what you mention i.e.to create another variable name was what I originally did after following documentations. However the test would not pass unless I used ‘var array’ twice- so my query fits with what you advised. To me having two 'var array' creates confusion.
J. Munford
@jhi5
Sep 15 2015 16:00
trying to start the node tutorial, but getting a 'command not found' when i try to open the first one. anyone else have this problem?
lauratalaat
@lauratalaat
Sep 15 2015 16:03
@alanbuchanan
function truncate(str, num) {
  // Clear out that junk in your trunk
  str.slice(num-3,str.length);
  var str2="...";
  str=str.concat(str2);
  return str;
}
i don't know how
Arsalan Sabir
@aayanqazi
Sep 15 2015 16:04
Some One help me in portfolio ??
Sean Oelkers
@SeanOelkers
Sep 15 2015 16:11
bf seek and destroy
CamperBot
@camperbot
Sep 15 2015 16:11

:fire:Bonfire: Seek and Destroy :link:

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

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

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

more info:  bf details | bf links | hint

Sean Oelkers
@SeanOelkers
Sep 15 2015 16:11
bf details
CamperBot
@camperbot
Sep 15 2015 16:11

:fire:Bonfire: Seek and Destroy :link:

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

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
You will be provided with an initial array (the first argument in the destroyer function), followed by one or more arguments. Remove all elements from the initial array that are of the same value as these arguments.
Remember to use RSAP if you get stuck. Try to pair program. Write your own code.
links:
Sean Oelkers
@SeanOelkers
Sep 15 2015 16:11
bf hint
CamperBot
@camperbot
Sep 15 2015 16:11
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Rory Smith
@alanbuchanan
Sep 15 2015 16:14
@lauratalaat close. you have to reassign str, so you'll need to use str = before str.slice
the first argument in slice is wherever in the string you want to start from. so in this case, it's the first letter of the string
the second argument should be what you currently have for your first :)
georgiel
@georgiel
Sep 15 2015 16:38
This message was deleted
I'm getting error of unexpected token var
punyas25
@punyas25
Sep 15 2015 16:49
Hello
I am encountering a problem. Can someone tell me the correct syntax of nesting an anchor tag 'a' within a paragraph tag 'p' in html5?
Dulio Denis
@duliodenis
Sep 15 2015 16:52
Anyone ever had a page crash on them on FCC ?- I think I may have coded an infinite loop on the Intermediate Algorithm - the Bonfire about the Roman Numerals. Now everytime I go to that page it doesn't finish rendering and it hangs. Any help is appreciated.
Fábio Paraíso Oliveira
@FabioParaiso
Sep 15 2015 16:53
Well I had a similar problem
two options
first: restart the browser and page and try to open the bonfire again
if it still crashes
same that happened to me you have to use an incognito page
There may be a third solution but that was what worked for me =)
@duliodenis
AerisX
@AerisX
Sep 15 2015 16:59
Hello, can someone advise where are the learning materials for Algorithms?
rothweg2
@rothweg2
Sep 15 2015 17:03
Need help with Waypoint: Use the Bootstrap Grid to Put Elements Side By Side
Tirolês
@tiroles
Sep 15 2015 17:13
Hi people! Is it ok for me to go to codacademy to learn a little bit more of CSS (I'm a little stuck on my first zipline). I want to grasp the structure for real.
I was totally lost with all those nav navxxx nav navyyy nav nav nav hahahahhaa
what a mess is bootstrap, really...
it is a boot on my strap... lol
Mateja Trifunovski
@Matko95
Sep 15 2015 17:14
@tiroles It's not that it's ok, it's actually recommended
@tiroles In FCC you learn through doing projects, and your knowledge base is the whole internet, so you should use as many sources to learn more as you can
Tirolês
@tiroles
Sep 15 2015 17:15
@Matko95 Great!
@Matko95 thanks man!
CamperBot
@camperbot
Sep 15 2015 17:16
tiroles sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 291 | @matko95 | http://www.freecodecamp.com/matko95
Tirolês
@tiroles
Sep 15 2015 17:16
I was thinking that those waypoints were enough to go all the way through ziplines!
Mateja Trifunovski
@Matko95
Sep 15 2015 17:21
Depends on how simple you want your ziplines to be
Jack Demynn
@infectiouscode
Sep 15 2015 17:30
Im having trouble with shifts guys in JS? Can anyone help me? Not sure what I've done wrong
var ourArray = ["Stimpson", "J", ["cat"]];
ourRemoved = ourArray.shift();
// ourArray now equals ["J", ["cat"]].

var myArray = ["John", 23, ["dog", 3]];
// Only change code below this line.
myRemoved = myArray.shift();
var myRemoved = myArray; // This should be ["John"] and myArray should now be [23, ["dog", 3]].

// Only change code above this line.

// We use this function to show you the value of your variable in your output box.
// You'll learn about functions soon.
(function(y, z){return 'myArray = ' + JSON.stringify(y) + ' & myRemoved = ' + JSON.stringify(z);})(myArray, myRemoved);
My code is below john 23 dog 3 btw
SojournerOctocat
@SojournerOctocat
Sep 15 2015 17:39
@infectiouscode Think it's supposed to be var myRemoved=myArray.shift(). You don't need the other line.
Jack Demynn
@infectiouscode
Sep 15 2015 17:41
Still doesn't work :/ @SojournerOctocat
Andrew Matthews
@rahzell
Sep 15 2015 17:42
Hi I have a theoritical question to Bonfire: Check for Palindromes
Should we check only for Letters ? Or Nummers too? Or Special characterhs too?
Mateja Trifunovski
@Matko95
Sep 15 2015 17:42
@infectiouscode remove the code above your var myRemoved= myArray; and just add the .shift(); on the myArray
@rahzell you remove all special characters, and check for letters and numbers
Jack Demynn
@infectiouscode
Sep 15 2015 17:42
I found out how to do it, I had the code on the wrong line! thanks @Matko95 @SojournerOctocat
CamperBot
@camperbot
Sep 15 2015 17:42
infectiouscode sends brownie points to @matko95 and @sojourneroctocat :sparkles: :thumbsup: :sparkles:
:star: 288 | @sojourneroctocat | http://www.freecodecamp.com/sojourneroctocat
:star: 292 | @matko95 | http://www.freecodecamp.com/matko95
Andrew Matthews
@rahzell
Sep 15 2015 17:44
but then its give fake true "0000"
assert(palindrome("0_0 (: /-\ :) 0-0") === true, '"0_0 (: /-\ :) 0-0" should return true.');
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 17:45
hey guys! does anyone know if the quote generator site needs to be responsive?
Mateja Trifunovski
@Matko95
Sep 15 2015 17:47
@rahzell your regex must be the problem then
@psykobilliethekid Every zipline should be done in a responsive design, but it's not obligatory, it's just good practice for a modern design
Manuel Niederl
@ManuelNiederl
Sep 15 2015 17:55

Hey everyone, I've already got some help on this but still couldn't get it to work. I'm sorry to ask again. I have the following code in the weather challenge and want it to toggle between Fahrenheit and Celsius. I managed to toggle the value of the button itself but that doesn't help me in this case so I'm trying a different approach.
I have a variable which is the unit accesed by the loadWeather function. I want that variable to change when the button is pressed.
This is my JSS:

var temp = 'c';
function change(btn) {
if (temp == 'f') {temp = 'c';} 
else if (temp == 'c') {temp = 'f';} 
}
$('.btn').on('click', function() { change (); })

function loadWeather(location, woeid) {
  $.simpleWeather({
    location: location,
    woeid: woeid,
    unit: temp,
    success: function(weather) {
      html = '<h2>' + weather.temp + '&deg;' + weather.units.temp + '</h2>';
      html += '<ul><li>' + weather.city + ', ' + weather.region + ', ' + weather.country + '</li>';
      html += '<li class="currently">' + weather.currently + '</li>';
      $("#weather").html(html);

And here is my HTML:

<button class = "btn" value= "f"> Toggle F/C </button>

and a link to the codepen: http://codepen.io/ManuelNiederl/pen/qOdNLW

MrZappy
@MrZappy
Sep 15 2015 17:57
@ManuelNiederl Looks good though
catalinxD44
@catalinxD44
Sep 15 2015 18:01
i need some help i have this <p class="red-text"> and it says to give it font size how to i add it to it?
i know that the font size is like this { font-size: (number); }
found it :D
Nick S Proud
@NickSProud
Sep 15 2015 18:05
Tell the CSS to give all <p> </p> a font size of 16. so under the .red-text {} make a section with just "p { font-size:16;}"
Ah good. :D
Manuel Niederl
@ManuelNiederl
Sep 15 2015 18:11
@MrZappy Haha thanks, It's super annoying not being able to find my mistake though.
CamperBot
@camperbot
Sep 15 2015 18:11
manuelniederl sends brownie points to @mrzappy :sparkles: :thumbsup: :sparkles:
:star: 200 | @mrzappy | http://www.freecodecamp.com/mrzappy
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:17
@Matko95 thanks dude! appreciate it! %_%
CamperBot
@camperbot
Sep 15 2015 18:17
psykobilliethekid sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 293 | @matko95 | http://www.freecodecamp.com/matko95
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:18
@Matko95 I mean to do ^_^
the typos are strong with me today
have another question for anyone out there. how do you post your codepen? do you just post the link and it shows your work? or do you have to tweet it then post the tweet?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 15 2015 18:22
@psykobilliethekid Link would just do fine. If you want to give elaborate name, you can use Markdown format too
marcusmatthias1
@marcusmatthias1
Sep 15 2015 18:29

Hi all, re. Zipline=Random Code Generator. I have a JS function that correctly inserts randomized quotes from an array into the desired location on the page, however, I cannot get the onclick event in HTML to run the function again and display another quote. I simply don't understand the interaction here (I am not even close to being a dev). I think the relevant code is as follows (goal is to click the "Try Another Quote" button/div and have a new quote populate the "randomQuote" div): Javascript

function newQuote() { document.getElementById("randomQuote").innerHTML = quote[Math.floor(Math.random() * quote.length)];
}
newQuote();

HTML:
<div id="instruction"> <button type="button" id="clickbutton" onclick="newQuote()">Try Another Quote</button> </div> <div id="randomQuote"> <p id="results"></p> </div>

Dealga McArdle
@zeffii
Sep 15 2015 18:37
@marcusmatthias1 are you avoiding JQuery on purpose?
Dealga McArdle
@zeffii
Sep 15 2015 18:43
@marcusmatthias1 I think it does work... http://codepen.io/zeffii/pen/EVPdKj?editors=101
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:51
@aniruddhabarapatre cool! thanks!
CamperBot
@camperbot
Sep 15 2015 18:51
psykobilliethekid sends brownie points to @aniruddhabarapatre :sparkles: :thumbsup: :sparkles:
:star: 209 | @aniruddhabarapatre | http://www.freecodecamp.com/aniruddhabarapatre
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:52
I'm having some trouble getting my site to be responsive. Can someone take a look? http://codepen.io/psykobilliethekid/pen/gaPjbq
Yeah it's pretty jacked up
Not sure why
Dealga McArdle
@zeffii
Sep 15 2015 18:54
excellent idea to do a ron swanson generator
ronaldnicol89
@ronaldnicol89
Sep 15 2015 18:54
lmao
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:55
@zeffii i know right? just wish it would behave in different display sizes
@ronaldnicol89 if you can actually get the quotes to show up it's pretty hilarious
Dealga McArdle
@zeffii
Sep 15 2015 18:56
pitty the quotes are hard to read over the image
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:57
@zeffii yeah that's what im having trouble with
i cant get the quotes to stay to the right of the image
marcusmatthias1
@marcusmatthias1
Sep 15 2015 18:57
@zeffii thanks for the help. I'm avoiding JQuery only because I don't really understand it yet and wanted to simplify things until I actually got something working. I will compare the code you have with my whole project, I must have something else wrong. FYI, you can find it at: http://codepen.io/sammslug/pen/XmXJQr
CamperBot
@camperbot
Sep 15 2015 18:57
marcusmatthias1 sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 353 | @zeffii | http://www.freecodecamp.com/zeffii
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 18:58
I'm trying to do Bootstrap at the lowest screen size now to see if I can work my way up to a working site. It's really annoying but I'm working through it
Dealga McArdle
@zeffii
Sep 15 2015 18:59
you might be interested
Jordan Shackelford
@JordanShackelford
Sep 15 2015 18:59
I just added a tweet button to my quote generator but many of the quotes are over the 140 character limit lol
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 19:00
@zeffii oh wow! thanks! its long so ill take a look at it later
CamperBot
@camperbot
Sep 15 2015 19:00
psykobilliethekid sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 354 | @zeffii | http://www.freecodecamp.com/zeffii
Dealga McArdle
@zeffii
Sep 15 2015 19:00
ok @marcusmatthias1 i'll take a look!
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 19:00
@JordanShackelford i know that feel! im having the same problem with mine
Dealga McArdle
@zeffii
Sep 15 2015 19:01
@psykobilliethekid just planting seeds.. it can be a neat effect... in moderation.
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 19:01
@zeffii might use it for my next zipline. still getting the hang of bootstrap
Dealga McArdle
@zeffii
Sep 15 2015 19:04
@marcusmatthias1 see: http://codepen.io/zeffii/pen/WQrajL
there's a variety of reasons your code didn't work.
best you compare yours with the edit I made... and maybe tell me what you notice is different
there's a tonne of ways to do this.. you found a way that doesn't work... if you can pinpoint why, then you will grow!
Dealga McArdle
@zeffii
Sep 15 2015 19:09
@psykobilliethekid bootstrap is pretty neat! especially the grid system!
(imho)
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 19:19
@zeffii yeah i really do enjoy working with it. it usually doesnt give me this much trouble but for some reason im having a hard time with this one
Dealga McArdle
@zeffii
Sep 15 2015 19:23
responsive web is tricky without using frameworks ..which are tweaked...
N3stro
@N3stro
Sep 15 2015 19:28
Waypoint: Make Dead Links using the Hash Symbol . Need help with this when I change "href" on "#" like I wana make dead link I get like I made somthing wrong.
Dealga McArdle
@zeffii
Sep 15 2015 19:28
href="#"
N3stro
@N3stro
Sep 15 2015 19:29
ty
Dealga McArdle
@zeffii
Sep 15 2015 19:29
does that make sense now?
0kanenas
@0kanenas
Sep 15 2015 19:30
hi
i am lost somewhere.. http://freecodecamp.com/challenges/waypoint-use-a-css-class-to-style-an-element - I can't understand what i have to do.. Could anyone explain this to me?
John McEnery
@leftfieldhero
Sep 15 2015 19:36
@0kanenas you have to create a css class in between the <style> tags and then apply that class to the <h2> element
0kanenas
@0kanenas
Sep 15 2015 19:39
@leftfieldhero okay... i will text back when i will solve it
jameswlytle
@jameswlytle
Sep 15 2015 19:43
Having trouble with the bonfire Arguments Optional. Can anyone assist? I have one condition that i cannot get met.
bf Arguments Optional
CamperBot
@camperbot
Sep 15 2015 19:43

:fire:Bonfire: Arguments Optional :link:

function add() {
  return false;
}

add(2,3);

Create a function that sums two arguments together. If only one argument is provided, return a function that expects one additional argument and will return the sum.

more info:  bf details | bf links | hint

MrDrBird
@MrDrBird
Sep 15 2015 19:43
Anyone willing to help me out with bf No repeats please?
Aleksander Gębicki
@Takumar
Sep 15 2015 19:44
@0kanenas with <style> ... </style> tags you can inject CSS code to your HTML code.
John McEnery
@leftfieldhero
Sep 15 2015 19:46
@jameswlytle I pulled this from documentation: The arguments object is an Array-like object corresponding to the arguments passed to a function.
jameswlytle
@jameswlytle
Sep 15 2015 19:46
@leftfieldhero the only one i still can't get to work is the add(2)(3). as this is not a valid function call, not sure how else to handle this.
0kanenas
@0kanenas
Sep 15 2015 19:51

@Takumar okay... so when i have this it works: <style>
h2 {
color: red;
}
</style>

<h2>CatPhotoApp</h2>

<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
but when i have this one it doesn't: <style>
red-text {
color: red;
}
</style>

<h2>CatPhotoApp</h2>

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

BabyKosh
@badbabykosh
Sep 15 2015 19:51
@warkentien2 thank you I'll try there ^_^
CamperBot
@camperbot
Sep 15 2015 19:51
badbabykosh sends brownie points to @warkentien2 :sparkles: :thumbsup: :sparkles:
:star: 287 | @warkentien2 | http://www.freecodecamp.com/warkentien2
Ben Heavner
@bheavner
Sep 15 2015 19:51
I'm attempting to do Bonfire: Diff Two Arrays with no loops - shooting for functional/recursion, but I'm getting "undefined" as my output.... help? code is at http://tonicdev.com/bheavner/arraydiff
Ariel
@ArielLeslie
Sep 15 2015 19:55
@bheavner I'm honestly a little confused by your approach, but are you aware that onlyUnique and valueHere are identical?
Nathan Wind
@Nathan-Wind
Sep 15 2015 19:57

hello all... so I have a quick question about this ```js function titleCase(str) {
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}

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

Ben Heavner
@bheavner
Sep 15 2015 19:57
No I wasn't aware of that. And yes, my code is confusing and ugly... esp compared to things with for loops. (I'm trying to grok the benefit of recursion and not quite there yet...)
Nathan Wind
@Nathan-Wind
Sep 15 2015 19:57
function titleCase(str) { 
return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
}

titleCase("I'm a little tea pot", "");
Ben Heavner
@bheavner
Sep 15 2015 19:57
@ArielLeslie does describing my (intended) logic help?
ah - whops - cut and paste error, sorry.
Ariel
@ArielLeslie
Sep 15 2015 19:58
I feel like you're maybe making it more complicated than it has to be?
Ben Heavner
@bheavner
Sep 15 2015 19:59
I am certain I am! Esp compared to something like this: https://tonicdev.com/bheavner/loopydif
I'm trying to wrap my brain around approaches like described in the functional programming article at http://www.smashingmagazine.com/2014/07/dont-be-scared-of-functional-programming/
DTing
@dting
Sep 15 2015 20:01
function diff(arr1, arr2) {
  return arr1.filter(function(v) {
    return arr2.indexOf(v) === -1;
  }).concat(arr2.filter(function(v) {
    return arr1.indexOf(v) === -1;
  }));
}
Ben Heavner
@bheavner
Sep 15 2015 20:01
Basically, my goal is to define a recursive function that picks off the first value of whichever array is longer, then checks whether it's in the other array. If it's not, it calls itself to do the same thing on the next value.
DTing
@dting
Sep 15 2015 20:01
recursion seems forced for that problem unless you are going out of your way to use it
Ben Heavner
@bheavner
Sep 15 2015 20:02
Recursion is new to me, so I don't really know when it's appropriate and when not, so yeah - I'm trying to go out of my way to use it as a learning exercise. And at the moment I may be learning that it makes for much uglier code at my current skill level.
That solution is pretty, btw @dting, as usual.
DTing
@dting
Sep 15 2015 20:04
hmm. i usually dont think of using recursion unless when im trying to figure out how to solve the problem in my head i'm like. Okay and do i what i just did do some new things.
Aleksander Gębicki
@Takumar
Sep 15 2015 20:05
@0kanenas you're doing it well. In first example you've styled all h2 headers on red colour. In second example you've almost created a class red-text which should be applied to h2 in HTML code.
Ben Heavner
@bheavner
Sep 15 2015 20:05
I suspect that for now, focusing on getting the hang of .filter is a better thing for me to focus on. :)
Nathan Wind
@Nathan-Wind
Sep 15 2015 20:06
can anyone tell me what txt.substr(1) indicates in my code i pasted above? I'm curious why my code works (makes letters lowercase) when I didn;t indicate and ending point such as txt.substr(1,4).
DTing
@dting
Sep 15 2015 20:07

substr https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr

If length is 0 or negative, substr() returns an empty string. If length is omitted, substr() extracts characters to the end of the string.

Nathan Wind
@Nathan-Wind
Sep 15 2015 20:07
I'm also curious why it seems to have made all the first letters uppercase and all the following lowercase. I don;t see that
ok thanks for the link
CamperBot
@camperbot
Sep 15 2015 20:07
if you want to thank someone, put an @ before their name!
0kanenas
@0kanenas
Sep 15 2015 20:07
@Takumar so i didn't create a css class into the html code?
Aleksander Gębicki
@Takumar
Sep 15 2015 20:07
@0kanenas but remember that when you create style in CSS, you have to add dot before name of this style: .red-text { color:red; }
and then in HTML you type: <h2 class='red-text'>
Do you know what I mean?
0kanenas
@0kanenas
Sep 15 2015 20:09
@Takumar .... i dont know. im confused...
wait a min
Ariel
@ArielLeslie
Sep 15 2015 20:11
@bheavner Probably wise. This isn't really an ideal case for recursion. Factorial, however, is. So if you want to play with recursion, try that
Aleksander Gębicki
@Takumar
Sep 15 2015 20:11
@0kanenas when you create a style for paragraph (p), header (h1..h6), link (a) you just type name of this tag. In case of class you type dot before name of class i.e. .red-text. You can style HTML tag also using IDs. When you want to create this by using id you have to add hash before name of id.
DTing
@dting
Sep 15 2015 20:11

that function matches a word character, [A-Za-z0-9_] followed by any number of white spaces. So lets say you have:

"heLLo       fRiend  "

and you call your function on it. the str.replace first matches:

"heLLo       "

and returns that that should be replaced with the first letter capitalized + the rest of the match lowercased.

"Hello       "

then does the same to the second match

"fRiend  "
"Friend  "
0kanenas
@0kanenas
Sep 15 2015 20:12
@Takumar nope, i didn't solve it..
Aleksander Gębicki
@Takumar
Sep 15 2015 20:12
@0kanenas
<style>
#red-text {
  color: red;
}
</style>

<h2 id='red-text'>This text will be red because I've used CSS style</h2>
0kanenas
@0kanenas
Sep 15 2015 20:13
Thanks @Takumar but I think I had enough for today. I will continue tomorrow with hopefully a more clear mind.
CamperBot
@camperbot
Sep 15 2015 20:13
0kanenas sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:star: 320 | @takumar | http://www.freecodecamp.com/takumar
Aleksander Gębicki
@Takumar
Sep 15 2015 20:13
@0kanenas but you are very close to finish. Go for it.
Nathan Wind
@Nathan-Wind
Sep 15 2015 20:13
@dting so did my str.replace actually create an array? And then it applied the function to every slot of that array? I don;t understand why each word in the string is set up this way (uppercase then lowercase); as opposed to the first letter of the string followed by all following words being lowercase
0kanenas
@0kanenas
Sep 15 2015 20:14
@Takumar thanks for the code. i'll go
CamperBot
@camperbot
Sep 15 2015 20:14
0kanenas sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: 0kanenas already gave takumar points
DTing
@dting
Sep 15 2015 20:14
when you use the global flag the replace function is called with each match as an argument to the regex
Nathan Wind
@Nathan-Wind
Sep 15 2015 20:14
Tom likes apples vs Tom Likes Apples
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:15
Has anyone done Exact change, No repeats please , or Friendly date ranges?
Aleksander Gębicki
@Takumar
Sep 15 2015 20:15
@0kanenas try this:
<style>
.red-text { color: red; }
</style>
<h2 class='red-text'>Whatever you type</h2>
0kanenas
@0kanenas
Sep 15 2015 20:16
@Takumar Awesome! I did it :smile: :+1: Now let me understand it...
Thanks again @Takumar
CamperBot
@camperbot
Sep 15 2015 20:16
0kanenas sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
:warning: 0kanenas already gave takumar points
Aleksander Gębicki
@Takumar
Sep 15 2015 20:16
Remember . == class and # == id , you use class for many same HTML elements and id for particular one.
0kanenas
@0kanenas
Sep 15 2015 20:17
@Takumar I have a question: if it works with hastag then why the instructions say to use dot?
marcusmatthias1
@marcusmatthias1
Sep 15 2015 20:17
@zeffii Thanks again, and yes, I have it working now. Biggest gap in my knowledge was wrt the JS. I see now that I needed separate functions to populate the box initially, then again with the onclick event. re. the HTML, I originally had everything in the same div, but separated them when I couldn't get it to work (which likely was due to the JS being wrong, not the HTML.) I had thought that using id selectors instead of class selectors would be ok, but I saw you switched my randomQuote id to a class. I need to think about why...
CamperBot
@camperbot
Sep 15 2015 20:17
marcusmatthias1 sends brownie points to @zeffii :sparkles: :thumbsup: :sparkles:
:star: 355 | @zeffii | http://www.freecodecamp.com/zeffii
Aniruddha Barapatre
@aniruddhabarapatre
Sep 15 2015 20:18
@ManuelNiederl When toggle is clicked, your weather function is not being called again. All you're doing is changing temp unit, but call has to be made again with updated unit.
Aleksander Gębicki
@Takumar
Sep 15 2015 20:20
@0kanenas if you give header its id, the next header should have another id. But you may want every header <h2> to have red text than you should use class (.) not id(#)! Of course you can use the same class to colour your paragraphs.
Nathan Wind
@Nathan-Wind
Sep 15 2015 20:20
@dting so the reg ex worked to identify the pattern as words; so I didn;t need an array? Maybe it would help me to know what the function would be if I wanted "Tom likes apples" as opposed to "Tom Likes Apples" - what would that look like?
Mateo Pool
@IAmMyself
Sep 15 2015 20:21
whats wrong with this?
'function palindrome(str) {
// Good luck!
var i = str.replace(/\W/, "");
var j = i.toLowerCase();
var k = j.split('');
var l = k.reverse();
var m = l.join("");
if (j === m) {
return true;
} else {
return m;
}
}'
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:21
So many variables.
Nathan Wind
@Nathan-Wind
Sep 15 2015 20:21
(ps my code output was "Tom Likes Apples"
0kanenas
@0kanenas
Sep 15 2015 20:21
@Takumar okay.. i definetly need a notepad nearby ! :) i got it
Aleksander Gębicki
@Takumar
Sep 15 2015 20:22
@0kanenas very good :-)
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:23
@IAmMyself Why not do... var i = str.replace(/\W/g, '').toLowerCase();
var j = i.split('').reverse().join('');
Mateo Pool
@IAmMyself
Sep 15 2015 20:23
it's not deleting all spaces, just 1
DTing
@dting
Sep 15 2015 20:23
replace iterates over the matches yes. the regex is used to find matches in the string you called replace on. It is not necessarily an array @Nathan-Wind
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:24
function palindrome(str) {
    var i = str.replace(/\W/g, '').toLowerCase();
    var j = noSpace.split('').reverse().join('');
    if (i === j) {
        return true;
    } else {
        return false;
    }
}

palindrome("eye");
0kanenas
@0kanenas
Sep 15 2015 20:24
@Takumar :+1:
DTing
@dting
Sep 15 2015 20:25
it is no different than when you dont use a function as the second parameter. "ababbc".replace(/b/g, 'd'); the regex finds all the b's and returns a string where the matches are replaced with 'd'
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:25
@IAmMyself You have way to many variables. 5 is too many for this problem. You aren't even really using 3 of them.
Rex Schrader
@SaintPeter
Sep 15 2015 20:25
@thomasvaeth I notice that you're referencing a variable nosSpace that has not been defined?
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:25
@SaintPeter Sorry. I used my code, but tried to make it his variables.
Rex Schrader
@SaintPeter
Sep 15 2015 20:25
@thomasvaeth Maybe you meant to say i?
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:25
@SaintPeter var j = i.split('').reverse().join('');
Rex Schrader
@SaintPeter
Sep 15 2015 20:26
@thomasvaeth Right :D - Also, you're going to fail the last test unless you know that /\W/ === /[^a-zA-Z0-9_]/ (note the underscore)
@thomasvaeth Bah - I can't tell who is helping and who is asking for help.
Nathan Wind
@Nathan-Wind
Sep 15 2015 20:27
Ah ok I understand... thanks @dting ar eyou a full time helper on here?
CamperBot
@camperbot
Sep 15 2015 20:27
nathan-wind sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1179 | @dting | http://www.freecodecamp.com/dting
Thomas Vaeth
@thomasvaeth
Sep 15 2015 20:28
@SaintPeter I guess they updated the tests when they did that big roll out the other week. I'm just seeing it now, but passed it 2 months ago.
0kanenas
@0kanenas
Sep 15 2015 20:31
@Takumar the class . and the id # are linked in some way? like a transmitter (the class) and a reciever (the id) ?
Mateo Pool
@IAmMyself
Sep 15 2015 20:32
This message was deleted
This message was deleted
CamperBot
@camperbot
Sep 15 2015 20:33
:bulb: to format code use backticks! ``` more info
Mateo Pool
@IAmMyself
Sep 15 2015 20:33
This message was deleted
CamperBot
@camperbot
Sep 15 2015 20:33
:bulb: to format code use backticks! ``` more info
Mateo Pool
@IAmMyself
Sep 15 2015 20:33
This message was deleted
CamperBot
@camperbot
Sep 15 2015 20:33
:bulb: to format code use backticks! ``` more info
John McEnery
@leftfieldhero
Sep 15 2015 20:35
@jameswlytle still around?
Mateo Pool
@IAmMyself
Sep 15 2015 20:36
This message was deleted
CamperBot
@camperbot
Sep 15 2015 20:36
:bulb: to format code use backticks! ``` more info
Mateo Pool
@IAmMyself
Sep 15 2015 20:36
function palindrome(str) {
  // Good luck!
  var i = str.replace(/\W/g, "").toLowerCase();
  var k = i.split('').reverse().join("");
  if (i === k) {
    return true;
  } else {
    return false;
  }
}
what's wrong here?
Aniruddha Barapatre
@aniruddhabarapatre
Sep 15 2015 20:38
@IAmMyself Check with your regex. https://regex101.com/#javascript This would help you.
Also see which tests are failing and the reason if your regex is allowing it.
Mateo Pool
@IAmMyself
Sep 15 2015 20:39
This message was deleted
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 20:39
ok so maybe im an idiot and ive been doing this wrong for a while, but you can override the media queries in bootstrap with your own, right?
Mateo Pool
@IAmMyself
Sep 15 2015 20:39
This message was deleted
abhijats
@abhijats
Sep 15 2015 20:39
any ideas on what i'm doing wrong here?
I have a feeling something in the for loop or maybe the splice isn't necessary:
function where(arr, num) {

// this function is for numerical sort
function compareNums (a, b) {
return a - b;
}

// Numerically sort the values in arr
sortedArr = arr.sort(compareNums);

// loop through the sorted array
// compare if each element of arr is greater than num
// if so then add num to the right position

for (i=0; i<arr.length; i++) {
sortedArr[i]>num;
}  

sortedArr.splice(i,0,num);
return sortedArr;  
} 

where([40, 60], 50, "");
Aniruddha Barapatre
@aniruddhabarapatre
Sep 15 2015 20:40
@psykobilliethekid Yes. It's your page, so feel free to customize it. you can infact change some values in bootstrap too.
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 20:40
@aniruddhabarapatre Ok cool. And that should also work in codepen too, right? cause for some reason it isn't
and i have no idea why
Aniruddha Barapatre
@aniruddhabarapatre
Sep 15 2015 20:43
@psykobilliethekid Can you post the link again.
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 20:43
@aniruddhabarapatre oh my god im an idiot. i was writing css with sass. forgot you have to drill down to the element to get the style to work. it works now. thanks for your help!
CamperBot
@camperbot
Sep 15 2015 20:43
psykobilliethekid sends brownie points to @aniruddhabarapatre :sparkles: :thumbsup: :sparkles:
:star: 210 | @aniruddhabarapatre | http://www.freecodecamp.com/aniruddhabarapatre
Danielle "Dani" Moss
@psykobilliethekid
Sep 15 2015 20:44
@aniruddhabarapatre don't mind me. ive been working on code for a few hours now. i probably need a break but im so close to being done that i just want to finish it and move on, you know?
DTing
@dting
Sep 15 2015 20:48
@abhijats they want you to return the index where the element should be inserted
not an array with the num inserted in the correct position
Yan Kozlovskiy
@YanKozlovskiy
Sep 15 2015 20:48
how do i make 7 # appear in javascript?
var hash = "#"

console.log(hash * 10);
NaN?
DTing
@dting
Sep 15 2015 20:49

also you could replace:

// Numerically sort the values in arr
sortedArr = arr.sort(compareNums);

// loop through the sorted array
// compare if each element of arr is greater than num
// if so then add num to the right position

for (i=0; i<arr.length; i++) {
sortedArr[i]>num;
}  

sortedArr.splice(i,0,num);

with

var sortedArr = [num].concat(arr).sort(compareNums);
@YanKozlovskiy you cant multiply strings like you can in some other languages
there is a string.repeat in ES6
var hash = "#";
hash.repeat(7);
// "#######"
Yan Kozlovskiy
@YanKozlovskiy
Sep 15 2015 21:03
how would i create my own function?
jameswlytle
@jameswlytle
Sep 15 2015 21:04
@leftfieldhero I am still here.
DTing
@dting
Sep 15 2015 21:07
@YanKozlovskiy
function repeat(str, num) {
return str.repeat(num);
}
abhijats
@abhijats
Sep 15 2015 21:12
@dting so something like this:
function where(arr, num) {

function compareNums (a, b) {
return a - b;
}

sortedArr = arr.sort(compareNums);

for (i=0; i<arr.length; i++) {
if (num > sortedArr[i]){
  return i;}
    }

} 
where([40, 60], 50, "");
DTing
@dting
Sep 15 2015 21:15
close i think
you need to insert it if it is >= i believe
i forget let me look at the problem again
bf where
CamperBot
@camperbot
Sep 15 2015 21:18

:fire:Bonfire: Where art thou :link:

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

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

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

more info:  bf details | bf links | hint

DTing
@dting
Sep 15 2015 21:18
find where
CamperBot
@camperbot
Sep 15 2015 21:18
DTing
@dting
Sep 15 2015 21:18
bf where do
CamperBot
@camperbot
Sep 15 2015 21:18

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
  // Find my place in this sorted array.
  return num;
}

where([40, 60], 50);

Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).

more info:  bf details | bf links | hint

DTing
@dting
Sep 15 2015 21:19
@abhijats okay so it says that arr is already sorted so you dont need the sort code
if you are just going to iterate arr to find the position
Calandra Zellner
@calandraz
Sep 15 2015 21:21
Maybe it's me but what is Bonfire: Confirm the Ending asking me to do :confused:
DTing
@dting
Sep 15 2015 21:21
for (var i =0; i < arr.length; i++) {
  // if the value at arr[i] <= num return i
}
// return length of arr
@calandraz its asking you to check that the end of the first string is equal to the second string
Aleksandar B.
@aleksandar-b
Sep 15 2015 21:24
if Node.js is build in C++, then in which language is C++ build?
Calandra Zellner
@calandraz
Sep 15 2015 21:25
Think I've had it today...these bonfires are killing me. Thank you @dting
CamperBot
@camperbot
Sep 15 2015 21:25
calandraz sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1180 | @dting | http://www.freecodecamp.com/dting
ALINATSUI
@ALINATSUI
Sep 15 2015 21:34
@calandraz There's more a-coming.
Calandra Zellner
@calandraz
Sep 15 2015 21:36
@ALINATSUI I know...that is even more daunting. I feel like I've stepped into the wrong class today but too embarrassed to get up and leave
abhijats
@abhijats
Sep 15 2015 21:53
thanks @dting
CamperBot
@camperbot
Sep 15 2015 21:53
abhijats sends brownie points to @dting :sparkles: :thumbsup: :sparkles:
:star: 1182 | @dting | http://www.freecodecamp.com/dting
abhijats
@abhijats
Sep 15 2015 21:55
bf where do i belong
CamperBot
@camperbot
Sep 15 2015 21:55

:fire:Bonfire: Where do I belong :link:

function where(arr, num) {
  // Find my place in this sorted array.
  return num;
}

where([40, 60], 50);

Return the lowest index at which a value (second argument) should be inserted into a sorted array (first argument).

more info:  bf details | bf links | hint

abhijats
@abhijats
Sep 15 2015 21:55
hint
CamperBot
@camperbot
Sep 15 2015 21:55
:construction: Spoilers are only in the Bonfire's Custom Room :point_right:
Jelani Thompson
@JelaniThompson
Sep 15 2015 22:42
Hey guys, I was just wondering if anyone here could inspect my code and take a look at why the nav bar is getting cut off at the far right
Boby Fussell
@boby2
Sep 15 2015 22:43
E
Jelani Thompson
@JelaniThompson
Sep 15 2015 22:43
Not exactly sure why the nav bar is invisible in the preview lol
Arianna
@anaradanarad
Sep 15 2015 22:48

Hey guys. Having trouble on http://freecodecamp.com/challenges/bonfire-seek-and-destroy. I've googled and found solutions, but they don't use Array.filter, and I'd like to try to. Here's what I've got so far: function destroyer(arr) {

function remove(value) {
for (var i=1; i<arguments.length; i++) {
if (value === arguments[i]) {
return false;
} else {
return true;
}
}
}

return arr.filter(remove);

}

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

Chahan Shah
@Chahanshah
Sep 15 2015 22:54
I may have accidentally created an infinite loop, which ofcourse froze the page. I closed the tab and came back to the website. However, when I try to go back to the bonfire, the page is still stuck. How do I undo this?
Mateja Trifunovski
@Matko95
Sep 15 2015 22:54
@Chahanshah try going to that exercise in incognito mode
Coira Ellison
@Coira
Sep 15 2015 22:55
@JelaniThompson if I remove the bootstrap parts the navbar is enclosed in it stretches the whole width, but I can't really say why
Mateja Trifunovski
@Matko95
Sep 15 2015 22:56
@anaradanarad does it work?
Arianna
@anaradanarad
Sep 15 2015 22:56
@Matko95 it does not, comes back with an empty array
Mateja Trifunovski
@Matko95
Sep 15 2015 22:57
This message was deleted
Peter Deal
@DealPete
Sep 15 2015 22:57
@anaradanarad when you use arguments in the function remove, I suspect it's gettin g the arguments for "remove", not for "destroyer"
Chahan Shah
@Chahanshah
Sep 15 2015 22:58
thanks @Matko95 I erased my cookies and cache and it works now. It also removed all my saved code too though
CamperBot
@camperbot
Sep 15 2015 22:58
chahanshah sends brownie points to @matko95 :sparkles: :thumbsup: :sparkles:
:star: 294 | @matko95 | http://www.freecodecamp.com/matko95
Mateja Trifunovski
@Matko95
Sep 15 2015 22:58
@Chahanshah you didn't have to remove them all :)
Arianna
@anaradanarad
Sep 15 2015 22:58
@JelaniThompson padding-right: 15px is affecting it!
Chahan Shah
@Chahanshah
Sep 15 2015 23:02
@Matko95 Yes, i realized that too late. Anyways I still have access to my old solutions in my profile. I just have to redo this particular bonfire from scratch again.
Arianna
@anaradanarad
Sep 15 2015 23:02
@DealPete Intttterresting, okay. Thanks for the reply. Any idea how I can override that? Or should I just create an array from the initial arguments?
CamperBot
@camperbot
Sep 15 2015 23:02
anaradanarad sends brownie points to @dealpete :sparkles: :thumbsup: :sparkles:
:star: 269 | @dealpete | http://www.freecodecamp.com/dealpete
Mateja Trifunovski
@Matko95
Sep 15 2015 23:02
@Chahanshah Cool, be careful :)
BruceJamesH
@BruceJamesH
Sep 15 2015 23:03
This is just to vent a little. Progress going through FCC was just fine - maybe a few bumps - but hitting algorithm scripting was like hitting a brick wall. A little discouraging.
Peter Deal
@DealPete
Sep 15 2015 23:04
in destroyer, you could have "a = arguments", inside remove() replace "a" with "arguments"
also, in the loop you have something like if (X) return true else return false... like this you'll never get past the first element of the loop
@BruceJamesH are you talking about "basic algorithm scripting"?
Mateja Trifunovski
@Matko95
Sep 15 2015 23:07
@anaradanarad I think i figured it out, when you call for arguments[i], it returns the arguments[i] of the remove function so it checks value===value
Arianna
@anaradanarad
Sep 15 2015 23:08
@DealPete Awesome a=arguments worked great. Yeah I need it to keep scrolling through. Working on fixing that now.
@Matko95 Thank you I think you're right!
CamperBot
@camperbot
Sep 15 2015 23:08
anaradanarad sends brownie points to @dealpete and @matko95 :sparkles: :thumbsup: :sparkles:
:warning: anaradanarad already gave dealpete points
:star: 295 | @matko95 | http://www.freecodecamp.com/matko95
Peter Deal
@DealPete
Sep 15 2015 23:09
the bonfires and ziplines are quite a bit harder than the waypoints
1234Matt
@1234Matt
Sep 15 2015 23:11
Hi, what kind of IDE or text editor, do you use? I prefer free :)
for HTML CSS and JavaScript :)
Robert Richey
@0x0936
Sep 15 2015 23:12
@BruceJamesH yep. Bonfires are when you might consider pair programming - or, spending considerable time reading through official docs. We all hit brick walls - the question is, do you give up? plow through it? go around / over it?
@1234Matt Atom or Sublime Text
1234Matt
@1234Matt
Sep 15 2015 23:14
Thanks! I am still on vindows vista (I know that I have to buy 7 or something better), so no Atom for me, Is Sublime Text free?
CamperBot
@camperbot
Sep 15 2015 23:14
if you want to thank someone, put an @ before their name!
1234Matt
@1234Matt
Sep 15 2015 23:16
@camperbot Is that to me? :)
Mateja Trifunovski
@Matko95
Sep 15 2015 23:19

@anaradanarad

function destroyer(arr) {
  // Remove all the values
  var args=[];
  var bool=undefined;
  for(var j=1;j<arguments.length;j++)
    {
      args.push(arguments[j]);
    }
function remove(value) {
    for (var i=0;i<args.length; i++) {
        if (value===args[i]) {
          bool=false;
          break;
         } 
      else {
          bool=true;
       }
     }
    return bool;
}
return arr.filter(remove);
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);

I got something like this to work, it's a bit messy but it works :D

1234Matt
@1234Matt
Sep 15 2015 23:28
@0x0936 Thanks! I am still on vindows vista, so no Atom for me (I am going to buy something better, I hope... :)), Is Sublime Text for free?
CamperBot
@camperbot
Sep 15 2015 23:28
1234matt sends brownie points to @0x0936 :sparkles: :thumbsup: :sparkles:
:star: 145 | @0x0936 | http://www.freecodecamp.com/0x0936