These are chat archives for FreeCodeCamp/Help

23rd
Jul 2018
Karma Drukpa
@coderkarma
Jul 23 2018 00:08
@thekholm80
question
Karma Drukpa
@coderkarma
Jul 23 2018 00:14
NeverMind i got it.
Karma Drukpa
@coderkarma
Jul 23 2018 00:56
function average(...nums) {
    let sum = 0;

    for (const num of nums){
        sum += num;
      }
    return  sum/nums.length;
}

console.log(average(2, 6));
console.log(average(2, 3, 3, 5, 7, 10));
console.log(average(7, 1432, 12, 13, 100));
console.log(average());
@thekholm80 wondering do you have another way of finding this.
Kyle Holm
@thekholm80
Jul 23 2018 00:57
another way of finding what?
Karma Drukpa
@coderkarma
Jul 23 2018 00:57
also my last test is not passing
avg
Kyle Holm
@thekholm80
Jul 23 2018 00:58
i find averages by adding everything up and dividing by the number of items
Karma Drukpa
@coderkarma
Jul 23 2018 00:58
finding average of unlimited amount of numbers
Kyle Holm
@thekholm80
Jul 23 2018 00:59
what does console.log(average()); return?
Karma Drukpa
@coderkarma
Jul 23 2018 00:59
nan
not a number
Kyle Holm
@thekholm80
Jul 23 2018 00:59
what should it return?
Karma Drukpa
@coderkarma
Jul 23 2018 00:59
0
Kyle Holm
@thekholm80
Jul 23 2018 00:59
so do that then
if there are numbers passed as parameters, return the average. otherwise, return 0
Karma Drukpa
@coderkarma
Jul 23 2018 01:00
oh i see, i could just add 0 while returning
function average(...nums) {
    let sum = 0;

    for (const num of nums){
        sum += num;
      }
    return  sum/nums.length || 0;
}

console.log(average(2, 6));
console.log(average(2, 3, 3, 5, 7, 10));
console.log(average(7, 1432, 12, 13, 100));
console.log(average()); //0
I Could use || operator there?
Kyle Holm
@thekholm80
Jul 23 2018 01:01
did you try it?
Karma Drukpa
@coderkarma
Jul 23 2018 01:01
trying..
it worked .
Kyle Holm
@thekholm80
Jul 23 2018 01:02
good job
Karma Drukpa
@coderkarma
Jul 23 2018 01:02
but is that good way of doing it?
Kyle Holm
@thekholm80
Jul 23 2018 01:03
sure
Karma Drukpa
@coderkarma
Jul 23 2018 01:04
ok. thanks
yesterday question, i had to consult with my friend
to get it done. how did you do it ?
closures question?
Kyle Holm
@thekholm80
Jul 23 2018 01:07
def running_average():
    history = []

    def get_average(num):
        nonlocal history
        history.append(num)

        return round(sum(history) / len(history), 2)

    return get_average
Karma Drukpa
@coderkarma
Jul 23 2018 01:12
is that in python ? does append works like push?
wow that is different
Kyle Holm
@thekholm80
Jul 23 2018 01:12
oh duh
function runningAverage() {
  let history = [];

  return num => {
    history.push(num);
    return Math.round((history.reduce((a, b) => a + b) / history.length) * 100) / 100;
  }
}
sorry
Karma Drukpa
@coderkarma
Jul 23 2018 01:15
nice
Anand Potukuchi
@anandpotukchi
Jul 23 2018 04:25
when you wke up in the morning to see 250 unread messages -_-
Karma Drukpa
@coderkarma
Jul 23 2018 04:25
lol
Anand Potukuchi
@anandpotukchi
Jul 23 2018 04:40
howndo I optimize codepen to show fcc test suites
Note: Did'nt bother reading anything - just clicked on the fcc pen
suvi
@sumaya99
Jul 23 2018 04:52
   <div class="visitorsdiv">
           <div> <label for="visitor">Visitors</label>
            <input type="number" id="visitor" name="visitors" value="2"></div>

          <div>  <label for="check-in">Check-in</label>
            <input type="date" id="check-in" name="Check-in" placeholder=""></div>
            <div>
            <label for="check-out">check-out</label>
            <input type="date" id="check-out" name="Check-out" placeholder=""></div>
            <input class="continue" type="button" value="Continue">
</div>
how can i create an input type date that in the placeholder it should be show day/month/year
but i doesn't work i try all the way
date.PNG
the placeholder turned like that
Rahul
@Rahul59738571_twitter
Jul 23 2018 05:28

@sumaya99 You can start with a simple (and working) solution like date-util for polymer that allows you to use a tag like this one:

