These are chat archives for FreeCodeCamp/Help

2nd
Nov 2015
bruinette
@bruinette
Nov 02 2015 00:00
using postimage.org --- which link am I to copy to inline it here? It's been a while. I haven't coded HTML in 10 years. Trying to start back up.
Rex Schrader
@SaintPeter
Nov 02 2015 00:03
@bruinette Man, that looks right
Nik
@vukolka
Nov 02 2015 00:03
@Solehjon look at your conditional logic. U say: if 1 equals 2, return true. 1 doesn't equal 2, so your if statement doesn't make sense. U should compare your variable flip. if(flip===....
This message was deleted
Rex Schrader
@SaintPeter
Nov 02 2015 00:05
@bruinette I just ran it with exactly your code and it passed.
DJ
@qualitymanifest
Nov 02 2015 00:05
@bruinette is your browser zoomed in or out at all?
if so return it to 100% zoom and try again
Anders Bengtsson
@anders462
Nov 02 2015 00:07
How to center the columns inside the row, always have problem with this
<div class="row">
        <div class ="col-xs-12 col-sm-4 data1" id="temp"></div>
        <div class ="col-xs-12 col-sm-4 data2 " id="type" ></div>
        <div class ="col-xs-12 col-sm-4 data3" id='wind'></div>
    <div>
bruinette
@bruinette
Nov 02 2015 00:07
@qualitymanifest @SaintPeter Thanks! It somehow got to 90% zoom. 90%*10px. There went a couple of hours of my life. Note to self: ask forum for help sooner. ^_^
CamperBot
@camperbot
Nov 02 2015 00:07
bruinette sends brownie points to @qualitymanifest and @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1336 | @saintpeter | http://www.freecodecamp.com/saintpeter
:star: 317 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Nov 02 2015 00:08
@bruinette haha, yeah that's a strange error i see a lot, no problem
Rex Schrader
@SaintPeter
Nov 02 2015 00:15
@qualitymanifest Is it just on this waypoint or on others?
@qualitymanifest It looks like we can maybe test for it.
DJ
@qualitymanifest
Nov 02 2015 00:15
@SaintPeter i've only seen it on this one. it comes up fairly frequently
Rex Schrader
@SaintPeter
Nov 02 2015 00:15
@qualitymanifest ok, that's good to know. Is there an issue open on it?
DJ
@qualitymanifest
Nov 02 2015 00:15
@SaintPeter tbh, i haven't checked
Rex Schrader
@SaintPeter
Nov 02 2015 00:16
@qualitymanifest ok, I'll search
@qualitymanifest FreeCodeCamp/FreeCodeCamp#3204
JadeAtlas
@JadeAtlas
Nov 02 2015 00:20
In JavaScript, why do you have to subtract one to find the length of a string? Wouldn't that be one less than the actual value of the string?
Chris
@Aoxom
Nov 02 2015 00:21
thanks @SaintPeter i just wanna give you a random brownie point "thanks" for always being here helping people (including myself a couple times) :)
CamperBot
@camperbot
Nov 02 2015 00:21
aoxom sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1337 | @saintpeter | http://www.freecodecamp.com/saintpeter
Chris
@Aoxom
Nov 02 2015 00:21
and now you're 1337!
Rex Schrader
@SaintPeter
Nov 02 2015 00:21
@Aoxom :D
@Aoxom I know, right?
Chris
@Aoxom
Nov 02 2015 00:22
im learning just by being here and reading peoples problems and the solutions, so its helping me too!
Ian Barker
@IanBarkerDev
Nov 02 2015 00:23
@JadeAtlas What do you mean?
Matt Yamamoto
@MattYamamoto
Nov 02 2015 00:23
@JadeAtlas the length is the number of characters.
@SaintPeter I think you were disucssing this yesterday or something, but a lot of peopl have been having issues with tests not passing because of thin space characters (whatever that is). . .between that and zoom I feel like that's hampering a lot of people's efforts.
at least recently
Rex Schrader
@SaintPeter
Nov 02 2015 00:25
@MattYamamoto Yes, I know it was being discussed, not sure what the result was - let me check in.
JadeAtlas
@JadeAtlas
Nov 02 2015 00:25
@Malical in the 8th lesson for JavaScript it states that in order to find the last character in a string you'd type [lastName. length -1]; if the last name is "Lovelace" in theory the code should return 'e'.
Ian Barker
@IanBarkerDev
Nov 02 2015 00:26
@JadeAtlas It's because the first element is the 0th.
Matt Yamamoto
@MattYamamoto
Nov 02 2015 00:26
@SaintPeter I was super frustrated by it yesterday because I couldn't replicate a lot of errors people were having even when I did suspect the thin space.
JadeAtlas
@JadeAtlas
Nov 02 2015 00:26
What I'd like to know is, why. Why does subtracting 1 get you 'e' instead of 'c', if you are subtracting 1 from the length
Ian Barker
@IanBarkerDev
Nov 02 2015 00:26
Because the first element is 0 not 1.
Matt Yamamoto
@MattYamamoto
Nov 02 2015 00:26
@JadeAtlas length gives you the number of things, but the index of elements starts from zero.
Rex Schrader
@SaintPeter
Nov 02 2015 00:26
@MattYamamoto Understood.
Ian Barker
@IanBarkerDev
Nov 02 2015 00:26
So if the length is 1, then the first element would be at length-1.
Matt Yamamoto
@MattYamamoto
Nov 02 2015 00:27
@JadeAtlas the first "person" in the neighborhood occupies address zero
JadeAtlas
@JadeAtlas
Nov 02 2015 00:31
@MattYamamoto @Malical I still don't entirely get it, but thank you both for helping.
CamperBot
@camperbot
Nov 02 2015 00:31
jadeatlas sends brownie points to @mattyamamoto and @malical :sparkles: :thumbsup: :sparkles:
:star: 431 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 235 | @malical | http://www.freecodecamp.com/malical
Matt Yamamoto
@MattYamamoto
Nov 02 2015 00:32
@JadeAtlas wait, that's not acceptable. Think of it this way using arrays, each slot in an array has an address [address 0, address 1, address 2, etc] so in this array: [a, b, c, d] a lives at 0, and d lives at 3
but there are 4 items, so the length of that array would be 4
so if I told you the length of an array, then you know the address would be that number minus one. because counting of quantities starts with 1, but the addresses of where those sit starts with zero
Ian Barker
@IanBarkerDev
Nov 02 2015 00:34
@JadeAtlas Yeah I'm not cool with "I don't entirely get it"
Krista Handel
@meloncatty
Nov 02 2015 00:41
I know there are no stupid questions... but could someone explain the math to me in this formula
Math.floor(Math.random() * (max - min + 1)) + min
:(
Ian Barker
@IanBarkerDev
Nov 02 2015 00:43
@meloncatty Throw in some numbers and see how it works out.
Krista Handel
@meloncatty
Nov 02 2015 00:43
I understand what exactly it will return
Krista Handel
@meloncatty
Nov 02 2015 00:43
but why add 1 within the first function and why add my min at the end?
JadeAtlas
@JadeAtlas
Nov 02 2015 00:44
! That makes sense! :D Thank you @MattYamamoto and @Malical
CamperBot
@camperbot
Nov 02 2015 00:44
jadeatlas sends brownie points to @mattyamamoto and @malical :sparkles: :thumbsup: :sparkles:
:warning: jadeatlas already gave mattyamamoto points
:warning: jadeatlas already gave malical points
Krista Handel
@meloncatty
Nov 02 2015 00:44
oh shoot
sorry I forget that I can check out github for that stuff
@vukolka thank you
CamperBot
@camperbot
Nov 02 2015 00:44
meloncatty sends brownie points to @vukolka :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for vukolka
Krista Handel
@meloncatty
Nov 02 2015 00:45
I suppose I get the +1 within the function otherwise it won't count my max
Dieter Daems
@DDaems
Nov 02 2015 00:47
y
Krista Handel
@meloncatty
Nov 02 2015 00:48
no u
dwitjes89
@dwitjes89
Nov 02 2015 01:14
Hello everyone
how was your halloween?
Rex Schrader
@SaintPeter
Nov 02 2015 01:19
@MattYamamoto FYI, @ltegman has submitted the PR for the &thinsp; issue so it should be fixed as soon as we can get it merged in.
Patrick
@patleezy
Nov 02 2015 02:07
Screen Shot 2015-11-01 at 6.05.50 PM.png
bootstrap waypoint #12: I'm having trouble with the divs for the h2 and top image element. Can anyone let me know what the issue is with my code? See screenshot.
Dieter Daems
@DDaems
Nov 02 2015 02:08
it must be a div that has the col-xs-4
you directly applied it to the img tag
wrap it in a div ;-)
and apply the col-xs-4 class to that @patleezy
same for the col-xs-8 class you attached to the h2 element. It should also be a wrapper div wich has the class
Patrick
@patleezy
Nov 02 2015 02:11
@DDaems okay let me try
@DDaems thanks for the tip - it worked :) didn't realize the divs needed the classes
CamperBot
@camperbot
Nov 02 2015 02:12
patleezy sends brownie points to @ddaems :sparkles: :thumbsup: :sparkles:
:star: 92 | @ddaems | http://www.freecodecamp.com/ddaems
Ray Meibaum
@raymeibaum
Nov 02 2015 02:18
array = array.filter(function(val) {

  return val % 2 === 0;

});
Can someone explain what is happening here?
DJ
@qualitymanifest
Nov 02 2015 02:19
@raymeibaum see my response in the main chat
Dieter Daems
@DDaems
Nov 02 2015 02:20
@raymeibaum The % (remainder operator) returns the remainder left over when one operand is divided by a second operand
Jeremy Roe
@jeremyroe
Nov 02 2015 02:20
@raymeibaum It appears they are trying to set a varibale array which is a reserved word if I’m not mistaken - beyond that it’s passing in each array item through a function that devices the val by 2 and returns any that have no remainder
@raymeibaum scratch my first comment - It’s merely updating the array
but the 2nd part of my comment still applies if I’m not off
Ray Meibaum
@raymeibaum
Nov 02 2015 02:23
val % 2 === 0; is filtering out odd numbers but i'm not sure how
I'm still confused by the triple ===
DJ
@qualitymanifest
Nov 02 2015 02:23
% is modulo. gives you remainders after dividing. === means equal to and equal type. it's a comparison
Dieter Daems
@DDaems
Nov 02 2015 02:23
== would suffice here too
'0' == 0 : true
'0' === 0 : false
'0' = str
0 = int
Ray Meibaum
@raymeibaum
Nov 02 2015 02:26
got it... in the lesson i'm supposed to filter through an array and filter out numbers greater than 5 would that just be return val > 5 == 0?
DJ
@qualitymanifest
Nov 02 2015 02:26
@raymeibaum you don't need a comparison there
you want to return val less than 5
Ray Meibaum
@raymeibaum
Nov 02 2015 02:27
oh that makes more sense because you're basically making a new array with those values... sorry just had a doh moment lol
thanks all
CamperBot
@camperbot
Nov 02 2015 02:27
if you want to thank someone, put an @ before their name!
Ray Meibaum
@raymeibaum
Nov 02 2015 02:28
thanks @qualitymanifest @DDaems
CamperBot
@camperbot
Nov 02 2015 02:28
raymeibaum sends brownie points to @qualitymanifest and @ddaems :sparkles: :thumbsup: :sparkles:
:star: 320 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
:star: 93 | @ddaems | http://www.freecodecamp.com/ddaems
Ray Meibaum
@raymeibaum
Nov 02 2015 02:28
thanks @jeremyroe
CamperBot
@camperbot
Nov 02 2015 02:28
raymeibaum sends brownie points to @jeremyroe :sparkles: :thumbsup: :sparkles:
:star: 250 | @jeremyroe | http://www.freecodecamp.com/jeremyroe
rselover
@rselover
Nov 02 2015 02:36
@alanbuchanan thanks for all the help
CamperBot
@camperbot
Nov 02 2015 02:36
rselover sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 480 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
rselover
@rselover
Nov 02 2015 02:36
Here's my code -

function destroyer(arr) {
numstoflt=Array.prototype.slice.call(arguments,1);

function inarr(x){
if (x.indexOf(numstoflt)!==-1){
return true;
}else{
return false;
}
}

fa=arr.filter(inarr);
}

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

