« first day (3562 days earlier)      last day (1378 days later) » 

1:59 AM
How to get multiple array with same value? In python I can do: [[1,2,3]]*3 => [[1, 2, 3], [1, 2, 3], [1, 2, 3]]
 
|| mdn Array fill
 
||> Array(3).fill([1,2,3])
 
@JBis [[1,2,3],[1,2,3],[1,2,3]] Logged: `` Took: 0ms
 
Thanks.
 
 
1 hour later…
3:14 AM
any one out there?
 
@ShashankNawathe 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:53 AM
I think the with statement is as cool as object destructuring when used right 🤔
 
4:18 AM
you think wrong
 
4:42 AM
imma optimzie the fuck outta jitsi
 
5:02 AM
@JBis This fills it with the same array:
||> arr = Array(3).fill([1,2,3]); arr[0][1] = 4; arr
 
@VLAZ [[1,4,3],[1,4,3],[1,4,3]] Logged: `` Took: 0ms
 
to get different arrays you can use Array.from
 
ssshshshsh
 
||> arr = Array.from({length: 3}, () => [1,2,3]); arr[0][1] = 4; arr
 
@VLAZ [[1,4,3],[1,2,3],[1,2,3]] Logged: `` Took: 1ms
 
5:02 AM
|| mdn array.from
 
I had a feeling that was the case
 
@iaeliyen ^
 
@iaeliyen i fucked up ^
 
It's super annoying, I know.
 
5:03 AM
while your here, am i doing anything wrong or did tensorflow people just fuck up github.com/tensorflow/tfjs/issues/3617
 
I dunno. I'd have expected you to get compiled files there.
 
seems like a rookie npm mistake, not sure why they made it
 
Not everybody is perfect. Or there is something I'm not aware of but I believe you were correct to post an issue.
 
in other news, Jitsi the open source alternative to Zoom (and competitor to my own version, BitLink) has a super bad blur feature that basically crashes the app. I figured out how to optimize it for BitLink so I'm gonna open source that part and push a fix to Jitsi :)
My first legit contribution to OSS.
 
Well done, I guess. I think my legit contribution to OSS is a couple of issues I reported on GitHub
 
5:10 AM
hey, some issues are just as important
alright im out for now night o/
 
Good night!
 
5:32 AM
i hate js bitwise operators
 
@Crupeng 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.
 
@Crupeng They're quite useful when you get to know them
@JBis That's why I won't use in production code for companies or teams of developers, because it's an unsupported (if not unpopular) opinion
Regardless, I still find the with statement useful in certain circumstances. Sure it has it's mishaps and can be done without even but it can also be convenient (without cost) and useful here & there.
Deciding to share this:
https://gist.github.com/LapysDev/fe54e3047e3ac389ef88fbc85c9d1e72

It's a line drawing algorithm I came up with.
Obviously it's not the best and it's not a proposal for a new algorithm or anything
but it is something I thought would be nice to share.
 
5:59 AM
The line drawing algorithm is dependent on ratios...

The ratio of how much `x` is updated with regards to `y` up to a count e.g.: 90 degree line has a ratio of `1:0` where `x` is incremented unit-by-unit and `y` is not updated (incremented by nothing)
 
 
3 hours later…
9:25 AM
😐
 
🐱‍🚀
 
what's that lol?
 
9:52 AM
To test if an property still exist...whats best ? 1.) typeof window.activeSliders !== "undefined" or 2.) "activeSliders" in window
 
@FerencRozsa 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.
 
@FerencRozsa both are different approaches
the first one gets a value from an object property while the in operator checks both object properties and in the object's prototype chain
so if you are using in, then it is possible that 'activeSliders' in windowyields true while doing window.activeSliders gives undefined 🙂
 
hi guys
 
@KarelG ..because it is in the prototype chain ?
 
10:08 AM
object properties and prototypes are different things. Lookup in MDN :)
 
I need to open a modal and focus an input, after the user click another 'tab event' the focus must go on the ther input. The proble is the the focus on the first input doesn't move to other
 this.someInput.nativeElement.focus(); (in angular for focus the firt element)
 
@Doflamingo19 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.
1 message moved to Trash can
 
nad
and:
 
@KarelG apparently the emoji is called "astro cat". It also has a ninja-like headband on the outside of the space suit. So I guess a space ninja cat.
 
  this.renderer.listen('document', 'keydown', (event) => {
      console.log(event);
      if (event.keyCode === 9) {
        this.someInput.nativeElement.blur();

      }
    });
I don't know why the first focus doesn't lose focus also I use blur() where the user clicks on tab button
 
10:13 AM
browsers have a default behavior to move to next focusable element if you press tab
 
@FerencRozsa not necessarily. There is a difference between a property existing and that property being set to undefined. For example:
||> obj = {myProp: undefined}; console.log(typeof obj.myProp !== "undefined", obj.myProp !== undefined, "myProp" in obj);
 
not an option to let the browser do the job?
 
@VLAZ undefined Logged: false, false, true Took: 1ms
 
10:55 AM
@VLAZ o.k. thx
so the "in" operator makes more sense to test on existing...
 
