« first day (3533 days earlier)      last day (1639 days later) » 

00:30
jbis
I have a question
is there anyway to control this .on statement
  changeStreamIterator.on('change', next => {
        console.log('THIS IS NEXT ============================== ', next.fullDocument);
00:54
StackOverflow added reactions to answers... Don't know how to feel about it
what do reactions do
they need an advanced stackoverflow
for professionals
i'd pay for that
someone could earn money for answer questions, correctly of course
01:27
that exists
@ChristianMatthew what are you trying to do?
I've never used observers and don't know how they work
That just looks like an event listener which i do know, so whats your question
@Lapys just a thanks button, prevent "thanks" comments
the question it is piping an event through and it is not the observer that is just listening it is the emitter
the .on
wat
changeStreamIterator.on('change', next => {
        console.log('THIS IS NEXT ============================== ', next.fullDocument);
this is emitting multiple times instead of 1 at a time
it is duplicating emission
mmmm
i think is my issue here
SseEmitter connection keep alive time:-
By default, Spring Boot with the embedded Tomcat server keeps the SSE HTTP connection open for 30 seconds.
 
1 hour later…
02:56
You might be binding the eventListener multiple times.(I may be wrong) But still, you can try this:
changeStreamIterator.off('change').on('change', next => {
})
@SakshamChaudhary 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.
use off instead of on?
trying now
Use "off" to unbind/remove the existing 'click' eventListener. Again "on" to bind it as a fresh one.
I get this error
Unhandled Promise rejection: The "listener" argument must be of type function. Received undefined ;
if thats a standard listner that won't work for what you want
.once will do what you want
03:06
hmmmm
it helps JBis
the thing is that any subsequent requests are now gone. so let me try this
What are you trying to do exactly? I find it very difficult to understand what your questions are. It seems like you explain half of the issue.
let newChangeStream;
    changeStreamIterator.once('change', next => {
        console.log('THIS IS NEXT ============================== ', next.fullDocument);
        subject.next(next.fullDocument);
        const resumeToken = changeStreamIterator.resumeToken;
        changeStreamIterator.close();

        newChangeStream = collection.watch({ resumeAfter: resumeToken });
        newChangeStream.on('change', next => {
            console.log('New changestream fired ');
            subject.next(next.fullDocument);
I am going to try this
what i am trying to do is just connect a SSE route to a mongodb changestream
upon testing the changestream gets fired off repedidly with one single data change and when I refresh the browser the situation seems to become exponential. so 5 repeats turns into 10
see I just did a single data change and this is what happened
COMPLETE
COMPLETE
COMPLETE
COMPLETE
COMPLETE
messageId  21
21 messages got piped through
and this is the data
ell it's big
I have to blame that on mongo.
I agree something is binding repeatedly and I can't reset it
your code there doesn't line up with the output
what do you mean
theres no consonle.log("COMPLETE") in the code you provided
03:21
that is here
post in a gist
 subject.subscribe({
        next: (v) => {

            console.log(`observerA: ${JSON.stringify(v)}`);
            res.write(`event: ${channelStream}\n`);
            res.write(`data: ${JSON.stringify(v)}\nid: ${messageId}\n\n\n`); // res.write() instead of res.send()
            messageId++;
            if (messageId > 20) {
                subject.complete();
            }
            console.log('messageId ', messageId);
            // number++;

            // res.end();
            // return;
ok
|| mcve
Invalid command! Did you mean: msie, dice, mcve? Try help for a list of available commands..‍.‍.‍.‍.‍.‍
If you would like assistance, please create a Minimal, Complete, and Verifiable Example
preferably create that ^
03:22
I can't do that this an express server
there's nothing crazy about it
also, i don't know if you're familiar with node but the server resets the SSE connection like very 2 minutes
it's annoying
03:38
is there a way to flush the listener?
 
1 hour later…
04:42
I figured it out
 
2 hours later…
06:15
I'd love to know why and how deleting a bookmark in Firefox managed to run alert("hello"). It just showed me a plain alert dialog with "hello" in it. All I did was to open boomarks, I saw one wasn't needed any more, so I right-clicked and deleted it. I can't seem to be able to replicate it any more, though.
posted on June 18, 2020 by Krishna Govind

Hi everyone! We've just released Chrome Beta 84 (84.0.4147.53) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome

 
2 hours later…
07:55
question. I know how this works but I am unsure of how these streams work. will different browsers create different server sessions? different IP's should though right?
my browser from chrome to edge is acting upon the same server session
> will different browsers create different server sessions?
yes, unless there is a mechanism that links each sessions to each other, making a session referencing to other
it is possible but silly.
wouldn't it have the same port and ip address?
to the server, what would change? The browser being used in the meta data
honest question, I don't know
08:12
@Neil I can open two browsers and browse the site. I log into browser A but not browser B. Why would the server maintain the same session for both? Moreover, there could be any number of people accessing the same site but they all come from the same gateway. To the site that's the same IP. Making them all share a session means you'd have a security nightmare.
though sites do support auto-login features
which really ultimately means you can access the site without login from either browser
display tooltip in canvas graph points
@Neil yes. But it is not reliable as you might figure out
you can spawn VM's with same browsers and use a bridged network to have a same, identifiable entity
to tackle it down, there is a simple principle
want to contact this user @markE.How can I?
on first visit: you do not have a session (either starved out or fresh browsing session) -> an id is generated and put as cookie.
then the sessions follows, you are constantly passing the same session ID until it get refreshed or you stop with your browsing session
yeah HTTP is stateless :)
@Millie you just pinged him. He eventually decide to listen at it or ignore it
(well if that name is valid. Pinging can be done by doing @<name>)
08:24
thanks@KarelG
@markE. Trying to contact you regarding tooltip on canvas graph Point.
08:38
In this case, this will not notify the user. There are some rules for when a ping is sent (not exactly sure on the condition). The way to actually know if somebody would get a notification is if the name is auto-completed after the @ symbol. I tried it now, and there was no auto-complete suggestion after I typed in mark
there is a superping thing. For mods only AFAIK
 
1 hour later…
09:41
Superping sounds like something you use when ping domain.com doesn't respond. I imagine it sends the packets more forcefully to attempt to break through firewalls and other obstructions in the tubes.
heh
When it comes to high-performance applications, when are memory pools not useful?
When you start running out of memory
Then dynamically resize the memory pool for more memory?
What if there is no more memory to be had? Start throwing RAM sticks at the machine?
09:55
Allocate files on the disk (lol, definitely won't work)?

Yea, I can see your point but aren't memory pools meant for quick allocations with many small units of memory?
Yeah, but they're also temporary. It depends on the usage
Gotta make sure GC works without leaks too
@Lapys Indeed. We're not saying that memory pools aren't useful - you asked for situations where they cannot help. The biggest is requiring too much memory.
Hmm, I guess.

At the point where it starts allocating on disk, it'll evolve into more of a memory management interface than a memory pool.
@VLAZ Alright, then. I'mma start using it in all my "not so simple" projects
You've got to take into account fragmentation too
@Lapys Well...memory pools aren't a silver bullet, either. Do try them out to get used to how they are used but note that memory pools aren't needed in all cases. Having an extra complexity thrown into an application that provides you no benefit is usually a bad idea in serious applications.
10:04
Ben I agree, but that's stepping into issues with dynamic memory allocation in general
Definitely, only use them in "not so simple" projects: like a 2D renderer that uses tons of particles...
So, it's useful to get to know how to use memory pools but they aren't a universal thing. Many times you'd need to do analysis of how your already developed application behaves in order to figure a good way to use a memory pool for it. Or you need a very well designed application so you can make the decision upfront.
Noted.
10:20
Does anyone know whether it is possible to write content into a javascript file? Like write a program to create a sample.js file with a simple "Hello world" program instead of writing one yourself?
Yeah, but why
that requires more effort than creating the file and write that hello world program there.
I have some legacy file filled with string constants, but it is using syntax for node, using modules.export and require. I want an exact same file with the same constants but one with ES6 syntax(import and export). Want an easy way to just add export in front of any "const" keyword
a programmer's true nature is being a lazy arboreal mammal, he does minimal effort to get the desired maximal output.
@KarelG I mean...
|| xkcd#1319
10:26
@VLAZ "SyntaxError: Unexpected number" Logged: `` Took: 0ms
Invalid command! Did you mean: xkcd#, okay, kfc? Try help for a list of available commands..‍.‍.‍
Invalid command! Did you mean: xkcd#, encode3, c#? Try help for a list of available commands..‍.‍.‍.‍.‍
OK...
|| xkcd1319
Invalid command! Did you mean: xkcd#, encode3, kidssay? Try help for a list of available commands..‍.‍
Lol
how does the xkcd command work? Does it work?
|| lol?
10:27
Invalid command! Did you mean: lol, love, lofi? Try help for a list of available commands..‍
|| xkcd# 1319
I should write an automation tool that I give it a command and parameters and it tries all possible permutations until it finds the correct way to call it.
It will save so much time in the long run
||xkcd# 974
not sure that you need the hashtag <.<
10:29
|| xkcd 974
Invalid command! Did you mean: xkcd#, okay, kfc? Try help for a list of available commands..‍.‍.‍.‍.‍.‍.‍
apparently you do
was going to try that in the sandbox :P
There is a sandbox for James?
10:29
!!sandbox
Please go and play in the Sandbox
the sandbox is Wietbot domain
> Did you mean: xkcd#,
@JBis I am curious at that command name. Any reason for that hashtag?
It's actually cap's domain so back off 😃
@Wietlol I think some cats will disagree. Unless Wietbot is a cat.
10:31
it is
Complaint withdrawn.
11:23
Evolution of web design:
- Show text in HTML
- Style in CSS
- React with JS
- Get SASS
- Get a library
- Get that newer library
- Install NPM
- Install 1mio dependencies
- Use VUE cause it is „lightweight“
- Search for newer libraries
- Become an agile developer
- Hold a presentation about agile

- And now there's React...
 
1 hour later…
12:45
hmm running audits on our website shows a terrible rank for "performance" - 23 points.
(in google chrome)
with reason that it takes 8.3 seconds before first meaningful view
But when I analyze it further it take 6.7 seconds waiting for "script evaluation". Which seems a bit awkward, how can one reduce this?
13:01
@paul23 Add more hamsters to the server. /s
It's the spa rendering code on frontend that takes 7 seconds apprently
You can probably do some of that preloading that's popular nowadays. You show some view that's close to what the users would see (e.g., side bar, empty boxes for images, etc) but then show the real view when finished.
For an example, see YouTube - it's the first that comes to mind that does it.
7 seconds? that's hard to optimize until < 1 seconds.
1 seconds is my absolute limit for 99% of use cases
Not sure what the "script evaluation" refers to, though. Depends on how they measure it. Might be a rather meaningless statistic.
@KarelG Yes, I agree that I'd expect such a statistic to take up to a second but I don't know what it actually measures. It might be wrongly counting some irrelevant background calls as "evaluation"
We had a client that wanted the page to "finish loading" in set amount of time. Their definition is "we don't want to see a spinner in the tab". Which was weird. The spinner showed while waiting for some resources from the backend but those resources weren't relevant for showing or using the page. And the call only took longer on their systems since they used tin cans connected by a piece of string instead of an ethernet cable (my best guess, at least).
"script evaluation" = time required to interpret all scripts (either inline or via js file) and make ready for execution.
well. I could be wrong tho. Feel free to correct me
13:09
Again, I don't know how this is measured. It might be that the page is ready for use in 500ms and there is another 6.5s spent on running various pieces of code that are background only.
Or it might be that the page can only be fully used in 7s. Not sure.
@paul23 ... we're waiting...
CLARIFICATION REQUIRED
yeah I have no idea what's taking 7 seconds when I use the chrome build in auditter
It only ahpens when I select "mobile" - on my pc it takes 1ish seconds before the page is fully rendered.
13:49
Did you try removing while(secondsRunning() < 7){}; loop from the code?
@VLAZ no, it must be removing one of the zero's!
 
1 hour later…
DIG
DIG
15:14
hi! does anybody can explain immerJs peculiarities?
 
1 hour later…
16:23
I keep getting an error from 'if (object.length <= 1) {...}' saying "cannot read property length of undefined" but right above the part that returns that error if I type object.length it returns the length. Could someone help me figure out what I am doing wrong?
16:36
@Nika can you give more context for this code?
@VLAZ Sure! It is basically taking input from HTML (so the input is a string), but hte form of the input is (a,b,c,...,z) instead of [a,b,c,...,z]. So part of my task is to turn the string (a,b,c,...,z) into an array, which in js looks like [a,b,c,...,z].
So the first part of the code replaces all instances of ( with [ and all instances of ) with ]
so in the end I get [a,b,c,...,z] except it is still a string
But then I use JSON.parse on it which turns it from a string into an object
and when I write "return object.length" it returns the correct number, i.e., [2,4,6] returns 3.
but then when object.length is a condition something goes wrong
16:55
Hey Nika, have you tried using the String split() method instead to turn (a,b,c..) into an array?
@GilbertCurbelo 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.
17:18
@GilbertCurbelo Yes but if I did that it wouldn’t account for sub-arrays. For example, (1,(2,3))
|| xkcd# 974
@KarelG idk, someone put it there when creating the command
@Nika Ah okay, then in that case, could you try Object.keys(object).length?
I had a general question, I'm building a web app where execution time for code matters but load time doesn't matter. Am I better off with vanilla js or is jquery just as fast once loaded? I have a fair amount of dom traversing and animations, so I'm concerned about making the switch from jquery.
17:34
I would stick with jquery
Okay, are there any particularly slow parts of jquery that I should avoid? Sorry, I know that's a less specific question
honestly it doesn't make a significant difference
avoid looping where unnecessary
and generally bad algorithms
Unless you're doing drastic changes to the html, then you shouldn't worry too much. Also, you might run into animation issues on mobile. But, all you'd have to do is optimize the CSS
if you find it's slow, optimize.. otherwise don't try to optimize prematurely
Idk if optimize is the word I'm looking for, but hopefully that makes sense
17:42
Yeah, that makes total sense. Thanks so much for the advice. I feel like I'll be able to code it all just fine, it was just that initial decision whether or not to use jquery. I really appreciate the discussion!
though in my personal opinion, it's important to know how to do it in vanilla
the problem with jQuery is that once you get used to it, you kinda want to include it in everything
Yeah, I feel like most of the time I use the vanilla alternative, but I find it really hard to traverse the dom easily without jquery. I think that was my main concern in switching.
so, if it's all the same, try it in vanilla first
it used to be that there was querySelectorAll
and jQuery filled a very massive void
but now you can achieve the same thing for the most part
it's faster for that matter
okay, that's good info, I'll look info how I might do that. I'll code vanilla js until I run into a problem I can't get through. That will likely help me to understand whether I feel like its necessary for what I'm trying to do
I promise, you can do everything in vanilla :)
just have to find out how
try to resist using jQuery if you can
17:47
yeah, that's where I'm going to start, then!
18:24
@GilbertCurbelo Object.keys(object) renumbers everything in the array
I would not use jquery for a complete different reason...
18:48
@paul23 -1 not enough jQuery
19:06
new project started, 100% test coverage!
Let's see how fast that will drop this time.
19:28
posted on June 18, 2020 by Prudhvikumar Bommana

The beta channel has been updated to 84.0.4147.56 for Mac, Linux and Windows A full list of changes in this build is available in the log. Interested in switching release channels?  Find out how here. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Prudhvikumar Bommana Goog

19:38
0%
19:50
About 30 minutes? That's a new record! Well done everybody, we did it!
20:04
@paul23 whats that reason?
20:46
posted on June 18, 2020 by Cindy Bayless

The Stable channel is being updated to 83.0.4103.112 (Platform version: 13020.82.0) for most Chrome OS devices. This build contains a number of bug fixes and security updates. Systems will be receiving updates over the next several days. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels? Find out how. You can submit feedback using

 
1 hour later…
22:06
Because the functionality is fully taken over by "vanilla" javascript. On top of that it introduces a... peculiar syntax that is quite stumbling for people not versed in jquery. And finally: if you truly need the advanced mechancis there are better libraries/frameworks. Frameworks that promote good planning of the interface instead of random code everywhere.

« first day (3533 days earlier)      last day (1639 days later) »