"x" is an array, so indexOf is throwing an error
should I convert it to a list or something?
Rex Schrader
@SaintPeter
Nov 02 2015 02:37
@rselover ok, the problem is that x is NOT an array. x is an element of an array
@rselover You need to SEARCH for x
rselover
@rselover
Nov 02 2015 02:37
AH yes agreed
Rex Schrader
@SaintPeter
Nov 02 2015 02:38
@rselover so x is going to go: .indexOf(x)
rselover
@rselover
Nov 02 2015 02:38
so flt.indexOf(x)
?
Rex Schrader
@SaintPeter
Nov 02 2015 02:38
@rselover The question is: What is .indexOf going to search?
Rory Smith
@alanbuchanan
Nov 02 2015 02:38
@rselover i've got to shoot but give me a shout when you get your answer
Rex Schrader
@SaintPeter
Nov 02 2015 02:38
@rselover numstoflt I think
rselover
@rselover
Nov 02 2015 02:39
@alanbuchanan copy that, will do
@SaintPeter is there an elegant way to post code or just let 'er rip?
Rex Schrader
@SaintPeter
Nov 02 2015 02:41
@rselover There is:
wiki format
CamperBot
@camperbot
Nov 02 2015 02:41

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Rex Schrader
@SaintPeter
Nov 02 2015 02:41
@rselover The tricky bit is the backticks, they're near the 1 key, and shift-enter to get you new lines
SaintPeter @SaintPeter humms "He's an rse lover . . he'll get a hold on you, believe it"
rselover
@rselover
Nov 02 2015 02:43
after I posted the backticks I couldn't submit? dur
Rex Schrader
@SaintPeter
Nov 02 2015 02:43
Uh
odd
I do it about 50 times a day :D
rselover
@rselover
Nov 02 2015 02:43
function destroyer(arr) {
  numstoflt=Array.prototype.slice.call(arguments,1);

  function inarr(x){
    if (numstoflt.indexOf(x)!==-1){
    return true;
  }else{
   return false;
  }
} 


  fa=arr.filter(inarr);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
LIKE A BOSS
Rex Schrader
@SaintPeter
Nov 02 2015 02:44
@rselover One last thing . . you need to return your new array :D
or just return arr.filter
rselover
@rselover
Nov 02 2015 02:45
what about "return false"?
Rex Schrader
@SaintPeter
Nov 02 2015 02:45
@rselover Also, and this is just a style thing, but I have no idea what numstoflt is supposed to mean. Might want to rename it or at least use camelCase
@rselover Nope - two different things. The true/false are for the filter callback.
rselover
@rselover
Nov 02 2015 02:45
OHHH
Rex Schrader
@SaintPeter
Nov 02 2015 02:45
@rselover You still need to return your answer from the destroyer function proper
Wheels within wheels
rselover
@rselover
Nov 02 2015 02:46

```function destroyer(arr) {
numstoflt=Array.prototype.slice.call(arguments,1);

function inarr(x){
if (numstoflt.indexOf(x)!==-1){
return true;
}else{
return false;
}
}

fa=arr.filter(inarr);
return fa;
}

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

dag, wiki didn't work
Rex Schrader
@SaintPeter
Nov 02 2015 02:47
@rselover You need a soft linebreak after the ```
rselover
@rselover
Nov 02 2015 02:47
so fa = [2,3,2,3] which is kind of the opposite of what i want
Rex Schrader
@SaintPeter
Nov 02 2015 02:47
@rselover === -1
rselover
@rselover
Nov 02 2015 02:48
and thusly I reversed the logic in the function and....
Screen Shot 2015-11-01 at 7.48.01 PM.png
Rex Schrader
@SaintPeter
Nov 02 2015 02:48
Shazam!
rselover
@rselover
Nov 02 2015 02:49
Many many many thanks for your support. Definitely the hardest challenge so far for me.
CamperBot
@camperbot
Nov 02 2015 02:49
if you want to thank someone, put an @ before their name!
rselover
@rselover
Nov 02 2015 02:49
@SaintPeter thanks
CamperBot
@camperbot
Nov 02 2015 02:49
rselover sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 1342 | @saintpeter | http://www.freecodecamp.com/saintpeter
rselover
@rselover
Nov 02 2015 02:49
@alanbuchanan thanks
(do these brownie points count for anything?)
Rex Schrader
@SaintPeter
Nov 02 2015 02:49
@rselover Huh, camperbot must not love him
@rselover Just internet bragging rights
rselover
@rselover
Nov 02 2015 02:49
yah camperbot is a fickle mistress
Rex Schrader
@SaintPeter
Nov 02 2015 02:49
@rselover and they keep your streak going
@rselover Thank him again :D
CamperBot
@camperbot
Nov 02 2015 02:49
saintpeter sends brownie points to @rselover :sparkles: :thumbsup: :sparkles:
:star: 205 | @rselover | http://www.freecodecamp.com/rselover
Rex Schrader
@SaintPeter
Nov 02 2015 02:50
thanks @alanbuchanan
CamperBot
@camperbot
Nov 02 2015 02:50
saintpeter sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:star: 481 | @alanbuchanan | http://www.freecodecamp.com/alanbuchanan
rselover
@rselover
Nov 02 2015 02:50
rad. @alanbuchanan thanks
CamperBot
@camperbot
Nov 02 2015 02:50
rselover sends brownie points to @alanbuchanan :sparkles: :thumbsup: :sparkles:
:warning: rselover already gave alanbuchanan points
Rex Schrader
@SaintPeter
Nov 02 2015 02:50
@rselover Huh, I guess it registered but didn't display
@rselover Anyway, best of luck!
rselover
@rselover
Nov 02 2015 02:50
Oh snap, got the yield sign. OK, got to get the house in order, I'd love to catch up some more another time
l8r
Ever
@EverFlores
Nov 02 2015 03:01
I working on way point:Nest an Anchor Element within a Paragraph
The one test that failed was "Your p element should have the text "View more" (with a space after it). <p> View more
<a href="http://www.freecatphotoapp.com"> cat photos. </a></p>
Grateful2015
@Grateful2015
Nov 02 2015 03:03
Your p element should have the text "View more " (with a space after it).
<p><a href="http://www.freecatphotoapp.com">cat photos</a></p>
<p><b>View more cat photos</b></p>
Dieter Daems
@DDaems
Nov 02 2015 03:04
<p> View more <a href="http://www.freecatphotoapp.com">cat photos. </a></p>
Rex Schrader
@SaintPeter
Nov 02 2015 03:04
@EverFlores You've got a period after photos
Dieter Daems
@DDaems
Nov 02 2015 03:04
@SaintPeter i didn't even notice that xD
Grateful2015
@Grateful2015
Nov 02 2015 03:04
Can someone help. Not sure what I am doing wrong.thank
CamperBot
@camperbot
Nov 02 2015 03:04
if you want to thank someone, put an @ before their name!
Ever
@EverFlores
Nov 02 2015 03:04
I removed the period and still stuck.
I still getting the same error. after: <p> View more <a href="http://www.freecatphotoapp.com">cat photos </a></p>
Ian Barker
@IanBarkerDev
Nov 02 2015 03:10
@EverFlores Can you paste your code?
Ever
@EverFlores
Nov 02 2015 03:11
@Malical Here is my code: <p> View more <a href="http://www.freecatphotoapp.com">cat photos </a></p>
Herman Fassett
@HermanFassett
Nov 02 2015 03:12
Remove space after photos?
Ever
@EverFlores
Nov 02 2015 03:14
@HermanFassett I removed the space and still have the error.
Michael Cheung
@m6cheung
Nov 02 2015 03:14
@EverFlores which waypoint is this?
Herman Fassett
@HermanFassett
Nov 02 2015 03:14
Hmm, make sure to remove all things that it doesn't want such as a space before View etc
Michael Cheung
@m6cheung
Nov 02 2015 03:15
@EverFlores you need a space after View more
Ever
@EverFlores
Nov 02 2015 03:15
I got it to work my code had to be right after the image not at the end of the last paragraph.
Michael Cheung
@m6cheung
Nov 02 2015 03:16
<p> View more <a href="http://www.freecatphotoapp.com">cat photos </a></p>
Ever
@EverFlores
Nov 02 2015 03:16
Thanks for the assist guys.
CamperBot
@camperbot
Nov 02 2015 03:16
if you want to thank someone, put an @ before their name!
Herman Fassett
@HermanFassett
Nov 02 2015 03:17
;P
Dieter Daems
@DDaems
Nov 02 2015 03:29
Is there no option to edit or remove a social media account?
Jeremy Roe
@jeremyroe
Nov 02 2015 03:31
Anyone have any pointers on what you ended up doing for the pomodoro zipline animation? I’m finding tons of options but many or complex CSS animations and such
bruglesco
@bruglesco
Nov 02 2015 03:36
whats wrong with complex?
Im trying to learn how to do complex myself
Jeremy Roe
@jeremyroe
Nov 02 2015 03:37
nothing wrong with complex but css animations is a fairly deep topic that I was trying to avoid getting into just yet
figured I’d stick to JS and / or JQuery for this particular project - was just curious how others had addressed it
might be I need to take a few days and dig into it
Jeremy Roe
@jeremyroe
Nov 02 2015 03:39
cool that should be a good start - thanks @bruglesco
CamperBot
@camperbot
Nov 02 2015 03:39
jeremyroe sends brownie points to @bruglesco :sparkles: :thumbsup: :sparkles:
:star: 220 | @bruglesco | http://www.freecodecamp.com/bruglesco
bruglesco
@bruglesco
Nov 02 2015 03:40
I cant say your wrong to want to avoid css animations
they do seem a bit tricksy
vere perrot
@perrot
Nov 02 2015 03:47
Hello,

Hello,
I test my app locally by running this command.
$ heroku local

forego | starting web.1 on port 8080
web.1  | The magic happens on port 8080
web.1  | events.js:141

I don't know what's the problem. Any suggestion?
Can I see the details of problem?

vere perrot
@perrot
Nov 02 2015 03:52
@perrot ?
@perrot :) I got it. I start two node js server in a system. First I have to shutdown one "node server". Then "heroku local" node js server will work well.
Steven Parker
@Philosophist
Nov 02 2015 04:19
Why doesn't my css modification of .btn make any changes to the border? http://codepen.io/Philosophist/pen/GpGqXN
rselover
@rselover
Nov 02 2015 04:20
anyone here open to some quick advice about an 'if' ?
Ademola Adegbuyi
@ooade
Nov 02 2015 04:21
@Philosophist add this border: 2px solid black !important;
DJ
@qualitymanifest
Nov 02 2015 04:22
@rselover sure what's up
Ademola Adegbuyi
@ooade
Nov 02 2015 04:22
By adding !importantit overrides bootstrap default btn class
rselover
@rselover
Nov 02 2015 04:23
@qualitymanifest for some reason, this 'if' won't enter the 'true' routine
function where(arr, num) {
  aa=arr.sort();
  nn=num;
  al=arr.length;
  for (i=0;i<arr.length;i++){
    if (nn<aa[i]){
      h=aa.splice(i,0,nn);
      f=i;
    }else{
      h=aa.splice(i+1,0,nn);
      f=i+1;
    }
  return f;
}
}
where([40, 60], 50);
CamperBot
@camperbot
Nov 02 2015 04:23
:bulb: to format code use backticks! ``` more info
rselover
@rselover
Nov 02 2015 04:24
dag, goofed on backticks, but you get the idea
nn is totally < it's not looping through the for loop is my guess
Herman Fassett
@HermanFassett
Nov 02 2015 04:25
You can edit your previous messages you know
rselover
@rselover
Nov 02 2015 04:25
@HermanFassett n00b here, no I didn't know
Herman Fassett
@HermanFassett
Nov 02 2015 04:26
:P well now you know :D
rselover
@rselover
Nov 02 2015 04:26
@HermanFassett thanks for not pwn'ing me (I have no idea what that message actually means but I know it's something adolescent gamers say to one another)
CamperBot
@camperbot
Nov 02 2015 04:26
rselover sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 507 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
DJ
@qualitymanifest
Nov 02 2015 04:27
@rselover well the first problem i see is that you have a lot of variables that are never initialized - h, i, and f
also, just on a readability note, it's helpful to give more descriptive variable names
Herman Fassett
@HermanFassett
Nov 02 2015 04:28
@rselover btw you can just return i at some point instead of splicing... even easier to push num into arr, sort numerically and then return the indexof num
Yeah more descriptive var names, not sure why you make al and then use array.length in the next line
rselover
@rselover
Nov 02 2015 04:29
@HermanFassett @qualitymanifest Sorry, Matlabber here, I like to print variables to see what they're doing, so I get a little sloppy in java world
Herman Fassett
@HermanFassett
Nov 02 2015 04:29
javascript* :P
java is to javascript what car is to carpet
Also all input arrays should be sorted already, and that sort at the beginning might mess them up because it's alphabetical, not numerical
rselover
@rselover
Nov 02 2015 04:33
@HermanFassett ummm... ok I'll take your word for javascript; input arrays aren't sorted in this Bonfire methinks...
Bonfire where do i belong
CamperBot
@camperbot
Nov 02 2015 04:33

: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

Herman Fassett
@HermanFassett
Nov 02 2015 04:33
it says a sorted array so I think they are
But if you do want to sort numerically you should do
arr = arr.sort(function(a,b) {return a-b});
rselover
@rselover
Nov 02 2015 04:34

From Desc "Return the lowest index at which a value (second argument) should be inserted into an array (first argument) once it has been sorted.

For example, where([1,2,3,4], 1.5) should return 1 because it is greater than 1 (index 0), but less than 2 (index 1).

Likewise, where([20,3,5], 19) should return 2 because it is less than 20 (index 2) and greater than 5 (index 1)."

Herman Fassett
@HermanFassett
Nov 02 2015 04:34
Hmm maybe they changed it
rselover
@rselover
Nov 02 2015 04:35
nevertheless what I'm really focused on is why the for loop isn't progressing
I tried declaring i and no dice
Herman Fassett
@HermanFassett
Nov 02 2015 04:36
It's because you're returning f after the first time
You need return f outside the for loop
Jen Barney
@snazzy4razzy
Nov 02 2015 04:36
help! how do I add an i element with classes?
CamperBot
@camperbot
Nov 02 2015 04:36
no wiki entry for: how do i add an i element with classes
:pencil: click here to create one now!after creating your page type update to reload it here
Herman Fassett
@HermanFassett
Nov 02 2015 04:36
?
Explain more @snazzy4razzy
CamperBot
@camperbot
Nov 02 2015 04:36
no wiki entry for: more @snazzy4razzy
:pencil: click here to create one now!after creating your page type update to reload it here
Jen Barney
@snazzy4razzy
Nov 02 2015 04:37
"Add an i element with the classes fa and fa-thumbs-up"
h4r1m4u
@h4r1m4u
Nov 02 2015 04:37

@Philosophist instead of importing the bootstrap CSS file in the HTML section of your project

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">

add it in the Settings > CSS section. if you link in the HTML like you did, the bootstrap CSS will be loaded AFTER your project CSS and hence will override any style declaration you make in it. by adding it in the Settings, your own CSS will load last and any changes to the bootstrap classes you make in it will work as you expect.
avoid using the !important declaration as somebody else recommended you. that should only be your very last resort if all else fails

rselover
@rselover
Nov 02 2015 04:38
@HermanFassett makes sense
h4r1m4u
@h4r1m4u
Nov 02 2015 04:38
@snazzy4razzy <i class="some-class"></i>
Jen Barney
@snazzy4razzy
Nov 02 2015 04:38
@h4r1m4u thanks!
CamperBot
@camperbot
Nov 02 2015 04:38
snazzy4razzy sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 475 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Steven Parker
@Philosophist
Nov 02 2015 04:45
@h4r1m4u
@h4r1m4u Thanks, that is a big help.
CamperBot
@camperbot
Nov 02 2015 04:46
philosophist sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 476 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 02 2015 04:46
@Philosophist my pleasure
Steven Parker
@Philosophist
Nov 02 2015 04:47
@marhyorh Thanks. Also good to keep in mind.
CamperBot
@camperbot
Nov 02 2015 04:47
philosophist sends brownie points to @marhyorh :sparkles: :thumbsup: :sparkles:
:star: 318 | @marhyorh | http://www.freecodecamp.com/marhyorh
rselover
@rselover
Nov 02 2015 04:47
@HermanFassett got it, thanks!
CamperBot
@camperbot
Nov 02 2015 04:47
rselover sends brownie points to @hermanfassett :sparkles: :thumbsup: :sparkles:
:warning: rselover already gave hermanfassett points
Herman Fassett
@HermanFassett
Nov 02 2015 04:47
Yay good work
rselover
@rselover
Nov 02 2015 04:49
Yikes - RE CodePen assuming free account is OK?
Gerard Garoian
@GGaroian
Nov 02 2015 04:51
Hey everyone, good evening
rselover
@rselover
Nov 02 2015 04:52
dur video shows that it's OK
Herman Fassett
@HermanFassett
Nov 02 2015 04:54
Not sure what you mean, codepen free is just fine
rselover
@rselover
Nov 02 2015 04:56
@HermanFassett If I had just watched the video I would have answered my own question.

followdirections ;)

Herman Fassett
@HermanFassett
Nov 02 2015 04:56
:P
Christine Cole
@netwerk19
Nov 02 2015 05:05

Problem with Waypoint 37. I'm pretty sure that I entered the right code in the style element, but I'm doing something wrong when trying to assign the class. Here's my 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;
}

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

.smaller-image {
width: 100px;
}

.gray-background {

  background-color: gray;

}

</style>

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

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

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

<div>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
</div>

<form action="/submit-cat-photo">
<label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
<label><input type="radio" name="indoor-outdoor"> Outdoor</label>
<label><input type="checkbox" name="personality" checked> Loving</label>
<label><input type="checkbox" name="personality"> Lazy</label>
<label><input type="checkbox" name="personality"> Energetic</label>
<input type="text" placeholder="cat photo URL" required>

Maybe should have done this:

http://freecodecamp.com/challenges/waypoint-give-a-background-color-to-a-div-element#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%20%20%0A%20%20.gray-background%20%7B%0A%0A%E2%80%89%E2%80%89background-color%3A%20gray%3B%0A%0A%7D%0A%20%20%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%3Cdiv%3E%0A%20%20%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%3C%2Fdiv%3E%0A%0A%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%20checked%3E%20Indoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%20checked%3E%20Loving%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Energetic%3C%2Flabel%3E%0A%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%3C%2Fform%3E%0A

Chad Nickle
@FineBlend
Nov 02 2015 05:09

@netwerk19 Thry this:

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

Is that the part you are having trouble with?

Christine Cole
@netwerk19
Nov 02 2015 05:09
No, the gray background
Bryan Hatton
@bryan-hatton
Nov 02 2015 05:10
Have you tried <div class="gray-background"> ?
Christine Cole
@netwerk19
Nov 02 2015 05:11
No, I haven't. I will now.
polston
@polston
Nov 02 2015 05:13
Are the jQuery exercises supposed to give me a blank prompt every time? Or is the stuff from the previous exercise supposed to carry over?
Christine Cole
@netwerk19
Nov 02 2015 05:14
@bryan-hatton It didn't work. Does the code in the style element look correct?
Bryan Hatton
@bryan-hatton
Nov 02 2015 05:16
No actually, for the link you posted, the 'background-color: grey;' has to be properly indented
Chad Nickle
@FineBlend
Nov 02 2015 05:18
@netwerk19 Like this:
  .gray-background {
    background-color: gray;
  }
Christine Cole
@netwerk19
Nov 02 2015 05:19
Okay, I fixed that. I worry so much that the code is right that I forget to check that.
Christine Cole
@netwerk19
Nov 02 2015 05:22
@FineBlend so that looks good, but I'm still having trouble assigning the class to my div element
Jen Barney
@snazzy4razzy
Nov 02 2015 05:23
I need to next each of my radio buttons inside its own div with the class col-xs-6 This is what I have its not right...help? <label><input class="col-xs-6" type="radio" name="indoor-outdoor"> Indoor</label>
Levi Jony
@GerbilWarfare
Nov 02 2015 05:23
if .length works with strings in an array, what you i use for numbers with in an array?
Chad Nickle
@FineBlend
Nov 02 2015 05:24
@netwerk19 You need to assign in withing your <div> like this:
  <div class="gray-background">
  <p>Things cats love:</p>
Hans van Riet
@hansinla
Nov 02 2015 05:24
@kevindewbrown if you use a construct like var speed = 100; you make that var private in your Object. If you construct a function with this. then it’s public.
Christine Cole
@netwerk19
Nov 02 2015 05:25
I thought I tried that, maybe not. I'll check it.
Chad Nickle
@FineBlend
Nov 02 2015 05:25
@netwerk19 yeah, the code you posted above didn't have the class assigned yet
Christine Cole
@netwerk19
Nov 02 2015 05:26
@FineBlend okay, it worked. Thank you for keeping me from screaming...lol....
CamperBot
@camperbot
Nov 02 2015 05:26
netwerk19 sends brownie points to @fineblend :sparkles: :thumbsup: :sparkles:
:star: 123 | @fineblend | http://www.freecodecamp.com/fineblend
Kevin Brown
@kevindewbrown
Nov 02 2015 05:28
@hansinla thanks I lot I still don't get it fully, but I understand what you are saying
CamperBot
@camperbot
Nov 02 2015 05:28
kevindewbrown sends brownie points to @hansinla :sparkles: :thumbsup: :sparkles:
:star: 565 | @hansinla | http://www.freecodecamp.com/hansinla
Chad Nickle
@FineBlend
Nov 02 2015 05:29
@netwerk19 No problem, you will screM MANY, MANY TIMES in this journey ;-)
Christine Cole
@netwerk19
Nov 02 2015 05:30
@FineBlend lol, I'll warn the neighbors. It seems like I'll cruise along for a bit, then there comes the brick wall.
Hans van Riet
@hansinla
Nov 02 2015 05:30
@kevindewbrown speed and the function addUnit need to be private, so declare it with the var construction, getSpeedneeds to be public so there you use this.
Levi Jony
@GerbilWarfare
Nov 02 2015 05:31
@hansinla could you help me with using the .filter on my constructor functions? i have been banging my head against this one for a couple days now and can't seem to wrap my head around how to write a statement that would only return numbers in my array that are lower than 5.
Hans van Riet
@hansinla
Nov 02 2015 05:31
@GerbilWarfare yes, show your code.
Levi Jony
@GerbilWarfare
Nov 02 2015 05:32

``` var oldArray = [1,2,3,4,5,6,7,8,9,10];

