« first day (3202 days earlier)      last day (1968 days later) » 

00:00
Gnight folks
Gnight Shrek. Why does this not print "aaa" stackblitz.com/edit/js-que6xp?file=index.js
 
2 hours later…
01:42
Hmm are the jits nowadays clever enough that I can do Array.from(someMap.values()).find(sometest) and it will halt on first found item instead of copying the large map?
 
3 hours later…
04:38
want to know more detail about nodejs memory leakage (GC)
@SelvaKumar 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.
 
3 hours later…
07:28
hi comrade,
wanna ask
how to set up upload size restriction on client side using $.ajax()
08:10
From what I think you cant only do it properly from your server
However you ould check on size of the file and throw an error to the user
Which would probably not be the proper way but is a decent one
@Artoftroll simply don't make the call if the size exceeds your max, but note that it's trivial to bypass
@Baldráni it would be proper if done on both sides
Yup indeed
Quick question to you guys
Is it possible to launch a method only on the opening of the browser console ?
@Baldráni facebook does that somehow
Just to modifying the text no ?
If its only this, this is trivial
I'd like to troll my colleagues
And launch a sound
115
Q: Find out whether Chrome console is open

r0skarI am using this little script to find out whether Firebug is open: if (window.console && window.console.firebug) { //is open }; And it works well. Now I was searching for half an hour to find a way to detect whether Google Chrome's built-in web developer console is open, but I couldn't fin...

08:14
This is smart !
Lets do that haha =)
08:32
@BartekBanachewicz @Baldráni noted thanks !
Hello, how can I convert this back to decimal? in javascript
1,000.00
I want to make it like 1000.00
any help please?
Parse it?
I need a master of the dark arts... Are you around, @MadaraUchiha?
@AppleCiderYummy numeraljs
Is there like some Magic to extending RR <Route> components
is there any website where I can pass query strings and see result ?
08:45
@MikaelKen 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.
@AppleCiderYummy What is wrong with parseInt("1000,00");
hm the more I read about Lua implementation the more I think I could write a native compiler for it
Oh, nvm. Read that wrong, sorry.
@MikaelKen what do you mean with result?
> The Lua virtual machine’s set of arithmetic instructions looks like 3-operand arithmetic
instructions on an RISC processor. 3-operand instructions allow arithmetic expressions to be
translated into machine instructions pretty efficiently.
08:46
jsonplaceholder.com will do it
that's an understatement
there are direct x64 equivalents of most of Lua bytecode operations
React always screams at me that its not inside a router whenever I make the simplest, non-modified even, extension of the <Route>, telling me im not using it inside a router (even If it ends up there) Which makes me assume something goes wrong during some internal super call or there is some Magic to it
Cc @MadaraUchiha you love RR :P Maybe youll know
is router that thing you use for SPAs
oh well I only render react components in-situ
seems to save a lot of headaches
08:48
Im on phone so its hard to produce a proper example Real quick, but generally
and after someone here (rlemon I think) taught me to use mobx it's even nicer because they can be attached in various places and yet sync via one state provider
but then again I make simple apps
even the simplest export class MyRoute extends Route<RouteProps> {} will fail
And End up with react screaming at me its not inside a router, even If I do use it in place of another Route Thats inside a router and works as intended
@BartekBanachewicz I use mobX alongside, for history for example (and all other datastores too)
For now i cheated my way around this with a HOC around the rendered component
But it reaaaly is bugging me why it doesnt work
There has to be something im missing / not understanding
Just put it in a router c:
:residentSleeper:
But that is not with the extends Route thing :/
This post also does things: https://medium.com/@saipeddy/how-to-extend-react-router-with-a-health-check-61023876b155
It doesn't extend Route but React.Component<RouteProps>
08:57
Been there done that
Yeah, I expected that.
Meeting, late.r
I might have to make my thing more MCVE, Maybe there is something wrapping my stuff I didnt notice that is doing the fucky
But then again, If a generic <Route> works, and putting a simplest possible extension of it in its place doesnt
Weirds me out
09:09
Maybe the problem somehow lies with it not being able to read the router context for some reason
Hmmm
OH GOD WHAT THE FUCK HAPPENED WITH TWITTER UI
actually after the shock passed I kinda like it
@BartekBanachewicz yep same here
Any idea why wont my component render inside a switch case.. It should be damn easy..


