« first day (4100 days earlier)      last day (1073 days later) » 

00:52
hello every one!
@ModarNa 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 is the impact of a function causing an endless loop of console errors ? does it eventually crash the browser ? or what ?
Its some webpack issue in codesandbox, you can ignore that
@ModarNa console.log(props) is rendering all the data passed from parent component but not able to render it
@SusHill I mean if I have a website and after closing a modal it generates console errors infinitely, will it crash at the end ?
@SusHill sorry I didn
I didn't read the whole chat but kind of sleepless and came here to ask that
01:13
@ModarNa thats all right
@ModarNa dont know why its not rendering console.log(props.retriveRole);
 
1 hour later…
02:33
Hello folks!
I'm using Angular CLI 12. Is there any trick with radio buttons and pagination?
I have some groups of radio buttons. In the first page, I select one radio button and go to the second page. If I go back to first page, the radio button is not selected anymore. This is my html:

`<form #f="ngForm" (ngSubmit)="submitClick(f)">

<div id="quiz" class="form-group">
<div class="question" *ngFor="let questions of questionsList;let questionsListIndex = index">
<div *ngIf="questionsListIndex == pageNumber">
(see full text)
03:03
I changed the *ngIf to hidden and it works =D
 
3 hours later…
06:15
react native webview isnt scrolling the source=html:``
 
2 hours later…
08:32
so in js a event is trggered either by user action or programmatically...am I correct?
@DimitrisPapageorgiou 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.
08:54
@DimitrisPapageorgiou I guess you can say that. Whether it's correct or there is something missing depends on how exactly you want to use that information.
09:45
0
A: View base64 pdf in webview react native on iOS?

chikabalatry to wrap your code with a ScrollView to make the content visible/scrollable : <SafeAreaView style={{flex: 1}}> <ScrollView style={{ width: '100%' }} contentContainerStyle={{ flexGrow: 1 }} > <WebView style={styles.pdf} useWebKit={true...

any one from react native developer ?
 
5 hours later…
14:29
Just wondering, whats the fastest or most efficient way to spread one array into another (of different lengths if possible)

So, say, Im given the values [1, 2]... Id want them to be spread into the array [0, 0, 0] or [0, 0, 0, 0] to come back as [1, 2, 0], [1, 2, 0, 0] etc

Another edge case would be like.... pushing [1, 2, 3, 4] into [0, 0, 0], where the set array is locked to a 3 length set of zeros, so the output array would be [1, 2, 3]
I believe Array.push can do what I want it to but Im not entirely sure if thats the best way to do this
actually, reading the docs, array.push wont work
Im going to try out Array.splice
see if that works with spread syntax
		this.array = new Array(3).fill(0);
		let len = [...args].length;
		this.array.splice(0, len <= 3 ? len : 3, ...args);
It does seem to work as intended
and its pretty fast
if anyone has any better ideas, Id love to hear em
14:50
Fastest would probably be a simple for loop for(let i = 0; i < arrFrom.length; i++) arrTo[i] = arrFrom[i] however, you have to test it to make sure. splice might be slower depending on the implementation. Or might be faster. In general, trying to not modify the length of the array but just editing it in place should be the fastest.
Also, might be faster if you use a TypedArray, they tend to be more efficient.
Ive honestly never used a TypedArray

Essentially Im trying to find more efficient ways of initializing my vectors

My vector library is already pretty fast as is, but Ive only rewritten it a couple times, so I could probably still improve it
Oh, wait, I missed that the destination array can be shorter. Change i < arrFrom.length to i < Math.min(arrFrom.length, arrTo.length)
I don't know what the side effects would be, but you can use Object.assign
@BenFortune I do not believe that would work with a normal array, and I believe it completely overrides all target properties
so, saying it does work on arrays, if I pushed [1, 2] into [0, 0, 0], it would simply return [1, 2], not [1, 2, 0]
@BenFortune Not a bad idea but it wouldn't cap the length. At a guess, maybe Object.assign(arrTo, arrFrom, {length: Math.min(arrTo.length, arrFrom.length)}) might work.
14:55
!!> Object.assign(Array.from({ length: 3 }).fill(0), [1,2]).slice(0, 3)
@VLAZ Wouldnt a for loop be slower?
@BenFortune [ 1, 2, 0 ] Logged: [ ] Took: 1ms
@MisterSirCode you sure about that?
@MisterSirCode I don't believe so.
@BenFortune guess not
/shrug
14:56
😂
also we dont need Array.from({ length: 3 })
new array is ugly
don't use it
You can just do new Array(3)
oh
well, if you say so
@BenFortune is there any minute difference in the performance
Im trying to optimize the library as much as possible
wait, might be overthinking it here lmao
||> Array.from({ length: 10 }).fill(0)
14:58
@MisterSirCode [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] Logged: [ ] Took: 0ms
||> new Array(10).fill(0)
@MisterSirCode [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] Logged: [ ] Took: 0ms
Welp
I guess there isnt any major difference in performance
its just smaller
@BenFortune No, new Array is indeed pretty horrible.
!!> Object.assign(Array.from({ length: 3 }).fill(0), [1, 2, 3, 4]).slice(0, 3)
15:00
@MisterSirCode [ 1, 2, 3 ] Logged: [ ] Took: 0ms
@VLAZ wasn't talkinga bout that
||> Array.from({length: 10}, () => 0)
@VLAZ 'SyntaxError: Unexpected end of input' Logged: [ ] Took: 1ms
@VLAZ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] Logged: [ ] Took: 0ms
I guess all I need to do is make a little code to differentiate between 3 dimensional and 4 dimensional vectors.

2 dimensional arrays can still make use of the Z axis, so it would be pretty purposeless to include edge cases for 1 and 2 dimensional arrays
a 1 dimensional vector would be irrelevent anyhow
@VLAZ Pretty clean, no need for fill, I guess that also compacts it into one call, so Ill go with that
!!> const array = [1,2]; Array.from({ length: 3 }, (_, i) => array[i] ?? 0);
15:02
@BenFortune [ 1, 2, 0 ] Logged: [ ] Took: 1ms
Im assuming its 1ms slower because you created a constant?
Those are micro-optimizations that you shouldn't need to worry about
True, but when it comes to rendering hundreds of thousands of pixels and grabbing vector data in realtime
Don't trust the micro-benchmark here.
even 1ms delays build up
15:05
not really
Oh who am I kidding its javascript..
you should be offloading that to a worker thread if you aren't already
@BenFortune That is one thing Ive been neglecting to do
It might be, for example, rounding up on on 0.200ms so one might take 0.197ms the other 0.201ms and thus one shows up as 0ms the other as 1ms.
Could be
alright, so ignoring the 3 or 4th dimension check I have beforehand, this is my current vector initializer
		this._array = Array.from({length: this.dim}, () => 0);
		this._array.splice(0, this.dim, ...arr);
Id say thats a lot cleaner than what I had setup before
In general, don't do a micro-benchmark for one operation. The results might be wildly off for any variety of reasons. To do a benchmark, you need to do it in a loop over thousands or even millions of calls and examine the results. Get the average, median, highest, lowest, and then try to draw conclusions how much the operation takes.
However, do be aware that such a benchmark can also be off. See the link I posted above.
Micro-benchmarking is very hard to get right and draw meaningful conclusions about.
it's measuring ops not time
15:18
@VLAZ I know, it seems quite dumb in that sense, I just want to make an optimized library
The time of execution produced by James is mostly inaccurate. Could probably be improved to help with bench marking.
@BenFortune odd, the original one is the fastest
@MisterSirCode #3 is the fastest on my machine
not by much though
Its hard to really benchmark anything on my machine... Im using that same old shitty school laptop

I cut myself off from my home PC (via remote desktop) so I could focus more on schoolwork
15:21
@BenFortune lol if only images would work
dominoes pizza's website, app, and emails look like they were designed and developed by a 14 year old in 2005
@JBis I wouldnt say its that bad.
Maybe by a 14 year old in 2017
code block 3 (2523523) 🏆
100%
code block 1 (2448468)
97.03%
code block 2 (1103189)
43.72%
they also somehow managed to patent the css width property
@BenFortune Specs are nearly the same for me, just block 1 and 3 are swapped
also code block 3 apparently has errors
15:24
yeah that's their shitty linter
that doesn't support ??
@MisterSirCode imgur.com/a/PeaR6Bd an image from an email i received yesterday
Well, to be fair, nullish coalescence is relatively new. (By a few years, which is new when referring to web specifications and standards)
@JBis Cant see it ;_;
I purposefully shut down my remote desktop software for my own good, so I cant even view blocked websites anymore
skeuomorphism is like 2005ish UX (Windows Vista)
Oh get this...
My school firewall globally blocks aws and github
and also jsdelivr
so all of my resources are blocked
:3
I dont even know how most websites run, since a lot of sites grab from AWS CDNs and JsDelivr
Im stuck with JSFiddle
@BenFortune Also what are the numbers next to the tests, are those the number of operations that could run within the test period?
15:31
yeah, operations within whatever the limit per test is
Makes sense
Spread syntax doesnt work inside of string literals?
return new Error(`Vector cannot be initialized with parameters: ${...args}`);
huh??
Well that kinda sucks
15:51
you're not spreading to anything
that's the same as doing "foo" + ...args + "bar"
Need to wrap it in {} or []
or join
Hey everyone.
@AbdulWahab 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.
is there any parser like cookie-parser available for localStorage to get jwt token through create method. Or in other words have same functionality as of cookie-parser?
In node*
16:15
"jwt token" ew
@AbdulWahab npmjs.com/package/cookie-parser? that's for a server to parse cookies. localStorage isn't sent to the server
16:51
@JBis I have stored my token when user sign in in local storage previously as i am getting error so now i want any parser for localstorage
I am getting error in cookie so stored token in local storage
well again, the server doesn't have access to local storage, so you can't just but info from a cookie in localstorage and expect it to work
also this sounds like an XY issue. What was the error you got from cookie?
 
1 hour later…
17:58
posted on January 06, 2022 by Harry Souders

Hi, everyone! We've released Chrome Beta 98 (98.0.4758.34) for iOS: it'll become available on App Store in next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

 
2 hours later…
20:10
@JBis I've been amazed how bad has Domino's website has consistently been. Throughout multiple redesigns and I'm pretty sure complete re-writes.
Fun fact, at one point Domino's had the entire logic for the shopping basket implemented only in JS. That includes all the price calculation.
Yes, that does mean that you could simply edit it to whatever you like and that is what you paid for your order.
 
1 hour later…
21:34
posted on January 06, 2022 by Krishna Govind

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


« first day (4100 days earlier)      last day (1073 days later) »