« first day (3463 days earlier)      last day (1468 days later) » 
00:00 - 21:0021:00 - 00:00

Tay
12:04 AM
Hey I'm having an issue, my canvas project doesnt seem to be reacting to a this statement inside of a class attached to it
Javascript: https://github.com/FunctFlow/genGameObject/blob/master/rsc/index.js

Error: index.js:11 Uncaught TypeError: Cannot read property 'cvs' of undefined
at gameLoop (index.js:11)
 
Tay
12:17 AM
Anyone??
 
user11867329
12:53 AM
something stupid
 
user11867329
My chest hurts so much
 
5:46 AM
🚽
 
6:24 AM
hi all, can someone help to provide a solution for following question
 
@Kerim Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1
Q: Validate user input with whitespace

Domantas ŠlaičiūnasHow to in real-time format user input? For example, the user puts A9364470240ZGS001 to the input field, and javascript format it in the input field in real-time to like: A 936 447 02 40 ZGS 001? <div class="childDumpFile"> <label for="ds">Dataset</label> <input type="text" class="form-...

 
 
3 hours later…
9:31 AM
@Kerim you need to provide a sorta custom formatting function
 
9:51 AM
const names = [{name: 'Person1', id: 1}, {name: 'Person2', id: 2,}]                              I want remove an item for above by using there value or id. How can i do that
 
yes?
 
I want to remove an item by using their value? How can i do that*
Someone please help!!!
 
||> mdn Array.prototype.filter
 
@KarelG "SyntaxError: Unexpected identifier" Logged: ``
 
@JBis le google has modified it again
read the page. It has all info you need
if you comprehend the function, then you know how to remove a specific item from it
arr.filter(element => <condition that element must meet>);
however, that gives you a new array
 
10:09 AM
Isn't is posible with splice?
it
 
Why would you need to use splice?
 
I used filter and it gave me true and false
 
Obviously not correctly
 
10:26 AM
names.filter(element => console.log(element.name !== value.name))
 
...
names.filter(element => ...return true or false here...)
 
So my problem is that I have a list of names and I want to let the users to remove any names that is not. I have the list but I don't know how to let users remove an item by button click
 
||> const isEven = x => (x % 2 === 0); [1,2,3,4,5,6,7].filter(x => isEven(x));
 
@KarelG [2,4,6] Logged: ``
 
@learner if the button has an identifier, use that to find your object
<button data-id="1">delete</button>
then it's just in the click handler:
function delete() {
  const idToDelete = this.dataset.id;
  // use idToDelete in your filter then update dom
}
 
10:48 AM
Did you just enforce some social distancing? :P
 
I sure did :P
How about no
 
I have no qualms with you honestly
and frankly, going to a chatroom to receive insults from you is just a waste of my time
 
A small technical detail is that there's no such thing as "Private" rooms here.
 
was he kicked again?
 
yes
 
10:53 AM
my guess is he'll be back swinging in 30 minutes then
 
It's not worth anybodies time and you should all drop it.
 
😐
nice avatar tho ben.
 
It's okay, the next one is a mod flag :P
 
less nerd-y
 
lmao what made the other more nerdy?
 
10:54 AM
if he comes back, I promise I won't provoke him
 
wasn't the 2nd one 5 minutes?
 
he got a 2nd kick yes
he ignored the warning
 
and I'm off for lunch!
 
Enjoy!
 
Cmon man! Why you kicking me out who is trying to learn
 
10:57 AM
Stop right there
 
Ok but don't kick me out. I am trying to ask questions
 
|| room rules
 
Invalid command! Did you mean: door, riot, goog? Try help for a list of available commands..‍.‍.‍.‍.‍.‍.‍.‍
 
First of all, don't flag messages from people telling you to stop
 
HAMMERTIME!
 
10:59 AM
It won't work in your favor.
 
please check room rules
 
Secondly, you were warned not to be aggressive:
in Trash can, 15 mins ago, by Ben Fortune
So how about you stop being aggressive with the people in here trying to help you
Telling Ben to stay out of it got you kicked the first time.
Please note that Italic names indicate users that are "Room Owners".
As Karel said, read the rules. Then we shouldn't have a problem.
 