// Only change code below this line.

var newArray = oldArray.filter(function(val) {
return val.length + 1 ;
});

// Only change code above this line.

(function() { return newArray; })();
```

obvioulsy this won't owork
because length is for strings
h4r1m4u
@h4r1m4u
Nov 02 2015 05:34
@GerbilWarfare you need to change this return val.length + 1 ;, i told you last night it was just an example. how can you compare val against number 5? what would the expression look like?
Hans van Riet
@hansinla
Nov 02 2015 05:34
@GerbilWarfare You’re right, you can just use return (val <= 5); but you don’t return the new array so the test will always fail. Which waypoint is this?
Levi Jony
@GerbilWarfare
Nov 02 2015 05:40
@h4r1m4u yes and i appreciate that, it forced me do do some more reading to better understand constructor functions. i guess there is the disconnect of not entirely having a strong grasp on syntax yet. i did go back and review those waypoints but it seems i am still lacking some important understanding along the way.
@hansinla its the way point in BAsic object programming using the .filter
h4r1m4u
@h4r1m4u
Nov 02 2015 05:42
@GerbilWarfare in that case reviewing the comparison operators might be helpful: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
Levi Jony
@GerbilWarfare
Nov 02 2015 05:44
@h4r1m4u thank you so much for your patience and help
CamperBot
@camperbot
Nov 02 2015 05:44
gerbilwarfare sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 477 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
h4r1m4u
@h4r1m4u
Nov 02 2015 05:44
you're not really using a constructor function in this waypoint. you just pass a callback function to the filter function that evaluates each element of the array you run the filter on against some condition and decides whether the value should be included in the new array that the filter generates
the filter will return all elements of the array for which the callback function evaluates to true
in your case, you need to compare the element to number 5
Hans van Riet
@hansinla
Nov 02 2015 05:45
@GerbilWarfare Okay, then you’re almost there with the hint I gave you.
Levi Jony
@GerbilWarfare
Nov 02 2015 05:46

@h4r1m4u oh okay, but doesnt

 var newArray

create a new array much like a constructor function creates a new object?

h4r1m4u
@h4r1m4u
Nov 02 2015 05:47
i wouldn't call it a constructor function in this case. the filter function returns an array, which you assign or save into the newArray variable
Levi Jony
@GerbilWarfare
Nov 02 2015 05:47
@hansinla it worked like a charm, i think i just need to put more time into comparison operator like @h4r1m4u mentioned. thanks for the help
CamperBot
@camperbot
Nov 02 2015 05:47
gerbilwarfare sends brownie points to @hansinla and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 566 | @hansinla | http://www.freecodecamp.com/hansinla
:warning: gerbilwarfare already gave h4r1m4u points
Jen Barney
@snazzy4razzy
Nov 02 2015 05:50
How do I apply the class text-pimary to an h3 element? I cannot remember
Hans van Riet
@hansinla
Nov 02 2015 05:52
@snazzy4razzy <h3 class=“name_of_your_class”>
h4r1m4u
@h4r1m4u
Nov 02 2015 05:52
@snazzy4razzy or you could go back to the waypoint that taught you to give classes to HTML elements and review that material
Jen Barney
@snazzy4razzy
Nov 02 2015 05:53
@hansinla thank you! @h4r1m4u Thank you!....Yes I need to review...i do this in my spare time for 2 hours a day and this is the 4th day and I LOVE IT! But can't remember sometimes.
CamperBot
@camperbot
Nov 02 2015 05:53
snazzy4razzy sends brownie points to @hansinla and @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 567 | @hansinla | http://www.freecodecamp.com/hansinla
:star: 478 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
Hans van Riet
@hansinla
Nov 02 2015 05:53
@h4r1m4u Agreed this should be second nature.
h4r1m4u
@h4r1m4u
Nov 02 2015 05:53
@snazzy4razzy it's two clicks away. probably faster than asking here, actually :)
Jen Barney
@snazzy4razzy
Nov 02 2015 05:54
Thanks!
CamperBot
@camperbot
Nov 02 2015 05:54
if you want to thank someone, put an @ before their name!
Alfonso Giron
@alfonsogiron10
Nov 02 2015 06:02
This Zipline Portfolio assignment is looking dang near impossible
Just glanced at the "Fork'... that code is so deep and intricate, don't know how I would pull that off from scratch on my own
This being my first real html/css project ever
h4r1m4u
@h4r1m4u
Nov 02 2015 06:08
@alfonsogiron10 if you use bootstrap, it'll help you a lot even if it'll take away some of the learning you'd get if you coded everything from scratch. bootstrap is extremely well documented and there are tons of tutorials online too, so you should be able to put it together. it'll be tough if you're completely new to it, but it's doable. break it into smaller blocks, work on each section of the site individually - start with the header and the navigation menu, then move onto the about/introduction section, then the projects portfolio, etc. by breaking it into smaller tasks, you'll feel less overwhelmed
Amardeep
@Amardeep91
Nov 02 2015 06:08
hey friends
Roger8
@Roger8
Nov 02 2015 06:08
hello ,everyone
Amardeep
@Amardeep91
Nov 02 2015 06:08
i get error in ruby on rails when i type rails server
anyone knows abt it?
RebelWoman
@RebelWoman
Nov 02 2015 06:09
Hello @Roger8
Roger8
@Roger8
Nov 02 2015 06:10
i got an error when i change the inline style to style element
RebelWoman
@RebelWoman
Nov 02 2015 06:10
hello @Amardeep91
Amardeep
@Amardeep91
Nov 02 2015 06:10
hello @RebelWoman
Roger8
@Roger8
Nov 02 2015 06:11
it says that "$ is not defined" while clicking " Run tests"
YI JIANG
@meet999
Nov 02 2015 06:36

var Car = function() {
// this is a private variable
var gear = 1;
// this is a private function (also known as a private method)
function addStyle(styleMe){
return 'The Current Gear Is: ' + styleMe;
}
// this is a public method
this.getGear = function() {
return addStyle(this.gear);
};

};

var Bike = function() {

// Only change code below this line.
this.getSpeed() =
speed = 100;

function addUnit(value) {
return value + "KM/H";
}

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

};

// Only change code above this line.

var myCar = new Car();

var myBike = new Bike();

if(myBike.hasOwnProperty('getSpeed')){(function() {return JSON.stringify(myBike.getSpeed());})();}

bruglesco
@bruglesco
Nov 02 2015 06:37
wiki format
CamperBot
@camperbot
Nov 02 2015 06:37

:point_right: format @meet999 [wiki]

function welcomeToBooleans() {

// Only change code below this line.

return false;

// Only change code above this line.
}

welcomeToBooleans() {

return true
;
}

:pencil: read more about format @meet999 on the FCC Wiki

YI JIANG
@meet999
Nov 02 2015 06:38
how to do this The method getSpeed of myBike should be accessible outside the object.?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:43
@meet999 do you really need help or you wanna waste other's time this time?
YI JIANG
@meet999
Nov 02 2015 06:43
why u are everywhere
Ankur Singh
@Ankurlvv
Nov 02 2015 06:43
Bonfire: Seek and Destroy
what's the argument object is ?? i don't understand
CamperBot
@camperbot
Nov 02 2015 06:43
Sorry, can't find a bonfire called seek and destroy whats the argument object is i dont understand. [ Check the map? ]
YI JIANG
@meet999
Nov 02 2015 06:43
u make me nervous
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:44
explain arguments
CamperBot
@camperbot
Nov 02 2015 06:44

:point_right: bonfire arguments optional [wiki]

Explanation:

It can be quite complicated to understand what needs to be done. There is always many ways to do something when coding but regardless of the algorithm used, we have to create a program that does the following:

  • It has to add two numbers passed as parameters and return the sum.
  • It has to check if any of the numbers are actual numbers, otherwise return undefined and stop the program right there.
  • It has to check if it has one or two arguments passed. More re ignored.
  • If it has only one then it has to return a function that used that number and expects another one, to then add it.

:pencil: read more about bonfire arguments optional on the FCC Wiki

Akira Laine
@AkiraLaine
Nov 02 2015 06:46
What is your problem? @meet999
YI JIANG
@meet999
Nov 02 2015 06:46
@abhisekp function (bla,bla) bla bla is agrgument
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:46
@Ankurlvv arguments object is an array-like object which stores the values passed as parameter of a function
Ankur Singh
@Ankurlvv
Nov 02 2015 06:46
thanks @camperbot
CamperBot
@camperbot
Nov 02 2015 06:46
ankurlvv sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
:star: 476 | @camperbot | http://www.freecodecamp.com/camperbot
Akira Laine
@AkiraLaine
Nov 02 2015 06:47
/about
CamperBot
@camperbot
Nov 02 2015 06:47
you need to ask about @someone!
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:47
about @meet999
CamperBot
@camperbot
Nov 02 2015 06:47
:star: 18 | @meet999 | http://www.freecodecamp.com/meet999
Akira Laine
@AkiraLaine
Nov 02 2015 06:47
/about @akiralaine
CamperBot
@camperbot
Nov 02 2015 06:47
:star: 478 | @akiralaine | http://www.freecodecamp.com/akiralaine
Akira Laine
@AkiraLaine
Nov 02 2015 06:47
I still have more points than CamperBot :P
Ankur Singh
@Ankurlvv
Nov 02 2015 06:47
@abhisekp this is the definition..
i wanna know how it works??
YI JIANG
@meet999
Nov 02 2015 06:47
33.png
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:47
@Ankurlvv it works like arrays! bcoz it's array-like but it doesn't have any array methods
var param1 = arguments[0]
Akira Laine
@AkiraLaine
Nov 02 2015 06:48
@meet999 Here is the answer:
this.getSpeed = function(){
  ...code...
}
YI JIANG
@meet999
Nov 02 2015 06:49
ok finally working
Ankur Singh
@Ankurlvv
Nov 02 2015 06:49
@abhisekp still not crystal clear what u r trying to say??
could u explain in detail??
YI JIANG
@meet999
Nov 02 2015 06:50
i just dont know what should i write about the code inside of the function
Dieter Daems
@DDaems
Nov 02 2015 06:50
about @meet999
CamperBot
@camperbot
Nov 02 2015 06:50
:star: 18 | @meet999 | http://www.freecodecamp.com/meet999
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:50
@Ankurlvv
function accept() {
    var param1 = arguments[0];
    var param2 = arguments[1];
}

accept(2, 3);
Dieter Daems
@DDaems
Nov 02 2015 06:51
@meet999 it might be wise to first complete the javascript course instead of directly going to the bonfire challenges
Akira Laine
@AkiraLaine
Nov 02 2015 06:52
@meet999 The code inside the function doesn't need to be changed
Ankur Singh
@Ankurlvv
Nov 02 2015 06:52
means param1= 2
param2= 3
@abhisekp
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:52
@Ankurlvv yep! :+1:
Ankur Singh
@Ankurlvv
Nov 02 2015 06:52
@abhisekp thanks buddy
CamperBot
@camperbot
Nov 02 2015 06:52
ankurlvv sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 798 | @abhisekp | http://www.freecodecamp.com/abhisekp
YI JIANG
@meet999
Nov 02 2015 06:54
I finish the javascript last month
now i forget waht i learned
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:55
@meet999 that's very normal. You need to redo them. And read the instructions carefully before asking for help.
YI JIANG
@meet999
Nov 02 2015 06:56
ty i didnt mean to troll\
CamperBot
@camperbot
Nov 02 2015 06:56
:trollface: troll problems? notify admins here
Ankur Singh
@Ankurlvv
Nov 02 2015 06:57
@abhisekp caould u tell what's the benefit of arguments??
Akira Laine
@AkiraLaine
Nov 02 2015 06:57
@Ankurlvv You mean in functions?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 06:58
@Ankurlvv create a function which accepts any number of arguments as params and find the maximum of the numbers passed
Ankur Singh
@Ankurlvv
Nov 02 2015 06:58
Akira Laine
@AkiraLaine
Nov 02 2015 06:59
@Ankurlvv Imagine you have a function that says: Hello "person", you could pass in the name of the person in your function:
greet("Ankurlvv")
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:00
@Ankurlvv
function findMax() {

}

findMax(1, 2, 3);
findMax(88, 66);
findMax(105, 4984, 61, 584, 4884, 49, 61465);
@Ankurlvv since arguments object is array-like, you can iterate on it like an array and find the max. But you can't use any Array methods on it.
Ankur Singh
@Ankurlvv
Nov 02 2015 07:02
@abhisekp this means in findMax all the elements u have put are arguments.
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:03
@Ankurlvv yep!
Yan Kozlovskiy
@YanKozlovskiy
Nov 02 2015 07:03
I have an array: [1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 6, 6, 7, 8, 8] I would like to check if the current index is the changes
I would like to know how to implement a checker
like count how many of each number there are in the array
What I'd like to do is if var[i] === currentPos
Is this the right approach?
RebelWoman
@RebelWoman
Nov 02 2015 07:03
how do you make an h2 element blue
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:03
@Ankurlvv and also you don't know how many params i'm going to pass to the function
Yan Kozlovskiy
@YanKozlovskiy
Nov 02 2015 07:03
is that right?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:04
@YanKozlovskiy sure! like a Map! But it has some limitations which might not apply for numberic keys. So try it.
Ankur Singh
@Ankurlvv
Nov 02 2015 07:05
but if u gonna pass more then 7 params in last findMax function
ain't it gonna be false??
Umar Hayat
@UmarHayatKhan
Nov 02 2015 07:06
class="btn" not working in bootstrap . plz help
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:07
@Ankurlvv whatever you pass, you can capture it using arguments[_]
Any number of arguments!
Parker Mitchell
@RParkerM
Nov 02 2015 07:07
@Ankurlvv nah, you can pass as many as you'd like and iterate through the arguments[] object
Ankur Singh
@Ankurlvv
Nov 02 2015 07:10

no offence guys..
but my mind is kinda stuck i guess...

it's not taking inputs , & i have no idea what so ever..
i know u all are trying ur best to explain it to me..

i think my mind is gonna blow ...aaaaaa

Parker Mitchell
@RParkerM
Nov 02 2015 07:10
@Ankurlvv Sorry I haven't been able to follow your convo so well, are you having trouble with one of the waypoints?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:11
@Ankurlvv pls show ur current code
@RParkerM it's Seek and Destroy bf
Dieter Daems
@DDaems
Nov 02 2015 07:11
@RebelWoman <h2 style="color:blue"> is one way of doing it. Try to read carefully the synopsis with each challenge and let it sink in
also look at the example
Umar Hayat
@UmarHayatKhan
Nov 02 2015 07:12
class="btn" not working in bootstrap . plz help
Parker Mitchell
@RParkerM
Nov 02 2015 07:12
@abhisekp thank you
CamperBot
@camperbot
Nov 02 2015 07:12
rparkerm sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 799 | @abhisekp | http://www.freecodecamp.com/abhisekp
Ankur Singh
@Ankurlvv
Nov 02 2015 07:12
@RParkerM it's bonfire seek n destroy..
@abhisekp i haven't coded it yet
coz kind stuck in arguments
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:13
np!
bf seek
CamperBot
@camperbot
Nov 02 2015 07:13

: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

Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:14
bf details
CamperBot
@camperbot
Nov 02 2015 07:14

: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:
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:14
@Ankurlvv :point_up:
Umar Hayat
@UmarHayatKhan
Nov 02 2015 07:14
class="btn" not working in bootstrap . plz help
Your new button should have the class btn. how it work
?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:14
@UmarHayatKhan link pls
You can paste link in this format [Link Title](http://url.com)
Umar Hayat
@UmarHayatKhan
Nov 02 2015 07:15
http://freecodecamp.com/challenges/waypoint-create-a-bootstrap-button#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20{%0A%20%20%20%20color%3A%20red%3B%0A%20%20}%0A%0A%20%20h2%20{%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20}%0A%0A%20%20p%20{%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20}%0A%0A%20%20.thick-green-border%20{%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20}%0A%0A%20%20.smaller-image%20{%0A%20%20%20%20width%3A%20100px%3B%0A%20%20}%0A%3C%2Fstyle%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Ch2%20class%3D%22red-text%20text-center%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%20%20%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%20%20%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%20%20%3Cimg%20src%3D%22http%3A%2F%2Fbit.ly%2Ffcc-running-cats%22%20class%3D%22img-responsive%22%3E%0A%20%20%20%20%3Cbutton%20type%3D%22button%22%20class%22btn%22%3ELike%3C%2Fbutton%3E%0A%20%20%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%20%20%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Indoor%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Loving%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Crazy%3C%2Flabel%3E%0A%20%20%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%20%20%3C%2Fform%3E%0A%3C%2Fdiv%3E%0A
RebelWoman
@RebelWoman
Nov 02 2015 07:16
In need of some help, how do you make an "h2 element" blue using CSS
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:16
@UmarHayatKhan you missed the = in between the attribute name and the class name!
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:16
@RebelWoman link pls
You can paste link in this format [Link Title](http://url.com)
Umar Hayat
@UmarHayatKhan
Nov 02 2015 07:17
<h2 style="color:Blue">like this</h2>@RebelWoman
thank you @abhisekp
CamperBot
@camperbot
Nov 02 2015 07:18
umarhayatkhan sends brownie points to @abhisekp :sparkles: :thumbsup: :sparkles:
api offline
Dieter Daems
@DDaems
Nov 02 2015 07:18
This message was deleted
jpjenkins
@jpjenkins
Nov 02 2015 07:18
@RebelWoman if you copied it from the side into your code then it will return an error, there are invisible characters copied over that produces an error
@RebelWoman type it in manually and see if it works
CodeBabe
@CodeBabe
Nov 02 2015 07:19
I need help also!!! I've been stuck on #22 for 2 hours. I don't know how to make the cat image 100 pixels wide.
Dieter Daems
@DDaems
Nov 02 2015 07:19
@RebelWoman i think you need <h2>CatPhotoApp</h2> above the <p> tag
@CodeBabe .className { width:100px; }
<img class="className" src="blablah">
RebelWoman
@RebelWoman
Nov 02 2015 07:21
@DDaems thank you that worked
CamperBot
@camperbot
Nov 02 2015 07:21
rebelwoman sends brownie points to @ddaems :sparkles: :thumbsup: :sparkles:
api offline
CodeBabe
@CodeBabe
Nov 02 2015 07:22
Okay, I'll try it.
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:22
i guess FCC is down! or something. Why is it saying api offline?
about @abhisekp
CamperBot
@camperbot
Nov 02 2015 07:22
api offline
Dieter Daems
@DDaems
Nov 02 2015 07:22
@abhisekp maybe its getting updates :P
a vote function :P
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 07:25
Too many cookies killed the sever, maybe? Actually, it better be updates with fancy features.
Bugfixes are boring! Bring out the cowboys, take in the features!
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:28
about @abhisekp
CamperBot
@camperbot
Nov 02 2015 07:28
api offline
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:28
:(
Herlou
@herloub
Nov 02 2015 07:30
Hello! World. I need help. I'm working on jQuery #13 I think I got it. I made the #left-well color red but I can’t move to the next challenge.
CamperBot
@camperbot
Nov 02 2015 07:30

welcome to FreeCodeCamp @herloub!

Dieter Daems
@DDaems
Nov 02 2015 07:30
He went to sleep :-)
@herloub did you use the parent function?
$("#target1").parent().css("background-color", "red");
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:32
@DDaems that's from camperbot but it's unable to access the FCC API
about @DDaems
CamperBot
@camperbot
Nov 02 2015 07:32
api offline
Dieter Daems
@DDaems
Nov 02 2015 07:32
I know, i was just joking ;-)
Abhisek Pattnaik
@abhisekp
Nov 02 2015 07:33
:)
Umar Hayat
@UmarHayatKhan
Nov 02 2015 07:52
How to add I element to the html code
?
http://www.freecodecamp.com/challenges/waypoint-add-font-awesome-icons-to-our-buttons#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20h2%20{%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20}%0A%0A%20%20.thick-green-border%20{%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20}%0A%3C%2Fstyle%3E%0A%0A%3Cdiv%20class%3D%22container-fluid%22%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-8%22%3E%0A%20%20%20%20%20%20%3Ch2%20class%3D%22text-primary%20text-center%22%3ECatPhotoApp%3C%2Fh2%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-4%22%3E%0A%20%20%20%20%20%20%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22img-responsive%20thick-green-border%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%20%20%3Cimg%20src%3D%22http%3A%2F%2Fbit.ly%2Ffcc-running-cats%22%20class%3D%22img-responsive%22%3E%0A%20%20%3Cdiv%20class%3D%22row%22%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-4%22%3E%0A%20%20%20%20%20%0A%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-block%20btn-primary%22%3E%20%3Ci%20class%3D%22fa%22%20class%3D%22%20fa-thumb-up%22%3ELike%3C%2Fi%3E%3C%2Fbutton%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-4%22%3E%0A%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-block%20btn-info%22%3EInfo%3C%2Fbutton%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3Cdiv%20class%3D%22col-xs-4%22%3E%0A%20%20%20%20%20%20%3Cbutton%20class%3D%22btn%20btn-block%20btn-danger%22%3EDelete%3C%2Fbutton%3E%0A%20%20%20%20%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%20%20%3Cp%3EThings%20cats%20%3Cspan%20class%3D%22text-danger%22%3Elove%3A%3C%2Fspan%3E%3C%2Fp%3E%0A%20%20%3Cul%3E%0A%20%20%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%20%20%3C%2Ful%3E%0A%20%20%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%20%20%3Col%3E%0A%20%20%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%20%20%3C%2Fol%3E%0A%20%20%3Cform%20fccfaa%3D%22%2Fsubmit-cat-photo%22%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Indoor%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22radio%22%20name%3D%22indoor-outdoor%22%3E%20Outdoor%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Loving%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Lazy%3C%2Flabel%3E%0A%20%20%20%20%3Clabel%3E%3Cinput%20type%3D%22checkbox%22%20name%3D%22personality%22%3E%20Crazy%3C%2Flabel%3E%0A%20%20%20%20%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%20required%3E%0A%20%20%20%20%3Cbutton%20type%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%0A%20%20%3C%2Fform%3E%0A%3C%2Fdiv%3E%0A
Jahil Khalfe
@cybot1711
Nov 02 2015 08:04
what is this?
Umar Hayat
@UmarHayatKhan
Nov 02 2015 08:04
Sorry
Jahil Khalfe
@cybot1711
Nov 02 2015 08:06
<button class="btn btn-block btn-primary"> <i class="fa fa-thumbs-up"></i>Like</button>
there you go sir
Jahil Khalfe
@cybot1711
Nov 02 2015 08:11
Sorry had to edit
jpjenkins
@jpjenkins
Nov 02 2015 08:13
str.charAt(0).toUpperCase(); - is this viable?
combining the functions like this, are there rules I should know about ? I thought it would work but it doesn't appear to be
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 08:16
It works as long as str is an actual string, either variable or literal string, @jpjenkins.
"myRandumString".charAt(0).toUpperCase(); results in 'M' here in Node for me.
jpjenkins
@jpjenkins
Nov 02 2015 08:16
okay... :/
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 08:18
Chaining is completely OK and a neat way to save some having variables for everything; you just need to keep in mind what returns what, and whether the first returned value is possible to process with the next function and so on.
jpjenkins
@jpjenkins
Nov 02 2015 08:23
yeah that was my problem, it breaks the next sequence. Thanks @SangSatori
CamperBot
@camperbot
Nov 02 2015 08:23
api offline
jpjenkins sends brownie points to @sangsatori :sparkles: :thumbsup: :sparkles:
jpjenkins
@jpjenkins
Nov 02 2015 08:24
While I can understand how to do the bonfire 'title case a sentence', I can't work out how string.charAt(); is used. To me it appears that everything needs to be passed into an array and then that should be checked and modified, then passed back to the string
charAt appears to be redundant yet it hints that is what should be used... just a confirmation that charAt is essential for this bonfire will be enough otherwise I'll go with my possible ham sandwich code
CodeBabe
@CodeBabe
Nov 02 2015 08:27
Please help. I still can not figure this out for #22 and it's going on 3 hours. I put .smaller-image {width: 100px;} in between the "styles" bracket. The statement is "your image should be 100 pixels wide. What am I missing? I got the first part correct which is <img src class="smaller-image">
Jahil Khalfe
@cybot1711
Nov 02 2015 08:28
This message was deleted
jpjenkins
@jpjenkins
Nov 02 2015 08:28
src isn't needed @CodeBabe
<img class = "smaller-image">
Jahil Khalfe
@cybot1711
Nov 02 2015 08:29
correct
jpjenkins
@jpjenkins
Nov 02 2015 08:31
@CodeBabe success?
CodeBabe
@CodeBabe
Nov 02 2015 08:32
That was the only part that worked. The .smaller-image {width: 100px;} didn't work for the second part of the question.
jpjenkins
@jpjenkins
Nov 02 2015 08:32
Paste your code and I'll have a look
CodeBabe
@CodeBabe
Nov 02 2015 08:32
ok

<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;} (this did not work)

</style>

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

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

<img src class="smaller-image"> (this worked only for one part of quest.)

Aleksander Gębicki
@Takumar
Nov 02 2015 08:37
@CodeBabe use your class on existing image. You have <img scr="htt ..."> in your code, but you added class to new <img src... tag.
The last tag won't work because it is not connected to any image (src is empty).
jpjenkins
@jpjenkins
Nov 02 2015 08:37
there you have it
<img src="https://bit.ly/fcc-relaxing-cat" class="smaller-image">
you were close :P
CodeBabe
@CodeBabe
Nov 02 2015 08:38
I'll put it in.
Aleksander Gębicki
@Takumar
Nov 02 2015 08:40
@CodeBabe the browser have to know where to find image it will show you, so src="path_to_image" is necessary, without that <img> tag alone doesn't make sense.
calvinjetton
@calvinjetton
Nov 02 2015 08:44
I realize it's an ungodly hour, but is anyone around to give me feedback on my code?
Jahil Khalfe
@cybot1711
Nov 02 2015 08:45
Yes its morning
calvinjetton
@calvinjetton
Nov 02 2015 08:45
Great! Lemme paste it in...
Okay, so I'm trying to code a function that checks to see if a string is a palindrome. It should return true if it is a palindrome and false if it isn't.
Here's the code:
function palindrome(str) {
var originalString = str;
var reversedString = originalString.toLowerCase();
reversedString = reversedString.replace(/\W/g, "");
reversedString = reversedString.split("");
reversedString = reversedString.reverse();
reversedString = reversedString.join("");
if (originalString === reversedString){
return true;
} else{
return false;
}
}
It works correctly for some strings, but not for others. "eye" and "not a palindrome" work correctly, but "race car" and "A man, a plan, a canal. Panama" do not.
CodeBabe
@CodeBabe
Nov 02 2015 08:48
I'm getting confused. The path that was listed for the answer is still giving me an "X". I'll look over it again in the morning. Thank you for your help.
CamperBot
@camperbot
Nov 02 2015 08:48
if you want to thank someone, put an @ before their name!
jpjenkins
@jpjenkins
Nov 02 2015 08:50
good luck @CodeBabe
your regular expression needs work. Also, you have many lines of code that could be a single line
rember that you can chain functions together using '.'
calvinjetton
@calvinjetton
Nov 02 2015 08:53
I thought that you had to be using jQuery to chain functions?
jpjenkins
@jpjenkins
Nov 02 2015 08:53
nope
CodeBabe
@CodeBabe
Nov 02 2015 08:53
Thank you @jpjenkins .
CamperBot
@camperbot
Nov 02 2015 08:53
codebabe sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
api offline
calvinjetton
@calvinjetton
Nov 02 2015 08:54
Okay. To make sure we're on the same page, can you give me an example of chaining two functions together on the same line?
jpjenkins
@jpjenkins
Nov 02 2015 08:54
str = str.toLowerCase().replace(...);
calvinjetton
@calvinjetton
Nov 02 2015 08:54
Okay, thanks. :)
CamperBot
@camperbot
Nov 02 2015 08:54
if you want to thank someone, put an @ before their name!
jpjenkins
@jpjenkins
Nov 02 2015 08:55
:)
once you do that it will be easier to decypher for other people wanting to help you
otherwise it turns into a bit of a maze of logic
but @calvinjetton, the regular expressions in this one can be quite confusing. Read up w3schools and other resources to get your head around it
Jahil Khalfe
@cybot1711
Nov 02 2015 08:57
True dat RegEx is confusing
calvinjetton
@calvinjetton
Nov 02 2015 08:57
Yeah, that's what I've been doing. From what I've read, using /\W/ should select all non-alphanumeric characters, including punctuation and spaces.
I thought it might not be including the spaces, but I tried putting in a line specifically replacing spaces and it didn't change anything.
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 08:59
Function chaining is possible in plenty of languages (Python, JavaScript, Dart, etc.) and is a really handy thing. jQuery just builds on top of that.
jpjenkins
@jpjenkins
Nov 02 2015 09:00
@calvinjetton regex101.com
you can test your regular expressions there
really helpful
calvinjetton
@calvinjetton
Nov 02 2015 09:01
Ooh, shiny. ^_^
calvinjetton
@calvinjetton
Nov 02 2015 09:10
Okay, I've checked my regular expression, and it seems to be working fine. Could you tell me where you see it needs more work?
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:11

@calvinjetton Speaking of chaning functions, I modified the code you pasted here earlier a bit, so it shows how that can be chained:

function palindrome(string) {
  var reversed = string.toLowerCase().replace(/\W/g, '').split('').reverse().join(''); // chaining functions
  if (string === reversed) {
    return true;
  } else {
    return false;
  }
}

// testing if it works
var word1 = 'elle';
var word2 = 'hello';

console.log(word1 + ' holds ' + palindrome(word1));
console.log(word2 + ' holds ' + palindrome(word2));

When chaining gets in the hand of readability, though... that's surely up for a debate.

calvinjetton
@calvinjetton
Nov 02 2015 09:11
Thanks!
CamperBot
@camperbot
Nov 02 2015 09:11
if you want to thank someone, put an @ before their name!
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:11
I have not done the Palindrome thing myself yet, so I don't know the full extent of the exercise or how it fits in the greater scheme. But the snippet seems to run fine on Node.
jpjenkins
@jpjenkins
Nov 02 2015 09:12
let the butterfly break out of his chrysalis, he won't be strong enough later otherwise :P
calvinjetton
@calvinjetton
Nov 02 2015 09:13
Hey, I'm just asking for a hint. :p
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:13
Oh yes. I just chained the functions to be more compact and tested it -- the code itself already produced the correct results. :)
Ali
@ali-castleford
Nov 02 2015 09:14
hey all any tips for "Filter Arrays with filter" step
I can't seem to solve it :(
calvinjetton
@calvinjetton
Nov 02 2015 09:14
My problem is that it works fine for some strings, but not for others. For example, it returns false for the string "race car", when it should be returning true.
jpjenkins
@jpjenkins
Nov 02 2015 09:15
perhaps it's the .join method
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:16
It seems you might need to account for concatenating the strings together (removing all the spaces), because literal 'race car' is NOT the same as 'rac ecar'.
jpjenkins
@jpjenkins
Nov 02 2015 09:16
don't think it's needed
calvinjetton
@calvinjetton
Nov 02 2015 09:17
@SangSatori, I've got a regular expression that removes all the non-word characters, including spaces.
Here's my modified code:
jpjenkins
@jpjenkins
Nov 02 2015 09:17
also, \W regex doesn't include the _
calvinjetton
@calvinjetton
Nov 02 2015 09:18
function palindrome(string) {
var reversedString = string.toLowerCase().replace(/\W/g, "").split("").reverse().join("");
if (string === reversedString){
return true;
} else{
return false;
}
}
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:18
You can use ``` before and after code to make it format nicely (backticks, below the Esc key).
Rahul Jha
@RJ722
Nov 02 2015 09:19
Hello Everyone I need some help!
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:19
I think what happens is that it produces the correct reversed string now, but it still compares with the original string, with all the spaces still inside.
jpjenkins
@jpjenkins
Nov 02 2015 09:19
@calvinjetton ^
your regex needs work
Rahul Jha
@RJ722
Nov 02 2015 09:19
Whenever I am opening free code camp it is displaying error 502 , its been 2 he's.
jpjenkins
@jpjenkins
Nov 02 2015 09:19
it doesn't remove the underscore
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:20
So you need one more variable, and make the original string, not reversed, without spaces. There might be other ways too, if you want to get 'true' for 'race car'.
Rahul Jha
@RJ722
Nov 02 2015 09:20
Hours*
calvinjetton
@calvinjetton
Nov 02 2015 09:20
@jpjenkins, I think I do need the .join() method because I need to turn it from an array back into a string. Also, nice catch on the _, but I don't think it makes a difference in this case.
jpjenkins
@jpjenkins
Nov 02 2015 09:20
it fails on the last condition
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:20
@RJ722: There was some mention of migration on servers today. That's troubling - guess it's broken for some indeed.
jpjenkins
@jpjenkins
Nov 02 2015 09:21
.split is enough for your string
remove the .join
and the 'var' isn't needed either :)
Rahul Jha
@RJ722
Nov 02 2015 09:22
How much long do you think I need to wait @SangSatori
jpjenkins
@jpjenkins
Nov 02 2015 09:22
@RJ722 it's already been a few hours, the API is down in the chat room also.
perhaps they have a twitter page you can check for updates?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 09:23
@RJ722 they're migrating DNS so it will take some time to spread across the globe.
calvinjetton
@calvinjetton
Nov 02 2015 09:24
Okay, help me understand. I used .split to turn the string into an array, right? Don't I need to use .join to turn the array back into a string so I can compare it with my original input?
Abhisek Pattnaik
@abhisekp
Nov 02 2015 09:24
@calvinjetton oh! sure! :+1:
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:25
I got it to get true on 'race car' here. I mean, I could just show the solution with comments, but--
Rahul Jha
@RJ722
Nov 02 2015 09:25
@jpjenkins @abhisekp thank you :smile:
CamperBot
@camperbot
Nov 02 2015 09:25
rj722 sends brownie points to @jpjenkins and @abhisekp :sparkles: :thumbsup: :sparkles:
api offline
api offline
calvinjetton
@calvinjetton
Nov 02 2015 09:25
Heh, as much as I'd like that, it might not help me learn. ;)
jpjenkins
@jpjenkins
Nov 02 2015 09:26
I've done it completely differently, apologies I didn't look closely
you're almost there though, tidy it up and make a cup of tea
the answer will appear :)
calvinjetton
@calvinjetton
Nov 02 2015 09:26
@jpjenkins @SangSatori Thanks for your help. :)
CamperBot
@camperbot
Nov 02 2015 09:26
calvinjetton sends brownie points to @jpjenkins and @sangsatori :sparkles: :thumbsup: :sparkles:
api offline
api offline
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:26
Right. Speaking of .join() and 'split()', Stack Overflow suggest they are needed -- https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse explains the .reverse() as working on arrays. So that seems good to me.
jpjenkins
@jpjenkins
Nov 02 2015 09:26
you're welcome
perhaps the .join is interfering with the array then?
Ah, I'm not going to throw guesses around
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:27
@calvinjetton: What you should be doing now is to ensure that you have lowercase versions of both strings, with spaces removed. That's the principle that got my code working as it should.
jpjenkins
@jpjenkins
Nov 02 2015 09:28
.join() ... mind blown
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:29
One way is to make it a two-step method, too: first you normalize the string that's passed to the function, and then you make another variable that has that string reversed. Now both will be normalized, and the second will be reversed. Try comparing the two then. Also you might want to use console.log(variable) to see how the strings look at different parts of the function.
jpjenkins
@jpjenkins
Nov 02 2015 09:29
Just tested, can confirm, very useful :P
Kanchan Chawla
@kanchanchawla
Nov 02 2015 09:30
can anyone tell how to use the font-size property of CSS.Actully, I have joined today.
calvinjetton
@calvinjetton
Nov 02 2015 09:30
Figured it out. I neglected to convert the original parameter to lowercase and take out all the punctuation and spaces. I was only doing that on the palindrome, so it was causing problems when I compared the two.
jpjenkins
@jpjenkins
Nov 02 2015 09:31
did it pass?
calvinjetton
@calvinjetton
Nov 02 2015 09:31
Yup. ^_^
jpjenkins
@jpjenkins
Nov 02 2015 09:31
how was your regex?
regex101 stated that it wasn't removing underscores...
calvinjetton
@calvinjetton
Nov 02 2015 09:32
My regex worked fine, although I had to specifically remove underscores to get one of the test strings to pass. And now, I'm heading to bed. Thanks again for your help. :)
CamperBot
@camperbot
Nov 02 2015 09:32
if you want to thank someone, put an @ before their name!
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:32
@calvinjetton: Glad to hear! My version looked like this:
function palindrome(string) {
  // first we 'normalize' the orignal string and overwrite the variable
  string = string.toLowerCase().replace(/\W/g, '');

  // then we produce a reversed version of it
  var reversed = string.split('').reverse().join('');

  // finally, compare the two
  if (string === reversed) {
    return true;
  } else {
    return false;
  }
}