<date-util format="dd/MM/yyyy"></date-util>

or
<input type="date" data-date="" data-date-format="DD MMMM YYYY">
Anand Potukuchi
@anandpotukchi
Jul 23 2018 06:19
shoudl the survey form be just a design or should it be functional?
coz i guess the one in the example is
Anand Potukuchi
@anandpotukchi
Jul 23 2018 06:57
nobody online?
Claudio Restifo
@Marmiz
Jul 23 2018 07:13
As long as it suffice the user stories you'll be good to go @anandpotukchi
May Kittens Devour Your Soul
@diomed
Jul 23 2018 07:19
where is 90es.css
Prakash Kumar
@ThePrakashKumar
Jul 23 2018 08:14
1121.JPG
What is the problem?
Here is link of challenge
Aditya
@ezioda004
Jul 23 2018 08:31
@ThePrakashKumar Typo in arr[i].lenght
1LifeLess
@1LifeLess
Jul 23 2018 13:40

Please tell me i didn't go nuts, on FreeCodeCamp => splice is working like slice

let test= [0,1,2,3,4,5,6].splice(0,2);
      console.log(test);

can someone go to his account and test it?

image.png
Aditya
@ezioda004
Jul 23 2018 13:49
@1LifeLess .splice() also mutates the array and returns the removed chunk.
1LifeLess
@1LifeLess
Jul 23 2018 13:50
@ezioda004 ..hu...so if i want to return the mutated array and not the removed chunk?
Aditya
@ezioda004
Jul 23 2018 13:51
@1LifeLess
const arr = [1, 2, 3];
arr.splice(0, 1);
console.log(arr); //[2, 3]
1LifeLess
@1LifeLess
Jul 23 2018 13:52
@ezioda004 huuu.. i see, thank you! :-)
Marc
@MWBauer
Jul 23 2018 14:27
Hey folks. I was wanting to get your opinion on something. I'm making an app that requires a database of recipes. Do you think it better to let the user input the recipe or hardcode it into the app?
May Kittens Devour Your Soul
@diomed
Jul 23 2018 14:52
@MWBauer porque no los dos?
Aditya
@ezioda004
Jul 23 2018 14:52
Thats a good taco recipe.
May Kittens Devour Your Soul
@diomed
Jul 23 2018 14:53
ice cream as well
Marc
@MWBauer
Jul 23 2018 14:55
@diomed no porque
also, no hablo
Kyle Holm
@thekholm80
Jul 23 2018 15:04
yo soy un hombre con mucho queso
Aditya
@ezioda004
Jul 23 2018 15:17
You need soy sauce?
Kyle Holm
@thekholm80
Jul 23 2018 15:17
yes please
Spur
@Spur_Gaming_twitter
Jul 23 2018 15:17
May i join ? :)
Aditya
@ezioda004
Jul 23 2018 15:19
Yes, we're about to apply soy sauce to Kyles head on his demand.
Kyle Holm
@thekholm80
Jul 23 2018 15:20
do i get a vote on this plan?
Aditya
@ezioda004
Jul 23 2018 15:21
Too late hombre.
Karma Drukpa
@coderkarma
Jul 23 2018 15:21
hhahahahha
nalinpuri
@nalinpuri
Jul 23 2018 16:36
hello pls tell me what i am doing wrong in https://codepen.io/nalinpuri/pen/qKeKGL
I want to put the survey at the topbelow the white background at center.
how can i do that
survey text
gishy1
@gishy1
Jul 23 2018 16:38
hello world !!
i need help spacing my nav elements
i tried botttom-border in css and it failed
Ene Catalin
@EneCatalin
Jul 23 2018 16:45
maybe this ?
gishy1
@gishy1
Jul 23 2018 16:47
oh because i summoned the flex god i must continue along that line ?
got you
but is should be able to access the nav elements,no?
Ene Catalin
@EneCatalin
Jul 23 2018 16:49
I suck at css and remmebered flex-boxes
figured they have some auto-sizing
gishy1
@gishy1
Jul 23 2018 16:53
hmm is that why i cant seem to get my boxes to size properly
Yago Estévez
@yagoestevez
Jul 23 2018 16:59
@gishy1 looks like your using flexbox properties in a non-flex element
Also, there are typos
space-between no inbetween
Yago Estévez
@yagoestevez
Jul 23 2018 17:24
Anyone know what this "like" thing is about? https://giant-chronometer.glitch.me/
I wanted to figure it out myself, but Google Finance seems to be down and I the example project above doesn't work...
Kyle Holm
@thekholm80
Jul 23 2018 17:37
@yagoestevez kind of weird, but it looks like the site is tracking user's 'likes' on each stock, recording it and then if you search for 2 stocks it will show how one's 'likes' compares to the other
kind of like some financial popularity contest
May Kittens Devour Your Soul
@diomed
Jul 23 2018 17:40
@yagoestevez are u on glitch
like registered and all
Alexander R Bott
@Abott1222
Jul 23 2018 17:47
Kyle Holm
@thekholm80
Jul 23 2018 17:47
@Abott1222 oh geez
i don't know how i feel about that
Alexander R Bott
@Abott1222
Jul 23 2018 17:58
@thekholm80 ?
they picked an easy target to emulate, windows lol
Kyle Holm
@thekholm80
Jul 23 2018 17:58
they say they 100% wrote it from scratch - my concern would be security
Alexander R Bott
@Abott1222
Jul 23 2018 17:58
they arent trying to copy linux
Kyle Holm
@thekholm80
Jul 23 2018 17:58
windows isn't best known for being secure, and they have billions invested
Alexander R Bott
@Abott1222
Jul 23 2018 17:58
cant be much worse than windows
^
yup lol
its an interesting project though
Kyle Holm
@thekholm80
Jul 23 2018 17:59
linux is super secure, but they have a massive community of developers
it would be fun to download and play with, though
and i'm all about a gaming platform that doesn't require windows. if someone builds that, I'm all for it
Alexander R Bott
@Abott1222
Jul 23 2018 17:59
ya I would wait until they react v1 though hahaha
anyway back to work. just thought you would find that interesting
Kyle Holm
@thekholm80
Jul 23 2018 18:00
it's a good find, thanks
May Kittens Devour Your Soul
@diomed
Jul 23 2018 18:14
:hearts: favorite & forget
Ene Catalin
@EneCatalin
Jul 23 2018 18:19
at some point opening the saved pages becomes a scary task
Alexander R Bott
@Abott1222
Jul 23 2018 18:35
2 many media queries
Kyle Holm
@thekholm80
Jul 23 2018 18:57
@diomed x
May Kittens Devour Your Soul
@diomed
Jul 23 2018 18:58
ah yes, my old wallpaper
how nice to see it again
Kyle Holm
@thekholm80
Jul 23 2018 18:59
i'm sad that i'll never be that cool
idris
@idris12
Jul 23 2018 18:59
hello
Laura Veee
@Cyclokitty
Jul 23 2018 19:00
That is a glorious wallpaper
idris
@idris12
Jul 23 2018 19:02
test.PNG
how do i make the lower one on the same line with the first
the lower line is a ul but i used float
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:03
by showing code coz we aint screenshot readers
Kyle Holm
@thekholm80
Jul 23 2018 19:04
image.png
i used paint
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:04
haha.good1
fixed it
@thekholm80 u misunderstood him, he wanted those lower ones above, not above one lowered. lol
so. borked it
Kyle Holm
@thekholm80
Jul 23 2018 19:05
turn it upside down?
@idris12 joking aside, it's hard to suggest anything when we don't know anything about your code
idris
@idris12
Jul 23 2018 19:07
test2.PNG
here is the css
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:08
thanks for all the screenshots. lol
@idris12 ever heard of codepen.io or https://jsfiddle.net
Kyle Holm
@thekholm80
Jul 23 2018 19:14
how's this?
idris
@idris12
Jul 23 2018 19:20
its very good but the "us" on contact goes underneath
i want all of them to be on one line
Kyle Holm
@thekholm80
Jul 23 2018 19:21
oh i was aiming more at a 'proof of concept' not perfection
you may have to adjust to make it perfect
idris
@idris12
Jul 23 2018 19:22
ok thank you also that justify content is a new one for me
i havent seen that before
Kyle Holm
@thekholm80
Jul 23 2018 19:23
you could put your margins back and use justify-content: space-between; instead
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:26

