« first day (3671 days earlier)      last day (1502 days later) » 

01:04
posted on November 03, 2020 by Krishna Govind

Hi, everyone! We've just released Chrome 86 (86.0.4240.185) for Android: it'll become available on Google Play over the next few weeks. Security fixes in this release are listed in the corresponding Desktop Release. In addition, this Android release contains: [$NA][1144368] High CVE-2020-16010: Heap buffer overflow in UI on Android. Reported by Maddie Stone, Mark Brand, and Sergei Gla

01:49
hello everyone! i had a doubt - 1. mapDispatchToProps{a} and 2. mapDispatchToProps=(dispatch)=>({a:dispatch(a)}) both 1 and 2 function the same way....which should i use and why
i do realise my question format is not clean but its impossible to type properly here i am very sorry
1. mapDispatchToProps={a}
2. mapDispatchToProps=(dispatch)=>({a:dispatch(a)})
 
2 hours later…
user14475233
03:59
why was my message starred lol
06:56
@KevinB hey mate since this advice last night I spent the night and morning looking at it and have tried dpaste.com/7X2NABSJ3 dpaste.com/36UKDZ8C2 when checking with the console.log it still doesn't seem to be affecting the variable allow in the ajax calls seems to be evaluating it before they get back why is this? am I assigning the deferreds wrong? or is it in the when calls? cannot seem to wrap my head around this
dpaste.com/HPPB4HZH6 this is the ajax call being sent
 
2 hours later…
09:07
anybody have any idea why this isnt working
Hello,
Can anyone help with an AJAX related question please?
@matty357 I might I am facing my own problem but yours may be different
09:45
I'd never thougth I'd ever post in a quesiton in the inferior JavaSciptRoom
But allas I ahve to stoop so low
0
Q: Add a `v-text-field header` to `v-data-table` header for column based search

Squirrel in training❗ Under construction ❗ I am currently still checking the web to see if I can't find the answer I am looking for - if I find it will answer my own post down below Target: I am planing to add custom search to my v-data-table which filters on a per column basis. For example if I have the table ID...

YOU HAPPY NOW WIETL0L?
:D
Ha, ok thanks, lets try.

I have a website for example, 'http://myserver/mywebsite/'

There is an AJAX call to a controller action.
The url = 'controller/action'

In chrome it correctly puts together the URL as 'http://myserver/mywebsite/controller/action'
But in IE it puts together 'http://myserver/controller/action' and errors.

How do i control this or make the same behaviour for both browsers?
09:58
are you creating the url manually in the ajax call?
not the full URL.