Ok I will stop! but Ben I told you to stay out not in a bad way. All I meant was that don't waste your time.
Anyways thanks Karel. I just finished reading it
Btw what is JamesBot
 
A bot
 
Yeah I know
How do we make it
Run Like how to interact with it
 
11:07 AM
long time no see folks :)
 
Take a look at his profile page.
Hi Jon
 
hey - how you been?
 
Hi @JamesBot
 
Could be better... I've got a bit of an infection. No Corona, but serious enough...
The whole corona situation makes it difficult to see a doctor though.
 
ugh... sorry to hear that and yeah - completely get you on that one... was supposed to have a bit of dental work as one of my teeth I swear is trying to kill me but even at the best of times getting a dental appointment is not the easiest thing... sighs
 
11:11 AM
I'm still missing my front tooth 😃 They've had to delay my last 2 appointments for my dental implant
 
youch
just kinda hoping that I can get my stuff done sooner rather than later. I'm to blame though, it's one of those things you put off for a bit because of whatever reasons when it's just a bit of discomfort, then start to really think about it more when it's getting a bit silly... but strangely - one still adapts to it somehow, it's when you know it's going to reach a point of just being completely insane and the option to fix it might not be there for quite a while... sighs
 
Part of the problem is that I was at 40.2 degrees celcius this monday. With such a severe fever, the dentist is like "Nope"
 
@BenFortune my wife is waiting for a dental operation herself
 
@Cerbrus Isn't anything over 38.5 like super deadly?
 
No, that's 42, iirc
38.5 is the cutoff point of it being called a "fever". below that, it's just "elevated temp"
 
11:18 AM
@Cerbrus you feeling better now - 3 days later?
 
Yea, temp still isn't where it should be, but a lot better already
plenty of trouble in my mouth still, tho. but got some antibiotics now
 
best wishes that it stays that way
 
Yea, it'll work out eventually...
 
paws crossed it does... look after yourself... these are "interesting" times
 
Not everyday you see your countries leader in ICU
 
11:34 AM
this whole thing is managing to show human nature in so many ways - some of it is amazing as you all pull together - there's a few of us that go out each day to the supermarket or something and pick up shopping for our nearest neighbours that can't/shouldn't go out and leave it on their frontdoor step
 
Aye, I've been shopping for family and friends, ringing around when I see something in the shops that I know people are struggling to get
Toilet roll...
 
@Cerbrus intriguing that you have a COVID-19 related symptom but you said you don't have it
:P
 
No choughing ;-)
 
and then you've got people taking advantage of it with scare tactics and then you've got people that, while I'm not a fan of our PM tweet stuff like "good riddens - he should vacate a bed so other people more deserving can have one" and all that beep
 
Yeah, death threats too. I don't really like the guy but nobody deserves to die
 
11:38 AM
*trying to figure jon's country*
 
@KarelG The kingdom of united people who don't know what a quarantine is
 
many doesn't :P
 
@BenFortune yup... I think he's a right muppet... but heck... I've never and will never be happy if someone is unwell - I may disagree with them politically but yeah... that's just not something you ever do unless you're a little bit odd :)
 
I reckon we'll hit 1k today, because people don't know how to stay the hell indoors
 
but truth is actually that we have under-estimated the virus
even my gov made the same mistake
 
11:42 AM
@BenFortune it's interesting in a way - he wanted to be PM of this country since just a kid... I reckon this isn't what he had in mind when he did :p
 
they went "everything is in control. We are prepared" to a suddenly semi-lockdown and "battle for masks" and hazards in elder care centre
 
@JonClements Haha definitely not, thrown into the middle of our countries biggest divide, and now this
 
they were even people laughing with the measurements the day after the announcement of the lockdown. There was even "lockdown parties"
 
@KarelG Same pretty much everywhere until they realised how serious it is
Not gonna lie, I'm missing the hell out of McDonalds
 
I miss going to the pub with mates for a couple of pints on Friday nights
 