watch us rock your world with our web design capabilities

O_o

that may be an overstatement for now
idris
@idris12
Jul 23 2018 19:29
@thekholm80 still no luck
i tried adjusting the margin to move it to the left maybe it will readjust
but its stuck there
@diomed haha
Yago Estévez
@yagoestevez
Jul 23 2018 19:32
@thekholm80 sorry, I was away. So likes are about that... Aright then. Thanks!
@diomed I'm registered on glitch, yes.
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:34
@yagoestevez are u mby on support forums
Yago Estévez
@yagoestevez
Jul 23 2018 19:35
Nope
spaniarddev
About that... How can I change my name there? :D
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:38
u should ask that on support forums :smiling_imp:
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:49

screech screech

Yago Estévez
@yagoestevez
Jul 23 2018 19:50
hah
Definitely
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:51
@yagoestevez if u register, could u ask smth for me?
Kyle Holm
@thekholm80
Jul 23 2018 19:52
$10 says it's "why did you ban diomed?"
Vaibhav Singh
@vaibhavsingh97
Jul 23 2018 19:52
Hi developers! Help me understand better what difficulty do you face working on side projects, how do you manage your tasks and build a team? What tools and platforms do you use?
bit.ly/2LIGzIN
Yago Estévez
@yagoestevez
Jul 23 2018 19:54
lol
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:54
@vaibhavsingh97 I use tools and platforms
Kyle Holm
@thekholm80
Jul 23 2018 19:55
that's an ugly bird
May Kittens Devour Your Soul
@diomed
Jul 23 2018 19:56
such a bully
Fay Vor
@phavor
Jul 23 2018 20:21
How can I change the color scheme of the ubuntu's default terminal to a color scheme I downloaded from github?
Kyle Holm
@thekholm80
Jul 23 2018 20:22
did the github repo have any instructions?
Fay Vor
@phavor
Jul 23 2018 20:23
Yea, I should go to preference -> color -> and then click on load preset
but the problem is that, when I click on the color tab there is no load preset or anything like that, when I try to change the color, the best I see there is custom. There is no way to open the file-system and load any file
Kyle Holm
@thekholm80
Jul 23 2018 20:26
can you share the link to the repo?
Fay Vor
@phavor
Jul 23 2018 20:26
@thekholm80 am trying to configure the new zsh and oh-my-zsh which I installed earlier today
Kyle Holm
@thekholm80
Jul 23 2018 20:28