I am specifying the controller and actions, something automagically is happening to add the controller/action to the full url with he website address.
could you show the code
@Squirrelintraining pffft peasant ...
@matty357 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
1 message moved to Trash can
@matty357 there is a difference between relative and absolute url
10:02
@matty357 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
I cant get the code formatting right in this message dammit.
if you want to be it right, it is best to provide an absolute url
> hit Ctrl+K before sending
var url = "ProductBatch/ProcessBatchBarcodeString";

    var jstring = JSON.stringify(barcodeText);

    $.ajax({
        type: "POST",
        url: url,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: jstring,
        success: function (data) {
            if (data) {
                alert('test');
            }
            else {
                alert('test2');
            }
        },
        error: function (xhr, textStatus, errorThrown) {
            alert('test3');
Ok thanks you KarelG, I didn't really want to specify the full URL as it will change between UAT and LIVE, and I didn't want to maintain the URL in configuration files.

Or do you mean something different?
10:05
Awesome, I think that is what I'm looking for.

Thank you very much @KarelG
scroll down to " Absolute URLs vs relative URLs "
Karel do you have any idea why my problem above is not waiting
@Kwsswart the code is in this paste bin?
yeah
and the problem is?
(did not scroll up further in the history )
10:17
@KarelG 🤣
Wow i thoguht room is dead
didn't expect people to actually be interacting
https://stackoverflow.com/questions/64653038/how-to-return-asynchronous-calls-in-javascript-with-two-callbacks

How to return asynchronous calls in JavaScript with two callbacks
@_@
so, you want to have the server respond with two different ... callbacks on request?
@idan 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
1 message moved to Trash can
just don't return the promise?
either let the client get the auth code or let the server use await and return the response, based on the result of the request to google.
yes, I want to get the json from the client
@KarelG what the difference between .them , what I'm using now and await before the json.
10:58
@KarelG Hey mate sorry had a class i had to do so essentially the problem I am having is being able to check the boolean value after multiple ajax functions have returned thus to decide whether or not to allow the submit of a function to go through I have heard the when() method is best for this so have tried implementing it although
I seem to be having the problem of either the condition being checked before the ajax functions have finished or the ajax are not changing the variable from true to false as expected
I am not sure if this is due to the fact that I am assigning the deferred wrong or if it is an error somewhere along the way
the call is happening here dpaste.com/36UKDZ8C2
the function send_attendance is sending multiple ajax calls for different forms here dpaste.com/HPPB4HZH6
I have also tried using the when() method with here dpaste.com/7X2NABSJ3
I am unsure as to where this error is occuring
when using console.log with the deferreds on each loop it is printing as undefined which I am unsure if this is as supposed to although i think it is as its supposed to be assigning it to the deferred array and then using the $.when($, deferred).done() call should be running these functions and assessing it in the done() callback unless i misunderstood the premise and am implementing it completely wrong
which is highly likely
uhm ... do not forget that I am busy with working but did you have considered to step back and revise the problem?
like in dpaste.com/36UKDZ8C2, why don't you just send the whole list instead?
and have the server respond with the said list, accompanied with the attendance/allowance status
sending one call with a list > sending multiple calls with one element by list
11:14
Well thing is the list will be formed for each page depending on the amount of students and im sending it through ajax as its multiple forms handled by the same route individually
I do know thats why i appreciate any advice you can give
> im sending it through ajax as its multiple forms handled by the same route individually
that confuses me :P
is there one or more endpoints?
if multiple; is the endpoint form-specific?
lol sorry so basically what I have is many forms on the same page I have one form being submitted which is using the submit button being submitted to a single endpoint on completion ends with a redirect, however before submitting this form I have all the attendance forms which I am submitting via ajax to a different endpoint and if an error was returned from the form validation in server end it returns a successful ajax with the error message to be displayed
i need to check whether an error message was returned and decide whether to allow the original submit to be allowed or prevented until the errors have been resolved by user
so essentially got two end points one for the ajax calls and a second for the single update form submission
and the ajax is working well
as is the separate form submission
the problem I have is checking the value of the allow variable which will be changed in the ajax if an error is recieved after the ajax is returned thus allowing me to either preentDefault or not
$.when.apply(deferreds).done(function() {
                if (allow == true){
                    console.log('True')
                } else {
                    console.log('False')
                }
            });
your send_attendance function doesn't return anything, so what you're essentially doing is $.when(...[undefined, undefined, ...etc
that part of the code is the part I have a feeling isnt working as expected and if it is then the allow value isn't being reset in the ajax calls, however when using console.log in the ajax to print allow it it is being changed in the ajax
@BenFortune hmm did not notice this....
consider using promises instead of callbacks
11:27
@BenFortune will look into this see if i can figure it out thanks
$ajax(
  type: "POST",
  url: url,
  data: $('#'+ form_id).serialize(),
  // ect
  // success: DO NOT ADD THIS
)
.done(function(data){
  // HANLDE DATA AS YOUR FIRST RESPONSE
  $.ajax( ....FINAL SEND... );
}
that's what you need
best practice: put both as separate functions
handleAttendanceResponse + handleVoodoo (forgot it alread)
so essentially insead of using the success portion place it in .done(function(data) and handle it there
what is the ajax final send you placed there
obviously clean it up
never used when, I assume it's closeish to promises
hmm this is interesting I was thinking to use when as it would allow me to assess the value of allow and instead of having the prevent default at the start of the call placing the preventdefault conditionally to only prevent the final submit if there were form errors
else allow the submit to go through
well if you throw an error from the then handler inside your function, it should propagate up as promises can be chained
11:39
essentially making the boolean value reduntant and being able to place the preventdefault within the catch and providing the solution to the problem
pretty much :)
Like I said, that's assuming jQuery's fake promises (done/when) work the same way
hmm going to research now to try find solution but just incase you are interested receiving Uncaught TypeError: $.when(...).then(...).catch is not a function
@Kwsswart it's .fail(), not .catch() AFAIK
11:57
angular mat-checkbox need two clicks to uncheck and check
@Ijas 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:13
@KarelG Hmmm that doesn't seem to work either the 'throw line isnt causing failure but no worries going to try research now thanks for all the helpguys
Someone use asynchronous-calls-with-two-callbacks ?
https://stackoverflow.com/questions/64653038/how-to-return-asynchronous-calls-in-javascript-with-two-callbacks
12:54
@BenFortune and @KarelG just so i feel lik i have contributed with this i got the solution and it ended up being a combination of what you did ben and the solution that karelG stated along with using a Deferred object as here
function send_attendance(name, lesson, form_id, i) {

        var url = '/attendance/' + name + '/' + lesson
        $('#error-' + i).hide('slow')
        $('#error-' + i).html('')
        var form = $('#' + form_id)


        return $.ajax({
            type: "POST",
            url: url,
            data: $('#'+ form_id).serialize(),
            context: form,
        }).then(function(data) {
            console.log('done')
            return $.Deferred(function (deferred) {
                if (data.data.message == undefined) {
 $('#update_form').submit(function (e) {
            e.preventDefault();
            var allow = true
            var deferred = [];

            for (var i = 0; i < studentcount ; i++) {
                deferred.push(
                    send_attendance(st[i], lesson, 'attendance-' + i, i));
            }

            $.when(...deferred).then(function() {
                    console.log('True');
                }).fail(function() {
                    console.log('False');
                })

thanks for the assistance now to clean it up and make it functional
13:52
var, jquery, no native promises... are we in 2010 or what? :D
Is updating to ubuntu 20 hassle free?
14:26
@paul23 I did it from 18.04, and no it wasn't
I have been trying to figure out how to determine how far an element is from the bottom of the document in pixels. If I use getBoundingClientRect().bottom but that only returns the y coordinate for the bottom of the edge of the bounding rectangle... so then I tried adding getBoundingClientRect().y to the bottom and several other permutations. Does anyone know what I can do to calculate my elements position from the bottom of the document? This must be done with vanilla JS
updating from 16.04 to 18.04 really gave me troubles setting up the launcher again
@Kwsswart You're double wrapping, you're already inside a .then handler which you can chain calls from
@paul23 tbh most of it was broken apt sources
12
Q: GetBoundingClientRect but relative to the entire document

JohnIs there a method for getting the client rect for an element relative to the document besides offset? getBoundingClientRect() gets the value relative to the client's browser. I'm using D3 and jQuery's height() nor width() are working (I've even tried doing it window.load()), but offset() is. Nei...

@BenFortune good stuff, I'll give that a read - I hadn't thought to use it around the entire document
@BenFortune my custom launchers (icons) for shell scripts stopped working and ubuntu didn't like to reregister those scripts. Like pgadmin which is just a shell script to launch python-pgadmin server + open a webpage.
14:33
heh, thing with ubuntu 20 is that "it should be more stable than its predecessors", yet upgrading to it came with a lot issues
I just have functions for things like that linked to my .zshrc
I'm still waiting for stable wayland
@BenFortune dpaste.com/AB3SRC2Z8 this is what i have here only problem is that if all goes through with everything alright and sets the value allowSubmit to true it goes in a continuous loop instead of allowing the submit of the original form
15:32
does send_attendance return anything to the .push call?
the old version from yesterday didn't
@KevinB yeah its dpaste.com/ESCDAP3SS
Yeah returning the ajax but now that it is functioning with regards to getting the errors or not i am trying to conditionally set the event.preventDefault()
the event.preventdefault can't be conditionally called on something in the future
it has to be called during the event cycle, which ends when the event callback returns
so in your case, you'll just always prevent the default action, regardless of result
preferably right away
15:48
@KevinB why wouldn't this work dpaste.com/F64H2U8CW ? is there a way to do this or am i going to have to send another ajax in the succes of the other ajaxx called
see the linked answer, you can submit the form in the success, without re-triggering the submit callback if you call .submit() on the form and not a jquery collection
Afternoon. I'm puzzling over a piece of Vue code. The model has this property
public get sellOption(): SellOption {
@KevinB receiving: Uncaught TypeError: thisform.submit is not a function on doing this
then you didn't do it correctly
There's no equivalent setter. The function inside gets called - you can log it - but nothing I can see on the whole page actually binds to sellOption
There are bindings to myobject.sellOption - but will they invoke that property just because the name matches?
15:56
 $('#update_form').submit(function (e) {



            e.preventDefault();

            var deferred = [];
            thisform = this;

            for (var i = 0; i < studentcount ; i++) {
                deferred.push(
                    send_attendance(st[i], lesson, 'attendance-' + i, i));
            }

            $.when(...deferred).then(function() {
                    thisform.submit();

                }).fail(function() {

                })


        })
is #update_form a form?
also, don't forget to declare it
yes its the original form that the button is being pushed on here is the html dpaste.com/G9REUUTXV
you have an element mismatch there
td vs form
form should go inside
not sure if "width" set on a table row makes sense
dl isn't a valid direct child of table, tbody isn't a valid direct child of dl,
but none of this explains why your thisform doesn't have a submit method
2
Q: How to return asynchronous calls in JavaScript with two callbacks

idanThe following asynchronous function returns 2 callbacks, so I did what I usually do to return the response Added return before the fetch Added return before the result (json.access_token) but this time console.log(httpResponse, 'fetch json') is null on the console and console.log(json.access_to...

the form is submited with this button <td>{{ wtf.form_field(update_form.submit) }}</td> formed by flask-wtforms
16:05
@idan both conditions of your if/else should return
What is the actual html output if your server-side code?
thaat is the full html
16:34
the important part of it being dpaste.com/5HR2QDQJT that covers the forms being interacted with
16:57
@Kwsswart id="submit" is a bad idea
id's shouldn't be things that could also be properties/methods of dom objects
what would be better to set it to
does it need an id at all?
well gets set automatically by flask wtforms
it doesn't appear as though you use it at all
just set it to anything else
would that affect the situation i am having?
17:00
yes
since form.submit would be an input element rather than a function
oh worked perfectly
thank you mate
18:00
2
Q: angular mat-checkbox need two clicks to uncheck and check

IjasI have check-boxes, that populating dynamically, but issue when trying to unselected the check box it asks two clicks to uncheck the checkbox. enter code here <mat-tree [dataSource]="dataSource" [treeControl]="treeControl"> <mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTr...

18:33
im getting on object from the frontend in a json object im trying to deserialize it but its not working
                var work = JsonConvert.DeserializeObject<List<object>>(jobs.ToString());
im trying to access the properties in this object
19:07
which part isn't working
in what way is it not working
 
2 hours later…
21:31
@KevinB if the only JSON will return, is OK.
@idan 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
1 message moved to Trash can
:50844373
This function run from the client, the console log from the client return undefined but 'json.access_token backend' return the real value.
GetJSON(NewURLCode).then(httpResponse => {console.log(httpResponse.access_token,httpResponse.id_token,httpResponse.refresh_token , 'get token')

And this running from the server

 export function GetJSON (URLCode){

return fetch("https://accounts.google.com/o/oauth2/token", {
"method": "post",
"headers": {
"Content-Type": 'application/x-www-form-urlencoded'
posted on November 03, 2020 by Geo Hsu

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

21:47
@idan that's not what i'm talking about
in your .then(), you have a conditional
if x do this, else do that
but neither of the actions actually do anything if you don't return their result
you must return response.json(), or Promise.reject(), otherwise neither will have any impact.
you have to tell .then() what should be passed on to the next, which is done by return value.
22:30
Hey Guys
Anyone active in here?
o/
|| welcome GregBorbonus
@GregBorbonus 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.
Ohh, I've been here plenty of times. Used to answer all sorts of questions here and never really had an issue with asking if anyone was around.
oh well welcome back :)
Quick question for those on here. I'm looking to fix this recordRTC script that I'm working on. Sadly, I think the problem is the recordRTC itself but memory is just dying with this script. I'm looking for a clean way to record webcam, audio and screen at the same time and in any combination. Any of you think you can help me? Also willing to pay for your time as I'm getting paid for the work.
Thanks
22:34
well whats/wheres the script
Been a few years as work has gotten in the way.
Basically, not too much different than the demo they've got: webrtc-experiment.com/RecordRTC/simple-demos/…
and my script and the demo are showing the same issue. I'll literally pay someone who can actually record 10 seconds worth of video. Hell, I'll take anything over 6 as reasonably functional.
Invalid command! Did you mean: msie, dice, mcve? Try help for a list of available commands..‍.‍.‍
If you would like assistance, please create a Minimal, Complete, and Verifiable Example
haha. That is the example.
22:36
alright lets see
the demo is working for me
you're able to record 10 seconds?
yep, well 9 seconds it seems but yes
Damn, I can't get it to record 10.
Perhaps it's the load on my machine.
hmm. How new of a browser do you need to support?
New is perfectly fine.
Chrome is the browser I'm using on Windows 7
yes, that does work
it never lets go of my camera
but it works
must you use RecordRTC?

« first day (3671 days earlier)      last day (1502 days later) »