« first day (3828 days earlier)      last day (1113 days later) » 
00:00 - 18:0018:00 - 20:00

12:27 AM
hey guys! , is there any "brain friendly" example/tutorial of Mongodb (mongoose) on how to model product categories ? i'm really lost around multiple examples and arguments on using "Tags" as collections instead of category-subcategory approach ,
would appreciate the help!
 
12:52 AM
Hoorah for me. Just had a break through on a previously discussed struggle but still unsure about how to prevent entire table from rewriting
 
 
3 hours later…
3:49 AM
Managed to solve the issue. Anybody using jest - a gentle reminder.. jest has no idea which async code is going to fire up in your code to be tested, so if you are using a model created using mongoose.createConnection() - you need to touch the model before running the tests..
 
 
3 hours later…
7:13 AM
Is it possible to create lifecycle hooks for class vanilla JS (like render method is in React's Component class)
 
7:40 AM
React is ... written in js? technically seen yes
what you need is MutationObserver
|| mdn MutationObserver
 
@relidon ^
 
user14354123
7:53 AM
Hi Guys
 
@Demogorgon 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.
 
user14354123
i am getting an issue in accessing the Json obj
 
user14354123
can someone help
 
just ask your question 😀
 
8:06 AM
Thanks @KarelG
 
8:55 AM
Hello All
Hope All of you are well.
I'm trying to send data from the functional component to the class component using props. I have used useEffect to call api and once response will come I need to send data from another component.
but it does not affect after getting API call.
I have past my component code here.
 
9:19 AM
hi guyst
 
@JoeB 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.
 
someone use angular + primeng v9?
 
 
2 hours later…
11:17 AM
Hey could someone help me figure out why my button engine isnt supporting types?
I setup a setting for button types, and Im setting them correctly...
Seemingly the button click handler is working.. it detects a click and calls the input method...
The main draw method also works... but for some reason the hover and mousedown methods arent working
https://replit.com/@MisterSirCode/CGame-Engine-Alpha-1#engine.js
Id appreciate if anyone could give me some insight / see something wrong that Im missing
also the overlay method seems to be working, because I see my overlay text being drawn
 
11:46 AM
@VLAZ wondering if you're around. After some heavy modifications to one of your examples Im stuck and was wondering if you could take a look and advise
 
lol my button engine even sets a pointer cursor on the canvas now when you hover or click on a button
this is so hilariously cool and stupid
 
Ive really pulled off some great changes where the script doesnt rewrite the table headers and only rewrites the TD but now it's appending the td again and again making the table grow longer and longer every run and not sure how to correct my changes
My $100 offer still stands
 
@Stuart youre... youre offering a hundred bucks to fix your table code?
0 __ o
 
Its all Ive got
 
what... the... hell...
 
11:49 AM
100 offer is only for VLAZ
 
ah I see
problem is, you could also just take the money and the code and run
lol
 
as he has previously been to the ends of the earth to help me
Nahhhhh Thats not me
and in my prev offer I offered payment in advance
BEFORE the code
 
I mean... basic support systems offer about 5 bucks per hour
youre basically offering a week of support pay.... for a bit of table code
youre scamming yourself
badly
 
Nahhhh
 
er... alriiiight
you do you
 
11:52 AM
Its more than you think
 
Well I only have 200$ pocketed in savings ATM, and about 4$ in checking, so I cant really say anything about money
all I can say is, 100$ is a lot
 
I agree but VLAZ has done ALOT more than you could imagine
By all means take a look at
Is that EZ enough for you?
 
I mean its just a table templater
 
@MisterSirCode he offered it as a 'thank you' because VLAZ has helped him a lot
 
VLAZ wrote this script (And 7 others) for me
 
11:55 AM
you could google some examples for table parsing
 
Saw earlier what he has done
 
I get it, so you do you
 
Huh?
 
What Im saying is "You do whatever you feel like you need to" but with slang
 
idk what's being meant with "you do you"
ah
 
11:56 AM
are you able to refine the prev mentioned script?
 
its just some dumb little gen-z thing people say
 
Thanks for sticking up for Me and VLAZ @KarelG
 
@Stuart Personally, I dont use tables that often.. Im more focused on 3D Rendering and UI APIs at the moment, so no
Im sure if I wanted to work with tables, I could do some research and make something decent
/shrug
 
its not as simple as youre thinking... I promise
 
Well, tables are just iterated 2D arrays...
 
11:58 AM
Im already pretty crafty with code but this is some deep water Im swimming in
 
so the logic to generate them isnt that bad
 
Ok
 
its not easy, I get that, but its definitely not the hardest thing you could write
 
🤔
 
11:59 AM
Whats wrong with it?
no errors, appears to be generating table content correctly
I dont see whats wrong..
 
Its generating it over and over
 
ah
I see... lol
probably forgot to break the loop
I see the issue
setInterval(run, 1000)
no canceling, no breaking, nothing, its just generating the table again every second
are you trying to update it every second... or...
like what do you want to achieve
@Stuart
 
Computer froze Im back
 
That website is probably what caused it... generating a table every second probably burns memory fast
 
@Stuart you forgot to clear the table first before adding your new, updated list :)
 
