« first day (3660 days earlier)      last day (1271 days later) » 

12:19 AM
posted on October 23, 2020 by Krishna Govind

  Hi, everyone! We've just released Chrome 86 (86.0.4240.114) for Android: it'll become available on Google Play over the next few weeks. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome

 
 
2 hours later…
2:30 AM
 
@Rainbolt 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.
 
Forgot to comment a reference to StackOverflow in my JavaScript. Ended up with this jewel.
JamesBot why you gotta get in between my image and its caption? :(
Also had no idea what a label was in JavaScript before this showed up.
 
 
9 hours later…
11:25 AM
Good morning, Anyone familiar with real time communication using socketio? I'm trying to send a MediaStream via a socket, but when sending the MediaStream it just returns and empty object.
 
11:48 AM
Hi all. I have a question that I have not fixed for 2 days :(
Is it impossible to disable free text entry on mat-autocomplete?
 
@Jack 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.
 
I use Angular Material Autocomplete and I am looking for a smarter solution in order to prevent free text entry mat-autocomplete but as far as I see, there is almost no solution and some of the solution compare all the elements with the text entry in the autocomplete list that is not a good approach.
I have tried almost all of the proposed solutions on the web, but none o them fixed the problem. This one is more close to the solution, but as the blur() triggered first, I cannot fix by using that approach also. I just want to check if the autocomplete value is selected or not on blur event of the input. Or another proper fix can also be used of course.
@JamesBot Thanks, I posted. You can also find it on stackoverflow.com/questions/64499045/…
Any help would really be appreciated. Thanks in advance for all JavaScript and Angular Masters
 
@Jack question is kinda vague
and what's being meant with "free text entry"?
 
@KarelG Thanks for reply. I mean that the user should only enter text value for filtering selections. If the user does not select and option, the text that entered by the user should be cleared.
 
12:04 PM
if blur is issued, check the value with what's in the option list. If there is no match, clear it.
 
Could you please write it on the ready StackBlitz?
https://stackblitz.com/angular/onljnxyyogy?file=src%2Fapp%2Fautocomplete-auto-active-first-option-example.ts
Maybe you can also encounter the same problems that I faced for 2 days :(
 
been a while when I saw a very interesting SO question; stackoverflow.com/questions/64498877/…
 
But of course you can also fix and it would be great
 
Howdy
 
@brat 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.
 
12:15 PM
Could use a pair of eyes to let me know why my solution to an excersize does not work. page of excersize: javascript.info/closure
 
@KarelG Have you look at the stackblitz?
 
stackblitz?
Im pretty new at JavaScript :-o
 
why not jsfiddle?
 
I do not message to you, forget my messages
I asked Karel
 
12:20 PM
oops. sorry
 
@brat what you have is the problem of mutation and asynchrony
 
ok. But I dont understand why the inner functions dont have access to the array called shots. Im guessing that is why the calls end up undefined?
 
it has access to the array
but it uses the wrong index
 
@KarelG Are you there?
 
try alert(`i: ${i}, shot: ${shots[i]}`);
 
12:30 PM
i is undefined
 
nope
 
so, this does not happen in for loop?
 
in the loop, you create the functions
but you invoke the functions only after the loop has ended
keep in mind, the original code didnt have the shots array
perhaps it is better to start again from the example
 
yup. But it used an array called shooters. I just add array shots, basically populating it same way. I did start f... ugh. I just dont understand -_-. thanks anyways :)
 
do you understand what the expected result was from the original source?
 
12:43 PM
Yes. And they all share the same variable, but it changes, mutates, so it ends up at 10 at end of loop, so they all refer to variable that has value 10. hence they all print out 10. I tried to make each function point to a different variable, held in an array, to bypass this problem. I like to try own solutions. But cannot understand why it is not working. Since one can usually populate an array like this, and the actuall array is outside the function... wait, they all refer to...
I'll check something...
 
i is still 10 at the end of the loop
and each function now reads from shots[i]
so, they all read from shots[10]
which is undefined
because only 0..9 have a value
 
Yah. just waht I checked. So tried to let j = i inside the function. Thinking pass by value. so j would actually have the number.
and it would not change once the function is made. Or so I thought hehe.
 
thats correct
as a general rule of thumb, you should only use const values inside closures
... as a general rule of thumb, you should only use const
avoiding let everywhere you can
function makeArmy() {
  const shooters = [];

  let i = 0;
  while (i < 10) {
    const shooter = function() { // create a shooter function,
      alert( i ); // that should show its number
    };
    shooters.push(shooter); // and add it to the array
    i++;
  }

  // ...and return the array of shooters
  return shooters;
}

const army = makeArmy();
only the i cannot be a const because it is reassigned
i shouldnt be used inside the function
but if you make a const j = i; you can use that j perfectly fine
(obviously const and let dont really change the behavior, so let j = i; works just as well, but j can be a const, so it is better to mark it as such)
 
hmm. ok. Need to let that sink in
 
better const that sink in instead ;)
sits in the corner of shame
 
12:53 PM
xD
was a pretty good one imo :)
forgot how to post code here several lines, but not to many. cannot find in faq :-o
 