https://codesandbox.io/s/autumn-field-y66qs
@ShrekOverflow why is Charles xavier in that movie?
09:19
@Neoares That's not charles xavier that's 1 punch man at 400 years
oh shiet
Check mate
what happened to him? too much training?
@Neoares biology called, it needs the (whatever binds the DNA) gone
I can ask, I'm working in a biological laboratory ATM
but I won't
10:07
@Neoares Yamcha
what
@geisterfurz007 Sup
@KamilSolecki No idea, I'm afraid.
Typescript ain't adding my Imports (VsCode)
what's going on 😐
have restarted vs-code 3rice
it can't detect the exports from the same dict
What does "ain't adding my imports" mean?
> 3rice
10:18
😃
@JonasWilms VSCode should auto-add imports
vOv esp when using TypeScript
so if I type export class Blah extends FooBar{} I'd expect it to auto add FooBar
It works for node modules but not for my own data types wtf
Sounds like I have to rethink my IDE tools ... I'm still doing imports manually :)
In React, there is this form component, for each text field, I am setting a state. And I am keeping a state "formDisabled" which is true if any of those textfields is empty. So, formDisabled state is actually dependent on other states in same component. How should I avoid it?
@JonasWilms I stopped doing it manually after vscode added it
I don't mind doing it manually
I just hate having to expect it to do or not
@RahulJain move the text field values into the forms state, then derive the "formDisabled" inside render() from the values
@ShrekOverflow Krilin
10:31
@Neoares Still better
ofc
I could've said Saibaman
i mean i am balding
and have a hotwife
😛
and she's a robot
dunno about that but she is from russia
so -- red ribbon nuff
@ShrekOverflow yeah, thats annoying, cannot help unfortunately. I do have a similar case with Webpack import aliases, although it is building fine my IDE does not detect them, so I always have "module not found" errors everywhere
10:33
@ShrekOverflow Anything in the plugin error log?
lol the whole thing just crashed
@ShrekOverflow 😃
pretty sure its some nasty plugin
@ShrekOverflow yeah, you hated "M$", so it is paying you back
@KarelG I still hate and will do, probably forever.
10:35
You are betraying our own belief. You are using VSCode!
and TypeScript!
@KarelG I don't let my personal preference come b/w me and work productivity
that said if they made me use windows, I'd quit
also I wouldn't ever work for MSFT
is there any active data science room?
cause I can't find it
@Neoares it's called r/dataisbeautiful ... IT has both R and REDDIT!
which probably answers the "active" part
but reddit has no chat
there are no help vamps there
Just ask a damn question
10:37
reddit has chat o.O
then what's the point
and what shrek said
I never used reddit :o
it's going to be my first time
gotcha discover some interesting subs hehe
it doesn't feel like a Q&A place
10:38
have you ever been to r/buildapc
r/ama (heh)
everyone is posting statistics and stuff
> A place for visual representations of data: Graphs, charts, maps, etc. DataIsBeautiful is for visualizations that effectively convey information.
-.-
i just wanted a place to post something like "WHY ARE GANS SO DIFFICULT TO TRAIN" then quit
oh thats a different subreddit
thank you little boi
I still require a SO room
@Neoares are you doing a lot with GANs?
I am trying
it is suposed to generate dog images, but instead it is generating moon surface images
10:49
@Neoares They're good dogs bront
and this is in the first iteration, after that it gets even worse
hehe
what's your loss function?
we played around with some and that happens quite often
god, I totally forgot what we adjusted
binary crossentropy
for both the discriminator and the whole GAN
yeah I've seen many adjustements you can do to improve the GAN, the thing is that there are many combinations and trying them all is infeasable
even a grid search takes forever
yeah that's not an option
for the moment
10:56
not sure, really. I'd start playing with learning rate first
before tweaking the architecture itself?
yeah
I don't know enough about GANs though
and what hyperparameters are the most important there
I'll try to reproduce some others' work
but a lot of people is using torch instead of Keras, and I've never used torch
11:42
@JonasWilms Thanks
11:55
@MadaraUchiha I think I'm onto something with this thing
Sorry, was at lunch; I have an issue in a userscript of mine and I have no idea what's going on. A user filed an issue that the script wouldn't work on one of his machines and the issue was rather obvious; I had an undeclared assignment in strict mode. So I thought, I'd just add a var and everything would be fine. Turns out that while it now works for that one user on that machine, the change broke it for pretty much everyone else including myself.
The script is at https://github.com/SOBotics/QueenReporter/blob/master/QueenReporter.user.js and the lines that make me confused are 23-31. I co
react context isn't being passed and is wonky
I wonder where this will take me
Down the rabbit hole...
My assumption (not backed up by anything but that behaviour) is that the var statement is run before any code is executed, similar to how function blocks that are not assigned to variables are so that you can use them anywhere, but is that really how it works or is there any other magics going on?
 
