« first day (3624 days earlier)      last day (1316 days later) » 
00:00 - 20:0020:00 - 00:00

12:03 AM
posted on September 17, 2020 by Krishna Govind

 Hi everyone! We've just released Chrome Beta 86 (86.0.4240.42) 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 C

 
 
2 hours later…
1:48 AM
Having an issue in angular.
I've the following scenario. Routes: /item/:category points to itemComponent and in navbar, routerLink: item/item1, Text: Item 1, routerLink: item/item2, Text: Item 2, etc.
When a user is in item/item1 and click Item 2 on navbar, the page doesn't update.
Navbar is a separate component called directly using <app-navbar> in app.component and ItemComponent is rendered using routerOutlet in app.component
ngOnChanges doesn't work. Not sure why but may be the change is taking place from another component (from Navbar). Any idea to make it work?
 
2:31 AM
able to resolve that one, nvm
 
 
6 hours later…
8:14 AM
no php? mmmm...
as it looks like a prebuild site, like all the others so variants
i thought it was wirh any of these awesome tools which php is plenry of
i made a kickstarter
but i dont expect anything from there in reality
plantomium cms
you can copy my source, i know i am a wasted human which god wanted to make suffer
it is the way for my personality in this place, natural rules
a source of imagination drained by human greed. i usually think what did i do to god in previous lives
i have been thinking about making distributed computation with this tool, for other devices to connect, ask for a task of a common tasks pool stored at the database, and use them to computate algorythms and report the results to the central server
but no, i will focus on building websites through components
it is kinda nasty to be building a tool that might be used to forbid people who dont have money to access to information... or to fake the data between users of an app depending on rules or conditions, but that is what security means in the end...
 
9:12 AM
today i will implement the part of the cms that applies the authorizarion rules per each: table or column, and type of request (get, post, put, delete) in the selfgenerated rest api
it is kinda sad day, coz this part of the code is used by humans to create human elitism, i prefer to think about the usage it offers for games... but for some reason, reality is made by permissions and groups too
 
10:08 AM
Hello, can anyone explain me this line ?
validation = ((item:any): boolean => true) || null;
 
@Kruno 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.
 
10:25 AM
Morning. Sorry for dumb fool question but I've not worked with JS async calls before and I'm struggling to understand why this isn't being called?
             Axios.get<ProductWrapperSummary[]>(searchUrl).then((result) => {
                alert(result.data.length);
            });
Axios.get returns a promise but none of the code in the then() function ever gets called, so clearly I've not understood how this is working - but what's wrong?
 
you can use .catch to handle errors
after the .then(...).catch(error => ...)
 
ah, of course. I just presumed it would work as it's a standard API call, didn't think to check for errors
 
kruno it looks like someone leaving a hole
you can use await too
it will make your code more maintainable
 
11:08 AM
Morning
 
evening
 
11:34 AM
HI Can i convert bpmn digram to png.I am using npmn moduler libaray
I have this package but it did not know How to use in pure JS developer.aliyun.com/mirror/npm/package/bpmn-to-image/v/0.5.0
like <script> file include using hrml
*html
 
I have absolutely no idea what youre asking
Are you trying to convert a Graph in html into an Image?
 
bpmn diagram into image
 
Unfortunately I cant help. My domain is blocking that site.
 
thnks
 
Ill give you this tip though
if your graph is in a Canvas
you can save the canvas as an image
If its in HTML, Well youll probably need one of those "HTML to SVG to Canvas" libraries
Screenshotting HTML has been a rabbit hole Ive fell down many times
and I do not want to do it again
 
11:55 AM
Isn't it a server side package?
 
12:28 PM
Hey all. I'm not understanding something about how to get the results of an async function. I've done this
	@Prop() giaToIsaAllowed: boolean;

	async created() {
		this.checkGiaToIsaAllowed().then(result => {
			this.giaToIsaAllowed = result;
		});
	}
 
@BobTway 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.
 
