These are chat archives for FreeCodeCamp/Help

21st
Jul 2018
Momozor
@momozor
Jul 21 2018 06:02
hello world

many elements require an opening <p> and closing </p> tag. some are "self-closing", so they don't require the closing tag, like <input type='text'>
@thekholm80

I'm not familiar with how HTML5 elements works yet, I saw some HTML code use a tag like this <link ... />. Is it okay to use <...> for self closing tags instead of <../> or the latter is actually deprecated and only required for XHTML and older?

Fay Vor
@phavor
Jul 21 2018 06:12

@faraco some elements are self closing while many others require you close them with their closing tags.
<link rel="" href="" /> is an example of self-closing tag. In HTML5 you could leave out trailing backslash. <link rel="" href="" > would work perfectly fine too.

Most of the block elements have to be closed with their pair. <header>...</header> you couldn't do <header ... />

NONE
@BIGDBIRD
Jul 21 2018 08:39
0.0
Spur
@Spur_Gaming_twitter
Jul 21 2018 08:39
What do you call this symbol ""
NONE
@BIGDBIRD
Jul 21 2018 08:40
English poor
Spur
@Spur_Gaming_twitter
Jul 21 2018 08:40
Ur English is poor?
NONE
@BIGDBIRD
Jul 21 2018 08:41
T T
The background-color of your form element should be green.
if i don't add any class or style attributes to your form.how to achieve??T T
Spur
@Spur_Gaming_twitter
Jul 21 2018 08:45
Can you send a screenshot
Fay Vor
@phavor
Jul 21 2018 08:59
what kind of font gets this '►' : '❚ ❚' icons showing
Spur
@Spur_Gaming_twitter
Jul 21 2018 09:00
That's Pause and resume
Fay Vor
@phavor
Jul 21 2018 09:03
yea, but it looks like fonts or × kind of stuff
Fay Vor
@phavor
Jul 21 2018 09:03
I don't wanna use font libs
Spur
@Spur_Gaming_twitter
Jul 21 2018 09:03
Is that what you wanted ?
oh
Fay Vor
@phavor
Jul 21 2018 09:03
I actually wanted something like this &times; kind of stuff
Spur
@Spur_Gaming_twitter
Jul 21 2018 09:04
Oh
Aditya
@ezioda004
Jul 21 2018 09:06
@phavor https://www.compart.com/en/unicode/U+25BA Theres HTML entity there.
Fay Vor
@phavor
Jul 21 2018 09:12
Thanks @ezioda004 Is it possible to find an extension like that for vscode
Aditya
@ezioda004
Jul 21 2018 09:15

@phavor Theres encode decode which can encode

String to HTML Entities
HTML Entities to String
String to Unicode
Unicode to String

Momozor
@momozor
Jul 21 2018 11:43
@phavor Ah, thanks!
balakrishna222111
@balakrishna222111
Jul 21 2018 11:53
image.png
image.png
image.png
Kyle Holm
@thekholm80
Jul 21 2018 13:04
@balakrishna222111 i don't know if you found a solution to this, but the trick to this one is remembering that the String type is an object, so you can destructure the methods from it
const { method: newVariableName } = stringName;
suvi
@sumaya99
Jul 21 2018 13:12
eee.PNG
Ene Catalin
@EneCatalin
Jul 21 2018 13:12
that looks horrible
suvi
@sumaya99
Jul 21 2018 13:13
how can I organize this items in this div without shaking , cuz when i scroll the screen it will all destroy
yea its :sob:
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:17
looks rather nice
typography-wise
:smile:
suvi
@sumaya99
Jul 21 2018 13:18
yyy.PNG
the original design
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:18
@sumaya99 we can't help u with screenshots. u have to send code
suvi
@sumaya99
Jul 21 2018 13:18
typography-wise is for what
alright
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:18
it's for how nice that font is :yum:
suvi
@sumaya99
Jul 21 2018 13:19
            <div class="col-3">
                    <label for="visitors">Visitors</label>
                    <input type="number" id="visitors" name="visitors" value="2"><br>
                    <label for="check-in" id="check-in">check-in</label>
                    <input type="date" id="check-in2" name="day/month/year"><br>
                    <label for="check-out" id="check-out">check-out</label>
                    <input type="date" id="check-out2" name="day/month/year"><br>
                    <input type="submit" id="continue"value="Continue">
        </div>