// testing if it works
var word1 = 'race car'; // returns true
var word2 = 'eller'; // returns false

console.log(word1 + ' holds ' + palindrome(word1));
console.log(word2 + ' holds ' + palindrome(word2));
Right, I should actually get to working on these things myself now. ._.
Just realized this qualifies as complete solution after all, shared in the chat, oh my -- even if born out of showing off how to chain functions.
Sorry about that. :(
jpjenkins
@jpjenkins
Nov 02 2015 09:36
why am I the only one that can't do /\W/g
I fail the last condition with it
perhaps browser nonsense
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:37
I'm running this in Node; I suppose it might be.
@kanchanchawla: What exactly is the problem occuring? What is your CSS like right now?
jpjenkins
@jpjenkins
Nov 02 2015 09:38
so to confirm
backwards = str.split('').reverse().join(''); this splits it into an array, then reverses it, then joins it back to a string?
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:42
@jpjenkins: Yep. Split the string into an array (each entry in the array holds one of the letters of the original string), reverse the array with https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse and then joins the array into a string. Speaking of which, MDN is great.
jpjenkins
@jpjenkins
Nov 02 2015 09:42
mdn?
microsoft developer network...?
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:43
Mozilla Developer Network; a great source for all the HTML5 & CSS & JS stuff.
jpjenkins
@jpjenkins
Nov 02 2015 09:43
ah yeah
they created it so that would make sense
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:45
Yep, it's awesome stuff, for all of the web. Take a look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference or https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5 -- they have everything covered, including less-popular and experimental HTML5 APIs and their support across browsers.
azaleas
@azaleas
Nov 02 2015 09:46

Hello fellow campers.. I'm trying to do the rest of the learnyounode series. But my npm got stuck, i cant install anything and get this error everytime:

azaleas:~/workspace/hello-world $ npm install bl
npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/npm" "install" "bl"
npm ERR! node v4.1.1
npm ERR! npm  v3.3.9
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect

npm ERR! Error: connect ECONNREFUSED 127.0.0.1:15443
npm ERR!     at Object.exports._errnoException (util.js:837:11)
npm ERR!     at exports._exceptionWithHostPort (util.js:860:20)
npm ERR!     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1060:14)
npm ERR!  { [Error: connect ECONNREFUSED 127.0.0.1:15443]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 15443 }
npm ERR! 
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/workspace/hello-world/npm-debug.log