alternatively, mermaid and plantuml do the trick most of the times
even skemator, a programming language i made once
the 3 can generate pngs
 
And that seems to work fine - if I log the value of the property, I get the expected result. But it's binding to a vue model and vue doesn't like it at all, complaining "Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders."
How can I just get the result of my function and make it available as a property?
 
the idea is the following: properties are the html attributes you pass to your vue component, and they should not mutate at all. But, in the data() or wherever, you can use the properties to calculate the data object properties, which can do mutations, to update your component accordingly.
finally, the async operations are done yes, but not blocking the lifecycle of vue components, so they can be loaded fastly, and updated later, achieving certain naturality in their behaviour when they fetch data, and allowing you to use loader components before the data is fetched
idk if it helped
 
 
1 hour later…
1:56 PM
18 messages moved to Trash can
You were warned @CarlGentleman
Could someone help me with git? github.com/jitsi/jitsi-meet/pull/7473#issuecomment-694248355. She want's me to rebase to avoid conflicts but 1, i don't think there are any conflicts, 2, I'm not sure what to rebase.
 
2:22 PM
hi, is there a way to have a nested interface all populated for a unit test automatically with typescript?
 
3:10 PM
what
@JBis I think they meant rebase so you don't have the upstream merges in there
Like this one
 
@BenFortune i thought you aren't supposed to rebase things that's been pushed to origin
so i decided to merge, which they can just squash
this guy says they can squash but maybe i just screwed up. Not really sure.
 
Github normally shows merge conflicts at the bottom... is that only for authors and maintainers? I can't see it there.
 
i've had conflicts on that exact pr before and it showed them so idk what she is talking about
ok she upvoted the guys comment so i think we're good
 
is there a HAML room?
I cant figure out how to use a damn class and attributes together
and the documentation is fking 1 page
 
nope, you were correct @BenFortune
 
3:24 PM
ffs... I hate haml now
its useless
Cant even parse basic attributes
and SVGs just break everything
 
eh, isn't haml like super basic?
 
3:44 PM
Hi. When I require my javascript file which contains my functions I can not use the functions. Why?
 
wdym
 
require('./functions');
I expected after this line I've to be able to use the functions and variables inside the functions file, but I can't.
@KevinB Got it?
 
@X4748-IR require doesn't copy and paste the file. It's not like PHP or an include directive.
 
@JBis How does it work then? How can I put my functions in a separate file? Is there any tutorials about it?
 
look up commonjs require tutroiral
 
4:01 PM
Thanks.
 