Rahul
@Rahul59738571_twitter
Jul 21 2018 13:20
use br tag at all the endings
suvi
@sumaya99
Jul 21 2018 13:20
ya i used already
oh shit , i get it :sweat_smile:
Rahul
@Rahul59738571_twitter
Jul 21 2018 13:23
so where u were doing mistake?
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:25
:broken_heart: tags
suvi
@sumaya99
Jul 21 2018 13:25
there r three break tags i should use them for all labels too
Rahul
@Rahul59738571_twitter
Jul 21 2018 13:25
exactly... that is what i suggested...
suvi
@sumaya99
Jul 21 2018 13:26
yea thank u :)
Rahul
@Rahul59738571_twitter
Jul 21 2018 13:26
ur wlcm
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:31
@Rahul59738571_twitter how are u with css?
Rahul
@Rahul59738571_twitter
Jul 21 2018 13:33
m fine with it...
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:35
@Rahul59738571_twitter am having some issues with some logic for css arrows
could you help me out?
Rahul
@Rahul59738571_twitter
Jul 21 2018 13:37
sure...
m always ready to help people
:)
Fay Vor
@phavor
Jul 21 2018 13:39
@sumaya99 have you fixed it?
suvi
@sumaya99
Jul 21 2018 13:40
yup :smiley:
Fay Vor
@phavor
Jul 21 2018 13:40
aiit cool
May Kittens Devour Your Soul
@diomed
Jul 21 2018 13:42
@Rahul59738571_twitter so look here ; see those lil green arrows arrows: template
wanna use them here in this accordion
accordion got styles for arrows like this::
.more:after {
    position: absolute;
    right: 24px;
    top: 50%;
    height: 2px;
    width: 13px;
    background: #cfdca0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transition-property: -webkit-transform;
    -moz-transition-property: -moz-transform;
    transition-property: transform;
    -webkit-transition-duration: 0.2s;
    -moz-transition-duration: 0.2s;
    transition-duration: 0.2s;
}

.less:after {
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    transform: rotate(45deg);
    right: 32px;
}
I tried to replace those but didn't quite succeed
basically - I wanna get rid of those, in favor of those little green arrows from first template
May Kittens Devour Your Soul
@diomed
Jul 21 2018 14:04
banzai!
guy vanished, lol. classic
Kyle Holm
@thekholm80
Jul 21 2018 14:04
i don't blame him
:runner:
May Kittens Devour Your Soul
@diomed
Jul 21 2018 14:05
diomed asks smth = everybody :running:
Fay Vor
@phavor
Jul 21 2018 14:16
fullscreen.png
May Kittens Devour Your Soul
@diomed
Jul 21 2018 14:18
thanks for teh screenshot.
lemme just incorrectly rewrite code
Fay Vor
@phavor
Jul 21 2018 14:18
fullscreen.png Am trying to make the video player fullscreen when I click a button and also remove the fullscreen when I click the same button. A sort of toggling the fullscreen state
Alexander R Bott
@Abott1222
Jul 21 2018 15:52
hello world let me off
ok I have put off playing with phaser for too long
anyone wanna do some pair programming on a game?
Kyle Holm
@thekholm80
Jul 21 2018 17:04
@Abott1222 what kind of game are you making?
Lynn Bucher
@lunacticice_twitter
Jul 21 2018 17:48
can someone please tell me what "The main element should have two paragraph elements as children." means and how to actually do it
Rahul
@Rahul59738571_twitter
Jul 21 2018 17:49
@lunacticice_twitter see u need to add <main> tag
Lynn Bucher
@lunacticice_twitter
Jul 21 2018 17:50
i have a <main> tag
Moisés Man
@moigithub
Jul 21 2018 17:50
main>p*2
Rahul
@Rahul59738571_twitter
Jul 21 2018 17:50
than have u ended it with </main>?
n have u kept the two <p>tags inside the main tag
Lynn Bucher
@lunacticice_twitter
Jul 21 2018 17:51
yes
i did those things rahul
Rahul
@Rahul59738571_twitter
Jul 21 2018 17:51
can u send me screenshot
so that i can check
Moisés Man
@moigithub
Jul 21 2018 17:51
probably if u show ur code.. would be easier... (no guessing )
Lynn Bucher
@lunacticice_twitter
Jul 21 2018 17:52
image.png
Rahul
@Rahul59738571_twitter
Jul 21 2018 17:52
see
u have kept only one p inside main
u must cut ur <main> from 4th line
& paste it to 2nd line
than run it
Lynn Bucher
@lunacticice_twitter
Jul 21 2018 17:54
okay thanks
Rahul
@Rahul59738571_twitter
Jul 21 2018 17:54
ur wlcm
@diomed i was not vanished bro... i went for dinner at that time... that's why i won't responded
1LifeLess
@1LifeLess
Jul 21 2018 21:14
when you do something like (Redux):
const reducer = (state = defaultState, action) => {
}
  1. what is the "state" = means? is it just an alias?
  2. why doing the follow : state = Object.assign({},defaultState) isn't really make the state as a new copy of the object?
