These are chat archives for FreeCodeCamp/Help

13th
Feb 2015
Bettina Schaden
@bSchaden
Feb 13 2015 01:58

```<!DOCTYPE html>

<head>
<style>
div {
height: 150px;
width: 300px;
margin: 0 auto;
}

.beep {
width: 5px;
height: 0;
border: 5px solid transparent;
border-top: 10px solid #777;
border-bottom: 80px solid #888;
}
.brain {
background: radial-gradient(circle, white 15%, transparent 40%), #cc5;
background: -webkit-radial-gradient(circle, white 15%, transparent 40%), #cc5;
background: -moz-radial-gradient(circle, white 15%, transparent 40%), #cc5;
background-size: 75px 150px;
height: 150px;
width: 150px;
border-radius: 60px 60px 10px 10px;
border-bottom: 40px double #666;
}

.torso {
height: 0;
width: 140px;
border-top: 300px solid #bc6;
border-left: 75px solid transparent;
border-right: 75px solid transparent;
border-radius: 20px 20px 100px 100px;
}

.foot {
height: 40px;
width: 40px;
background: #ccc;
border-radius: 40px;
border: 15px solid #999;
}

</style>
</head>

<body>

<div class="beep"></div>
<div class="brain"></div>
<div class="torso"></div>
<div class="foot"></div>

</body>

Cristián Berríos
@crisberrios
Feb 13 2015 01:59
missed the ending `'s
Bettina Schaden
@bSchaden
Feb 13 2015 01:59

On Dash robot, not sure why my robot has dark circles around his eyes.
```<!DOCTYPE html>

<head>
<style>
div {
height: 150px;
width: 300px;
margin: 0 auto;
}

.beep {
width: 5px;
height: 0;
border: 5px solid transparent;
border-top: 10px solid #777;
border-bottom: 80px solid #888;
}
.brain {
background: radial-gradient(circle, white 15%, transparent 40%), #cc5;
background: -webkit-radial-gradient(circle, white 15%, transparent 40%), #cc5;
background: -moz-radial-gradient(circle, white 15%, transparent 40%), #cc5;
background-size: 75px 150px;
height: 150px;
width: 150px;
border-radius: 60px 60px 10px 10px;
border-bottom: 40px double #666;
}

.torso {
height: 0;
width: 140px;
border-top: 300px solid #bc6;
border-left: 75px solid transparent;
border-right: 75px solid transparent;
border-radius: 20px 20px 100px 100px;
}

.foot {
height: 40px;
width: 40px;
background: #ccc;
border-radius: 40px;
border: 15px solid #999;
}

</style>
</head>

<body>

<div class="beep"></div>
<div class="brain"></div>
<div class="torso"></div>
<div class="foot"></div>

</body>```