1 hour later…
12:59
I am so confused my own terminology in my project
._. I have shot myself in the foot a few times
it's kinda good to write that thing down
@ShrekOverflow *pats your shoulder* don't worry bud. I have been in your shoes as well.
(pun intended)
I mean I have to deal with protocols
and they all have request response semantics
so ._. ofcourse I confused it
Now shall I use composition or inheritence
composition probably
13:41
Hi, In React, I am passing no props to child component. Still, in child component, this.props.onclick is not undefined. why so?
Hmm I know i normally shouldn't do it but I wonder
Is deleting entries of a Map while iterating over said map "safe"?
@paul23 yes
for (const [k,v] of someMap) {
    if (someTest(k,v)) {
        someMap.delete(k);
    }
}
Or is the iteration after deletion undefined?
it uses an @@iterator
so
map with key => value pair as [0=>0, 1=>1, 2=>2, ect)
loop0: [k,v] = map.iter.next()
  k=0, v=0
  if test = false
loop1: [k,v] = map.iter.next()
  k=1, v=1
  if test = true -->del
loop2: [k,v] = map.iter.next() // the next element without problem
  k=2, v=2
ect
it is a separate entity
13:57
@geisterfurz007 In that case, GM is meant to be a global object
Try window.GM = {} instead of var GM = {}
 
1 hour later…
15:08
Hey everyone. I have a little issue that's driving me crazy and I can't find an answer on the web.
I'm dynamically generating a set of options (unordered list of inputs and selects...).
To this point, everything ran smoothly and worked as intended.
However, my last change was to add a checkbox in front of every list item, to simply turn it off. For options that are not optional, I want to disable the checkbox (while preferably keep it ticked).

