These are chat archives for FreeCodeCamp/HelpFrontEnd

21st
Jun 2018
Aymen
@AymenAlSalem
Jun 21 2018 00:38
@DSlatkin you can use minmax(min,max) to define minimum and maximum column width.
here is a lesson from FCC youtube that helped me to fully understand CSS grid : https://www.youtube.com/watch?v=t6CBKf8K_Ac&t=28s
include*engine
@newtothat
Jun 21 2018 01:00
what do you think about IT courses by google
Brad
@bradtaniguchi
Jun 21 2018 01:46
@newtothat Do you want to learn IT stuff?
include*engine
@newtothat
Jun 21 2018 02:25
@bradtaniguchi yes it helps to understand and going through history of technolgy and comparing tools that we had by than and what we have now
learning how computer works actually it helps me to understand .I mean everything you learn about computers.each skill helps to understand the other new ones easier and everything kinda starts to make sense
include*engine
@newtothat
Jun 21 2018 02:51
or Learning IT stuff is like preperation for computer science. And computer science in english is more like for native englis speakers
midnitedev101
@midnitedev101
Jun 21 2018 05:11
@bjorno43 , @Abott1222, @richRocksCodeBlocks Thanks guys!
mpmaan
@mpmaan
Jun 21 2018 06:52
This program prints undefined. I don't know what's wrong. Can anybody help?
function checkCashRegister(price, cash, cid) {
  let hash = {
    "PENNY": 0.01,
    "NICKEL": 0.05,
    "DIME": 0.1,
    "QUARTER": 0.25,
    "ONE": 1,
    "FIVE": 5,
    "TEN": 10,
    "TWENTY": 20,
    "ONE HUNDRED": 100
  }
console.log(available(hash, cid));
}
function available(hash,cid){
  return cid.reduce((prev, curr)=>{
    prev += hash[curr[0]]*curr[1];
  },0);
}
checkCashRegister(19.5, 20, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]);
abraham anak agung
@padunk
Jun 21 2018 06:58
@mpmaan you need to return inside your reduce function
mpmaan
@mpmaan
Jun 21 2018 07:01
@padunk thanks
abraham anak agung
@padunk
Jun 21 2018 07:04
@mpmaan np, if you want to calculate total in cid, you don't need hash
mpmaan
@mpmaan
Jun 21 2018 07:05
i need to map "HUNDRED" to 100 then multiply it with available number of notes
second value in 1D arrays is the number of notes/coins
abraham anak agung
@padunk
Jun 21 2018 07:07
@mpmaan i think the cid is like ONE HUNDRED, 100 means you have 1 ONE HUNDRED. TWENTY, 60 means you have 3 TWENTY notes
mpmaan
@mpmaan
Jun 21 2018 07:08
lol..really..i need to check the problem statement
abraham anak agung
@padunk
Jun 21 2018 07:08
yup :smile: so in total you have just about 300 something, not 11 thousand, that is too much
mpmaan
@mpmaan
Jun 21 2018 07:09
i am unable to conclude that from the question
ok..got it
because for "PENNY" number of coins can't be fraction like 1.01
abraham anak agung
@padunk
Jun 21 2018 07:13
@mpmaan PENNY is 0.01 notes so 1.01 will be 101 pennies
mpmaan
@mpmaan
Jun 21 2018 07:14
yeah..now i need to modify a lot of code
Simon Cordova
@gbsimon87
Jun 21 2018 08:02
Hey all! - was wondering if anyone could lend a quick hand
I've got an input, imagine a pinpad, and upon clicking a button, I only want to show the last digit on the input, but the previous digits must be an asterisk - any thoughts how to accomplish such a task?
mpmaan
@mpmaan
Jun 21 2018 08:23
@gbsimon87 i don't understand what do you want to do? what do you mean by previous digits being asterick?
if i press 3 should the output be *3?
or like those login forms where the password is invisible except for the last digit?
Simon Cordova
@gbsimon87
Jun 21 2018 08:27
like login forms where the pass is invisible except the last digit
@mpmaan
mpmaan
@mpmaan
Jun 21 2018 08:28
you can try something like n = length_of_the_character_in_input_field and then replace it with newInput = ***(upto n times) + new_entered_digit
Simon Cordova
@gbsimon87
Jun 21 2018 08:29
@mpmaan I'm trying something similar to no avail, I'll copy what you wrote so I can follow it closely thank you
mpmaan
@mpmaan
Jun 21 2018 08:35
@gbsimon87 the method i told you might cause inconvenience to users. if they pressed * then it will seem like it has been hidden , for example if current input is ***3 and user presses * then new input will be *****
what is 'no avail`?
Simon Cordova
@gbsimon87
Jun 21 2018 08:45
@mpmaan
No avail means no success
The only way the user can input a number is by clicking a button with the mouse, not with the keyboard.
The layout itself is an pinpad, so a disabled input up top and 9 numbers at the bottom. Upon clicking a button, it will take that button's value and insert it in the input. Currently it's working well just showing every number, I need to mask al but the last digit
mpmaan
@mpmaan
Jun 21 2018 08:46
like when user has entered correct pin it will automatically login into account or something similar
without the need to press enter or any submit button?
Simon Cordova
@gbsimon87
Jun 21 2018 08:48
Exactly
I've got everything in functionality except the hiding of all but the current last digit
mpmaan
@mpmaan
Jun 21 2018 08:48
then my method should work
but there mightbe some delay when updating the input
although user won't notice it because of presence of * characters
most probably lol
Simon Cordova
@gbsimon87
Jun 21 2018 08:54
I'll try it out :)
Claudio Restifo
@Marmiz
Jun 21 2018 08:56
@gbsimon87 something like
const hide = n =>
('' + n).slice(0, -1).replace(/./g, '*') + ('' + n).slice(-1);
you can add more argument to change the hiding char or the length of the visible number
caution: the return val is a string and not a number (since it has * in it)
Simon Cordova
@gbsimon87
Jun 21 2018 08:57
@Marmiz thank you, it can be either a string or number really, current they're strings in my app anyway
mpmaan
@mpmaan
Jun 21 2018 08:58
what wil slice(0,-1) do?
Claudio Restifo
@Marmiz
Jun 21 2018 08:58
return everything but the last letter of the string