Jay
4:34 PM
I have a login button in the header and users can browse around to quite a few different pages on my site without needing to be logged in. What's a good way to capture the current URL so I can send them back where they came from once they log in?
I tried a successRedirect: "back" in my app.post("/login".. route, but that just takes them back to the login page after posting
 
4:54 PM
Active morning in r17
 
5:16 PM
@Jay A pretty standard technique is adding the current URL to a query parameter like ?returnTo=/about.html
 
5:30 PM
Hi folks, any chance somebody could help me with a somewhat easy problem of mine?
 
@malthe.w 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.
 
chances are half decent, if a question is asked
 
Jay
thanks for the reply @forresthopkinsa, I can redirect them to abc.html every time no problem, but I'm trying to redirect them back to xyz.html if that's where they were when they clicked the login button
 
right so add the query parameter when they click the login button
read the current page and add it to the link
 
Problem: I am trying to have a function within my .js file execute after the other functions have executed first.
Question: How do I ensure this?
 
5:34 PM
call it after the other functions?
 
Jay
@malthe.w async await is your friend, javascript.info/async-await
@forresthopkinsa how do I do that?
 
right now, how do you handle someone clicking the login button?
 
Jay
clicking the login button takes them to the form for logging in at "/login"
here's the route
app.get("/login", function(req, res){
        res.render("login");
    });
then when they click okay there:
 
@Jay I'm afraid that I'm too big of a newbie to really understand that.
Basically, I have a html page that has an empty table. I then have my js file injecting the tr, th and td tags with data taken from a database as soon as the html page loads. Then I have another function which is meant to make the previous table sortable via clicking on the table headers. However, it seems like that function doesn't work for some reason and I'm suspecting it's because the function doesn't see the table that has been injected.
 
Jay
app.post("/login", passport.authenticate("local",
        {
            successRedirect: "/home",
            failureRedirect: "/login"
        }), function(req, res){
    });
 
5:44 PM
so your login button is just a link to the /login page
 
Jay
@malthe.w async await is a newer way to make sure a particular function finishes before starting another, I'd spend some time reading up on it a little bit. It's gonna do exactly what you want.
@forresthopkinsa yes
 
o/ forrest
 
Morning!
 
Jay
@malthe.w and your suspicion might be right, without async await the two functions may be running at the same time
 
@Jay window.location.href = '/login?return=' + window.location.pathname
something like that
 
5:50 PM
@jay
@Jay Hmm alright, thank you!
 
Jay
@forresthopkinsa okay, I was just trying this:
<script>
    $(function() {
        $(".btnLogin").on("click", function(){
            const whereTheyCameFrom = window.location.href;
        });
    });
</script>
but I'm not sure how to make it available on every page
 
well you're probably looking for the pathname rather than the href, for one thing
 
My PR for Jitsi was finially merged!
 
@JBis I saw that! good work!
 
thank you!
 
5:56 PM
@Jay as far as making it available on every page... aren't you already displaying the login button on every page?
 
Jay
yes
 
Unfortunately, its still pretty slow (but usable). However, it's something else with the app because the same script on BitLink works very fast.
 
Have you done any perf profiling?
 
Never done that before, iirc its in the dev tools > performance tab right?
 
Yeah
I've only used it a little bit myself but it's a cool tool
 
6:02 PM
!!||
 
|| say ||
 
@forresthopkinsa taking a look now, pretty cool. But I have no idea how much time things should be taking lol
 
Is there anything like pointers in javscript to edit variables outside the scope?
 
@X4748-IR 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.
 
6:11 PM
there are variables, but they aren't going to help you with asynchronous logic.
 
1 message moved to Trash can
 
||mdn closures
 
Something like this:

function foo(&x){
  x = 1;
}
x = 0;
foo(x);
 
6:16 PM
):
 
function foo(a) {
  a.x = 1;
}
const obj = { x: 0 };
console.log(obj.x); // 0
foo(obj);
console.log(obj.x); // 1
@X4748-IR Do you understand
 
Hmmm. I think so. Let me try.
 
||> global = {
      ...global,
       set x(val){
         this.x =  val
      }
}
 
@JBis "TypeError: Converting circular structure to JSON\n --> starting at object with constructor 'Object'\n | property 'global' -> object with constructor 'global'\n --- property 'global' closes the circle" Logged: `` Took: 29ms
 
hmmm. i wonder if you could somehow make that work.
 
6:30 PM
!!>const barf={x:0};function foo(x){with(barf){x+=1}}foo();
 
|| status
 
I am currently alive!
 
you broke him
 
uh oh looks like theres a bug
 
no bug
:)
!!>const barf={x:0};function foo(x){with(barf){x+=1}}foo();console.log(barf);
or maybeso
foo doesn't return barf, so it'd never log the result, without a console.log, but it's failing elsewhere
possible that whatever you have parsing it is killing with
 
6:34 PM
X47, don't use with
 
hmm
 
Kevin, you're shadowing x
 
fact
 
ok so for some reason window doesn't work with getters and setters
why
 
wdym
 
6:39 PM
||> bla = {
   get y(){
      return this._y;
   },
   set y(val){
     console.log("setting val: " + val)
     this._y = val;
   }
}
bla.y = 5;
 
@JBis 5 Logged: "setting val: 5" Took: 1ms
 
now change bla to window
 
i mean
what
you can't set window to something
 