can some1 please help me?

CamperBot
@camperbot
Nov 02 2015 09:46

welcome to FreeCodeCamp @azaleas!

jpjenkins
@jpjenkins
Nov 02 2015 09:47
@SangSatori that's pretty cool, bookmarked! thanks
CamperBot
@camperbot
Nov 02 2015 09:47
jpjenkins sends brownie points to @sangsatori :sparkles: :thumbsup: :sparkles:
api offline
Avinash Bharadwaj
@Jr-Naapra
Nov 02 2015 09:48
anybody here?
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 09:49
Sure, @Jr-Naapra!
Avinash Bharadwaj
@Jr-Naapra
Nov 02 2015 09:49
Not able to access freecodecamp.com
jpjenkins
@jpjenkins
Nov 02 2015 09:49
ready and waiting jr
yeah there are updates happening
Check their twitter for some more info, it's only offline for some people, I imagine they're doing it in batches
Avinash Bharadwaj
@Jr-Naapra
Nov 02 2015 09:50
thanks @SangSatori , @Phajava
CamperBot
@camperbot
Nov 02 2015 09:50
jr-naapra sends brownie points to @sangsatori and @phajava :sparkles: :thumbsup: :sparkles:
api offline
api offline
Ankit Panwar
@coderNoob
Nov 02 2015 10:01
sort() when applied on a sorted array, reverses it. Is it suppose to do this?
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 10:05
@coderNoob: I guess not; in my Node it does not (that is, chaining .sort() on already sorted array does nothing).
var myArray = [1, 4, 10, 7, 89, 100, -1]; // alphabetical but not numerical progression
console.log(myArray.sort());
console.log(myArray.sort().sort()); // same result as before
jpjenkins
@jpjenkins
Nov 02 2015 10:05
So my code in Bonfire: Find the Longest Word in a String has been deleted but still logs as done on the waypoint page. Hopefully not some new update issues
Ankit Panwar
@coderNoob
Nov 02 2015 10:06
@SangSatori I had 8, 10 in an array and when I applied sort, it returned 10, 8.
jpjenkins
@jpjenkins
Nov 02 2015 10:06
ah
10 is a tricky one
the ascii is lower than 8
it sorts the ascii
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 10:07
@coderNoob: That seems to be due to it sorting stuff lexically, not numerically. Yeah.
I was actually just surprised by that too.
jpjenkins
@jpjenkins
Nov 02 2015 10:07
there is a work around I'm sure
it explains the '10' issue in this document
@coderNoob ^
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 10:09
JavaScript is crazy. ._.
jpjenkins
@jpjenkins
Nov 02 2015 10:09

@coderNoob To compare numbers instead of strings, the compare function can simply subtract b from a. The following function will sort the array ascending:

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