Now here's the issue, I just can't make the checkboxes be checked on creation.
@SamuelNovelinka jsfiddle.net/5tz6nr8f Cannot reproduce.
got some code?
 function createOptions(info_opts){
	let option_menu = document.getElementById("graph_options_div");
	let menu = document.createElement("ul");
	let columns = info_opts.columns;
	option_menu.innerHTML = "";
	for(let i = 0; i < columns.length; i++){

		var li = document.createElement("li");

		var col_onoff = document.createElement("input");
		col_onoff.type = "checkbox";
		col_onoff.id = "col_onoff" + i;
		if(!columns[i].optional)
			col_onoff.disabled = true;
		col_onoff.defaultValue = true;
		li.appendChild(col_onoff);
@SamuelNovelinka What's defaultValue?
Yea, sorry. That's already code a bit fiddled with. Checked is false by default so that was one of the more desperate ways of checking it upon creation.
Formerly there was "col_onoff.checked = true;" instead of the defaultValue
I also tried to move things around thinking checking only works before/after appending, but to no avail.
15:20
Oh
It's because of the innerHTML.
I'm like 99% sure
Lemme check that
Yep, you're a saint.
Makes me wonder tho... how would you append raw text then?
Code's recent build is janky shit on OS-X
ignore the unread emails their is a spam catcher account added in there
see the magic -- no vscode in dock
@SamuelNovelinka document.createTextNode
Look it up
15:27
@MadaraUchiha Yep, got it. Once again, giant thanks! I was starting to get crazy.
One more question. Let's say I have multiple fields for multiple values (namely multiple fields, each having it's own "type", "column", "enabled", "format" ...) I need to generate the option div and afterwards collect the data.

Currently I use overly complicated way of constructing specific id for every element (eg. "col3tooltip", "col_type2annotation"...), which I deconstruct at the data collection... but I find that somehow cumbersome.

Is there any better/more obvious way to do it, or should I stick to the ids?
Are you using the names of the inputs for anything important? Do the inputs stay in order, giving them a number (their index in a node collection) thus eliminating the need to numerate them?
Yes, I would say the inputs stay fixed in order.
15:50
Hmm anyone experienced with mobx?
-> How do you debug what is causing mobx in react to force a rerender?
Hmmm
if you're using strict mode, then it would be caused by an action
If I test all properties/injected stores inside componentWillUpdate I'm actually seeing exactly the same values as the old props - lodash' deep equal doesn't show any differences.
if it's caused by an action and you're in dev mode, you should be able to see that in the devtools
So you'd at least know which action is causing it
you could then narrow it down within that action
Where would I see the action that caused it?
running a dev build right quick to confirm
but pretty sure i saw them in the console
nope
dunno then
> [Violation] Only request geolocation information in response to a user gesture.
??
you could use a spy
seems like it'd be a good idea to add that regardless
gets disabled in a production build automagically
16:26
@ShrekOverflow snap changed vscode to code a few releases ago and it changed shortcuts and stuff depending on how you had it setup. It could have been something similar on OS X
hmm.... it seems like it's not properly setting the env to production while building for production
it's correct in my webpack config, but it's not disabling the spy
How can I walk a protocol chain and get all constructor names?
@KevinB I'll have toread up on that tomorrow
My component is updating "on downloading store data" - but the data is equal to the old data and I think it is merged and never replaces the references.
(Only replacing primitives)
i can even confirm that NODE_ENV is "production", but the spy is still being called. but, i can just disable it myself with an if statement. :shrug:
So long as you have the spy as singleton that isn't a problem
16:37
TIL __proto__ was deprecated. I mean, good, it's a terrible solution, but it was fairly new
really
that's been popping in up devtools for a long time
:p
I wonder why one would really use it? - Other than to manually walk the inheritance chain for debugging.
to see if one class inherits from another, I suppose, without instantiating and doing an instanceof check
but I've only ran into that scenario once, and I think I solved it some other way anyways
oh wait, actually, no that wouldn't work either
I'm not sure what it's use case would be lol
it isn't readonly
I hate heat, it's getting 40 degrees Celsius soon, how am I going to survive.
16:42
@paul23 manually walk the inheritance chain for debugging and to resolve dependencies
@KevinB Dependency injection is a fun and amazing tool. I've used it to great effect in python. however the prototype inheritance doesn't lend to it as well as ducktyping + multiple inheritance does.
there's Reflect.getPrototypeOf now, not sure if that's an equivalent or not
707
Q: __proto__ VS. prototype in JavaScript

0x90 This figure again shows that every object has a prototype. Constructor function Foo also has its own __proto__ which is Function.prototype, and which in turn also references via its __proto__ property again to the Object.prototype. Thus, repeat, Foo.prototype is just an explicit proper...

none of that actually demonstrates what we lose by it being removed
That image is more confusing than anything lol
well following the flow chart without __proto__ you never get to Object
Say Bar extends Foo, which extends Base. I then pass data X to base which then calls all its derivatives on match, which then calls its Derivatives on base and so on until they keep matching, the depth first match will then instantiate the object
@paul23 I won't be heading to Object
I'll stop at Base
it's more registering 😛, the consumer just writes plugins
I have to load em
I mean I could just make everyone do Base.extends/register when defining a deriviative class but that's just UGLY.
Base.register(class Foo extends Base{
              ... uhgly!
});
def(class Foo extends Base {
 ... NOICE! ain'it?
});
I'll just go with Register though tbh vOv whatevs
17:19
@paul23 try Phoenix
the highs this week are hanging around 110 F
before the summer is over it's gonna get to 120
export function def(
    test: TTester,
    Record: TRecordClass,
    ComponentCtr?: Component,
) {
    const derivatives: IProtocol[] = [];
    return {
        Record,
        test,
        derivatives,
        Component: ComponentCtr,
        toRecord(entry: Entry) {
            if (!test(entry)) {
                return null;
            }
            const derivative = derivatives.find(p => p.toRecord(entry));
            if (derivative) {
                return new derivative.Record(entry);
Probably the worst implementation
I didn't evolve for this temperature
should I only stored token id in my database if I am using Google Auth API's and verify the user to backend with that token
How can I if this one is wrong ?
17:35
Do we have to pay to use Firebase?
I think it has a free tier.
Per their website, "firebase helps mobile and web app teams succeed."
Firebase, like GCP, has a pretty generous free tier
their strategy is to get hobbyist developers to love them so they'll eventually bring that usage into the workplace
Ah, that makes sense.
it's a good tactic
17:41
Their website mentions they have a Slack integration. I bet that could be a great venue for keeping a team on track.
17:57
Hmm is it a good idea to just no longer user passwords: instead on each session creation a one time token url is sent to the user's email with which they can open the website?
^ that's a feature often requested to me.
@forresthopkinsa what's your opinion of firebase?
@DavidKamer Haven't used it myself but I'm a big fan of GCP
I intend to use Firebase eventually because it looks cool but I haven't had a project that calls for it lately
you're early Tavo
Firebase... was... not a fun experience at first because of its default to v6. Honestly less of a learning curve to setup your own server with DO or whatever. I don't mind it now, but I hated it when I first started using it. I was probably expecting too much
18:27
DO?
we use firebase for a simple user system... but i'm not a huge fan of it. I'm just not confident in the way permissions are set.
Interesting
every time it comes up in here I'm like, I need to find a project that will let me play with it
just use jquery
I think if you say that enough times then it'll start being a good idea
that's how react got popular
18:40
that's how mobx got popular
madara talked about it enough times
bob got me into mobx
thank god, redux makes me want to die
connect your component to the store so you can dispatch your actions to your reducers that will update your store with the state that will trigger your connected component to re-render
wtf
redux pls
selectors too
I dunno, too many things to remember when it doesn't have to be
it makes sense, the way redux does it
I just don't think it's neccessary
We had an old project that used a similar permissions config to firebase, and... lets just say it wasn't very intuitive. Loopback's ACLs (very old loopback, haven't looked at version 2+)
kind of like fully js frontends :D
we had a particular set of data we wanted everyone to be able to set and read their own, and we wanted them to be able to read responses by admins to their own, and admins to be able to see/write to all... and that ended up being a huge mess to configure ACLs for
a ticket system essentially
firebase has a bit more control in that regard
loopback might too by now, but we're not going back to that
18:49
I'm now running into an inherent problem of mobx though. It's really really easy to get a mess of "interactions" where you are no longer have a clear path of what causes what to update.
It works: but my applications is having like 5-10 render cycles each update. And apparently also updates when completely unrelated information loads.
Reduce the number of functions you have that are Actions
like, imo one action should never call another action
Redux would have the same problem
that's not a library issue
Well I have say an "authorize" store that holds the current user information.
However if that changes (due to logout action) also the data needs to be reloaded (some users have more information regarding certain data than others). So I have a reaction on that.
But then if the data reloads the user's other data also needs to be reloaded potentially, as the data are mostly just references to actual data elsewhere (and that data store is loaded, on demand, so per-id).
Yup, we have that exact scenario. Ours is a dealer locator, so when you change, say, the type of dealer you are looking for, or the search radius, we have to hit the DB to pull in the new data set. so you have an action that updates the radius, that then calls a fetch which in turn again updates the store, resulting in two renders
what we could do in that scenario is delay setting the radius to the store until after the fetch, so you're updating the store once.
that though has the downside of causing the change to radius to be delayed until the data has been fetched
@KevinB the "multiple renders on load" isn't a problem for me. It's that apparently something is also causing rerendering if I load the data with exactly the same data.
18:55
well, exactly the same data, wouldn't be the same data would it?
[1,2,3] !== [1,2,3]
like every few seconds all stores recheck the loaded data to check for updates. They overwrite their primitives with the gained data (deep merging data).
what are you using to do that merge
for (let i = 0; i < newdata.length; i++) {
    if (isprimitive(olddata[i])) {
        olddata[i] = newdata[i];
    } else {
        mergeData(olddata[i], newdata[i];
    }
}
^that's the pseudocode.
So you're leaving object/array references alone, and just replacing the primitives, recursively
yes
I'm now also adding equals guards around it.
Yet they still "update" even though that specific field is not used in the view.
19:00
@forresthopkinsa Digital Ocean
IE all stores have a "last_checked" that is obviously changed each database call. However that is not used in views. I'm suspecting that this is causing the views to update.
Do the views that are updating have their own component?
for example, assuming you're rendering a list of users, is that list it's own component?
and each user?
Well it's the mainview that is causing the rerendering which is basically a header bar + switch (mobx-react-router)
In other words, are you avoiding this problem: mobx.js.org/best/…
changes to something that would change just the header causing the entire list to be reconciled
Hmm I know it must be something like that, but I'm hunting for a day already the cause :P
Well it's just that mobx doesn't "solve" the problem of tangled mess of updates. Contrary while it helps with removing logic from the components to stores/models/controllers that comes as the cost of a more difficult "what causes what reaction" path. - Compared to simply using react state.
19:43
🚽
💩
20:15
-3
Q: Есть решение с зумом safari, но, я обнаружил, что в момент прокрутки зум все равно работает, как это можно исправить?

Денис ФилипкинThis code helped me to turn off the zoom in safari for 2019, but I found that while scrolling the page I can still zoom, how to catch this event? can I make it so that at an event I can touch the scrolling termination and fix it in my situation? window.onload = () => { document.addEventListener(...

21:05
posted on July 23, 2019 by Michaël Zasso

Notable changes deps: Updated nghttp2 to 1.39.1 (gengjiawen) #28448. Updated npm to 6.10.0 (isaacs) #28525. esm: Implemented experimental "pkg-exports" proposal. A new "exports" field can be added to a module's package.json file to provide custom subpath aliasing. See proposal-pkg-exports for more information (Guy Bedford) #28568. http: Added response.writableFinish

 
2 hours later…
22:40
Having to use node 8 mades me sad :(
23:22
hmm which javascript version added class property methods?
jsfiddle is choking on it.
class base {
    constructor() {
        this.data = 'blah';
    }
    foo = () => {
        console.log(this.data);
    };
}

« first day (3202 days earlier)      last day (1968 days later) »