11:45 AM
can you not use the drive-way?
drive-way sales are allowed here
 
@KarelG All restaraunts and bars in the UK are closed
 
I miss eating out at my favorite mexican restaurant
 
The only places allowed to stay open are takeaways
 
it's closed here as well but they are allowed to deliver food (as takeaways)
 
We have zero fast food options at the moment
 
11:46 AM
I've worked from home exclusively now for ~7 years - so I'm use to that bit - but some friends I think are starting to crawl the walls
 
we have a colleague here that already have problems with it after 5 days.
 
I'm an introvert, so it's a small adjustment for me
 
@JonClements I've never experienced WFH before this, especially it being enforced. I don't think it'd be quite so bad if I could go out on a weekend
 
it's a challenge for your own mental health
I hope that people realize that people in prison have tough time by experiencing the lockdown themselves. (it has been a discussion many times that the sentence is not long enough)
 
Mine wasn't really stable to start with 😛
 
11:49 AM
I feel bad for people in retirement centers
they rely on people to help them in everything, and they're highest at risk
 
oh boy. some of these centers are a hazard atm here
then our minister was like "whoops, I knew I forgot something"
the only thing he did was a full lock down three weeks ago
 
Aye, my sister works in a care home and it's absolute hell
 
but he forgot to provide tools (gels, safe clothing, masks, ...) for safe care
 
my wife's grandmother is in a nursing home. we're kind of relying on the fact that it would be bad business if they didn't be very careful
not really much else we can do. we literally can't see her
 
are videocalls allowed?
 
11:55 AM
I think she has one of those old nokia phones
someone bought her a smartphone and she didn't know how to use it
not even for basic calls
these days, I doubt she could make a phone call anyway, she's a little out of it (nearly 100 years old)
but she's fed and cared for at least
 
@Neil couldn't one of the nurses do it for her? So they could take some tablet/phone device with 'em to her room and set it up for her and make a call?
 
they'd say that's not part of their service or some shit like that
 
bulls*it - I'd have thought that's part of "caring"
 
you overestimate the extent of their "caring"
 
that's how it's done here Neil o.o
 
12:00 PM
believe it or not, this was supposed to be one of the better retirement homes in our city
 
either a tablet or a laptop is used for a skype session
 
call me cynical, but they might as well ask for an extra 100 euros a day for "caring"
 
when it's done, it gets cleaned
and prepared for the other elder
 
anyway folks, gotta run for a bit - take care and probably see you around
 
gotcha check my washings
kinda an advantage by staying home :P
secretly doing spring cleanup chores as work hours
 
12:18 PM
@KarelG gasp!
that's downright unprofessional!
 
Secretly playing games and getting paid for it
 
that's something I won't do
but I am certain some of us are doing that
I don't mind though
tasks gets done, only with a longer duration than usual
 
I'm sort of waiting on clarifications for a new job
I don't feel bad about killing time, what else am I supposed to do?
 
Got runscape open on one screen and work on the other 2 😃
 
runescape! ^^
been a while ago. Very long ago :o
last time I've played was still in the webbrowser (classic one, with j-applet)
 
12:23 PM
haha, they still have the oldschool version from 2007 with some big updates, and rs3
You wouldn't recognise it as the same game from years ago
 
I played the classic runescape back before it was called classic :P
 
same, this account is like 16 years old
 
I think somewhere between mining level 51 and 52, I realized how grindy it was and how hard 99 would be
though I'll admit, the "grindy" aspect of it is still done well
 
Don't check my stats then 😛
 
what are you leveling up today?
 
12:27 PM
New skill, Archaeology
 
hmm, interesting
how does that get leveled up?
 
Surveying digsites, retrieving artifacts some other stuff
 
I don't mind games being grindy, if I enjoy it while I'm grinding I suppose
but that's often not the case
 
@BenFortune there are new skills ?
 
@KarelG A few, yes
 
12:31 PM
I don't recognize some icons
I could make a big fortune selling runes :P
had access to some essential ones like chaos and fire
 