12:06 PM
Im too lazy to look up the maximum memory usage of a website, but from experience, I know that making hundreds of HTML calls and logs / usages of strings can easily freeze chrome
Exactly. You need to rid the first one if you want to update it.
As it goes now, youre just appending a copy of the table every second
 
Nahh Computer freeze is long standing issue without visiting any site
 
Invest in a cheap computing-biased laptop?
/shrug
 
Thank You Karel. Sounds easy enough lol...
 
if that $ is from jQuery, you can simply do $("#main").empty().html(table);
notice the "empty()` addition, it clears the content
 
12:08 PM
Good ol' jQuery... Staining the internet with improper JS since the early 2000s
though... javascript seems to be leaning towards it more and more
with childnode and all the tiny shortcut methods
 
Well... You see... This works perfectly (Updates table every 2 seconds) but it also rewrites the entire table each run... Including the TH's Link coming
 
@Stuart Isnt that what you want though?
To update the table data every few seconds?
 
Still not really sure what ya want...
Anyhow, Im gonna go work on my engine, cyall
 
So based off of jsbin.com/winegoc/1/edit?html,css,js,output I got crafty and modified the code to not rewrite the <table> and <th> tags and was real happy when it worked (A little luck involved) but I was also pretty sure it was not ideally coded and then when I saw it was appending data over & over I came here
I could probably iron it out in a week or so but there's a race coming tmw and with my gratitude for VLAZ's help I figured its only fair to offer him 100 to get reinvolved and hold my hand through the rest of this
 
12:16 PM
hmm. did my answer help? :S
it has been a while, le jQuery
 
as I'd like to keep it NOT rewriting the table and th's and I was also wanting to do a couple other refinements
unmentioned today
Yes it did help Karel... It was a great "Clue" Im just not sure how to proceed or if its the best way to proceed
 
you only have to correct that line :)
 
@KarelG are you referencing epicmotos.com/AMA-live-timing-example7.html ?
 
yeah, look for this line; $("#SXLiveTimingTable").append(table);
 
I see it
 
12:20 PM
alter that so that it becomes this: $("#SXLiveTimingTable").empty().append(table);
 
Hmm doesnt seem right b/c VLAZ never used empty in original example but lemme try
No offense Karel
Oh Karel... I havent tried your example YET but I forgot to mention... The script works withOUT t hat line
lol
I forgot to recomment it out before discussing here
Complicated ehh?
 
if you werent using jquery.. this couldve already been fixed
 
Infact I dont even see how the script even outputs w/o that line but even more interesting is that if you remove function run() {} altogether (Since it appears to do nothing with that line commented out) the whole thing stops working
 
why do people still insist on making debugging harder by using jquery...
Hopefully by 2030 jquery will be sounded out
 
Fix it Mister and Ill send you $20
 
12:26 PM
if not, I may well lose hope for the webdev community
@Stuart Alright
 
but its gotta be up to my standards
and Id like to do more than mentioned here this AM
but I welcome you making a JS Fiddle based off of this code
for me to review
if I like it Ill send you $20 and another 20 for my next "Idea" regarding this same script
 
Bro if you want I can just make you an entire table API with ES6 classes..
 
Ok
Id rather older JS
no classes
IDK enough about classes
 
,__, but classes are amazing
a class is (very simplified) a variable instance with functions in it
 
But remember this project is pulling data from a constantly updated (during a race) XML fiile
By all means plz create a JS Fiddle for me to review
 
12:32 PM
So no classes?
 