from mdn

If negative, it is treated as strLength + endIndex where strLength is the length of the string (for example, if endIndex is -3 it is treated as strLength - 3).

ie: 6 -1 == 5
mpmaan
@mpmaan
Jun 21 2018 08:59
good..i didn't know it
abraham anak agung
@padunk
Jun 21 2018 09:02
@Marmiz if we replace the password with * will it still read as number or string when we store it in database?
Claudio Restifo
@Marmiz
Jun 21 2018 09:04
it returns a string
bit no other way since you want to change it to a string
that's why you should have a formatter and a parser so that once you read the value is back as a number
Adam Jacks
@AdamHJ123
Jun 21 2018 09:05
Hey guys, I've been working as a front end developer for a year and 2 months now. I got let go yesterday
I need to build a new portfolio and get a new job ASAP but I'm bad with design and I can't find good enough inspiration to give me a base design idea
Could anyone help me out a little?
abraham anak agung
@padunk
Jun 21 2018 09:06
@Marmiz ah i see, never know about formatter or parser.
mpmaan
@mpmaan
Jun 21 2018 09:06
I got let go yesterday
@AdamHJ123 what do you mean?
@Marmiz yeah, what is formatter, parser?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:07
Essentially I got fired but not for bad reasons
abraham anak agung
@padunk
Jun 21 2018 09:07
@AdamHJ123 sorry to hear that
i'm not good with css or design too, maybe just surf the internet ?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:08
@padunk Cheers, I think it could benefit me to be honest. I wanted to move to a new area anyway and I'm getting paid for the rest of the month, next month, and all of my owed holiday pay
I've checked out a lot of portfolios but none of the designs interest me
mpmaan
@mpmaan
Jun 21 2018 09:09
you can't expect people using linux(me) to know anything about design...
Adam Jacks
@AdamHJ123
Jun 21 2018 09:09
I've made big sites and and a lot of great projects to go on my portfolio
Claudio Restifo
@Marmiz
Jun 21 2018 09:09

@mpmaan @padunk well, you should write your own function that handles the user input --> formatter.
then one when you actually read the value --> parser.

those are just names. I could have called them ironman and spiderman for that regard