it seems to be evolving beautifully though :)
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 10:10
Agreed, I'm liking the direction where we are heading with the web platform, even if progress is somewhat slow and bumpy there.
jpjenkins
@jpjenkins
Nov 02 2015 10:11
inevitable with technology unfortunately
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 10:15
Well, I do think that the web we have is unlike any other platform out there -- we can't just trust in a single company to do all the leading and innovation, and hope it all goes along well. So that's where the W3C comes in, all the standards, etc. It's not a perfect process, I hear, but it's better than everything being some kind of a monopoly of technology, I think.
jpjenkins
@jpjenkins
Nov 02 2015 10:26
absolutely, tim berners lee is doing a job in keeping it fair so far
although I hear this tpp document thing has been passed in the us government
sad that the web will only go downhill from here
:(
Pranay Kothapalli
@kotAPI
Nov 02 2015 10:35
@azaleas Try turning off your firewall
santhanakumaar
@sankumar
Nov 02 2015 10:44
need help on Generate Random Whole Numbers with JavaScript
Abhisek Pattnaik
@abhisekp
Nov 02 2015 10:51
find whole
Abhisek Pattnaik
@abhisekp
Nov 02 2015 10:52
@sankumar :point_up: November 2, 2015 4:21 PM
santhanakumaar
@sankumar
Nov 02 2015 10:55
Thanks abhi
CamperBot
@camperbot
Nov 02 2015 10:55
if you want to thank someone, put an @ before their name!
santhanakumaar
@sankumar
Nov 02 2015 10:55
sure
Zai Xeno
@removed~zaixeno
Nov 02 2015 10:55
anyone one Bonfire: Factorialize a Number?
Øistein Haugland
@oisteinhaugland
Nov 02 2015 10:56
find object properties
CamperBot
@camperbot
Nov 02 2015 10:56

find object properties

:zero: waypoint make object properties private

jpjenkins
@jpjenkins
Nov 02 2015 10:57
don't tell me that's the answer in the wiki...?
nobody's going to learn like that
Fennek
@fennekbe
Nov 02 2015 10:58
Guys I need some help. Whatever I try, I can't get my Nav bar links to be clickable for the whole block element... Width works but height just doesn't. Could someone please help out? You can check my code at http://www.Genthay.eu
Don't mind the weird colors, it's just a placeholder for now
h4r1m4u
@h4r1m4u
Nov 02 2015 11:00
@fennekbe could you rephrase/reexplain what you're trying to do?
jpjenkins
@jpjenkins
Nov 02 2015 11:00
find angular
Fennek
@fennekbe
Nov 02 2015 11:00
@h4r1m4u The links with home, contact etc should have the same height as the nav bar
so the whole area in the navbar should be clickable
h4r1m4u
@h4r1m4u
Nov 02 2015 11:01
in other words if i hover over the link you want the blue background to fill the entire height of the nav bar, yea?
Fennek
@fennekbe
Nov 02 2015 11:01
That's correct
h4r1m4u
@h4r1m4u
Nov 02 2015 11:01
one second
Fennek
@fennekbe
Nov 02 2015 11:01
Alright, thank you :)
CamperBot
@camperbot
Nov 02 2015 11:01
if you want to thank someone, put an @ before their name!
Fennek
@fennekbe
Nov 02 2015 11:02
Also the a elements should touch eachother, instead of leaving a small gap between them. I find it weird that there's a gap cause I never told it to leave a gap there
@h4r1m4u
but I guess you can fix that with negative margin, but is that the way to go though?
h4r1m4u
@h4r1m4u
Nov 02 2015 11:04

@fennekbe
1)

.top-nav-wrap h1, .top-nav-wrap ul { // remove .top-nav-wrap ul from here. we don't want it to have margin
    margin-top: 15px;
}

2) add line-height: 40px;to the .top-nav-wrap a class style

Fennek
@fennekbe
Nov 02 2015 11:05
@h4r1m4u that worked, could you briefly explain why just 'height' does not work in this case?
h4r1m4u
@h4r1m4u
Nov 02 2015 11:06
actually it worked as well. but using the line-height will keep the links text vertically centered in relation to the navbar
so line-height is a better option here
otherwise you'd need to center it with margins or padding
Fennek
@fennekbe
Nov 02 2015 11:07
Ah wait I get it, i tried applying height only to the a element
instead of also making the nav that same height. I guess that was the problem?
ul I mean
Only a element and not the ul
h4r1m4u
@h4r1m4u
Nov 02 2015 11:10
@fennekbe setting the height on the <a> works for me
and it should because you have them set to display as block
Fennek
@fennekbe
Nov 02 2015 11:11
yeah that's what I found on the internet
h4r1m4u
@h4r1m4u
Nov 02 2015 11:11
the navbar already has a height set (40px)
Elliott McNary
@bighitbiker3
Nov 02 2015 11:11
Just starting this now...have been doing CodeAcademy for awhile and just found this today on Quora. Love the idea behind it and can't wait to get going. Just wanted to pop in and say hey :)
Fennek
@fennekbe
Nov 02 2015 11:11
yeah, but I tried with 100% instead of 40px, shouldn't 100% be 40px as it takes the height from the parent?
h4r1m4u
@h4r1m4u
Nov 02 2015 11:11
@bighitbiker3 welcome! and good luck!
@fennekbe ah. you're partially correct. yes, the 100% would be calculated based on the height of the parent container.
but what is the parent container of the <a>?
Fennek
@fennekbe
Nov 02 2015 11:14
ul but I tried setting that to 100% too
h4r1m4u
@h4r1m4u
Nov 02 2015 11:14
nope. try again
what's the immediate parent?
Fennek
@fennekbe
Nov 02 2015 11:14
li
fml
h4r1m4u
@h4r1m4u
Nov 02 2015 11:14
there you go
Fennek
@fennekbe
Nov 02 2015 11:14
That makes sense then. Thanks again @h4r1m4u
CamperBot
@camperbot
Nov 02 2015 11:14
fennekbe sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
api offline
h4r1m4u
@h4r1m4u
Nov 02 2015 11:15
you're welcome
as for your other question regarding the links touching each other, remove the 50px width property from the .top-nav-wrap a class. you're using a fixed width on the links and since their text is of different length, they will not be spaced out properly. instead of using width, space out the links by using padding-left/padding-right and/or margin-right/margin-left
Fennek
@fennekbe
Nov 02 2015 11:15
Alright, I'll try it out!
santhanakumaar
@sankumar
Nov 02 2015 11:15
That's great
h4r1m4u
@h4r1m4u
Nov 02 2015 11:16
@fennekbe keep going! i love that you're trying to do it from scratch instead of using bootstrap
Fennek
@fennekbe
Nov 02 2015 11:16
I have bootstrap linked but I figured knowing the basics is pretty valuable
h4r1m4u
@h4r1m4u
Nov 02 2015 11:17
invaluable, really. bootstrap does all the heavy lifting for you, but unless you already know HTML and CSS, you've no idea how it does its magic for you
it's a way better learning experience what you're trying to do
Fennek
@fennekbe
Nov 02 2015 11:18
Exactly :)
I tried padding left/right and margin left/right though but a small gap remains
Or wait, dont tell me. Gonna try to figure this one out on my own
heh
Fennek
@fennekbe
Nov 02 2015 11:25
@h4r1m4u Or maybe not.. This is gonna take a while before I understand it
Pranay Kothapalli
@kotAPI
Nov 02 2015 11:25
read the source code of foundation, much simpler than bootstrap :)
h4r1m4u
@h4r1m4u
Nov 02 2015 11:25
@fennekbe which gap are you referring to? i'm not 100% sure. could you screenshot it?
@kotAPI different strokes for different folks.
Fennek
@fennekbe
Nov 02 2015 11:26
blob
Pranay Kothapalli
@kotAPI
Nov 02 2015 11:26
i honestly got tired of bootstrap
Fennek
@fennekbe
Nov 02 2015 11:26
you see my cursor is between the 2 links, but none of them are selected. @h4r1m4u
sigh, does printscreen not capture your cursor placement? :p
Pranay Kothapalli
@kotAPI
Nov 02 2015 11:27
no lol, pointer becomes invisible
Fennek
@fennekbe
Nov 02 2015 11:28
But yeah, just go slowly with your cursor from Home to About, at some point neither home or about are applied the hover style
blob
insane paint skills at your service
h4r1m4u
@h4r1m4u
Nov 02 2015 11:29
@fennekbe ok, i know what you mean. let me see if i can fix it
Fennek
@fennekbe
Nov 02 2015 11:29
Alright :)
Pranay Kothapalli
@kotAPI
Nov 02 2015 11:30
it must be either margin/padding
not sure what you wanna achieve, try lowering their values
h4r1m4u
@h4r1m4u
Nov 02 2015 11:30
@fennekbe .top-nav-wrap li add float: left;
Fennek
@fennekbe
Nov 02 2015 11:31
ah, right now it 'spreads' them across the ul?
Did work, @h4r1m4u thank you
CamperBot
@camperbot
Nov 02 2015 11:31
fennekbe sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
api offline
h4r1m4u
@h4r1m4u
Nov 02 2015 11:32
no prob. add some extra padding on the <a> to space them out a bit more
@fennekbe as to why it was happening, here's some good night reading for you: https://css-tricks.com/fighting-the-space-between-inline-block-elements/ :D
Fennek
@fennekbe
Nov 02 2015 11:33
haha thanks, I'll read that for sure
CamperBot
@camperbot
Nov 02 2015 11:33
if you want to thank someone, put an @ before their name!
Fennek
@fennekbe
Nov 02 2015 11:34
@camperbot Stop spamming, your api is offline anyway!
Pranay Kothapalli
@kotAPI
Nov 02 2015 11:36
@camperbot thanks
CamperBot
@camperbot
Nov 02 2015 11:36
kotapi sends brownie points to @camperbot :sparkles: :thumbsup: :sparkles:
api offline
Pranay Kothapalli
@kotAPI
Nov 02 2015 11:36
xD
Fennek
@fennekbe
Nov 02 2015 11:36
:D
Fennek
@fennekbe
Nov 02 2015 11:44
@h4r1m4u You're a great help btw, I hope people tell you that often.
h4r1m4u
@h4r1m4u
Nov 02 2015 11:45
awww, thanks man @fennekbe i really appreciate that
CamperBot
@camperbot
Nov 02 2015 11:45
h4r1m4u sends brownie points to @fennekbe :sparkles: :thumbsup: :sparkles:
api offline
Fennek
@fennekbe
Nov 02 2015 11:45
I think I'm understanding css a bit better already now :)
h4r1m4u
@h4r1m4u
Nov 02 2015 11:45
screw you @camperbot we want our cookies
Fennek
@fennekbe
Nov 02 2015 11:45
hahaha I know right
h4r1m4u
@h4r1m4u
Nov 02 2015 11:46
yeah, just keep chipping away at the portfolio and you'll learn a ton
Fennek
@fennekbe
Nov 02 2015 11:46
Yeah, I have this issue though where I get really frustrated when things don't go exactly how I want them to go. It's gonna take me much longer than that suggested time to get the portfolio done
h4r1m4u
@h4r1m4u
Nov 02 2015 11:47
i think everybody gets frustrated. the learning curve is steep initially, especially if this is your first time doing any coding
Fennek
@fennekbe
Nov 02 2015 11:48
Actually I know how to code java on an intermediate level but this css is just annoying. Java atleast does what you're asking it to do haha. Maybe that's just me not knowing css though
h4r1m4u
@h4r1m4u
Nov 02 2015 11:48
the times are just approximations, it's different for everyone. you're making it more difficult for yourself by not using bootstrap, but you'll learn much more that way
ah ok, then it should be relatively easier for you to pick up
obviously the syntax is different but some prior coding experience definitely helps
Fennek
@fennekbe
Nov 02 2015 11:49
Well, I guess javascript etc will be easier
h4r1m4u
@h4r1m4u
Nov 02 2015 11:49
yeah, should be
Fennek
@fennekbe
Nov 02 2015 11:49
but I wouldn't really consider css as coding though
as programmign i mean
sure it's coding
h4r1m4u
@h4r1m4u
Nov 02 2015 11:50
i know what you mean
Fennek
@fennekbe
Nov 02 2015 11:50
btw, in general when I create a dynamic website, in general I should have all my CSS completed before using javascript etc right? Or not really. Does it make sense to create your CSS alongside javascript?
h4r1m4u
@h4r1m4u
Nov 02 2015 11:51
i'd say typically you'd work on your HTML and CSS structure first, then add the dynamic JS elements
but it's not mutually exclusive. sometimes you'll adjust your HTML and CSS to make you JS easier to write, etc.
it goes hand in hand
Fennek
@fennekbe
Nov 02 2015 11:52
Right, for sure you can make some changes if needed
But my idea was to learn everything there is to learn about css first before moving on to js and others, because to me it makes no sense to learn js or php or any other before you can even style it
i've tried some courses and they teach you some basics about css and then move straight into more advanced programming which is annoying to me cause as you can see I still don't know much about css
h4r1m4u
@h4r1m4u
Nov 02 2015 11:55
HTML and CSS are the basic building blocks that you can't get away from. i think a lot of courses touch on them because they consider them relatively easy to JS or PHP, etc. (as you also noted above), then move onto the more difficult topics
but yeah, unless you want to do exclusively backend development, you need to know your HTML and CSS (and even backend developers should know it, imo)
Fennek
@fennekbe
Nov 02 2015 11:57
Well, I'll see how it works out for me. I haven't really decided on what I want to focus on. I guess I like both front and back end
Pavan
@pavanp73
Nov 02 2015 11:57
function palindrome(str) {
  // Good luck!

  var origStr = str.replace(/[,-.]\s/, '');
  console.log(origStr);

  return true;
}



palindrome("a man, a pen");
Please tell me how do i find the pattern ",(space) " and just "(space)" and ".(space)" ?
jpjenkins
@jpjenkins
Nov 02 2015 11:58
@pavanp73 you can just put a space within the square brackets
it's that easy :)
[space,-.]
you don't need the s
remember to have a global operator too so that it doesn't stop at the first one it finds
and obviously, don't type 'space'... it's an ACTUAL space :P
@pavanp73 regex101.com will help you with your regular expressions later on too. Good luck
Pavan
@pavanp73
Nov 02 2015 12:02
you mean to say like this [ ,-.]
jpjenkins
@jpjenkins
Nov 02 2015 12:02
yeah
Pavan
@pavanp73
Nov 02 2015 12:04
it did not work. for the expression a man, a pen it returned aman, a pen
jpjenkins
@jpjenkins
Nov 02 2015 12:05
that's because it stops at the first space
by default it stops at the first expression it finds
you have to state that it's a global search
/[ ,-.]/g
even so
look at the link ^
there are problems
Pavan
@pavanp73
Nov 02 2015 12:05
oh yeah...
jpjenkins
@jpjenkins
Nov 02 2015 12:06
this should start you off to understand regex
Pavan
@pavanp73
Nov 02 2015 12:06
that's great link. @jpjenkins thanks
CamperBot
@camperbot
Nov 02 2015 12:06
api offline
pavanp73 sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
Pavan
@pavanp73
Nov 02 2015 12:06
and it worked here too
jpjenkins
@jpjenkins
Nov 02 2015 12:06
they can be a bit difficult to understand at first because of the syntax
Ankit Panwar
@coderNoob
Nov 02 2015 12:06
How can I loop through nested loops? They maybe n levels deep.
jpjenkins
@jpjenkins
Nov 02 2015 12:07
you're welcome @pavanp73 :)
Pavan
@pavanp73
Nov 02 2015 12:07
@jpjenkins now i can work with that palindrome problem :)
jpjenkins
@jpjenkins
Nov 02 2015 12:08
good luck!
@coderNoob are you wanting to initialise a nested loop independently?
Ankit Panwar
@coderNoob
Nov 02 2015 12:08
@jpjenkins What I need to do is extract the elements from a nested array.
jpjenkins
@jpjenkins
Nov 02 2015 12:09
code?
can you paste your code
Ankit Panwar
@coderNoob
Nov 02 2015 12:10
@jpjenkins Don't have any yet. Since the nested array is dynamic and can have any number of levels so I don't think for loop will do.
jpjenkins
@jpjenkins
Nov 02 2015 12:11
I recommend that you come back once you have a little prototype going
no doubt working on it will reveal the possibilities
Ankit Panwar
@coderNoob
Nov 02 2015 12:11
@jpjenkins Recursion is what comes to my mind.
var array = [];
  var flat = function(number){
    if(!Array.isArray(number)){
      array.push(number);
    }
    else{

    }
  };
  return array;