Morning. Happy Friday
 
How is everyone
 
@KarelG No offense I havent yet tried your example but rmbr it works without that line
Morning @BeerusDev
Were good
 
@BeerusDev Tired. I didnt get to work on my game at all this week as Ive been away from my personal computer
So ive been stuck making a game engine in canvas / javascript instead
 
12:33 PM
@Stuart check out datatables.net
 
which, while fun, doesnt give me that satisfying feeling
webdev doesnt give me the same ecstatic vibe it used to
 
:(
 
Thank You @BeerusDev I looked but no thanks on 3rd party external scripts
 
by next week... Ill have a 2D game engine with physics detection and UI layers... but what then...

After that... the next best thing I could come up with is making a programming language
 
12:35 PM
@BeerusDev I think he doesnt want to use libraries
 
So useful though
 
/shrug
I mean if I write you a table API stuart, itd be the same thing as using a library
 
Built in filtering/sorting/pagination
 
^^^^^^ Libraries are useful for not reinventing all that stuff from scratch
 
Yea... Everything on my site is hand rolled
except jQuery library
 
12:36 PM
Personally, I have fun and enjoy making my own versions of modern tools...
But for a production project like yours... libraries might be much better
If it were me, id much rather use datatables than jquery
jquery is just... alright Im not going to go down that hole again
 
Yea Id prefer JS from 1995
 
Datatables uses jQuery
 
Infact there are very few jQuery calls on my site
and it is mostly 1995 JS
 
If a library references other libraries, it causes all sorts of drama
 
What type of site is it
 
12:37 PM
the way I like it
A Very simplified and fast site
Look and see
 
What for though is what I am asking
 
Motorcycle racing resources
 
@MisterSirCode jquery datatables ...
 
like here a while back...

Some microscopic NPM library called "leftpad", which, as its name suggests, was an 11 line function that padded numbers with left zeroes...

The developer left NPM and deleted all of his packages, including leftpad, and hundreds of the most important packages and websites on NPM and in the world crashed
So take it lightly, but libraries shouldnt reference more libraries
 
@KarelG haha
 
12:39 PM
but libraries shouldnt reference more libraries I like it
Anyways... Back to looking at my code. Hopefully VLAZ makes an appearance and is able to help
 
Would be even better if you didn't have to reference any and it was all integrated into and became "vanilla" JS
 
I Loveeeeeee Vanilla JS
 
What do you need help with @Stuart ? I read up but didn't quite see what you are asking for
 
Infact I try hard to only use Vanilla
 
@Stuart Bro your project is 50% jquery
Jquery is the most non-vanilla thing you could use
 
12:42 PM
THIS one is
 
Taylor ... drop it
 
(Besides a pre-proccessor)
@KarelG calling me by my name? wow, never had that happen before
 
@JBis morning
 
@BeerusDev one moment
 
o/
 
12:44 PM
|| alive
 
ouch
oh
there he is
 
@Stuart btw, compensation is generally frowned upon on SO. Please don't post anymore offers on site.
 
@BeerusDev Im wanting to do this without rewriting <table> and <th>tags every run
 
Karel has already given you a solution
youre just using jquery, so it doesnt work
and the jquery solution karel gave you doesnt work, because jquery probably doesnt support that method anymore
just dont use jquery
and use Element.remove();
way easier
no debugging / deprecation drama either :D
 
12:48 PM
@JBis I sincerely did not know and was truly only trying to make sure I was being fair to VLAZ. I will no longer offer compensation however if he takes me up on my offer I will gladly pay and eat ramen noodles for a week as Im not rich... Just trying to show appreciation
and not take take take take without giving in return
 
oh lord..
alright, im out
cyall
 
@Stuart is $ really jquery?
 
IDK?
Im in kinda over my head anyways
 
@Stuart Thank you. If you'd like (in the future), you can donate what you would pay one of us to a charity.
 
Thank You @JBis
 
12:51 PM
aah I see my mistake
you are appending trs ... the header is not present
 
I do help people where im able and am always kind to strangers
I Always hold the door for people at stores etc
Slightly confused Karel
Yes I removed the header part from jsbin.com/winegoc/1/edit?html,css,js,output
My "Craftiness"
lol
Whats crazy is if I comment out $("#SXLiveTimingTable").append(table); it works
but if I remove function run() {} entirely (which appears to do nothing w/o that line) nothing works
Bottom line is I want prev provided JSBin to work without rewriting <table> and <th> every run
but has some issues I was hoping @VLAZ would be able to assist with since he is the one who wrote the original script and is already familiar with my intent
Yall are gonna really like this when I get it just right... and Im close
I think I just need to dive back into the code and try, try again
Regarding: "if I comment out $("#SXLiveTimingTable").append(table); it works"
it works (kinda)
as previously discussed...
Sry guys gotta run out to the shop for little bit. I man both a keyboard and wrenches
 
1:23 PM
@JBis I came back to clarify... My 100 offer to VLAZ was NOT intended so that I could forever pester him afterwards. I am truly grateful of his past help as he has spent considerable time with me and I dont have any other way to repay him. Before my 100 offer I insisted that I would come over and wash his car and mow his yard to show my appreciation but Europe is a little far from Florida for that
There are very few like me (and Y'all) left in the world. Most people wont lift a finger for anyone unless they're getting paid
I'll be on the lookout for the next homeless person I see with a dog and WILL buy him/her a bag of dog food
Oh and incase you missed it previously, My girlfriend and I rescued a pitbull mix puppy from a horrible living condition about a year ago. (Penny is approx 1.5 years old now and happy and healthy)
Over & Out
Oh... and I didnt mean to go blowing my own horn about the good deeds ive done. I was just trying to quietly do another good deed by my offer twds VLAZ
but the situation turned ackward... Back out to the shop I go and if anyone needs any help with anything technical that burns gas please dont hesitate to bounce it off of me
 
1:40 PM
Stuart, it is okay ...
you're just re-telling the whole story. VLAZ is aware of that, so let's keep it "low profile" :)
 
2:12 PM
lol yall still talking about this
ouch
well I guess it ended 20 minutes ago
hopefully
 
I feel like I missed something
 
nah
youre good
 
|| joke
 
How do you check if a webpage is HTML5?
Try it out on Internet Explorer
 
lmao
 
2:26 PM
|| joke
 
@jaouadelaoud 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.
What's the best part about TCP jokes?
I get to keep telling them until you get them.
 
|| joke
 
jaouad el aoud's code 😜
 
edgy
 
@JamesBot LOL
|| joke
 
2:27 PM
There are 10 types of people in this world...
Those who understand binary and those who don't
 
got it
|| joke
 
Why do programmers always mix up Halloween and Christmas?
Because Oct 31 == Dec 25
 
facepalm
that one took too long
 
I dont get the joke
the binary one is good... the holloween / christmas one makes no sense
 
this one is a number system joke too
 
2:31 PM
||> 031 === 25
 
@JBis true Logged: `` Took: 0ms
 
|| joke
 
Why do C# and Java developers keep breaking their keyboards?
Because they use a strongly typed language.
 
|| joke
 
Why do Java programmers wear glasses?
Because they don't C#
 
2:32 PM
bad one
 
|| sandbox jaouadelaoud
 
|| joke
 
Please go and play in the Sandbox
(hip hip array)
['hip', 'hip']
 
@jaouadelaoud please go play with james in the sandbox :)
 