Nathan
@terakilobyte
Feb 13 2015 01:59
on their own lines above and below
don’t repaste, you can just edit the message
Bettina Schaden
@bSchaden
Feb 13 2015 02:00
sorry, I'm having a hard time learning this chat
Danny Fritz
@dannyfritz
Feb 13 2015 02:00
I'm not seeing dark circles around the eyes
Bettina Schaden
@bSchaden
Feb 13 2015 02:02
Gah! how do I edit? I want to put the ``` into a new line but when i hit enter it just posts
Cristián Berríos
@crisberrios
Feb 13 2015 02:03
shift + enter
or click the chat icon on the right ->
Bettina Schaden
@bSchaden
Feb 13 2015 02:03
@dannyfritz You don't see the gray circles around the eyes???
@crisberrios I did click the chat icon... hm
Bettina Schaden
@bSchaden
Feb 13 2015 02:05
@dannyfritz oh, weird!
Cristián Berríos
@crisberrios
Feb 13 2015 02:06
what browser are you using?
Bettina Schaden
@bSchaden
Feb 13 2015 02:06
firefox
Cristián Berríos
@crisberrios
Feb 13 2015 02:06
i see
I'm using a webkit-based browser too and it shows some dark lines
Danny Fritz
@dannyfritz
Feb 13 2015 02:06
you are using safari?
Bettina Schaden
@bSchaden
Feb 13 2015 02:06
yeah, like the gradient is gray.
i tried commenting out certain lines, but nothing
Danny Fritz
@dannyfritz
Feb 13 2015 02:07
ah, here it is with firefox http://i.imgur.com/2N58Qi6.png
Bettina Schaden
@bSchaden
Feb 13 2015 02:07
yup!
he looks tired... lol
been coding too long into the wee hours...
so, can/should i fix it?
Danny Fritz
@dannyfritz
Feb 13 2015 02:10
try this instead background: -moz-radial-gradient(circle, white 15%, #cc5 40%);
Bettina Schaden
@bSchaden
Feb 13 2015 02:11
yes, that worked. but why?
Danny Fritz
@dannyfritz
Feb 13 2015 02:12
setting it to transparent is really weird
i guess mozilla interpolates from green to transparent differently than chrome
i mean, how does one interpolate from green to transparent?
and i guess blink and mozilla had different ideas about it
blink and gecko*
Bettina Schaden
@bSchaden
Feb 13 2015 02:13
right. i didn't quite understand the transparent. this actually makes more sense. you're going from white 15% to the green 40%, right?
Danny Fritz
@dannyfritz
Feb 13 2015 02:13
right
i actually updated them all in this fiddle http://jsfiddle.net/csnrnL2v/2/
Bettina Schaden
@bSchaden
Feb 13 2015 02:14
yes, that makes sense
sorry i didn't get the blink gecko thing... ? inside coder jokes?
Danny Fritz
@dannyfritz
Feb 13 2015 02:15
gecko is mozilla's layout engine and blink is chrome's
Bettina Schaden
@bSchaden
Feb 13 2015 02:16
and the rabbit hole just got deeper... lol!
Bettina Schaden
@bSchaden
Feb 13 2015 02:16
well, thanks for your help
the dash fb is not much help at all
Bettina Schaden
@bSchaden
Feb 13 2015 03:29
And now my robot eyes are not blinking! I got checkmarks (temporarily changed code back to the weird transparent thing, just to be sure I wasn't messing something else up) http://pastie.org/private/gf3llagsmdbmv6ihcxn8na
It works in chrome but not in firefox
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 03:35
@bschaden did you add the -moz one?
Bettina Schaden
@bSchaden
Feb 13 2015 03:36
yes, I did
in chrome the eye was blinking red to a cyclops so i followed some advice to include background-size: 75px 150px; in each @keyframe and it solved it. working perfectly in chrome. mozilla does nothing
can you make sure i added the -moz correctly?
@AmmarAliShah ?
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 03:39
@bschaden wait let me take a look
@bschaden oh yeah one more thing: you should try the code outside of Dash like in codepen.io sometimes it doesn't work in dash
Bettina Schaden
@bSchaden
Feb 13 2015 03:40
@AmmarAliShah let me try that
doesn't work in codepen either
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 03:42
@bschaden give me the codepen link
Cristián Berríos
@crisberrios
Feb 13 2015 03:43
^
Bettina Schaden
@bSchaden
Feb 13 2015 03:43
i'm sorry, how do i get the link?
Cristián Berríos
@crisberrios
Feb 13 2015 03:44
just the pen URL
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 03:45
@bschaden it isn't working in firefox right?
Bettina Schaden
@bSchaden
Feb 13 2015 03:45
correct
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 03:45
@bschaden the blinking eyes?
Bettina Schaden
@bSchaden
Feb 13 2015 03:45
yes
they are just white
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 03:46
@bschaden okay let me check on firefox
Cristián Berríos
@crisberrios
Feb 13 2015 03:46
forked it for you, so css is separated from html
no changes made
Bettina Schaden
@bSchaden
Feb 13 2015 03:47
n00b here. what is forking?
i see the separated css
Cristián Berríos
@crisberrios
Feb 13 2015 03:50
I think you repeated -webkit-gradient instead of using -moz
hmm no
I think it was an error in codepen
let me check again
Bettina Schaden
@bSchaden
Feb 13 2015 03:53
@crisberrios I also tried with the code without the transparent and it didn't work either
Cristián Berríos
@crisberrios
Feb 13 2015 04:02
If I remove the background property the entire head starts to blink :P
Bettina Schaden
@bSchaden
Feb 13 2015 04:03
@crisberrios my head is blinking too. or throbbing...
@crisberrios would that mean that the problem is in the @keyframe then?
Cristián Berríos
@crisberrios
Feb 13 2015 04:07
wait
Cristián Berríos
@crisberrios
Feb 13 2015 04:13
ok, so it works in chrome
but not firefox
Bettina Schaden
@bSchaden
Feb 13 2015 04:13
yes, it does
Cristián Berríos
@crisberrios
Feb 13 2015 04:20
I think firefox is uncapable of animating multiple backgrounds
or at least, look into that problem
the code is fine.
it "should" work without hacks
Bettina Schaden
@bSchaden
Feb 13 2015 04:21
huh
is everybody else just working in chrome or something else?
i would use chrome, except the slides on dash don't advance on chrome :worried:
Ammar Ali Shah
@AmmarAliShah
Feb 13 2015 04:22
@bschaden Most of us use Chrome
Bettina Schaden
@bSchaden
Feb 13 2015 04:23
is there a way to make Dash work in Chrome, then?
Cristián Berríos
@crisberrios
Feb 13 2015 04:23
just today I installed Pale Moon since Chrome is too bloated
Also, I think if I make something work in Gecko, most likely it will work in Chrome :P
is not working in chrome? I did it in chrome
Bettina Schaden
@bSchaden
Feb 13 2015 04:24
the slides don't advance in Chrome for me.
nothing happens when I click the "next slide"
Cristián Berríos
@crisberrios
Feb 13 2015 04:26
hmm... only advice I could give you is delete old cookies, but maybe it's bugged ATM
Bettina Schaden
@bSchaden
Feb 13 2015 04:26
ATM?
Cristián Berríos
@crisberrios
Feb 13 2015 04:27
at the moment
Bettina Schaden
@bSchaden
Feb 13 2015 04:27
ah
i'll try clearing some stuff out tomorrow.
@crisberrios thanks for looking into it
appreciate it
Cristián Berríos
@crisberrios
Feb 13 2015 04:28
no problem, it also helps me learn more :)
Bettina Schaden
@bSchaden
Feb 13 2015 04:28
you're in mexico?
i'm from brazil
but in US
good nigth
night
Cristián Berríos
@crisberrios
Feb 13 2015 04:36
I'm from Chile, but living in Mexico
goodnight!
Danny Fritz
@dannyfritz
Feb 13 2015 16:44
var Person = function(fullName) {
  this.setFullName(fullName);
  return this.getFullName();
};

Person.prototype = Person.prototype || {};

Person.prototype.getFirstName = function () {
  return this.firstName;
};

Person.prototype.getLastName = function () {
  return this.lastName;
};

Person.prototype.getFullName = function () {
  return this.firstName + ' ' + this.lastName;
};

Person.prototype.setFirstName = function (firstName) {
  this.firstName = firstName;
  return this.getFirstName();
};

Person.prototype.setLastName = function (lastName) {
  this.lastName = lastName;
  return this.getLastName();
};

Person.prototype.setFullName = function (fullName) {
  var names = fullName.split(' ');
  this.setFirstName(names[0]);
  this.setLastName(names[1]);
  return this.getFullName();
};

var bob = new Person('Bob Ross');
do the tests thing it is a chaining API and it is trying to call functions on the strings returned?
cerissa
@cerissa
Feb 13 2015 16:45
ok i need advice, im doing a plain ole javascript game, but i want to add a highscore feature, can anyone help me out with that, here is my game in codepen http://codepen.io/cerissa/pen/vEpRQM
Ashley Drake
@aldraco
Feb 13 2015 16:46
@cerissa what element of the problem in particular are you stuck on?
cerissa
@cerissa
Feb 13 2015 16:46
i dont know what i should do to be get the highscore system. should i do a variable? a while loop or what?
Ashley Drake
@aldraco
Feb 13 2015 16:47
where is the score? all i see is a time
cerissa
@cerissa
Feb 13 2015 16:47
exactly
well i should say quickest time
Ashley Drake
@aldraco
Feb 13 2015 16:48
ah, so you want "high score" to be equal to the quickest time
?
cerissa
@cerissa
Feb 13 2015 16:48
yea,
Danny Fritz
@dannyfritz
Feb 13 2015 16:48
you'll either want to use a closure or a global to store the high score
or some other form of storage outside js
cerissa
@cerissa
Feb 13 2015 16:48
sorry i wasnt more specific,
Ashley Drake
@aldraco
Feb 13 2015 16:49
@dannyfritz would that be a good opportunity to have a high score module? to separate concerns? I'm still figuring out modularization
Danny Fritz
@dannyfritz
Feb 13 2015 16:50
in this case i don't think modularization is necessary unless you just want to learn about it
cerissa
@cerissa
Feb 13 2015 16:51
i thought about doing a variable for quickest time, but im not sure how to save times if that makes sense. i know i would have to compare times in a var but im not sure how to do that.
sorry if thats not making sense
Ashley Drake
@aldraco
Feb 13 2015 16:52
you would only have to update the times if the user got a better score, so there would be some kind of check function each "round"
cerissa
@cerissa
Feb 13 2015 16:53
hmm ok @aldraco
ill try it out
Ashley Drake
@aldraco
Feb 13 2015 16:53
you could use a ternary operator to check
let me see if i can actually get the code formatting to work thsi time ...
''' highScore = (newScore > highScore ? newScore : highScore);'''
dang it
highScore = (newScore > highScore ? newScore : highScore);
cerissa
@cerissa
Feb 13 2015 16:54
its the ``` in the upper left hand corner by the 1
Ashley Drake
@aldraco
Feb 13 2015 16:55
thanks :)
cerissa
@cerissa
Feb 13 2015 16:55
it took me forever to figure that out lol
Ashley Drake
@aldraco
Feb 13 2015 16:55
i'm still not sure on getting codepen in here so i'm not even going to mess with it haha!
i'm going to eat lunch right now... sorry i can't be more helpful
cerissa
@cerissa
Feb 13 2015 16:57
its ok, its leaning me in the right direction, thank you
Cristián Berríos
@crisberrios
Feb 13 2015 16:58
@cerissa if you want the high scores to persist then it's another story (localStorage for instance)
but for session persist a solution like the one @aldraco posted is simple enough
do you want to compare with other users?
cerissa
@cerissa
Feb 13 2015 17:00
yea i found a few websites describing localStorage. and will probably look into that sometime soon.
no i just want to have you beat your high score, its not a complex game just a little something for me to practice my js
Nathan
@terakilobyte
Feb 13 2015 17:02
@dannyfritz thanks, I found the issue
I’ll have a fix live in a few
save your code
Danny Fritz
@dannyfritz
Feb 13 2015 17:05
thanks
Nathan
@terakilobyte
Feb 13 2015 17:17
@dannyfritz I’ll let you know when teh changes go live, have to discuss them with quincy as it results in a change in the way bonfire behaves. It’s a tradeoff in user protection vs allowing prototyping
cerissa
@cerissa
Feb 13 2015 17:19
@crisberrios what value would i put to the newscore var?
Cristián Berríos
@crisberrios
Feb 13 2015 17:24
 reactionTime= (clickedTime-createdTime)/1000;

       highScore=0; 


       highScore = (newScore> highScore ? newScore: highScore);