did you do this part?

Drop the cobalt2.zsh-theme file in to the ~/.oh-my-zsh/themes/ directory.

Open up your ZSH preferences at ~/.zshrc and change the theme variable to ZSH_THEME=cobalt2.

Fay Vor
@phavor
Jul 23 2018 20:29
yes I did
Kyle Holm
@thekholm80
Jul 23 2018 20:29
and it saved correctly?
Fay Vor
@phavor
Jul 23 2018 20:30
yes I used nano. so I did the normal ctrl x y and enter to save the modification
Kyle Holm
@thekholm80
Jul 23 2018 20:30
i :heart: nano
Fay Vor
@phavor
Jul 23 2018 20:30
lol same here. I can't seem to get a hold on it's pal vim
Kyle Holm
@thekholm80
Jul 23 2018 20:31
i've never even bothered to try
editing config files with nano is too easy
Fay Vor
@phavor
Jul 23 2018 20:31
:laughing:
Kyle Holm
@thekholm80
Jul 23 2018 20:31
i'm not sure what this iTerm2 is
In iTerm2 access the Preferences pane on the Profiles tab.
Fay Vor
@phavor
Jul 23 2018 20:32
It's a terminal app for MacOx users
Kyle Holm
@thekholm80
Jul 23 2018 20:32
that explains why i don't know what it is lol
Fay Vor
@phavor
Jul 23 2018 20:32
zsh is supposed to be the remedy for other linux distros
Kyle Holm
@thekholm80
Jul 23 2018 20:34
i'm looking through zsh's docs to see if they have linux help
Fay Vor
@phavor
Jul 23 2018 20:34
aiit
Kyle Holm
@thekholm80
Jul 23 2018 20:36
cobalt2.itermcolors is for anyone who uses iTerm2 and wants the colours.
Fay Vor
@phavor
Jul 23 2018 20:36
That means, linux users can't use it?
Kyle Holm
@thekholm80
Jul 23 2018 20:37
maybe?
Fay Vor
@phavor
Jul 23 2018 20:39
it :broken_heart: my heart
Kyle Holm
@thekholm80
Jul 23 2018 20:41
sorry. it may be possible to get it working - but i can't spend the rest of the day trying to figure it out
Fay Vor
@phavor
Jul 23 2018 20:45
I'd keep looking around
1LifeLess
@1LifeLess
Jul 23 2018 21:24
image.png
damn it didn't let me to add description, well it's React, in JS the way to get date is "new Date()" but in React it throw an error, why?
The solution is to NOT use the "new" keyword, can someone please explain why?
alpox
@alpox
Jul 23 2018 21:27
@1LifeLess Date() returns a string with the current time. new Date() returns a new date object
1LifeLess
@1LifeLess
Jul 23 2018 21:28
@alpox hmm..i see now...many thanks!
PeterWebDev
@PeterWebDev
Jul 23 2018 23:33
quick review on portfolio please looking to refine it