is it an order ?
or you want me to help you improve your Bot ?
 
2:34 PM
Just to reduce clutter in main room
 
okay cool sorry
 
You could add the classic fortunes to JamesBot, there are probably enough databases around like this one, althought.. there is no real purpose
missing the offensive fortunes... let's see if I can install those on my mac
 
Hehehe... https://replit.com/@MisterSirCode/CGame-Engine-Alpha-2#testing-it.js
I got my button engine fully working.
All detection types are functional, and now it supports game states which also work perfectly!
beautiful
the different mouse state callbacks allow you to draw any kind of Canvas UI and custom button UI for each button and mouse event
so you can change the sprite, you can change colors, or even render different shapes on mouse down or hover
thoughts?
 
2:51 PM
@makadev good idea
I'm going to document the plugin API soon. Once I go to school I probably won't have time to work on a lot of plugins so I figure someone else can add them if they want.
What is something simple that humans are really good at, but computers are really bad at?
 
@JBis but skip the offensive database.. I just stumbled over this while searching for why brew fortune, guess SO probably has a similar stance
 
@JBis Dynamic Art and Imagination
Imagination may never be truly possible with computers, as AIs adapt based off of previously learned ideas..

but humans do aswell, so who knows what constitutes actual "imagination"
 
3:15 PM
Hey, does anyone know a decent method for speeding up / optimizing requestAnimationFrame animated canvases?
Im noticing that when my canvas is resized too quickly, it teleports around and gets delayed (You can see white bars / edges of the canvas not being filled)
https://replit.com/@MisterSirCode/CGame-Engine-Alpha-2#testing-it.js
Is there a way to reduce those white edges from appearing if the canvas is resized too quickly?
or is that just an unfortunate shitty issue with webdev that cant be fixed
 