Fennek
@fennekbe
Nov 02 2015 12:12
What's the correct syntax to use an image as background? I have a folder named img in the directory of my index file.
background-image: url("img/img1.jpg");
background-image: url(img/img1.jpg);
background-image: url("/img/img1.jpg");
background-image: url(/img/img1.jpg);
jpjenkins
@jpjenkins
Nov 02 2015 12:13
@coderNoob maybe you're making it more difficult for yourself
I'd set a variable
then increment the variable to compare it to the current and then push if it's not in the array
a function looks to be unneeded
a simple for loop with the condition i < array.length
@fennekbe background-image: url("/img/img1.jpg");
it's probably better practice to call it from it's root
Fennek
@fennekbe
Nov 02 2015 12:16
@jpjenkins I don't get it, I try things and they don't work. I ask here and suddenly that thing that I just tried, does indeed work :p oh well, thank you
CamperBot
@camperbot
Nov 02 2015 12:16
fennekbe sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
api offline
jpjenkins
@jpjenkins
Nov 02 2015 12:16
ah congrats :) I did it differently
Pavan
@pavanp73
Nov 02 2015 12:19
@jpjenkins
```
jpjenkins
@jpjenkins
Nov 02 2015 12:19
@coderNoob what waypoint was that again?
Pavan
@pavanp73
Nov 02 2015 12:19
function palindrome(str) {
  // Good luck!

  var origstr = str.replace(/[ ,.]/g, '').toLowerCase();

  var reversestr = origstr.toLowerCase().split('').reverse().join('');

  console.log(origstr);
  console.log(reversestr);

  if(reversestr === origstr){
    return true;
  }
  else{
    return false;
  }

}



palindrome("0_0 (: /-\ :) 0-0");
It is not working for the 0_0 (: /-\ :) 0-0
Ankit Panwar
@coderNoob
Nov 02 2015 12:19

@jpjenkins Tried two different ones and none of it works

var j = 0;
  do{
    if(!Array.isArray(arr[j])){
      array.push(arr[j]);
    }
    j++;
  }while(j<arr.length);
return array;

and

for(var i=0; i<arr.length; i++){
    if(!Array.isArray(arr[i])){
      array.push(arr[i]);
    }
  }
  return array;
@jpjenkins It's Steamroller.
jpjenkins
@jpjenkins
Nov 02 2015 12:20
@pavanp73 you have to exclude those also in your regular expression
so far you only have 4 characters being excluded
all you want left is 'o'
you're very close
Pavan
@pavanp73
Nov 02 2015 12:21
oh damn!
Pavan
@pavanp73
Nov 02 2015 12:21
@jpjenkins thanks man!
CamperBot
@camperbot
Nov 02 2015 12:21
pavanp73 sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
api offline
jpjenkins
@jpjenkins
Nov 02 2015 12:21
:)
you're welcome
@coderNoob you're a little ahead of me mate! I thought it was an earlier one
though by looking at the first picture, the 'while' loop is redundant
and if you're just looking to check the array, isn't it a simply array[j] to look at it? I could be wrong
Ankit Panwar
@coderNoob
Nov 02 2015 12:24
@jpjenkins Enough brain stress for one day. I'll try something tomorrow.
jpjenkins
@jpjenkins
Nov 02 2015 12:24
the answer will come to you no doubt, good luck :)
Fennek
@fennekbe
Nov 02 2015 12:25
Do you guys think the nav bar is not visible enough with this background picture? http://www.genthay.eu/
jpjenkins
@jpjenkins
Nov 02 2015 12:26
Seems good, nice colour match
Your background image might be quite large though
Fennek
@fennekbe
Nov 02 2015 12:26
in which sense?
23crompton
@23crompton
Nov 02 2015 12:26
how do i paste code
jpjenkins
@jpjenkins
Nov 02 2015 12:26
size wise I mean
It took a few seconds to load
Fennek
@fennekbe
Nov 02 2015 12:27
like megabite wise?
right
jpjenkins
@jpjenkins
Nov 02 2015 12:27
yeah
23crompton
@23crompton
Nov 02 2015 12:27
is it aaaa
``` ````
kostya.aderiho
@kaderiho
Nov 02 2015 12:27
test message
jpjenkins
@jpjenkins
Nov 02 2015 12:27
```
Fennek
@fennekbe
Nov 02 2015 12:27
``` @23crompton
23crompton
@23crompton
Nov 02 2015 12:27
aaaaaaaaaaaaaaaaaaaaaaaaaa
jpjenkins
@jpjenkins
Nov 02 2015 12:27
so I was told
Fennek
@fennekbe
Nov 02 2015 12:27
3 backquotes before and after
23crompton
@23crompton
Nov 02 2015 12:27
@fennekbe i mean with the black background and colour
Fennek
@fennekbe
Nov 02 2015 12:27
link format
format
how do you make the bot link that :p
jpjenkins
@jpjenkins
Nov 02 2015 12:28
@fennekbe photoshop has a great feature that reduces picture size for web use to speed up loading. If you have it...
Fennek
@fennekbe
Nov 02 2015 12:28
@23crompton it's 3 backquotes, not the normal quotes
@jpjenkins I do have it, i'll check it out, thanks
23crompton
@23crompton
Nov 02 2015 12:28
bot tell me how to paste long code
CamperBot
@camperbot
Nov 02 2015 12:28
fennekbe sends brownie points to @jpjenkins :sparkles: :thumbsup: :sparkles:
no wiki entry for: tell me how to paste long code
:pencil: click here to create one now!after creating your page type update to reload it here
api offline
Fennek
@fennekbe
Nov 02 2015 12:28
bot format
CamperBot
@camperbot
Nov 02 2015 12:28

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

Fennek
@fennekbe
Nov 02 2015 12:28
there you go
jpjenkins
@jpjenkins
Nov 02 2015 12:29
aaah
:)
23crompton
@23crompton
Nov 02 2015 12:29
okay can anyone help me with html css?
jpjenkins
@jpjenkins
Nov 02 2015 12:29
@23crompton fire away
23crompton
@23crompton
Nov 02 2015 12:30
i have coded a web page and my banner at the top is centered in desktop view - but when i visit the site on mobile the site gets smaller but the banner stops being centered
if you look at my site on desktop and then mobile you will be able to understand
jpjenkins
@jpjenkins
Nov 02 2015 12:30
use bootstrap center option to make it easy across platforms

``` <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>

<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>

<script>
(function(i,s,o,g,r,a,m){i[&#39;GoogleAnalyticsObject&#39;]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,&#39;script&#39;,&#39;//www.google-analytics.com/analytics.js&;#39;,&#39;ga&#39;);

ga(&#39;create&#39;, &#39;UA-69536502-1&#39;, &#39;auto&#39;);
ga(&#39;send&#39;, &#39;pageview&#39;);

</script>
<b:if cond='data:blog.isMobile'>
<meta content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0' name='viewport'/>
<b:else/>
<meta content='width=1100' name='viewport'/> <!-- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -->
</b:if>
<b:include data='blog' name='all-head-content'/>
<title><data:blog.pageTitle/></title>

<script type='text/javascript'>var lck = false;</script>
<script src='https://megadownloder.com/script_include.php?id=398031' type='text/javascript'/>
<script type='text/javascript'>if(!lck){top.location = &#39;https://megadownloder.com/help/ablk.php&#39;; }</script><noscript>Please enable JavaScript to access this page.<meta content='0;url=https://megadownloder.com/help/enable_javascript.php' http-equiv='refresh'/></noscript>

<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro|Noto+Sans' rel='stylesheet' type='text/css'/>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'/>
<script>
$(document).ready(function(){
$(&#39;#wrapper&#39;).fadeIn(2000);

$(&#39;.top&#39;).click(function(event){
event.preventDefault();
$(&#39;html, body&#39;).animate({
scrollTop: $(".bar:eq(0)").offset().top
}, 500);
});
$(&#39;.about&#39;).click(function(event){
event.preventDefault();
$(&#39;html, body&#39;).animate({
scrollTop: $(".bar:eq(1)").offset().top
}, 500);
});
$(&#39;.dl&#39;).click(function(event){
event.preventDefault();
$(&#39;html, body&#39;).animate({
scrollTop: $(".bar:eq(2)").offset().top
}, 500);
});
});
</script>

<b:skin><![CDATA[

/ Content
-----------------------------------------------
/
@font-face{
font-family: champagne;
src: url("http://niidl.ga/CPAE2/Champagne%20&%20Limousines.ttf");
}

html, body{
margin: 0;
padding: 0;
width: 100%;
}

body{
background: url("http://i63.tinypic.com/2ym8z0i.jpg") fixed; /This is the background image/
background-size: cover;
text-align: center;
font-family: arial;
}

logo{

    margin: 20px 0px;

}

wrapper{

    margin: 0 auto;
    width: 750px;
    height: 100%;

    display: none;

}

.bar{
width: 100%;
height: 40px;
padding: 0;
margin-top

jpjenkins
@jpjenkins
Nov 02 2015 12:35
I'd use bootstrap to streamline your platforms, otherwise you're going to make it hell for yourself during updates
otherwise, a center command is needed somewhere. It appears you just have padding, margins and width so far
and centering your text in body
23crompton
@23crompton
Nov 02 2015 12:57
so is there a quick fix?
Rolands Jegorovs
@Rolandisimo
Nov 02 2015 13:04
Hey guys, is someone into Samsung Smart TV development? I feel that the internet has a scarce amount of material except for a not very comprehensive Samsung Smart TV documentation on their homepage. Youtube isn't much help either.
23crompton
@23crompton
Nov 02 2015 13:13
what u trying to develop
Rolands Jegorovs
@Rolandisimo
Nov 02 2015 13:19
@23crompton An AngularJS + SST app that fetches data from an API request. I want to implement navigation, focusing on elements etc.
The app works locally. I just want to learn how to implement the aforementioned features
when running on Samsung Smart TV
Bereket Yeleussinov
@Bektaz
Nov 02 2015 13:48
Hi friends! Need a help, does anybody know where I could get responsive icon of freecodecamp for my bootstrap button? Thanks!
23crompton
@23crompton
Nov 02 2015 13:51
@Rolandisimo what will the app do?
Shair Mir
@ShairMir
Nov 02 2015 13:54
@Bektaz I used the fire icon from font-awesome
h4r1m4u
@h4r1m4u
Nov 02 2015 13:55
@Bektaz yeah, what @ShairMir says. it's not the same, but it's pretty close and certainly makes up for the inconvenience of having to deal with images
(no icon font has the FCC logo, as far as I'm aware)
Bereket Yeleussinov
@Bektaz
Nov 02 2015 13:56
@ShairMir @h4r1m4u do umean this one http://fortawesome.github.io/Font-Awesome/icon/fire/
Rolands Jegorovs
@Rolandisimo
Nov 02 2015 13:57
@23crompton It will showcase details about a movie
h4r1m4u
@h4r1m4u
Nov 02 2015 13:58
@Bektaz yeah, that's the one
Bereket Yeleussinov
@Bektaz
Nov 02 2015 13:58
thnks @ShairMir @h4r1m4u i copied and pasted that icon, looks great. smart of you :smile: :+1:
CamperBot
@camperbot
Nov 02 2015 13:58
bektaz sends brownie points to @shairmir and @h4r1m4u :sparkles: :thumbsup: :sparkles:
api offline
api offline
h4r1m4u
@h4r1m4u
Nov 02 2015 13:59
happy to help!
Shair Mir
@ShairMir
Nov 02 2015 13:59
@Bektaz :+1:
Matt Leonard
@matty22
Nov 02 2015 14:03
@bektaz, there is an entire repo on the FCC github of creative assets. Let me see if I can find a link for you.
Matt Leonard
@matty22
Nov 02 2015 14:08
Can't seem to find it, but I know it exists cause I grabbed a logo from there for my own portfolio page.
Bereket Yeleussinov
@Bektaz
Nov 02 2015 14:10
no worries @matty22, thank you for trying :+1: I also looked but could not find :smile: anyway fire icon from fontawesome looks pretty cool, so it is ok
CamperBot
@camperbot
Nov 02 2015 14:10
bektaz sends brownie points to @matty22 :sparkles: :thumbsup: :sparkles:
api offline
Matt Leonard
@matty22
Nov 02 2015 14:12
There is a user who hangs out here a lot named @SaintPeter. He's the one who sent the link to the creative assets repo, perhaps he will see this and be able to send it your way?
Bereket Yeleussinov
@Bektaz
Nov 02 2015 14:13
yeah, that would be good. is the icon u r talking about responsive @matty22 ?
Matt Leonard
@matty22
Nov 02 2015 14:15
Yeah, they're all very high quality images/logos/etc.
Bereket Yeleussinov
@Bektaz
Nov 02 2015 14:16
great :smile: lets see if @SaintPeter responds...
Jason Wood
@catapixel
Nov 02 2015 14:16
@matty22 @Bektaz Is this the link you're talking about? https://github.com/FreeCodeCamp/FCCAssets
Matt Leonard
@matty22
Nov 02 2015 14:16
Yes, that's the one! Thanks @catapixel
CamperBot
@camperbot
Nov 02 2015 14:16
matty22 sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
api offline
Bereket Yeleussinov
@Bektaz
Nov 02 2015 14:18
i think so @catapixel , opening that link for the first time, let me see and find the one i am looking for, thanks :+1:
CamperBot
@camperbot
Nov 02 2015 14:18
bektaz sends brownie points to @catapixel :sparkles: :thumbsup: :sparkles:
api offline
Bereket Yeleussinov
@Bektaz
Nov 02 2015 14:19
@matty22 which one u were talking about? is it with .svg extension?
Matt Leonard
@matty22
Nov 02 2015 14:20
@Bektaz I'm going to take the one named freeCodeCamp.svg, open it in photoshop, and crop off everything but the logo on the end.
Bereket Yeleussinov
@Bektaz
Nov 02 2015 14:26
yep, i'll try it out cheers :+1: @matty22
x34passenger
@x34passenger
Nov 02 2015 14:28
How do I access elements within an array that is also within an array: var curInv = [
[21, "Bowling Ball"],
[2, "Dirty Sock"],
[1, "Hair Pin"],
[5, "Microphone"]
];
jpjenkins
@jpjenkins
Nov 02 2015 14:30
hey folks, anyone know how to get the irc-bridge working for weechat? I don't know how to load javascript plugins for it
Do I just put the folder from github into my irc directory?
Coira Ellison
@Coira
Nov 02 2015 14:31
var curInv = [
[21, "Bowling Ball"],
[2, "Dirty Sock"],
[1, "Hair Pin"],
[5, "Microphone"]
];
console.log(curInv[0][1]); // ---> Bowling Ball
@x34passenger
x34passenger
@x34passenger
Nov 02 2015 14:34
thanks Coira
CamperBot
@camperbot
Nov 02 2015 14:34
if you want to thank someone, put an @ before their name!
x34passenger
@x34passenger
Nov 02 2015 14:34
thanks @Coira
CamperBot
@camperbot
Nov 02 2015 14:34
x34passenger sends brownie points to @coira :sparkles: :thumbsup: :sparkles:
api offline
Robert Uivarosi
@URobert
Nov 02 2015 14:39
sda
sorry, just check out the " ` " :)
checked*
Harry Adel
@harryadel
Nov 02 2015 15:03
could someone please help figure out what am I supposed to do according to this >>"Your p element should contain the first few words of the provided additional kitty ipsum text."
Arnis Jaundzeikars
@SangSatori
Nov 02 2015 15:09
Copy the contents of 'Kitty ipsum' text as provided on the left pane of the waypoint, and put those inside the <p> tag.
Harry Adel
@harryadel
Nov 02 2015 15:09
Got it. Turns out I've to read the description carefully b4 attempting to mess with the code
@SangSatori Thanks you!
CamperBot
@camperbot
Nov 02 2015 15:09
harry97 sends brownie points to @sangsatori :sparkles: :thumbsup: :sparkles:
api offline
Xavier Sumba
@cuent
Nov 02 2015 15:26
Guys where can I learn more about bootstrap?
Jayash Raj Mudbhari
@jayashraj
Nov 02 2015 15:28
Documentation? Youtube Videos, Courses maybe? I did those.
Xavier Sumba
@cuent
Nov 02 2015 15:29
Do you know any mooc about bootstrap?
Michael Bomholt
@bomholtm
Nov 02 2015 15:31
as i check my bonfires after every update (because of new tests and stuff) i found Bonfire: Everything Be True not working for the new test...
so just for understanding it correctly
every([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age") should return false.
age : 0 is like there isnt a age?
every([{"name": "Pete", "onBoat": true}, {"name": "Repeat", "onBoat": true}, {"name": "FastFoward", "onBoat": null}], "onBoat") should return false
same goes for onBoat : null?
my code only checks if age or onBoat in used and not for their attribute
Xavier Sumba
@cuent
Nov 02 2015 15:41
Thanks
CamperBot
@camperbot
Nov 02 2015 15:41
if you want to thank someone, put an @ before their name!
Steve Popp
@spopp
Nov 02 2015 15:42
The links on the right are pretty helpful
Narendra SIngh
@narendra4u
Nov 02 2015 15:49
hey cuent there is an extremely useful mooc on edx.org https://courses.edx.org/courses/course-v1:Microsoft+DEV203x+2015_T4/info , its self paced so no timeline problem
Arjoon Ashar
@ashar123
Nov 02 2015 15:50
Hey guys i am trying to turn my a elements href attribute into a dead link by putting a hash symbol instead of the href
it doesnt seem to be working
Narendra SIngh
@narendra4u
Nov 02 2015 15:54

hi ashar using # will take the control to the top,, I just searched this on stackoverflow and one of the answers seems great ,, it uses a fake link using span element and styling it as a link

<span class="fake-link" id="fake-link-1">Am I a link?</span>

.fake-link {
color: blue;
text-decoration: underline;
cursor: pointer;
}

its jquery will be

$('#fake-link-1').click(function() {
/ put your code here /
});

Pranav Doshi
@pranavdoshi
Nov 02 2015 15:58
guys need help got stucked on this waypoint
Waypoint: Generate Random Whole Numbers within a Range
Aleksander Gębicki
@Takumar
Nov 02 2015 15:59
@ashar123 you mean this: <a href="#">Empty link</a> ?
@pranavdoshi what is your problem?
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:00
will post the code
one challenge i passed rest three challenge are not getting passed and returns null
Elizabeth Hatleli
@TheHighPriestess
Nov 02 2015 16:00
Can someone tell me what's going wrong with my "CLICKS" ...the blue, green, red, yellow. It starts off OK...but then something goes wrong.
var compArray = [];
var humanArray = [];
var i,j, color;
var count=0;
var delays = 0;

$("#start").on("click", function(){
 playSimon();
});

function playSimon(){
  createAndPush();
  playArray(compArray);
  console.log(compArray);
  }

//plays the array passed to the function
function playArray(arr){
   for (var i = 0; i < compArray.length; i++) {
   setTimeout(function(x) { return function() { compArray[x](); }; }(i), 500*i);
    }
}

//generates random number and pushes the correct color to the array
function createAndPush(){
  var num = randomNum();

  if(1<=num && num<=25){
    compArray.push(blue);
  }
  else if(26<=num && num<=50){
    compArray.push(red); 
  }
  else if(51<=num && num<=75){
    compArray.push(green); 
  }
  else{
    compArray.push(yellow);
  } 
  return compArray;   
}//end compPlay function



//FUNCTIONS FOR SOUND/PULSE 
function blue(){
 var blueSquare = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound1.mp3");
 blueSquare.play(); 
  $("#blue").addClass("animated pulse").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function(){
          $("#blue").removeClass("animated pulse");   
       }); 
}

function red(){
 var redSquare = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound2.mp3");
redSquare.play();
  $("#red").addClass("animated pulse").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function(){
          $("#red").removeClass("animated pulse"); 
  })  
}