logic is halfway ok
but if you look, you are resetting the highscore each time you assign it
so new score will always be the high score
Also, variable isn't defined (I don't se a var highscore = 0;) anywhere
and if you define it inside the function, it won't survive after the function ends
so it would be a good idea to define it outside, either as a global variable (not recommended) or inside an object, like var scores = { high: 0}
so you can invoke scores.high from anywhere
cerissa
@cerissa
Feb 13 2015 17:30
ok, ill try that
Nathan
@terakilobyte
Feb 13 2015 17:56
@dannyfritz bonfire has been updated, you may freely prototype away
@dannyfritz and thanks, your (almost) solution to the person challenge has inspired another challenge
;)
Danny Fritz
@dannyfritz
Feb 13 2015 18:07
thanks. finished the challenge. :)
Nathan
@terakilobyte
Feb 13 2015 18:08
only slightly devious, no?
I’m making a new challenge where Object.keys(bob).length will have to equal 0 ;)
Ashley Drake
@aldraco
Feb 13 2015 18:41
bootstrap question for anyone who can help:
Nathan
@terakilobyte
Feb 13 2015 18:41
bootstrap answers
Ashley Drake
@aldraco
Feb 13 2015 18:41
YES
Nathan
@terakilobyte
Feb 13 2015 18:41
MAYBE
;)
lol what’s the question?
Ashley Drake
@aldraco
Feb 13 2015 18:42
i'm watching a tutorial, the teacher says to add the .container class to a <div> wrapped around the content within <body>. I thought the point of HTML5 was to be more semantic; why would you not insert the class directly on the body tag itself? or does it matter?
Nathan
@terakilobyte
Feb 13 2015 18:42
it depends on the look you want
it may be the styling on container doesn’t look very good if it is attached to body
try out some examples locally and see
Ashley Drake
@aldraco
Feb 13 2015 18:44
/typing/ ...
Nathan
@terakilobyte
Feb 13 2015 18:44
also bootstrap by default styles the body element with some stuff
Ashley Drake
@aldraco
Feb 13 2015 18:45
no discernable difference
to me it makes it easier to read the code if you avoid using too many divs... just wondering if there was some convention specifically for bootstrap that was different.
thanks
Nathan
@terakilobyte
Feb 13 2015 19:00
what if you wanted other elements in the body that weren’t in the container?
Cristián Berríos
@crisberrios
Feb 13 2015 19:02
@aldraco bootstrap relies on classes and I think it's too cluttered sometimes. Take a look at bourbon/neat approach.
Ashley Drake
@aldraco
Feb 13 2015 19:03
@crisberrios yeah, that's a lot easier to read. thx, i'll have to get familiar with that.
Cristián Berríos
@crisberrios
Feb 13 2015 19:04
and although it's still very simple, take a look at the source code of my github page. I could even refactor some css to use less classes
Ashley Drake
@aldraco
Feb 13 2015 19:04
@terakilobyte i'm starting to see how it works, and it does rely a lot on divs and classes. quick to get started but uuugly to read.
Nathan
@terakilobyte
Feb 13 2015 19:04
^
jade makes it easier to digest
Ashley Drake
@aldraco
Feb 13 2015 19:06
nice site @crisberrios
jade is interesting ... so much to learn
(that's a good thing imho)
Cristián Berríos
@crisberrios
Feb 13 2015 19:09
jade is more like refining current html knowledge than really learning
is like learning how to write code here, rather than learning a new language
I never used jade before messing with wintersmith the other day.
Nathan
@terakilobyte
Feb 13 2015 19:11
you pick it up fast
Ashley Drake
@aldraco
Feb 13 2015 19:11
so much = so many tools to use
--> better product
Cristián Berríos
@crisberrios
Feb 13 2015 19:13
the trick is learning, but not depending on the tools you learn
Danny Fritz
@dannyfritz
Feb 13 2015 19:53
@terakilobyte http://www.freecodecamp.com/bonfires/truncate-a-string
http://i.imgur.com/6S0oN7F.png
function truncate(str, num) {
  return str.substr(0, num);
}

truncate('A-tisket a-tasket A green and yellow basket', 11);
Nathan
@terakilobyte
Feb 13 2015 19:56
punishment for blocking my analytics
;)
Danny Fritz
@dannyfritz
Feb 13 2015 19:58
:P
Nathan
@terakilobyte
Feb 13 2015 20:00
thanks, fixed the error, changes will go live shortly
but seriously, if you’d consider allowing ga for FCC I’d really appreciate it
if it concerns you I can show you the data we collect
Danny Fritz
@dannyfritz
Feb 13 2015 20:01
okay i unblocked FCC
Nathan
@terakilobyte
Feb 13 2015 20:01
thanks
just so you know
I’m harvesting page loads, if and how many times you click more info, how many times you attempt the run code, and ultimately how long it took to solve a challenge, along with how many attempts
no personal data
you can verify by checking out our source if you want
Danny Fritz
@dannyfritz
Feb 13 2015 20:02
i'm not paranoid. i just have an adblocker with the default settings.
Nathan
@terakilobyte
Feb 13 2015 20:08
kk
btw
reload the challenge and it should work now
thanks for the heads up
Danny Fritz
@dannyfritz
Feb 13 2015 20:12
i think there is an error in the runner now
assert.strictEqual(truncate('A-tisket a-tasket A green and yellow basket’, 'A-tisket a-tasket A green and yellow basket’.length + 2), string, 'should not truncate if string is < length');SyntaxError:Unexpected identifier
Nathan
@terakilobyte
Feb 13 2015 20:22
looking into it
Danny Fritz
@dannyfritz
Feb 13 2015 20:23
ah, one of the apostrophes is a pretty apostrophe
both of the closing apostrophes
Nathan
@terakilobyte
Feb 13 2015 20:25
looking into it
Danny Fritz
@dannyfritz
Feb 13 2015 20:28
@terakilobyte how come your avatar starts as a wolverine, switches to a lambda, but then your hover profile is a PI
4TSG4X
@4TSG4X
Feb 13 2015 20:30
Opposite for me lol.
Nathan
@terakilobyte
Feb 13 2015 20:31
because gitter is super slow on updating avatars
Nathan
@terakilobyte
Feb 13 2015 20:47
cleaning up that challenge, sorry
Danny Fritz
@dannyfritz
Feb 13 2015 20:53
You're going to hate this @terakilobyte. haha.
you have a character instead of a .... Also, I don't think the checked value is right.
expect(truncate('A-tisket a-tasket A green and yellow basket', 24)).to.eqls('A-tisket…');AssertionError:expected 'A-tisket a-tasket A g...' to deeply equal 'A-tisket…'
Nathan
@terakilobyte
Feb 13 2015 20:55
yeah I’ve cleaned that up too, it should work now
not sure why the contributers text editor put those in there, I’m goign to have to talk to him about it
Danny Fritz
@dannyfritz
Feb 13 2015 20:56
passed. :P
Nathan
@terakilobyte
Feb 13 2015 20:58
thanks
again, not sure wher ethese special chars came from
nor why the linter isn’t picking them up
kind of pissing me off
I don’t see any more though
Danny Fritz
@dannyfritz
Feb 13 2015 21:00
well, the ... in the string is fine. But, not the pretty apostrophes.
they aren't picked up becuase they are all encoded in a string.
Nathan
@terakilobyte
Feb 13 2015 21:01
the … isn’t ok either for the purposes of the way the test was written
Danny Fritz
@dannyfritz
Feb 13 2015 21:03
well, i mean in the linters perspective. they are all valid characters in a string.
Nathan
@terakilobyte
Feb 13 2015 21:03
true
well it’s fixed now
which is the most important aspect to me
Danny Fritz
@dannyfritz
Feb 13 2015 21:47
@terakilobyte next one: http://www.freecodecamp.com/bonfires/where-art-thou
answer doesn't look right assert.deepEqual(where([{ 'a': 1 }, { 'a': 1 }, { 'a': 1, 'b': 2 }], { 'a': 1 }), [{ 'a': 1 }, { 'a': 1 }, { 'a': 1 }], 'should return with multiples');
Nathan
@terakilobyte
Feb 13 2015 21:50
pm me your code plz?
Cristián Berríos
@crisberrios
Feb 13 2015 22:20
does anyone remember that js or css that shows the outline of every element?
Danny Fritz
@dannyfritz
Feb 13 2015 22:22
probably something like
  • { outline: solid 1px #f00 }
* { outline: solid 1px #f00 }
Cristián Berríos
@crisberrios
Feb 13 2015 22:24
thanks :D
Danny Fritz
@dannyfritz
Feb 13 2015 22:25
this one is pretty neat too dashed 1px hsla(200, 100%, 50%, 0.3)
Dominic Jones
@towwiow
Feb 13 2015 23:12
Could also use devtools