Uncaught TypeError: setting getter-only property "window"
well thats stupid
 
hahaha it's pretty predictable
can you think of a valid reason to set window to a new object lmao
 
6:41 PM
ok doesn't matter, i got a better idea
 
Object.defineProperty?
 
you guys wanna see something cool and completely unrelated to js
 
yes
(to both)
 
ez
still doesn't let you call a function with a variable and then have the function update that variable
 
Thank you all. @JBis, @forresthopkinsa
 
6:44 PM
np
Okay I was working on this really basic project in Blender last night and the renderer was tripping up because I was doing volume scattering, i.e. fog, which is really challenging to render. so the render was reaaally noisy
So I turned up the sample count from 1024 to 8192, and it took a hell of a lot longer to render but it was still unacceptably noisy
So I tried 8192 samples + Nvidia's proprietary hardware denoiser
And if you look closely at this one you can tell that even though the noise is gone, there are some really weird artifacts around the glow stick thing
So I was thinking that I had reached the end of the road and there wouldn't be any practical way to improve it
Then someone in the Blender discord suggested this obscure third-party denoiser online, so I tried it
Here it is, now with lower sample count (4096) and using the "SuperImageDenoiser"
And it looks phenomenal
Never would've expected that some random Blender add-on would perform so much better than Nvidia's proprietary solution
 
@KevinB fuck
@forresthopkinsa looks great
blender is fun
 
Definitely fun
I think I'm gonna donate to the guy who made this add-on
 
I tried to fluid simulations for a while, quite difficult.
 
oh yeah those are hard
did you do it before or after 2.8?
I think it was 2.8 where they replaced the fluid engine with the new Mantaflow
 
after but i think i used the older fluid engine
i cant remember
followed something online and then gave up lol
 
6:52 PM
¯\_(ツ)_/¯ the new engine is a pretty big improvement
still tricky to use but easier to get good results with
 
theres gotta be a way to do this
this issue is when i get it, it returns a value instead of a reference to variable
it doesnt lazy get
Somehow get the value that Math.random() produces in this function

function random(num){
   num = Math.random();
}
 
call random and get the value Math.random() returns for your function call
 
and pull it back into the variable you passed to the function?
 
yeah
basically a primitive observable
 
6:59 PM
well Math.random() returns a float
so you'd need to wrap it in an object
if you reassign a variable at any point then you lose the reference
but you can set an object property
 
you can do whatever you want as long as you keep the function deceleration the same
 
function random(num) {
  num.a = Math.random();
}
const n = {};
random(n);
 
you changed the function
function random(num){
   num = Math.random();
}
Object.defineProperty(window, 'y',  {
   get (){
      return this._y;
   },
   set(val){
     console.log("setting val: " + val)
     this._y = val;
   }
});
window.y = 5;
console.log(window.y);
random(window.y);
console.log(window.y);
that was my attempt but it doesnt work cause of what kevin said
random(window.y) doesn't lazy get y, it gets the value
 
of course it does, when you call window.y it evaluates the getter
 
lol
 
7:04 PM
yes i know
im saying if it didn't it would work. but it does so it doesn't.
 
there was something i was reading about this recently... that i think was the same issue
and used destructuring to solve it
but i don't recall if it was the same problem or something else
 
I don't think there's any way you can make reassigning a function parameter work
 
not destructuring, object literal shortcut
x = {foo}
but i don't think that'll work for function arguments
so now i wonder wtf it was
 
hmm interesting
 
it was a question that was closed recently, and contested on meta
 
7:07 PM
if you can find it i'd be interested to see
what if you override the primitive classes...
 
@JBis, js doesn't support passing variable by reference, so it's impossible to see assignment outside of the function (except of closure of course)
 
js passes objects by reference
 
@JBis object variable is reference, but when you pass it to function, you copy the reference (but not the object)
 
|| mdn valueOf
 
7:15 PM
@Qwertiy yes
 
