« first day (3576 days earlier)      last day (1379 days later) » 

4:04 AM
 
 
2 hours later…
6:11 AM
Really disappointed. The character in a tv show I'm watching was developing a website and I was excited the creators were realistic and had him using real vue code in vs code but then he used material UI and I almost shut it off.
 
Hi Guys,
In Jquery, do you guys have any way to show a tooltip of disabled dates ?. Those disbaled dates are after the max date
 
@ErikChau 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.
 
for more detail. it's in the Datepicker
 
 
6 hours later…
12:29 PM
https://stackoverflow.com/users/11165703/mister-sircode

That moment where your reputation is your favorite number... and probably one of the greatest template resolutions for logos and images

500 fucking 12
 
 
2 hours later…
2:15 PM
Does anyone here have any experience with Algolia?
 
2:34 PM
hey i want to combine these in to one jqplay.org/s/sti5DD3WsP jqplay.org/s/arDnC8oOjo
 
3:03 PM
guys what is the difference between module e models in angular?
 
Hi guys, the text variable in the return below is out of scope, how to make it so that is read from the parameter?

```js
const findBtnWithTextAndClick = async (page, text) => {
try {
const btn = await page.evaluateHandle(
() => {
const btns = [...document.querySelectorAll('button')]
// the text variable below is out of scope, how to make it so that is read
// from the parameter?
return btns.filter(({ innerText }) => innerText === text)
}
)

if(btn) {
await page.evaluate(btn => btn[0].click(), btn)
 
which return
 
Hi @KevinB, is the one below this comment "// the text variable below is out of scope, how to make it so that is read
// from the parameter?"
I need to access the text variable from the main function parameter
in here: return btns.filter(({ innerText }) => innerText === text)
 
what do you mean out of scope
 
It is not defined when I use it here: return btns.filter(({ innerText }) => innerText === text)
 
3:16 PM
that's not true
text will be whatever is passed a the parameter.
 
Yes but since it is within await page.evaluateHandle() it goes out of scope...
 
no, it doesn't
javascript doesn't work that way
 
Understood, then why when I hardcode return btns.filter(({ innerText }) => innerText === 'some text')
it works, while when I call the function with the same string parameter it doesn't work?
 
probably because text isn't what you think it is
 
as in what, it is overriden by some other parameters? ie. from page.evaluateHandle() ?
 
3:18 PM
as in, maybe it's not text at all
 
understood so what it is? coming from where?
 
dunno
hows the function being called? how are the params generated?
 
pptr.dev/… that's the function that I was talking about
is just a tiny function invocation: ie. await findBtnWithTextAndClick(page, 'more')
 
and 'more' is hardcoded?
 
yep, that's why I was very suprised
 
3:20 PM
put a breakpoint inside at your problem spot
 
So if I put a console.log({text}) just after the first try it outputs correctly (obviously) while if I put it just before the return it doesn't even log (might be the innerworks of puppeteer tho)
if I hardcode the text inside the return it works
(the function)
 
if text is a string, and none of the code in that function overwrites what is in the parameter, it isn't being changed
that it works when you hardcode it doesn't change that
the console.log not showing up is.... problematic
puppeteer can't affect that
 
mmmhh
the mistery deepens lol
 
unless, it's somehow copying that function to an entirely different scope
which is the entire purpose of that function
:)
use the args param
 
Are you running this in Puppeteer?
 
3:40 PM
Yup
Maybe I am using the second param wrong in that function?
by that function I mean pptr.dev/…
 
hey all i have a quick question about react functions
 
i don't think you're using it at all atm
 
Doing that does not seem to work:

const btn = await page.evaluateHandle((_, text) => {...})
 
that's not right
 
IIRC puppeteer does a bit of a strange conversion. It serialises the function as text then re-creates it in the browser with the Function constructor. So, some of the context can get lost in the translation.
 
3:41 PM
See, I misunderstood the docs then FML lol
 
text would need to both be a param of the callback, and be an argument passed to evaluateHandle
 
@VLAZ ah! that might be the reason as well.....
@KevinB uhm ok let me try something...
 
There was a way to pass extra information to the callback somehow. Let me try to find it.
 
Thanks @VLAZ
 
(text) => {...}, text
 
3:43 PM
@KevinB as second param? or first?
 
first
why would it be second?
 
No idea, for some reason I was thinking it needed to be the second one lol
Amazing it works now
Jesus where did I fail to deduce that info from the docs????
FML T_T...
and thanks to you both guys...
 
@MelMacaluso well, found what I was talking about, but I guess it's not relevant any more. I hope at least it helps in the future: How can I dynamically inject functions to evaluate using Puppeteer? How can I dynamically inject functions to evaluate using Puppeteer?
 
I will read that article big time
thanks mate
 
4:03 PM
@Joseph this?
 
@VLAZ i want it done with jq not js _
 
Hi All
i have multiple stages in my mongo aggregate query.
{
    "_id" : ObjectId("5f0be581910291001278b92c"),
    "createdAt" : ISODate("2020-07-13T04:39:29.550Z"),
    "updatedAt" : ISODate("2020-07-13T04:39:29.550Z"),
    "description" : "this is description",
    "status" : "active",
    "deals" : [
        {
            "userId" : ObjectId("5efe3085ff942000130c5cd4"),
            "rented" : NumberDecimal("100.00"),
        },
        {

            "userId" : ObjectId("5efe3085ff942000130c5ed4"),
            "rented" : NumberDecimal("200.00"),
        }
above is the response i get, what i want to do in the next stage is, i want to compare the value of userId with some value passed from the user

something like this
userId : {$in : [Id1, Id2]}
is it possible in someway to iterate or addField and compare.
 
@VLAZ check this jqplay.org/s/sti5DD3WsP and this jqplay.org/s/arDnC8oOjo , if i can combine both i get what i want
 
4:22 PM
Got a quick NextJs question (or react SSR ingeneral i guess)

In NextJS you can do 'getServerSideProps' which is processed on the server vs the client. My current plan is to call an API (that i control) to retrieve data. The thing that's confusing me is all that API does is access the database. Is it a 'better' idea to cut out the middle man and directly access the database vs. doing the API.
the API is within the same codebase and the DB call is also within the same codebase. So it seems less performant to do an await on an api response when i can just do it directly. I just dont know if this is a 'dude, WTF you doing' moment and i should just stick with doing it on an API.
 
 
2 hours later…
6:23 PM
Does anyone have any experience with Algolia?
 
morning
 
6:36 PM
heh
i must have ruffled someone's feathers,
> +28 rep: serial voting reversed
 
 
2 hours later…
8:25 PM
what are y'all thoughts on pagination vs infinite scroll for data tables?
 
pagination 100%
 
I think infinite scroll works best for simple columns of data, I don't think I've seen it used for a table outside of, like, a spreadsheet
 
hmm, ok. I've always liked infinite scroll over paginiation
 
infinite scroll is great but often when working with data it's easier to keep your place with pagination
I'd wager that Kevin doesn't like infinite scroll in general
 
i don't like infinite scroll with data tables
i like it with product listings/article listings
 
8:39 PM
do you think google results should infinite scroll
 
no
anything not in the top 5 isn't useful
 
I've been working on an HP server rack
HP server parts are so obscure and hard to find
I find myself going to page 2 pretty often
 
ok, ill go with pagination
 
main benefit i see with pagination is being able to skip
if it would make sense to be able to skip, for example with sorted results, pagination is king
 
I don't think skipping is a problem if scrolling loads under 100ms
 
8:41 PM
i agree with that, skipping can be helpful
 
unless you have dozens of pages of results
 
i'd rather click page 6 than scroll thorugh 6 pages
 
hmm perhaps
 
if i am sorting by date but i know i want 30 days later or something then i can just estimate and click a page
 
yeah that's kinda what I meant by "keeping your place" earlier
I think that does depend a lot on scroll loading time
 
8:42 PM
i mean scoll time and pagination should be the same right?
at least in terms of db query time
 
not necessarily
infinite scroll doesn't need to know how many total pages there are
just says grab next page. grab next page, repeat till no next page
 
yeah, but count operators are pretty fast
 
"the same"
:shrug:
 
db query time would probably be very similar but scrolling would still feel much faster
unless db query was slow, and then scrolling would feel much slower than pagination with the same db
 
9:00 PM
well, if you add ML to predict when they are going to go to the next page and preload it, it'll feel much faster
Pagination Powered By ML™
 
meh
 
shoot we should just use ML to know when a user will click something before they do
then we won't need interactive pages at all
 
10:05 PM
Hi, I completely changed my question which hadnt received any answer for too long and was -1 votes. I actually cannot write new questions due to question ban. stackoverflow.com/questions/62309322/… . So can someone see it, because -1 questions would be too far behind. Also I haven't got much reps to shell out to give a bounty yet
it's a pure javascript question
 
And done! Just merged virtual background and background blur into develop for bitlink.
tidy some stuff up and im ready for v1.0
 
11:07 PM
Nice!
 

« first day (3576 days earlier)      last day (1379 days later) »