They aren't worth squat anymore :P
 
lol. there are probably better runes out there
and more variety?
 
1:04 PM
Geez it's starting to look like WoW
 
like totally wow, man
far out
 
 
2 hours later…
2:47 PM
far cry
 
minecraft
 
 
1 hour later…
3:55 PM
I have a working function that does not pass all test cases. May I have help improving it?
 
4:13 PM
@KarelG
|| mdn Array
 
you used "||>" so it executed it
||> mdn Array
 
@JBis "SyntaxError: Unexpected identifier" Logged: ``
 
@Matthew Don't ask to ask just ask
 
tnx
var backspaceCompare = function(S, T) {

 let len = S.length;
 let word = '';

 for(let i = 0; i < len; i++) {
   if(S[i] == T[i] && S[i] != "#") {
     word+= S[i];
   }
 }
 return word;
};
I'm missing something, probably related to this:
Input: S = "a#c", T = "b"
Output: false
Explanation: S becomes "c" while T becomes "b".
I thought I returned overlap, but here 'c' and 'b' show no overlap
 
5:07 PM
you're going to run into an issue of s.length > t.length
also never use ==, use ===
 
this was the wrong solution
I need to filter an array, both the "#" and whatever preceded the "#." If it's two hashes in a row, then I need to remove three chars.
 
ok, does S and T have any effect on each other?
 
!!^
 
hmm
 
5:18 PM
awww
 
sorry new to this, not sure if appropriate?, maybe someone on here can help answer this: stackoverflow.com/questions/61124321/… - the glitch in safari is driving me mad
 