b492ouba
@b492ouba
Jul 21 2018 21:16

hi can someone help Basic JavaScript: Storing Values with the Assignment Operator

In JavaScript, you can store a value in a variable with the assignment operator.

myVariable = 5;

This assigns the Number value 5 to myVariable.

Assignment always goes from right to left. Everything to the right of the = operator is resolved before the value is assigned to the variable to the left of the operator.

myVar = 5;
myNum = myVar;

This assigns 5 to myVar and then resolves myVar to 5 again and assigns it to myNum.

Assign the value 7 to variable a.

Assign the contents of a to variable b.
Passed
Do not change code above the line
a should have a value of 7
Passed
b should have a value of 7
a should be assigned to b with =

Kyle Holm
@thekholm80
Jul 21 2018 21:17
@1LifeLess the state = defaultState will assign the value of defaultState to state if no value is provided. so if a value is passed into the reducer, that value will be used. otherwise, the default value will be used instead
i don't really understand your second question
@b492ouba what have you tried?
1LifeLess
@1LifeLess
Jul 21 2018 21:18
@thekholm80 ignore the second, now that i understands what it really does
Kyle Holm
@thekholm80
Jul 21 2018 21:18
:+1:
b492ouba
@b492ouba
Jul 21 2018 21:19
i don't understand how to assign a to b
Kyle Holm
@thekholm80
Jul 21 2018 21:20
the same way the example assigned myVar to myNum
the trick is to remember to read the assignment from right-to-left
var x = 'hello';
var y = x; // store the value of x in y
console.log(y); // 'hello'
b492ouba
@b492ouba
Jul 21 2018 21:30
what is the contents of a
b492ouba
@b492ouba
Jul 21 2018 21:38
i got it thanks @thekholm80
Kyle Holm
@thekholm80
Jul 21 2018 21:42
@b492ouba good job! :tada:
Lee Arnold
@nsanity1
Jul 21 2018 21:53
good evening all
Kyle Holm
@thekholm80
Jul 21 2018 21:53
@nsanity1 :wave:
Lee Arnold
@nsanity1
Jul 21 2018 21:54
hey @thekholm80
:smile_cat:
i'm taking a moment to stop banging my head against my desk
Fay Vor
@phavor
Jul 21 2018 21:55
:department_store: @nsanity1
Kyle Holm
@thekholm80
Jul 21 2018 21:57
that's probably good for both your head and your desk
Lee Arnold
@nsanity1
Jul 21 2018 21:57
lol
let's hope so
Kyle Holm
@thekholm80
Jul 21 2018 21:58
my desk is glass, so i bang my head against other things instead
the sill of my car door, for example
Lee Arnold
@nsanity1
Jul 21 2018 21:58
fair enough...mine is ikea so it can take a light beating every now and then
Kyle Holm
@thekholm80
Jul 21 2018 21:58
oh nice
Lee Arnold
@nsanity1
Jul 21 2018 21:58
emphasis on light
Kyle Holm
@thekholm80
Jul 21 2018 21:59
from what i hear of the ikea assembly experience, i would think they'd have to withstand a bit of abuse
Lee Arnold
@nsanity1
Jul 21 2018 21:59
i have had a lot of furniture from them so far...they hold up pretty well
Kyle Holm
@thekholm80
Jul 21 2018 22:00
i've never been. i did visit their online store though - they seem to have a lot of cool things with unpronounceable names
Lee Arnold
@nsanity1
Jul 21 2018 22:01
the stores are worth the trip...they have a food area that is awesome...i suggest the meatball deal they have
and the furniture is cool too
:wink:
Kyle Holm
@thekholm80
Jul 21 2018 22:02
lol
maybe i'll give it a shot one of these days
Lee Arnold
@nsanity1
Jul 21 2018 22:02
its `` to put in code right?
Kyle Holm
@thekholm80
Jul 21 2018 22:02
`` for inline code
``` for blocks
inline
block
Lee Arnold
@nsanity1
Jul 21 2018 22:03
yea...i need to share this and see if i'm missing something
//Setup
var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["JavaScript", "Gaming", "Foxes"]
    }
];


function lookUpProfile(name, prop){
// Only change code below this line

for(var i=0; i<contacts.length; i++){
if(contacts[i].firstName===firstName){
if(contacts[i].hasOwnProperty(prop)){
  return contacts[i][prop];
}else{
  return "No such property";
}
}


}

return "No such contact"

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
```
Kyle Holm
@thekholm80
Jul 21 2018 22:04
you can edit it and add the ``` on a new line at the end
make sure the opening ``` is on it's own line, too
```
code
```
first off, name = contacts[firstName] i don't think this is what you want, since contacts is an array
Lee Arnold
@nsanity1
Jul 21 2018 22:07
I was trying it from a post i saw about this challenge
even with it out it won't pass...i've done two walkthroughs and still no luck...
Kyle Holm
@thekholm80
Jul 21 2018 22:08
and here if(contacts[i].firstName===firstName){ i don't think you've got a variable called firstName so i don't think this is what you want. you do have an argument called name you can compare to
something like if(contacts[i].firstName === name){
Lee Arnold
@nsanity1
Jul 21 2018 22:08
yea, it was giving me that firstName is undefined
i'll try it...i had that reversed
same error
Alexander R Bott
@Abott1222
Jul 21 2018 22:09
@thekholm80 idk I need to see what I can do with phaser first but probably a simple io game with websockets
Kyle Holm
@thekholm80
Jul 21 2018 22:10
@nsanity1 can you show me just your updated function code?
Lee Arnold
@nsanity1
Jul 21 2018 22:10
nvm, forgot to delete the name= part
Kyle Holm
@thekholm80
Jul 21 2018 22:10
ah, kk
@Abott1222 have a link to the phaser docs?
Lee Arnold
@nsanity1
Jul 21 2018 22:10
i did it above in here, just not in there...lol
that's what happens when you code for 3.5 hrs str8
Kyle Holm
@thekholm80
Jul 21 2018 22:12
gotta take breaks! your desk won't survive much more
Lee Arnold
@nsanity1
Jul 21 2018 22:13
lol
i got a lot done today...i only have 8 lessons left and started today with at least 25 remaining....so progress
Kyle Holm
@thekholm80
Jul 21 2018 22:14
oh well done
i watched golf and read twitter
Lee Arnold
@nsanity1
Jul 21 2018 22:15
i also took up the 100DaysOfCode challenge and want to get my efforts worth the whole way through
Kyle Holm
@thekholm80
Jul 21 2018 22:15
i like that challenge
Lee Arnold
@nsanity1
Jul 21 2018 22:15
i'm on day 3 today
getting a lot done...helped me to refocus my energy
Kyle Holm
@thekholm80
Jul 21 2018 22:21
oh wow, i just tried that challenge using reduce() and it's pretty ugly lol
Lee Arnold
@nsanity1
Jul 21 2018 22:23
lol....don't know that one yet
what does it do?
Kyle Holm
@thekholm80
Jul 21 2018 22:23
when you want to iterate through an array and return a single value, reduce() is the way to go
Lee Arnold
@nsanity1
Jul 21 2018 22:24
ok....i'm guessing i'll get that in later lessons on fcc
Kyle Holm
@thekholm80
Jul 21 2018 22:24
yeah
it's super useful
Lee Arnold
@nsanity1
Jul 21 2018 22:24
looking forward to it then
Kyle Holm
@thekholm80
Jul 21 2018 22:24
map(), filter(), reduce() are all array methods you'll use a ton
Lee Arnold
@nsanity1
Jul 21 2018 22:25
cool...so i know who to come to when i start banging my head again with those.lol
Kyle Holm
@thekholm80
Jul 21 2018 22:25
i'm sure i'll be here lol
reduce has a bit of a learning curve, but map and filter are pretty straight forward
Lee Arnold
@nsanity1
Jul 21 2018 22:26
ok
Spur
@Spur_Gaming_twitter
Jul 21 2018 22:45
Hey kyle
Kyle Holm
@thekholm80
Jul 21 2018 22:54
@Spur_Gaming_twitter :wave:
Spur
@Spur_Gaming_twitter
Jul 21 2018 22:55
I followed you on twitter :)
Kyle Holm
@thekholm80
Jul 21 2018 22:55
oh cool, thanks!
Spur
@Spur_Gaming_twitter
Jul 21 2018 22:57
Thanks!
Karma Drukpa
@coderkarma
Jul 21 2018 22:58
@thekholm80 need some help understanding this question
Kyle Holm
@thekholm80
Jul 21 2018 23:01
this looks like a job for closures!
Karma Drukpa
@coderkarma
Jul 21 2018 23:01

Create a function runningAverage that returns a function.

When the function returned is passed a value and called, the series is updated with the current average of all previous function calls. You will have to use closure to solve this.

this is how it's worded
Kyle Holm
@thekholm80
Jul 21 2018 23:04
so how do you think you should go about it?
man, codewars is full of bugs for me today
Karma Drukpa
@coderkarma
Jul 21 2018 23:06
I might have to declare outer FUNCTION first , and then probably try to find out average in inner function and return it ..
Kyle Holm
@thekholm80
Jul 21 2018 23:11
that's a good way to do it
that was a fun kata, thanks for sharing it
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:23
@thekholm80
need help
image.png
Your stylesheet should declare a red-text class and have its color set to red.
Kyle Holm
@thekholm80
Jul 21 2018 23:24
i don't think you're supposed to include the h2 elements in your style sheet declarations
just the class
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:25
I removed it and now this is unchecked Your h2 element should be red.
Kyle Holm
@thekholm80
Jul 21 2018 23:26
show me your updated code
Karma Drukpa
@coderkarma
Jul 21 2018 23:26
@thekholm80 wondering how should i find average since we only have n as agruement
Kyle Holm
@thekholm80
Jul 21 2018 23:26
@coderkarma average is the sum of all numbers, divided by the number of numbers
so you need to express that in your function
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:28
FireShot Capture 2 - Basic CSS_ Use a CSS Class to Style an_ - https___learn.freecodecamp.org_resp.png
Kyle Holm
@thekholm80
Jul 21 2018 23:29
@Spur_Gaming_twitter try fixing your style code
look at how the example code is formatted and see what's different about yours. to start with, you have a ,
Karma Drukpa
@coderkarma
Jul 21 2018 23:30
@thekholm80 could you give me example
i know how to find average but not with closure
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:31
image.png
Kyle Holm
@thekholm80
Jul 21 2018 23:32
@Spur_Gaming_twitter what does your code look like now?
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:32
.red-text, h2 {color: red;}
Kyle Holm
@thekholm80
Jul 21 2018 23:32
@coderkarma i'm trying to think of a way to help you find the solution, instead of telling you how to do it
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:32
I changed it back to what it was
Kyle Holm
@thekholm80
Jul 21 2018 23:32
but you knew it was wrong before? so why change it back?
Karma Drukpa
@coderkarma
Jul 21 2018 23:32
@thekholm80 sounds good
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:33
It gave me a green mark
If i remove what you said i get uncheck mark
Kyle Holm
@thekholm80
Jul 21 2018 23:34
look at the example code. that is how you would do it if you wanted to use blue instead of red
you should make your code look like that, but instead of blue, use red
@coderkarma okay, so what do you have so far?
Spur
@Spur_Gaming_twitter
Jul 21 2018 23:36
It worked thanks
Kyle Holm
@thekholm80
Jul 21 2018 23:40
oh wow double thanks @coderkarma i didn't know about scope issues with variables in python, learned something new
that is a great kata
Karma Drukpa
@coderkarma
Jul 21 2018 23:41
@thekholm80 i am still not able to figure out what to do ?
John
@taloloy18
Jul 21 2018 23:44
https://codepen.io/taloloy18/pen/RBREOq Hi guys. Why is it my submit button dont move below my Any comments and suggestions although I already put my code.
Kyle Holm
@thekholm80
Jul 21 2018 23:45
@coderkarma what do you have so far?
show me some code
Karma Drukpa
@coderkarma
Jul 21 2018 23:54
@thekholm80
I COULDN'T THINK OF DOING ANYTHING EXCEPT THIS LITTLE TRY
function runningAverage(nums){

    function average(){
        let sum = 0
       for (let i = 0; i <=nums; i +=1){
           sum +=i;
           let avg = sum/ nums.length
           return avg
       }
    }
}
Kyle Holm
@thekholm80
Jul 21 2018 23:55
so a few things
when runningAverage() is called, they're not providing any parameters
so nums isn't doing anything there
Karma Drukpa
@coderkarma
Jul 21 2018 23:56
so that made me kept thinkin
since parameter was not given
Kyle Holm
@thekholm80
Jul 21 2018 23:57
next, you need to be sure you're returning the inner function, so that when runningAverage() is called the return value is your inner function
once you get that far, show me your code again and we'll keep talking through it
Karma Drukpa
@coderkarma
Jul 21 2018 23:58
ok