mpmaan
@mpmaan
Jun 21 2018 09:10
lol ..you seem to be a marvel fan
Claudio Restifo
@Marmiz
Jun 21 2018 09:10
@AdamHJ123 I don't even have a portfolio, I just link my github
otherwise have you checked dribbble? good designers post snippets there. Maybe you see something that interest you :)
abraham anak agung
@padunk
Jun 21 2018 09:11
@Marmiz lol... i preferred naruto and sasuke then
Adam Jacks
@AdamHJ123
Jun 21 2018 09:11
@Marmiz I feel like it's nice to have my projects all neatly in one place
I'll check out Dribbble thank you
mpmaan
@mpmaan
Jun 21 2018 09:12
check behance too
Adam Jacks
@AdamHJ123
Jun 21 2018 09:12
Will do :D
abraham anak agung
@padunk
Jun 21 2018 09:12
@AdamHJ123 neat design on padstow
Adam Jacks
@AdamHJ123
Jun 21 2018 09:12
Yea the designer at the company I was at did the design
I just built the front end
mpmaan
@mpmaan
Jun 21 2018 09:12
yeah, i might be able to buld something like that by the end of this year
Adam Jacks
@AdamHJ123
Jun 21 2018 09:12
Did animations and JS
@mpmaan Stuff like that is easy to do just takes a little while to get used to doing and a long time to do it right
Took about a month
For front end alone
mpmaan
@mpmaan
Jun 21 2018 09:16
@AdamHJ123 lol..it's clear how good is your design skill by looking at your portfolio
zombie game is cool
mpmaan
@mpmaan
Jun 21 2018 09:23
console.log(96.74 - 90) prints 6.739999999. How can i get only 6.74?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:23
@mpmaan In all fairness I made that like a a year and a half ago
abraham anak agung
@padunk
Jun 21 2018 09:25
@mpmaan you could use Math.floor, .round or .toFixed
mpmaan
@mpmaan
Jun 21 2018 09:26
.floor() will give 6, .round() will give 7
never heard of .toFixed().. what does it do?
@padunk by the way , i'm still solving that cash register question
i solved it for a week :smile:
mpmaan
@mpmaan
Jun 21 2018 09:32
:confetti_ball: thanks to you just finished it
Adam Jacks
@AdamHJ123
Jun 21 2018 09:33
I've been given a contact for a company. I've looked at this companies website, bare in mind they are a web development company
If I hover on their logo, it disappears
mpmaan
@mpmaan
Jun 21 2018 09:33
can you give website link?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:33
I looked at the CSS, they have a 3000+ line single file
abraham anak agung
@padunk
Jun 21 2018 09:35
@mpmaan more about floating point precision here
mpmaan
@mpmaan
Jun 21 2018 09:35
@AdamHJ123 looks creative
but i think there is a glitch in their logo animation
Adam Jacks
@AdamHJ123
Jun 21 2018 09:43
@mpmaan It's not a well made website
mpmaan
@mpmaan
Jun 21 2018 09:44
yeah..in some places text is hard to read
Adam Jacks
@AdamHJ123
Jun 21 2018 09:44
A lot of the hovers are borken
Broken*
No transitions on a lot of hovers
Animations and hovers happen at mobile when they clearly shouldn't
mpmaan
@mpmaan
Jun 21 2018 09:46
haha...they also seem to be a wordpress fanboy..if you know wordpress you may get a job plus point out faults in their website and give some suggestions
Adam Jacks
@AdamHJ123
Jun 21 2018 09:46
I could do wonders for a company like that haha
I've used Wordpress a bit, I don't like it but I need a job
I'll show them how useful I am by pointing out their flaws and showing how I can improve them
A company like that should be using SCSS and BEM
mpmaan
@mpmaan
Jun 21 2018 09:47
lol..making your portfolio better than their website will do wonders
Adam Jacks
@AdamHJ123
Jun 21 2018 09:47
Exactly haha
Plus I only want about £18,000
abraham anak agung
@padunk
Jun 21 2018 09:51
@AdamHJ123 what is BEM?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:51
@padunk It's an acronym for Block Element Modifier
It's the best way I've found to lay out SCSS/CSS
So block__element--modifier
Example: header__logo--big
mpmaan
@mpmaan
Jun 21 2018 09:52
@padunk check this out
is reading bootstrap and jquery docs from their website a good way to learn them?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:55
@mpmaan Idk why they use bootstrap tbh, it's not necessary
mpmaan
@mpmaan
Jun 21 2018 09:55
who?
Adam Jacks
@AdamHJ123
Jun 21 2018 09:56
FreeCodeCamp
I don't find it useful
abraham anak agung
@padunk
Jun 21 2018 09:57
@AdamHJ123 oh, that is what happen with all that double underscore. Thanks @mpmaan
mpmaan
@mpmaan
Jun 21 2018 09:58
we can't create complete page from scratch always..sometimes it's better to use a framework
@padunk what do you think about saa vs scss vs less?
lol that was for @AdamHJ123
Adam Jacks
@AdamHJ123
Jun 21 2018 09:59
@padunk It's just naming conventions, helps make it clear haha
abraham anak agung
@padunk
Jun 21 2018 09:59
@mpmaan i like saas, but never use less, saw the syntax but kind of confusing
Adam Jacks
@AdamHJ123
Jun 21 2018 09:59
@mpmaan SCSS is the way to go
I used to use SASS but in large files the indentation gets confusing
mpmaan
@mpmaan
Jun 21 2018 10:01
does scss has a website? i am unable to find it
Dhaval Vira
@dhavalveera
Jun 21 2018 10:01
yes scss has website
Adam Jacks
@AdamHJ123
Jun 21 2018 10:01
You can use SCSS on Codepen
I use GULP to compile mine though
mpmaan
@mpmaan
Jun 21 2018 10:02
i searched for scss and first result is sass
@dhavalveera can you give the link?
Dhaval Vira
@dhavalveera
Jun 21 2018 10:05
for the for the Mis-confusion you can use SCSS on CodePen
Adam Jacks
@AdamHJ123
Jun 21 2018 10:05
SASS is the same as SCSS
But SCSS use brackets
Adam Jacks
@AdamHJ123
Jun 21 2018 10:25
What do you guys think of this site?
Thinking about going for a similar design
mpmaan
@mpmaan
Jun 21 2018 10:29
the best i've ever seen
Adam Jacks
@AdamHJ123
Jun 21 2018 10:29
There we go
I want mine to be with text though
So this is gonna be difficult
Daniel Feldman
@Feldbot
Jun 21 2018 13:51
I'm working on the Simon app, and they provided links to short sounds that last about 250ms. Does anyone know of a method that could sustain the sound for a predefined amount of time, say a second? I'm wondering if a method exists or if I actually would have to edit the audio file.
Marianissimus
@Marianissimus
Jun 21 2018 13:55
@Feldbot There is duration on sound events, but is only a getter; You could try looping that event 4 times, and that is a second;
Tom
@moT01
Jun 21 2018 13:55
http://www.developphp.com/video/JavaScript/Audio-Play-Speed-Setting-playbackRate-Tutorial
Marianissimus
@Marianissimus
Jun 21 2018 13:57
changing the play speed / play rate will also change the pitch of the sound, won't it?
Tom
@moT01
Jun 21 2018 13:59
yes
perhaps there's a way to keep the pitch
Helio Goncalves
@srlhyo
Jun 21 2018 14:16
anyone here uses sass?
I am struggling to set it up
perhaps because it's been installed through cocolatey management package
Daniel Feldman
@Feldbot
Jun 21 2018 14:17
@moT01 @Marianissimus Thanks for the suggestions. The playbackRate does change the pitch so that won't work. I think I need to figure out how to sustain the sound from onclick until mouseup, like how an electronic keyboard would sustain a note. I'm not sure how to loop the sound yet with duration but am working on that angle.
Tom
@moT01
Jun 21 2018 14:36
would looping work? there might be a little pause at the beginning and/or end of the audio file @Feldbot
Daniel Feldman
@Feldbot
Jun 21 2018 14:39
@moT01 There is a pause in the files they provided, so you hear repeated sounds playing when looped instead of sustaining the note.
Tom
@moT01
Jun 21 2018 14:41
you got it to loop?
so maybe you do want to just go and edit the file
Daniel Feldman
@Feldbot
Jun 21 2018 14:46
@moT01 Do you know of a good open source audio editor? Seems strange I'd need to go that route to program the Simon app. Ugh.
Tom
@moT01
Jun 21 2018 14:49
well, you don't have to
no - dont know of one
what os?
Helio Goncalves
@srlhyo
Jun 21 2018 14:51
any moderators that can help me ?
Daniel Feldman
@Feldbot
Jun 21 2018 14:51
@moT01 It seems like a good thing to try to understand though, so probably worth the effort. I'm on Mac. If I find something decent I'll link.
Tom
@moT01
Jun 21 2018 14:53
usually mac has something that would work included
@srlhyo whats the problem
Helio Goncalves
@srlhyo
Jun 21 2018 14:57
@moT01 I have installed sass through cocolatey and now when using cmd to compile a scss file
I get this error C:\Users\Helio\Documents\project-one>sass --watch Source\Sass: Assets\Css Could not find an option named "watch".
it's weird!
Tom
@moT01
Jun 21 2018 15:02
yea, i dont know
maybe that space after the :
can you use any other sass commands there? like sass --help or sass --version (not sure if those are valid)
Daniel Feldman
@Feldbot
Jun 21 2018 15:07
@moT01 I forgot I even had Audacity, but that is a nice free sound editor.
Helio Goncalves
@srlhyo
Jun 21 2018 15:09
@moT01 I can use sass --version
and --help too
I thought about the space after double column too but it is the --watch that cmd doesn't seem to recognize
I really don't know
Tom
@moT01
Jun 21 2018 15:16
what about the \ - should they be /?
not sure why that would make the watch unrecognized
i would try it though
Helio Goncalves
@srlhyo
Jun 21 2018 15:19
didn't work
Tom
@moT01
Jun 21 2018 15:19
how about updating sass
Helio Goncalves
@srlhyo
Jun 21 2018 15:21
but I have just installed it
would that be the problem
I will probably install sass like the old days: with ruby and gem
that's how all tutorials and documents refer to the installation
Tom
@moT01
Jun 21 2018 15:23
that might work - i found this...
The Sass website documentation was referring to Ruby Sass, which has been deprecated. Dart Sass, which you installed via npm, doesn't yet support --watch (sass/dart-sass#264).
I've updated the website to stop mentioning --watch until we have it implemented in Dart Sass.
from here sass/sass#2498
and i think that's what you have
Helio Goncalves
@srlhyo
Jun 21 2018 15:24
yes
let me just read
ye ahahha
amazing!!!
so the installation is fine is just that --watch is not working at the moment
DerMann97
@DerMann97
Jun 21 2018 16:36
Hello everyone ! Can someone explain me what does inverse Reinforcement learning in AI mean ?
mpmaan
@mpmaan
Jun 21 2018 16:39
@DerMann97 you have a higher chance of getting the answer to that question in python room
Payton Jewell
@paytonjewell
Jun 21 2018 16:42

