Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Daniel Simeonov
@bjorno43 Amazing, thanks ! @DarkxPunk
@dbsimeonov Sleep well mate
Daniel Slatkin
Hey all. Someone who can help me with a css grid question? :smiley:
Trying to figure out how to make a grid template width be normally content-max of the column as long as it's less than 8em, otherwise it stays at 8em
@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
what do you think about IT courses by google
@newtothat Do you want to learn IT stuff?
@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
or Learning IT stuff is like preperation for computer science. And computer science in english is more like for native englis speakers
@bjorno43 , @Abott1222, @richRocksCodeBlocks Thanks guys!
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];
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
@mpmaan you need to return inside your reduce function
@padunk thanks
abraham anak agung
@mpmaan np, if you want to calculate total in cid, you don't need hash
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
@mpmaan i think the cid is like ONE HUNDRED, 100 means you have 1 ONE HUNDRED. TWENTY, 60 means you have 3 TWENTY notes
lol..really..i need to check the problem statement
abraham anak agung
yup :smile: so in total you have just about 300 something, not 11 thousand, that is too much
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
@mpmaan PENNY is 0.01 notes so 1.01 will be 101 pennies
yeah..now i need to modify a lot of code
Simon Cordova
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?
@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
like login forms where the pass is invisible except the last digit
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
@mpmaan I'm trying something similar to no avail, I'll copy what you wrote so I can follow it closely thank you
@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
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
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
I've got everything in functionality except the hiding of all but the current last digit
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
I'll try it out :)
Claudio Restifo
@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