Found it, and it won't solve it (at least, the new answer using {} won't)
0
A: Get name of variable in typescript

Eye Time//typescript function getVarName(obj: object): string { const keys = Object.keys(obj); console.assert(keys.length == 1, 'key count must be 1'); return keys[0]; } const simpleName = 123; console.log(getVarName({ simpleName }), simpleName); or //javascript "use strict"; function getVarName(o...

because it'd mean changing the function call
foo({x}), thus giving you an object as an argument with the var name and value
still wouldn't let you directly update x
the old answer would just get you the var name, not any kind of access to it
 
can somebody help with migrating from typescript 3 to 4?
-1
Q: Optional readonly property or getter in abstract class

QwertiyThis code was valid for typescript 3, but in typescript 4 it produces an error 'smth' is defined as a property in class 'A', but is overridden here in 'C' as an accessor. Playground abstract class A { protected readonly smth?: number public f() { console.log(this.smth) } } ...

 
ah fuck
i forgot strings are immutable
 
and also I need to ignore all errors about deleting nonoptional fields, but without turning off strictNullChecks - seems like typescript doesn't support that, so I'm thinking about errors filtration in ts-loader and at-loader in webpack, but can't find any information about that - maybe there are some liks how to do that?
 
7:39 PM
wait no i didn't
ok i give up
 
i mean
if you figure it out, you could potentially get a lot of rep
but i'm pretty sure it's impossible
 
i was really close but then i accidently closed the debugger window i was working in
 
@KevinB what are you trying to do?
 
someone was trying to update a variable that was passed to a function
this is why it's impossible:
 
@KevinB 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
 
7:48 PM
err
 
||welcome KevinB
 
@KevinB 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 message moved to Trash can
 
but anyway, point is, it is evaluated before it's passed... the variable isn't a thing
at that point
 
i was going a different route
 
all you have is the value, and there's no connection between that value and the var
 
7:49 PM
why is this?
||> ("bla").valueOf()
 
@JBis "bla" Logged: `` Took: 1ms
 
you aren't passing a reference, you're passing a value
so it's literally not possible, unless you were instead passing a reference (aka an object)
 
6 messages moved to Trash can
@KevinB this is what i am going to try to do
by overriding the primitive wrappers
 
so like, String.proto.valueOf
 
yes
 
7:51 PM
it's already a string
so that won't get called
 
let bool = true;

class BoolBetter extends Boolean {
	constructor(val){
  	super(val);
    //bool = val;
  }
  valueOf(){
  	console.log("getting")
  	return bool;
  }
}

window._Boolean = window.Boolean;
window.Boolean = BoolBetter;
 
strange case, you can use the global variable and compare every value to the one you pass
but usually, what one does is to save them in 1 place
 
you're not replacing the primitive though
 
the problem here is for some reason with strings, the wrapper is called but not with booleans
 
booleans, numbers and strings are passed as value, objects and functions as reference
 
7:55 PM
we got that
 
if i override string and go "bla", it calls my class, but it doesnt with booleans
 
we're trying to break that
 
technically Carl they're all passed as values
it's just that object values are in fact references
 
tru
 
exactly
 
7:56 PM
since we can't break it by messing with the value itself within the function, thenext logical step is to look at breaking it before it reaches the function (but still without altering the function call)
 
you cannot reverse-engineer the name of a variable by its value
 
exactly
but, what if you could alter the value before it's passed, such that you can?
 
||>    class StringBetter extends String {
    	constructor(val){
      	super(val);
        console.log(true);
      }
    }

    global._String = global.String;
    global.String = StringBetter;

    console.log("test")
 
@JBis undefined Logged: "test" Took: 1ms
@JBis 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
@JBis undefined Logged: "test" Took: 1ms
 
i have a lib to hook functions before and after
if that is what you can
 
7:59 PM
hmm
 
not really what we're talkin bout
 
00:00 - 20:0020:00 - 00:00

« first day (3624 days earlier)      last day (1316 days later) »