@JoeSaad you can use inherit (e.g. font-size: inherit) on any properties you want the element to inherit from its parents
 
Just seems weird to use const that much, thats why I guess I need it to sink in. Coming from java I dont use it that much. Lots of "variables" changing depending on states and actions of other objects etc.
 
Hi
Can anybody please have a look at this issue
https://stackoverflow.com/questions/64500307/wait-for-api-to-return-its-response-before-executing-the-next-iteration-in-nodej
 
@Oops 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.
 
basically just j = i didnt work, so as a quick try I made j=i inside loop, then k=j in function, then shots[k] x)
 
12:58 PM
@brat I also come from Java, but I always considered every local variable final
only fields were allowed to be reassigned
const j = i; inside the loop should have worked
 
ok. Nice to hear :). Yup, Ididnt use const x). Dude. Massive thanks for the support. I need to take a break and chill and const it sink in as said before. hehe. Have a nice one!
 
[=/*-+<>?&|][=/*-+<>?&|] = b i g b r a i n
Yet again Im causing more messes with regex lol
 
@Jack oh I have been slacked off
not sure if I have time for that. Maybe. I forgot to work on a task whose deadline is today 🤔
 
Hi,

I am new to nodejs. I have an array of string that consists of around 30000+ values, which has the below format
I want to loop through these and need to sent each value to an external polygon.io API. Below is my code.

     await tickerArray.reduce((key:any, tickerSymbol:any) =>
         key.then(async () => await stockTickeDetails.runTask(tickerSymbol)),
         starterPromise
      );
    }).catch(function (error: any) {
       console.log("Error:" + error);
     });

My runTask function is below :
 
@Karel Thanks a lot Karel for kind reply. OK, if you have you may have a look at the question and reply on that page. Regards.
https://stackoverflow.com/questions/64499045/is-it-impossible-to-disable-free-text-entry-on-angular-material-mat-autocomplete
 
1:13 PM
Oi
 
1:24 PM
Ive got two buttons, one works completely fine, the others url is messed up instead of taking me to the NewForm.aspx link to fill out a new form it refreshes the same page?
Nothing in console
 
0
Q: Is it impossible to disable free text entry on Angular Material mat-autocomplete?

JackI use Angular Material Autocomplete and I am looking for a smarter solution in order to prevent free text entry mat-autocomplete but as far as I see, there is almost no solution and some of the solution compare all the elements with the text entry in the autocomplete list that is not a good appro...

 
1:48 PM
@KerrialBeckettNewham ...thats not how it works
 
@JBis How does it work then?
 
1. You can only send serializable data via websockets
2. You would need to take the mediastream, paint each frame to a canvas, get the raw canvas data, and then send that canvas data over websockets
3. You shouldn't use websockets for mediastreams at all, you should use webrtc which is made for what you are doing
take a look at this mediasoup.org
it's a MUCH more complicated process to setup
 
Thanks, but socketio uses WebRTC. I have already setup a working example, but it's using MediaRecorder, recoding the video and then sending it via a socket.
I have seen other examples doing what you suggested, As far as i'm aware in that case the audio and video would then have to be send to the server separately, which adds complexity.
 
@KerrialBeckettNewham This is a bit simplified but if you dont use an external server (SFU) you won't be able to connect to anyone outside of your network and even within your network you could only do 3-4 people.
@KerrialBeckettNewham I don't think it does. But even if it does, its a terrible way of doing it.
webrtc data channels are unreliable, websockets are reliable. When doing video/audio you don't want it to be reliable.
 
2:06 PM
@JBis Interesting, I have only set it up locally so far. As far as I understood WebRTC and websockets are the same thing, RTC meaning Real time communication. Currently, I can record a video then once the recoding has finished send the video as a blob across a socket, then output it to a video tag. What I'm aiming for is to stream continuously from when the video starts.
 
"As far as I understood WebRTC and websockets" no, completely unrelated things
 
websockets are built on RTC
 
"send the video as a blob across a socket", yes that data is serializable
@KerrialBeckettNewham wdym RTC? WebSockets can be used to achieve real time communication. It isn't "built" on RTC.
@KerrialBeckettNewham are you looking to make a video conference thing, or a broadcast live stream?
 
yeah, video conference thing
 
🤨
 
2:10 PM
recommendation for free ui design website ?
 
@JBis Yes, you're correct. I was mistaken
 
@KerrialBeckettNewham Why not use an existing platform?
 
@JBis doesn't have some features
 
To build a proper video conference application will take a long time. Are you doing this for fun?
 
user14475233
Morning'
 
2:12 PM
side project
 
user14475233
I just realised it might not be morning for some of you...
 
user14475233
ah well
 
@KerrialBeckettNewham ok well, i've built a similar project. You can take a look at what i did there github.com/oss-videochat/bitlink
 
@JBis yeah, that's fine. I'm just trying to set up a prototype
@JBis Nice! :)
 
thank you
 
2:16 PM
@JBis it's got a lot of features, what's the stack?
 
typescript, react, node,
another open source project github.com/jitsi
 
@JBis Thanks a lot!
 
In regards to SharePoint, why will it not allow me to add a web part (i.e. Content Editor/Script editor) to my NewForm.aspx form page. I need to insert code to make the attachment field mandatory
Nvm figured out
 
2:34 PM
This may be a bit unrelated... But it boggles me
When I try to use this button to redirect me to a SharePoint form, it just reloads the page I am currently on and nothing comes of it.
<form action="/SanitizationPolicy/NewForm.aspx">
<button type ="submit" class="btn">Sanitization Form</button>
</form>
But when I used this
<a href ="/SanitizationPolicy/NewForm.aspx" class="btn">Sanitization Form</a>
It works completely fine, but the button is no longer there for me
 
2:48 PM
I change the button to <a href> and the button that didnt work now works as a link, and the other button no longer works? That one now redirects me to the same page
 
pastebin.com/ywhsedFH , can someone help with this, I want to change the agm-circle color to yellow when the map is in dark mode, and when I get back to light mode I need change its color to black but it same as it was in dark mode. I did debug , when I comment the else part function getting called, but when I do uncomment it, the function is not getting called
 
user14475233
HAHAH, my pfp is incredible
 
user14475233
it hasnt updated for chat yet
 
hello everyone, How do i set a value to the last count of an array? for example i have an array 1, 2, 3, 4, 5 and this new value is 0 and if its 0 i want it to set it in the end of the array and give it the value of 6 in this case.
 
user14475233
hmm....
 
user14475233
2:54 PM
what are you trying to do with these numbers? Just make a counting sequence?
 
i don't understand what you are asking
you have a value of 0, and you want to add it ot the end of the array as 6
What significance then does it being 0 provide?
 
user14475233
so
if(number ==0)
0+6?
 
i have a page that lets you set thing in order and saves them to display in the main page, at the moment i have a couple items that have 0 and its breaking my code
 
user14475233
or 0+x
 
Ah, sort order
what i've usually done with that is upon save, get the current order and number them programatically 0-n
 
2:56 PM
i dont have a set number i just want to know how to give it the 1+ of the last value'
 
get the last value and increment it by one
 
user14475233
did the bot just remove that?
 
i don't see anything removed
 
user14475233
bigchungus
(removed)
 
user14475233
theres a line that went missing
 
2:58 PM
yea it was a for loop
 
Oh, forgot to click show posts
doesn't look like the code was javascript anyway
 
user14475233
idk what it was
 
for some reason java was in my head thats why I deleted it
out of it right now
 
user14475233
lol
 
user14475233
what time is it for you guys
 
user14475233
3:01 PM
its 8:00am for me
 
user14475233
Friday, 10/23
 
I am aware of the day
11:01 AM
 
user14475233
east coast?
 
Yoss
 
user14475233
West coast for me
 
user14475233
3:02 PM
its gonna be CHILLY here
 
user14475233
highs of 60, lows of 40 on monday
 
user14475233
anywho
 
3:52 PM
||> [1,2][false]
 
@JBis undefined Logged: `` Took: 0ms
 
user14475233
4:07 PM
there we go
 
user14475233
my profile pic updated
 
user14475233
hah
 
Can someone tell me is this JavaScript? pastebin.com/7qJ7dy7X
 
4:21 PM
I tried to limit the number of unfollows and the time between 2 unfollows but I can't.
I know basic Python. I don't recognize this
I bought this script for $30. The man who sold it to me turned off the profile.
He told me that I could set everything up. I trusted him. The script works but I can't limit anything.
if anyone recognizes just let me know what it is. What program.
 
@Pijes yep
this is javascript using the newer lambda syntax
(a, b, c) => a + b + c
This is the same as function(a, b, c) { return a + b + c; }
well not exactly the same to be fair.. the value for "this" changes
 
4:42 PM
@Neil Thank you. I will try to find the solution
 
4:53 PM
HEy
 
So if you use the + in regex to select multiple matches...
how do I limit it
to between 1-3 matches
anyone got any ideas?
Specifically this code: [=/*-+<>?&|]+ It selects any operators, and any multiple operators
But I want to limit it to 1 to 3 characters
oh
seems there is a special regex selector for this sort of thing
{1,3} I think
 
Fook whos good w CSS
 
Im half decent?
Whats wrong
 
I can't get these Divs to go Side by side
 
I would use flexbox
one moment
 
5:03 PM
Ill check into it
And ok
Fixed the padding which was bugging me. I just can't seem to get them going horizontally aligned instead of vertically
 
Jsfiddle is really bad for this sort of thing lol
Im at school right now, so I cant access my VSC IDE
 
Well I just have it in there to demonstrate what I am trying to do
 
Strange
all my classic methods just arent functioning .-.
Flexbox broken ffs
hmm ill try a css grid
 
Wym
its broken
 
Im not sure
flexbox isnt affecting the divs
by the way
you had width: 100%;
which wouldve made all the methods impossible anyways
as all the devs are full page width
 
5:17 PM
@MisterSirCode that's normally how you'd specify that in regex
you'd need to check that javascript regex supports that, but it probably does
 
oh alright
It does
I tried it earlier and it works fine
 
cool beans
 
?
jsfiddle.net/wLjk0vpm/2 Like look how close I am.. I cannot get them side by side. Or even is it possible to get 3 on top 3 on bottom
 
5:53 PM
Pretty much anything is possible in css
its just something is wrong
im not sure whats going on with your project
Im sorry I couldnt get it working
I tried every method I know
 
I figured it out
I was missing display: flex; in .center
What do you think the easiest method would be to get a dropdown like this www2.northropgrumman.com/suppliers/Pages/…
datatable?
 
 
1 hour later…
7:16 PM
Anyone here familiar with Accordion and can assist me with something really quick
 
user14475233
Accordion?
 
user14475233
as in the instrument?
 
user14475233
in that case, no...i play trumpet lol
 
user14475233
but i do need a question actually answered in my life if anyone is down
 
user14475233
Check out this for a canonical thread on making viewports. You can adapt it to p5 without much trouble. — ggorlen 2 hours ago
 
user14475233
7:23 PM
wth
 
user14475233
2
Q: Automatically scrolling to my player using p5.js, but it does not work

LttntLrkThis is what I've tried, but it just doesn't work in p5.js Essentially, I need help fixing my function that makes an auto scroller for my game when the player reaches past the co-ordinates 1000x and 300y on the screen...What am I doing wrong? function ScrollToPlayer(){ setInterval(function(){ ...

 
user14475233
there
 
user14475233
@bigchungus If you could answer my question....my game depends on it
 
@LttntLrk please don't randomly ping people
 
user14475233
srry..
 
7:37 PM
@JBis this accordion drop down I made works perfectly in JSFIddle and Codepen but for some reason on sharepoint whenever I expand the row down, it causes the page to refresh and immediately collapses the row back after the page refreshed. I tried tracking it in console but I do not see a thing
any suggestions
 
user14475233
OHH
 
user14475233
accordion DROPDOWN
 
Yoss
 
user14475233
idk what that is
 
I dont see where instruments would be relative to this chat
except maybe mayonnaise
 
user14475233
7:39 PM
Maybe
 
It works here, but I cannot figure out what to console log to figure out what in sharepoint is making it refresh/collapse
Fixed the jonny
 
8:00 PM
Does someone know whether TypeScript provides a list of available Javascript types? So something like: type AvailableTypes = "string" | "number" | "undefined" | "object" ...
 
like, some kind of documentation?
 
8:25 PM
No I thought about a type
 
so a type that can be any of those things?
 
ahh why is enter sending
 
@Myzel394 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
 
No I want to use something like that:
 
@Myzel394 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.
 
8:30 PM
const getValidatorFunc = (type: AvailableTypes): Function => {
    return (value) => {
        return typeof value === type;
    }
}
ahh finally
 
1 message moved to Trash can
 
8:42 PM
I don't know if anyone knows leaflet but I'm looking to remove exposure of an API key on the front end to get mapbox tiles for embedded maps. I currently use this where Flask will inject the key from .env on rendering... so it's visible on "view page source".
Unless I’ve gone completely mad, I’m pretty sure that I inspected the source of some pages on the Leaflet Routing Machine site when I was trying to get my head around this, and there was a comment of “please don’t steal my key” embedded as a comment in the HTML. So I assumed it wasn’t possible. I can’t now find it. Has something changed? If so, how should I manage this?
 
Probably a silly question, but what makes the callback functions wait for the completion of an async request? while other functions don't? Callback functions are just the same as the other regular functions. They are just passed to the function which needs to do something and run the callback on it.
func_with_callback(
(data) => { // do something with the success data },
(data) => { // do something with the failure data }
);
func_with_promise()
.then(
(data) => { // do something with the success data }
).catch(
(data) => { // do something with the failure data }
);
NP, I've Got it.
 
9:18 PM
!!magic
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
@aderchox im going to talk about traditional callbacks because promises are different
function asyncLongrun(arg, cb){
      // some code
      cb(); // eventually
}
the function accepts a cb as and actually calls the cb when it's done. That's simple
the better question is 'how is the async operation actually occur in a non blocking way?'. Is that your question?
 
@JBis Well, my question is this: Let's say we have f1(); f2(); and f1 is doing an async task and f2 isn't. So f1 is running in a non-blocking way and f2 will be run first. However, with callbacks, what's inside f1 gets done in a blocking way and then the callback sent to it gets run.
 
not exactly sure what you mean
||> function func(cb) {
   console.log("A");
   cb();
}

func(() => console.log("B"))
 
@JBis undefined Logged: "A", "B" Took: 30ms
 
9:27 PM
well, it's not actually blocking
in most cases anyway
blocking is just the wrong term to use there
 
that isn't an async function but see how A is logged then B.
 
The javascript portion of it is blocking, all javascript is blocking, but what happens is you're doing some logic outside of javascript, such as a setTimeout, or an HTTP request, etc that itself has a callback
 
@JBis yes that's right, I understand that, but now let's say an async task is in place of the console.log("A");, what makes cb() run after that? (Is it clear now?)
 
what is the async task, for example?
 
@KevinB An AJAX call for example.
 
9:32 PM
so, ajax calls are made using fetch, or XMLHttpRequest
 
yes
 
the former returns a promise, which has a callback
the latter also has a callback
so cb() would simply exist within said callback
basically, i feel like looking at it from that kidn of example just punts the can down the road
function foo (cb) {
  // do stuff
  cb()
}

// becomes

function foo (cb) {
  fetch().then(response => response.json()).then(cb);
}
or,
function foo (cb) {
  fetch().then(response => response.json()).then(function (data) {
	cb(data);
  });
}
with a redundant function just to show what's happening
 
function asyncSum(arr, cb, index = 0, sum = 0){
    if(arr.length === index){
        cb(sum);
        return;
    }
    setTimeout(() => {
        asyncSum(arr, cb, index + 1, sum + arr[index]);
    }, 0)
}
console.log("A");
asyncSum([10, 20], (sum) => {
    console.log(sum);
});
console.log("B");
 
@JBis "ReferenceError: setTimeout is not defined" Logged: "A" Took: 0ms
 
well james is stupid but that would go A, B, 30
that is an example without a network call taking advantage of setTimeout
 
9:37 PM
@JBis "ReferenceError: setTimeout is not defined" Logged: "A" Took: 0ms
 
but none of this really demonstrates the async nature of it, because the... asyncness doesn't happen in JS
js just calls an api, and when that api says it's done, it calls a callback
 
And it works very well for 99% of things.
 
Let me ask a question, are callbacks under the hood of promises or it's the other way around?
 
callbacks are just functions that get called when something finishes, or during the process of doing something (such as a forEach or a map)
promses often use callbacks
they aren't the same thing
 
10:26 PM
 
11:16 PM
Guys watching this video cleared the concept for me: dev-metal.com/… Thank you.
 

« first day (3660 days earlier)      last day (1271 days later) »