@codenoob Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
6:00 PM
@JMoss Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
exports.user_signup = (req, res, next) => {
    User.findOne({ uniqueNumber: req.body.uniqueNumber })
    .exec()
    .then(user => {
      if (!user) {
        return res.status(409).json({
          message: "User exists"
        });
      } else {
        bcrypt.hash(req.body.password, 10, (err, hash) => {
          if (err) {
            return res.status(500).json({
              error: err
            });
          } else {
            const user = new User({
              _id: new mongoose.Types.ObjectId(),
Q: it keeps printing "User exists" even when the user doesnt exist, is there a reason why it does this?
 
6:22 PM
Anyone got a min? can you please join this and say hi in the chat? testing something
 
7:05 PM
i am going nutz. Can you not filter an array of objects simply by the key?
 
7:29 PM
@Jbis they don't affect each other.
If you want to simulate backspace in a String, say ab## == ' ', how would you?
ab## === ' '
I want to make this into two backspaces
 
so why are two things being passed intead of calling functon twice?
 
they will be compared
if they are the same, then return 'true'
 
restart the explanation from begining
 
after deleting at every #
So you have two strings, filled with #
 
@JMoss I think your issue is in the beginning, starting with that 'if' statement
 
7:38 PM
For every #, delete. If two, twice.
When finished deleting, compare two strings
if they are the same, return true; if not, false
 
ok gotcha
 
at first I just removed all #
but that's not deleting
then I thought I should do # and the previous index
so I got all indices of #
but that doesnt' work either, becuse two ## results in 3 deletes
I mean delete, delete ... taking three chars
 
Ok, i don't want to give you the answer. What is you thought process how to do this?
 
loop with #
for() { str.pop() }
but i can't pop inside the string
or even pop strings
 
7:44 PM
what can you pop?
 
if they were on the end, like str###, I'd pop three times
but because they are inside, like s#tr#, it won't work consistently
and I don't think you can pop chars, just elements in an arr
i was told this would work well with the stack datatype
that's why I'm mentioning pop
I tried converting the strings into an array, and then the array into many elements
iterate over, to read and manipulate
 
ok well i like converting it to an array, thats helpful
so how do we do that?
 
str.split("").joint("")
.join
 
||> "testing".split("").join("")
 
@JBis "testing" Logged: ``
 
7:49 PM
well thats not an array
How do we convert it to an array?
 
oh
let arr = [];
arr.push(S,T);
that initializes and array and puts the two strings inside as elements
 
||> let arr = []; const S = "testing"; arr.push(S); return arr
 
@JBis ["testing"] Logged: ``
 
I tried .filter() on the array
 
well now you have an array with a stirng inside but you still haven't converted the string to an array
 
7:53 PM
if I convert a string to an array, it's not an array with a string inside?
it would be "str" -> [str]?
not ["str"]
 
look above
we want "testing" --> ["t","e","s","t","i","n","g"]
 
i can do that
let's see
I'm working on it, just muddled. shouldn't take this long
 
You can use Google if you want
 
this is something I do a lot, so I'm not sure what's wrong
ok, got it. not sure what happened
let S = "ab#c", T = "ad#c";

let word = S + T;
word = word.split("");
 
8:11 PM
yes but no
All I am looking for is how to convert a string to an array. Nothing more nothing less.
How do we convert a string to an array?
 
str.toArray()?
 
||> "testing".toArray()
 
Invalid command! Did you mean: testhector, onethingonly, meltingcat? Try help for a list of available commands.
@JBis "TypeError: \"testing\".toArray is not a function" Logged: ``
 
Array.from()
 
there we go!
||> Array.from("testing")
 
8:14 PM
@JBis ["t","e","s","t","i","n","g"] Logged: ``
 
||> "testing".split("") // also works
 
@JBis ["t","e","s","t","i","n","g"] Logged: ``
 
let word = Array.from(S + T);
 
we don't want to combine them
 
you want an array of two subarrays?
 
8:16 PM
Don't think about S, T or anything else. We are just working with the logic right now.
const str = "ab#c"
thats out string
convert it an array and store it in a varible
 
ok
["a", "b", "#", "c"]
can I loop backwards?
from right to left?
if there's an #, cut previous...
 
why?
 
I'm trying to figure out how to get the # and the previous, but if it's multiple # a problem emerges
 
you are going to far ahead
 
ab##c i == c
 
8:19 PM
just wait
 
I could filter(a => a != "#")
 
const str = "ab#c"
const arr = Array.from(str)l // ["a","b","#","c"]
 
but that wouldn't get preceding element
 
hold on
 
8:33 PM
@forresthopkinsa did jitsi work well when y'all used it?
 
I didn't use it myself. Just saw a number of other people on Twitter praising it
 
@Matthew what does "#" signify? what does it mean that we need to do?
alright cause i'm gonna try it soon, hopefully it doesn't fail on me
 
# is a backspace
every # must backspace
so ab## = ''
a#bc# === 'b'
 
So # means remove itself and the preceding character?
 
yes
 
8:34 PM
@JBis lmk how it goes
 
but it will not remove another #, so that's an exception I have to work in
 
If # means remove itself and the preceding character, what does ## mean?
 
double backspace
so it removes 3
 
8:47 PM
ok great
Since we need to go back, I like your idea of going in reverse
we can use handy dandy arr.reverse
|| mdn Array reverese
 
Now, lets iterate through the array with for loop
const str = "ab#c"
const arr = Array.from(str).reverse(); // ["c","#",b,"a"]
How do we iterate through the array?
 
wat
 
wat wat kevin?
 
map?
 
8:53 PM
don't overthink it, just a regular for loop
 
for(let i = 0; i < arr.length; i++)
 
great
we want to keep track of how many backspaces there are
 
questoni
if i have a function and multiple if statements
 
let counter;
let counter = 0;
for(let i = 0; i < arr.length; i++){ counter++ }
 
is the work done in parallel or in sequence of once if statement to the other?
 
8:57 PM
we only want to increase the counter if we detect a # at the current position
 
you could nest if statements
 
@ChristianMatthew sequence
@Matthew create the for loop and add one to the counter evertime arr[i] is "#"
 
so everything in the if statement must finish before it moves on
 
Yes, unless you are using async code
 
what do you mean
I can't async an if statement
 
8:59 PM
lol
 
no but the stuff inside can be async
 
lol oh
yea
 
00:00 - 21:0021:00 - 00:00

« first day (3463 days earlier)      last day (1468 days later) »