11:11 AM
@FerencRozsa yes, in checks if the property actually exists, if obj.prop returns undefined then it either exists and it's not set to anything or it doesn't exist. If you need to check if the property doesn't come from the prototype chain, then you can use hasOwnProperty:
||> obj1 = {myProp: undefined}; obj2 = Object.create(obj1); console.log("myProp" in obj2, obj2.hasOwnProperty("myProp"));
 
@VLAZ undefined Logged: true, false Took: 0ms
 
11:22 AM
@VLAZ thx again....but i thought that "typeof" is really checking if the property exists where "obj.myProp !== undefined" just looks to what it is set.
 
typeof will only check for "existence" if used with a variable name. For example myVar === undefined will throw a TypeError if myVar is not declared. However, typeof myVar === "undefined" will not throw an error and would produce true in that case. With object properties it doesn't work that way typeof obj.myProp === "undefined" will be the same as doing temp = obj.myProp; typeof temp === "undefined" - the actual value of the property is fetched even if missing.
 
11:49 AM
@VLAZ o.k.
 
12:02 PM
hello,
I really need it to resolve , Could someone please help me in this question
0
Q: How to implement condition inside array field in redux form

Jonas I am using redux-form where I have used Array Field. With Array Field I am generating dynamic fields, I will attach an example of it. What I want to achieve to implement custom logic in array field. Actually, I have dropdown of two menus one is text and second is password. When user select text t...

 
12:52 PM
??
 
1:14 PM
Can someone point me to how to capture both strings with a regex just for the content of t(*)? I tried many ways but I'm not sure how to properly handle line jumps, Thanks

```
const title = t(
isPrevious
? 'carousel.control.previous'
: 'carousel.control.next',
);
```
 
1:40 PM
a regex to match both of them would be
```
/carousel\.control\.(previous|next)/
```
 
@Jabster28 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.
 
@Jabster28 sorry for not making myself clear, the value should be any string inside.
 
@DanielDoblado inside of what?
 
inside of the single quote
 
so you want to match carousel, control, previous and next?
 
1:50 PM
I want to match the content of the strings used in `t` function in a generic way.

'carousel.control.previous' and 'carousel.control.next' are just examples.
regex101.com/r/dOz2TG/2 as you can see here I capture all the other strings
 
._.
 
so, you want an array with whatever is in t(*)?
 
only with the values of the strings, for example the variable isPrevious should not be there.
 
can you give a sample of input -> output?
there is a regex chat fyi
 
2:05 PM
ohhhh
so an input of

const title = t(
isPrevious
? 'carousel.control.previous'
: 'carousel.control.next',
);
should return ['carousel.control.previous', 'carousel.control.next']
 
from what I read and comprehend is that he want to get any between t( and )
but current issue is multi-line content within those boundaries
fyi \s already covers \r\n
 
i'm not sure how to do it multiple times, but i can get the first result

/t\([\s\S]*?'([\S]*)'/gm
 
Use AST 😂
 
really interesting approach @Jabster28
 
it'll break if the string contains whitespace, but i can turn it into a lazy inf quantifier if that needs to be done
also doesn't work for escaped single quotes, you should really use something like AST for this
 
2:18 PM
thanks for your help @Jabster28
I need to look into AST, I have never used it before
 
theres a nice web ui for it astexplorer.net
you can paste some js and it turns it into a json like object that you can programatically run through
 
morning y'all
 
ohhi
 
welcome
here we talk about the language where (![]+[])[+!+[]] is the first letter of the alphabet
 
aka brainfuck
 
3:14 PM
interesting, web worker makes tensorflow slower....
Got a problem, anyone have any ideas? If I use requestAnimationFrame I get much better performance over setTimeout([..],0) however requestAnimationFrame gets slowed down when the browser isn't in focus. I need it to always preform at its best.
 
@JBis Are you running inside a canvas?
 
the cb is interacting with canvases, yes
 
You don't want to use rAF if you want the same FPS out of focus
that's the point of it
it only requests a frame when it's needed, it's not needed if the window isn't focused
 
ok, so then maybe rAF isn't the right solution but it seems to be much more preformant than any setTimeout solution (when the browser is focused)
 
You could maybe move it to an OffscreenCanvas
 
3:28 PM
Tried that in a web worker, offered worse (but non blocking) performance some how. Could try in regular context tho.
 
 
1 hour later…
4:54 PM
@JBis How did you make a safe javascript evaluation?
 
|| help
 
Command documentation and syntax can be found here.
 
Im working on a discord bot in node.js for the purposes of helping out with programming and other things...
oh ok
Ill look through it
 
Thanks
 
5:38 PM
 
6:04 PM
posted on July 17, 2020 by Marina Kazatcker

The Beta channel is being updated to 84.0.4147.94 (Platform version: 13099.72.0) for most Chrome OS devices. This build contains a number of bug fixes and security updates. Most 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

 
 
4 hours later…
9:46 PM
Cloudfare CDN is down
every fucking thing is down
lord help me
RIP Discord
RIP Every online cloudfare game
RIP Git and Heroku
 

« first day (3562 days earlier)      last day (1378 days later) »