@JBis Simple from a Human perspective, a general computer? Walking/Running with two Feet/Legs. Otherwise specialized computers/software are/is in general better at everything.
 
Uh anyone experience with fontawesome here?
Why does the basic tutorial for fontawesome refer to using libraries from fortawesome?
 
@paul23 That looks like a react component... it probably just shortcuts grabbing of font-awesome SVGs and icons, and adds some components to use with fontawesome
 
is fortawesome the same as fontawesome? They have different websites
 
I dont have experience with react, but thats what I can come up with
@paul23 Looks like some idiot riding off the coattails of FontAwesome to grab some free viewers / users of those who misspell fontawesome
 
3:22 PM
Yet then why does the official documentation of fontawesome refer to fortawesome?
 
no idea
couldve been, as I said, a typo
/shrug
ooooor its a part of fontawesome
 
@paul23 seems like fontawesome is one of their products, fort awesome is the distribution platform
or better
the company/distributor
 
that would make sense
company named fort awesome decides to create a massive font and icon industry called font awesome
 
@MisterSirCode A typo in example library as "use this to initially set up a test" seems weird and dangerous.
 
or another project that delivers fontawesome too
weird he
 
3:26 PM
@MisterSirCode think it would be different then: "group creates font awesome, decides to make a company and go broader than just font-based-icons and chooses similar name".
 
FortAwesome site states it's from the creators of FontAwesome, looks like it just contains a bunch of different icon packs, including FontAwesome
 
But it also seems so much of a click-bait as you can hardly see the difference when copying from npm directly
 
ye.. at first glance it could also be typosquatting
 
It important for us since we need to get the pro package
 
damnit... closure compiler doesnt support private class fields
 
3:29 PM
And wonder if we need to get it from fontawesome or fortawesome - especially since they both have different rules for the free package
 
anyone know of a library compiler / minifier that supports private fields?
 
So it's unclear if -when I use through fortawesome react bindings- fontawesome icons I need to pay the pro version if we have more than 5 developers.
Or if I need to go to fortawesome (which doesn't state a limit on developers).
 
If FortAwesome is cheaper/less restrictive, I'd just go with them, unless they have specific limits on the FontAwesome pack itself
 
Well they have a cheaper option - but no free option (we're currently due to corona only with 4 devs so free would be fine).
 
But they're the same company, so you needn't be concerned that FortAwesome isn't legitimate
 
3:33 PM
yet fontawesome -which hence would be fine- has in their tutorial download stuff from fortawesome base on npm.
 
Probably because FortAwesome is their package which contains many icon packs, not just FontAwesome
You can double check, but not thinking there's a FontAwesome NPM package?
 
@MisterSirCode babel should, there is most likely a plugin for private fields like: private properties and private methods
 
Well have found one with 3k downloads so doubt it exists indeed.
 
FortAwesome was their suggested package a year ago as well, so no issue there
 
4:04 PM
Im going to be honest here, fortawesome sounds like some 5 year old's tree house in a random suburb...

Doesnt sound like a big company with wide usage
@makadev I dont want to setup babel just to compile my library, but thanks for the suggestion anyhow
 
 
1 hour later…
5:16 PM
Hmm i was looking through some sites and I wonder this site: lnnmedia.nl/corona/…
how does it make the social media links (like twitter and facebook share) open in a small window?
It's not using target=_blank - what is it using?
Anyone got an idea how to make the browser do that? It's also a special window where you see the bookmark bar or extensions.. Similar things you see with some oath applications
 
5:32 PM
 
5:49 PM
hmm so have to intercept the mouse up event?
 
click event
element.addEventListener('click', () => window.open());
 
00:00 - 18:0018:00 - 20:00

« first day (3828 days earlier)      last day (1113 days later) »