https://codepen.io/lettiebear/pen/MXVpRV

Would anybody be able to tell me why my headings throughout the page are not centered? I created it originally in sublime text and everything displays fine from the original html file, but for some reason once I put it into CodePen, my heading elements are not displaying correctly :(

DerMann97
@DerMann97
Jun 21 2018 16:42
@mpmaan okay thank you ! But i don't really see it in the list
mpmaan
@mpmaan
Jun 21 2018 16:43
@DerMann97 it's the third room in the list
    $i:1;
    @while $i < 11{ 
       .text-#{$i}{
           font-size:5px*$i;
        }
         $i: $i + 1; 
    }
DerMann97
@DerMann97
Jun 21 2018 16:44
Thank you ! @mpmaan
mpmaan
@mpmaan
Jun 21 2018 16:44
i think this code works but i can't pass the challenge
i inspected each p tag in browser and they had correct font-size but i'm failing the tests
mpmaan
@mpmaan
Jun 21 2018 16:52
@lettiebear give margin:0 auto to <div class="row welcome text-center">and other relevant divs as well
mpmaan
@mpmaan
Jun 21 2018 17:10
don't bother with my last question ..it's related to an open issue on github
unless you can fix it
Tom
@moT01
Jun 21 2018 17:22
@lettiebear nice looking site - did you get it fixed? the only thing not centered that I see is the text below the top picture
Connor
@cresharper
Jun 21 2018 17:43
Does anyone here know any viable alternatives/polyfills for new Set() to support this in IE? I'm using filter() and new Set() to compare two array but it does not work in IE. Thanks.
include*engine
@newtothat
Jun 21 2018 18:31
how to resizean input tex with css?
im tring with width and height property it is not working
Aita Kane
@aita-kane
Jun 21 2018 18:32
hello can someone help me please my justify-content: flex-end doesn't work
Rob
@PGFracing
Jun 21 2018 18:35
how do I get a bigger gap (line-height) between 1,2,3,4 without effecting line height of the text in each paragraph
Kaz Baig
@kbaig
Jun 21 2018 18:36
@PGFracing why not just increasing the li margins
Rob
@PGFracing
Jun 21 2018 18:36
let me try that I thought that only effected the #1 not 2,3, and 4
perfecto YOU ROCK!