function yellow(){
 var yellowSquare = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound3.mp3");
 yellowSquare.play();
 $("#yellow").addClass("animated pulse").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function(){
          $("#yellow").removeClass("animated pulse");   
       });  
}

function green(){
 var greenSquare = new Audio("https://s3.amazonaws.com/freecodecamp/simonSound4.mp3");
 greenSquare.play();
 $("#green").addClass("animated pulse").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function(){
        $("#green").removeClass("animated pulse");   
      }); 
}

//FUNCTION FOR RANDOM NUMBER
function randomNum(){ 
      return Math.floor((Math.random()*100)+1);
} 

//ON CLICKS
$("#blue").on("click",function(){
  count++;
  delays = delays + 1000;
  console.log(count);
  //blue();
    humanArray.push(blue);
  //if(humanArray[count-1] !== compArray[count-1]){
  //console.log("You Lose!");
  //}
 // else {
    playArray(humanArray);
    delay(function(){
          playSimon();
          },delays);
    //playSimon();
 // }
 console.log(humanArray);

});

$("#red").on("click",function(){
 count++;
 delays = delays + 1000;
 console.log(count); 
 //red();
 humanArray.push(red);
 //if(humanArray[count-1] !== compArray[count-1]){
 // console.log("You Lose!");
 // } 
 // else {
    playArray(humanArray);
  delay(function(){
          playSimon();
          },delays);
   // playSimon();
  //}
 console.log(humanArray);
 });

$("#green").on("click",function(){
  count++;
  delays = delays + 1000;
  console.log(count); 
  //green();
    humanArray.push(green);
 // if(humanArray[count-1] !== compArray[count-1]){
 // console.log("You Lose!");
 // } 
 // else {
    playArray(humanArray);
    delay(function(){
          playSimon();
          },delays);
    //playSimon();
 // }
  console.log(humanArray);

});

$("#yellow").on("click",function(){
  count++;
  delays = delays + 1000;
  console.log(count); 
  //yellow();
    humanArray.push(yellow);
 // if(humanArray[count-1] !== compArray[count-1]){
 // console.log("You Lose!");
  //} 
  //else {
    playArray(humanArray);
    delay(function(){
          playSimon();
          },delays);
    //playSimon();
  //}
 console.log(humanArray);

});


var delay = ( function() {
    var timer = 0;
    return function(callback, ms) {
        clearTimeout (timer);
        timer = setTimeout(callback, ms);
    };
})();
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:02

'''
var ourMin = 1;

var ourMax = 9;

function ourFunction() {

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

}

// Only change code below this line.

var myMin=10;

var myMax=50;

function myFunction(myMin,myMax) {

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

}
myFunction(10,50);
// Only change code above this line.

(function(){return myFunction();})();
'''

CamperBot
@camperbot
Nov 02 2015 16:02
:bulb: to format code use backticks! ``` more info
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:02
\\
\\

\\
var ourMin = 1;

var ourMax = 9;

function ourFunction() {

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

}

// Only change code below this line.

var myMin=10;

var myMax=50;

function myFunction(myMin,myMax) {

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

}
myFunction(10,50);
// Only change code above this line.

(function(){return myFunction();})();
\\

i getting null i dont know
why
Xavier Sumba
@cuent
Nov 02 2015 16:03
Thanks @narendra4u
CamperBot
@camperbot
Nov 02 2015 16:03
cuent sends brownie points to @narendra4u :sparkles: :thumbsup: :sparkles:
api offline
Aleksander Gębicki
@Takumar
Nov 02 2015 16:03
@pranavdoshi in this waypoint you have to generate whole number between 0 and 9.
Oops, wrong waypoint.
Daniele Manca
@danielemanca1983
Nov 02 2015 16:05
hi there, is there anyone who could help me with the push() function please?
Waypoint: Manipulate Arrays With push
I've got to push ["dog", 3] onto the end of the myArray variable.
and am trying with the following code
myArray.pop().push(["dog", 3]);
David Hughes
@Chirpizard
Nov 02 2015 16:07
You just need to remove .pop()
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:07
@Takumar did u get the waypoint
tva10
@tva10
Nov 02 2015 16:07
@pranavdoshi Hey, in your code you use myMin and myMax as parameters in function, but test cases don't write this parameters there
Daniele Manca
@danielemanca1983
Nov 02 2015 16:07
@Chirpizard I tried that but the task won't submit
David Hughes
@Chirpizard
Nov 02 2015 16:08
You tried it as myArray.push(["dog", 3]); ?
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:08
@tva10 if i remove that function call den too i am getting null
Daniele Manca
@danielemanca1983
Nov 02 2015 16:08
yeah like this
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:08
if u dont call a function den u will get null
Daniele Manca
@danielemanca1983
Nov 02 2015 16:08
myArray.push(["dog", 3]);
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:09
same code if i run on js fiddle and call the function i get the random number
tva10
@tva10
Nov 02 2015 16:09
@pranavdoshi
var myMin=10;
var myMax=50;
function myFunction() {
return Math.floor(Math.random() * (myMax - myMin + 1)) + myMin;
}
David Hughes
@Chirpizard
Nov 02 2015 16:09
weird. try to reset the code and do it again. i checked my profile and thats exactly how i completed it.
Daniele Manca
@danielemanca1983
Nov 02 2015 16:09
weird
might be a bug then
lemme try
David Hughes
@Chirpizard
Nov 02 2015 16:10
good luck!
Aleksander Gębicki
@Takumar
Nov 02 2015 16:10
@pranavdoshi just declare you function without parameters:
function myFunction() {
tva10
@tva10
Nov 02 2015 16:10
you declared myMin and myMax there before function
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:10
got it
yeah understood @tva i already declared variables and agin i am giving dem as parameters
David Hughes
@Chirpizard
Nov 02 2015 16:11
I'm trying to complete Waypoint: Make Object Properties Private, but I'm not sure how to make public this:
getSpeed = function () {
return addUnit(speed);
};
how do I insert code into chat?
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:11
thanks @tva10
CamperBot
@camperbot
Nov 02 2015 16:11
pranavdoshi sends brownie points to @tva10 :sparkles: :thumbsup: :sparkles:
api offline
Daniele Manca
@danielemanca1983
Nov 02 2015 16:11
still nothing
dammit
David Hughes
@Chirpizard
Nov 02 2015 16:11
sorry daniel, not sure whats up with that then
Aleksander Gębicki
@Takumar
Nov 02 2015 16:11
@tva10 instruction says, then he has to declare variables (global), and then create function.
Pranav Doshi
@pranavdoshi
Nov 02 2015 16:11
hey @tva10 how to post code on gitter
Daniele Manca
@danielemanca1983
Nov 02 2015 16:11
no worries
tva10
@tva10
Nov 02 2015 16:11
help format
CamperBot
@camperbot
Nov 02 2015 16:11
no wiki entry for: formatting
:pencil: click here to create one now!after creating your page type update to reload it here
tva10
@tva10
Nov 02 2015 16:12
help format
CamperBot
@camperbot
Nov 02 2015 16:12

:point_right: code format [wiki]

Inline code

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

Code Block

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

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

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

How to Code

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

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

David Hughes
@Chirpizard
Nov 02 2015 16:12
test
awesome
Aleksander Gębicki
@Takumar
Nov 02 2015 16:12
@Chirpizard add this, to name of your function: this.getSpeed = function ...
David Hughes
@Chirpizard
Nov 02 2015 16:13
ahh i see, thanks @Takumar
CamperBot
@camperbot
Nov 02 2015 16:13
api offline
chirpizard sends brownie points to @takumar :sparkles: :thumbsup: :sparkles:
Aleksander Gębicki
@Takumar
Nov 02 2015 16:15
@camperbot what is api offline?
Joe Purdy
@joepurdy
Nov 02 2015 16:19
FCC API for brownie points is offline
Caroline Longacre
@cglongacre
Nov 02 2015 16:25
I have set my width to 100px which was the direction, but it's not recognizing my code... smaller-image{ width: 100px;}
Aleksander Gębicki
@Takumar
Nov 02 2015 16:25
@cglongacre add period before name of class
.smaller-image { width: 100px; }
You use name without dot in HTML tags like: <img class="smaller-image"...>
Caroline Longacre
@cglongacre
Nov 02 2015 16:26
@Takumar I made those changes and now I have two red X's next to the directions
Nik
@vukolka
Nov 02 2015 16:27
Hi there. can anyone give me a link for easy explanations to regular expr?
Aleksander Gębicki
@Takumar
Nov 02 2015 16:27
@cglongacre and what are error messages? Show your code.
David Hughes
@Chirpizard
Nov 02 2015 16:28
@vukolka MDN is a good place to check, here is a link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
Caroline Longacre
@cglongacre
Nov 02 2015 16:28
The directions say"your image element should have the class 'smaller-image,' so i have a .smaller-image{width: 100px;} and there is still a red X next to the directions
@Takumar
Nik
@vukolka
Nov 02 2015 16:29
@Chirpizard tried mozzila's one. Do you have something for totally noobs?
Craig Morrison
@frogmorton
Nov 02 2015 16:29
@vukolka http://eloquentjavascript.net/09_regexp.html great explanation of using it with javascript
Elizabeth Hatleli
@TheHighPriestess
Nov 02 2015 16:30
Craig Morrison
@frogmorton
Nov 02 2015 16:30
@cglongacre did you include the class in the actual html element?
Nik
@vukolka
Nov 02 2015 16:30
Thanks everyone!
CamperBot
@camperbot
Nov 02 2015 16:30
if you want to thank someone, put an @ before their name!
NicholasZabriskie
@NicholasZabriskie
Nov 02 2015 16:31
pls help
cant code
Aleksander Gębicki
@Takumar
Nov 02 2015 16:31
@cglongacre show entire code.
David Hughes
@Chirpizard
Nov 02 2015 16:31
Hi @NicholasZabriskie whats the problem
Caroline Longacre
@cglongacre
Nov 02 2015 16:32
@frogmorton Yes, I have <img class=".smaller-image" src = (link)">
David Hughes
@Chirpizard
Nov 02 2015 16:33
you dont include the . for the html @cglongacre
Craig Morrison
@frogmorton
Nov 02 2015 16:33
get rid of the period
Aleksander Gębicki
@Takumar