« first day (3083 days earlier)      last day (1860 days later) » 

11:04 AM
Could really use some help on this
1
Q: Node.js HTTP request socket hangup for any Google Video URL

JBisI am having a recurring issue where any Google Video videoplayback URL gets a socket hangup when requested from node. Whether it is requested from HTTP,HTTPS, HEAD or GET nothing works. If I edit /etc/hosts to point the url to 127.0.0.1 I don't get the error. So it's not a problem with the doma...

 
Benji! 😃
@BenjaminGruenbaum next time you are in London, wanna grab a pint 😛 ?
 
did you not say that you won't touch alcohol anymore?
Mar 18 at 13:20, by ShrekOverflow
@Neil I am staying away from alcohol
 
@KarelG The day after, you always say that :P
 
naah
never got drunk. That is the key.
= no "hangover"
 
I don't recommend it to anyone
 
11:25 AM
@BenjaminGruenbaum Fun times
 
Never Mind
 
@jAndy o/
 
\o
 
@MadaraUchiha Remember miaou ?
How have you been?
 
11:43 AM
is it still running?
 
heyy o/
 
hi
 
how is it going @KarelG ?
 
@ShrekOverflow Probably fullstack london in July
 
@BenjaminGruenbaum def!
I have settled in London for a while so I'll def. be happy to hangout
I wonder how this correlates with just the overall usage of a specific language
 
12:02 PM
depends of the language itself as well.
a lot critical applications got written in C.
PHP was a dangerous jungle with some GoT style theme
 
help me with this please
0
Q: Restrict page based on user role

Le guyFor my app, I'm using Angularjs for front end and PHP Symfony for back end. I am trying to restrict certain routes from being displayed for certain users. On logging in the back end sends me some data based on which the sidebar is populated. The back end only sends data specific to the user wh...

 
here is my unsolved problem from yesterday
0
Q: Ajax using JavaScript by a chrome Extension - Error blocked cross-origin response with MIME type application/json

za001aFailed to get a respond after Ajax a simple Array from JS by chrome extension to my back-end "python" error appears in console : Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:5000/test with MIME type application/json. See https://www.chromestatus.com/feature/5...

currently trying to test this but its in Jquery
50
Q: Cross-Origin Read Blocking (CORB)

JigneshI have called third party API using Jquery AJAX. I am getting following error in console: Cross-Origin Read Blocking (CORB) blocked cross-origin response MY URL with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details. I have used following...

$.ajax({
  type: 'GET',
  url: My Url,
  contentType: 'application/json',
  dataType:'jsonp',
  responseType:'application/json',
  xhrFields: {
    withCredentials: false
  },
  headers: {
    'Access-Control-Allow-Credentials' : true,
    'Access-Control-Allow-Origin':'*',
    'Access-Control-Allow-Methods':'GET',
    'Access-Control-Allow-Headers':'application/json',
  },
  success: function(data) {
    console.log(data);
  },
  error: function(error) {
    console.log("FAIL....=================");
any idea how to do this in javascript ?
 
12:22 PM
read the jquery code.
it is there. You only have to use it in vanilla javascript.
XMLHttpRequesthas a method for that: setRequestHeader
 
@KarelG fromm the comments i've notted that
headers: {
    'Access-Control-Allow-Credentials' : true,
    'Access-Control-Allow-Origin':'*',
    'Access-Control-Allow-Methods':'GET',
    'Access-Control-Allow-Headers':'application/json',
  },
is on the response side which means i should add it to the backend json object not the js
@KarelG XMLHttpRequest.setRequestHeader(header, value) could you help me with that ?
what header i should include witht the request ?
 
those 4 you just mentioned?
 
yea but those four under one of the answers it (
hese are response headers. They belong on the response, not the request.
This will make a cross-origin request non-simple, meaning that as well as basic CORS permissions, you also need to deal with a pre-flight.
) by Quentin
i assume by "response headers" that they should be added to the json response before sending back to the client
 
Hi, has anyone worked with "dojo2"?
 
@Carlos 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:43 PM
@ShrekOverflow nice! I'll be speaking there we can definitely grab a beer - the only other two things I have before that are DevDays Vilnius and JSConf EU in Berlin
And in JSConf I'll only be coming for the node parts
 
I won't be leaving UK for a while
but am working on the EU visa
 
@ShrekOverflow Indeed I do
Also, good, how are you?
Relocated?
 
yes need to start cooking
 
1:02 PM
@Carlos never imagined to meet someone that worked with such an ancient feature as well
wait.
could be that I am confused about the original dojo/dijit and the update of it from last year
 
Has anyone ever seen a legitimate reason to use switch(false)?
 
a false map?
switch( false ) {
  case obj.a:
  case obj.b:
    someShit();
  break;
  case obj.c:
    otherShit();
  break;
}
 
I have seen using switch(true) but false?
 
erm
what the fuck?
 
1:12 PM
they like yoda conditions
?
 
I never thought of using switch like that
 
conditional behavior
it works but imho I prefer to use if-elseif-else for that
 
it's not often the most useful approach
^^
 
switch (3) {
    case a.value:
    case b.value:
       someShit();
    case c.value:
       totallyDiffShit();
}
 
The reason was a combined action at two states
 
1:14 PM
I am pretty sure this will confuse someone
if (a.value === 3 || b.value === 3) someShit()
if (c.value === 3) totallyDiffShit();
over
 
fallthrough seems to confuse people at any level tho
best to just tell them to learn it
it isn't going away
 
No just the switch
Google should copy this - apple.com/apple-card
oh wait!
 
they all copied IBM
who cares
 
@rlemon easier said than done.
that za001 user is still struggling with that cors issue (scroll a bit up in historY)
 
I mean, these concepts are not going away.
 
1:21 PM
Apple can offer you a chargeless service because it can know everything you purchase
 
yea I saw it. purposely left that alone today
I think the main problem with programming today is also one of the main reasons it's grown so much
that's the low bar of entry that takes you only so far
then a massive learning curve
anyone can copy-pasta a project to almost working
it's the last 10% that become impossible
 
@Neil apple is not in the copy your data business
 
@ShrekOverflow Do you really believe this?
 
> Or use the Apple‑designed titanium card anywhere in the world.
that is a lie
 
facebook is into that more than Apple, but it's naive to think they don't use your data
 
1:24 PM
VISA is not accepted when I was in Cuba. Kinda logical
 
@Neil They literally have papers on how they anonymize your data before it hits their servers and how they do a lot more on device
on maps and stuff
they do collect your data :P
but it isn't part of their core business model
 
I don't trust a mix of technology company and a bank company
 
^ That is true
I'd prefer Apple over my current credit card though 😃
atleast they wont call me 30 times a month
 
@ShrekOverflow I believe that whatever they say they anonymize, they anonymize.
 
to offer me better deals
 
1:26 PM
Everything else though.. absolutely not
 
does your own bank not have an app so that you can use your phone as card? (via NFC)
Mine does.
It even offers another functionality to hook only that smartphone to a given bank card.
 
paying is already stupid easy
 
@KarelG I have two banks
 
tap cards, google pay et al, swipe passes, etc
 
Monzo -- Fucking love it
State Bank of Bullshit -- Fucking hate it
 
1:28 PM
I have Paypal :#
 
remember the days when you had to actually insert a card and put in a pin.
 
the apple card is basically NFC isn't it?
 
so much hassle.
 
I still do that.
 
@Neil no you can get a physical card too
 
1:28 PM
the chip it uses is the same
 
only if it's over $100
 
the contact less payment is limited to 20 euro here
 
made of Titanium 😃
 
$100 here
 
@KarelG contactless was still a dream in India
the govt. wants companies to use the govt. based biometric system (over network) to validate transactions like Apple Pay does, which is weird.
 
1:29 PM
India... they just prefer cash dude
 
@KarelG no
 
no registered income.
 
no the govt. swapped out hte entire currency
to fix that
 
they did?
 
Payment services were on the rise vOv
 
1:29 PM
no rupees coin/biljets?
 
I have used my physical card in India almost exclusively
 
no rupees coin/paper?
 
@KarelG They swapped out the 500 / 1000 denominations with newer versions
practically in 1 day
 
I was in India last year o.O
had to pay most things with paper/coins. I still have some of it at home i think
 
hey guys
 
1:33 PM
@KarelG wtf?
 
how can I make lodash.throttle discard calls instead of queuing them?
 
You can just use PayTM practically everywhere
or your Mastercard / Visa
keep in mind though, Indian exchange will be BS when paying from external cc :)
 
Was advised to do that <.<
but that does not matter much tho :P I am coming from a "wealthy country"
 
Trust me
I use the opposite direction to save money 😃
 
you can earn more with your profession
big demand
that does not work out very well if you are, let's say a pot baker
 
1:40 PM
@Victor what do you mean?
 
@KarelG You proabbly earn more than me
based on your skin color :P
(ok maybe I made it too awkward)
 
@rlemon looks like I was creating a new instance of the throttled function multiple time, and it looked like the calls were queued, not discarded
 
so instead of assigning the throttle function once you created it in a loop?
 
@ShrekOverflow sadly a partial truth. Discrimination on background still exist
even females with same education level and experience level earns a bit less than males.
however, the gap is narrowing slowly though
 
@KarelG Yes
Although the green gap is very significant afaik
 
1:47 PM
cos you're still green behind the ears 😉
EVEN WITH ALCOHOL
!!mdn for..of
okay. ..
 
mdn command doesn't work
relies on google
 
does mdn has its own api?
went on dev.io
 
2:04 PM
:)
 
@codfish555 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.
 
next person to talk is very strong and cool!!!!!!!11
 
now why is that flagged?
 
spam
 
No its not... Thats a bot. Its a welcome message to first time chat users
 
2:05 PM
Saw that message before typing
dont need to see it again
innit
 
@SurajRao cap's welcome message?
heh
 
yup
 
pardon
 
silly
hi codfish
 
Caprica welcomes every new user
 
2:06 PM
@KarelG yeah mate
 
aarghh matey
 
@KarelG not tmk
 
rip eu
 
what happened?
 
Article 13
 
2:21 PM
oh no...
 
yup
got accepted
 
politicians are 10/10 iq
 
but not sure if it is really rip
 
-6
Q: How to make dynamic select on php?

Bajiroot BajiPlease help me to solve it with php / javascript.. Thank you..

lmao
 
> Im trying write that question in body, but i cant submit that question.. so i capture and i add images to show my question.. im sorry
*consufes*
 
2:25 PM
very confuses
This one's good too: stackoverflow.com/questions/55357417/… -- It's not even a question, it just starts with "Write a query to display [...]", like a direct copy/paste of a homework question
 
omg iam going crazy right now -.-
nothing works with CORB
not even sure if the problem is with the front end or the backend
 
I've never had any issues with corb, but I don't usually do cross-site requests, because client side security is a nightmare to navigate
 
could anyone check the new update to my post and see if you can spot what is wrong ?
 
@KarelG It is not my decision to have to use dojo 2. I have seen some examples and it does not seem easy, the worst thing is that I do not know anyone who knows how to use it.
 
0
Q: Ajax using JavaScript by a chrome Extension - Error blocked cross-origin response with MIME type application/json

za001aFailed to get a respond after Ajax a simple Array from JS by chrome extension to my back-end "python" error appears in console : Cross-Origin Read Blocking (CORB) blocked cross-origin response http://127.0.0.1:5000/test with MIME type application/json. See https://www.chromestatus.com/feature/5...

@ndugger , when u make a chrome extention u sometimes require the users to be registed
u will go through it eventually one day
 
2:32 PM
Ah, you're making an extension
I've never had to do that
Makes sense
I don't really plan on being in the business of making extensions, so I doubt I'll face this issue lol
 
preface: I don't know flask.
but I do know that's not how you enable cors
 
corb
not cors
(I hadn't heard of it either until this dude)
makes me think of corn on the cob
 
he still needs cors headers
 
it's a nightmare , iam not trying to block it or to work around it i just dont know if the problem occurs on he backend or the front end
i've installed cors headers on backend and front end and still get blocked @rlemon
 
I think he has cors headers
I can see some in the question
 
2:35 PM
no, he's got some props on the json string hes returning
def req():
    y = request.form.get("x")
    z = jsonify({"success":y, 'headers': {
    'Access-Control-Allow-Credentials' : 'true',
    'Access-Control-Allow-Origin':'*',
    'Access-Control-Allow-Methods':'GET',
    'Access-Control-Allow-Headers':'application/json',
  }})
60
A: How to enable CORS in flask and heroku

Daniel RasmusonHere is what worked for me when I deployed to Heroku. http://flask-cors.readthedocs.org/en/latest/ Install flask-cors by running - pip install -U flask-cors from flask import Flask from flask_cors import CORS, cross_origin app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADERS'] = 'Con...

 
I can't fucking read python, lol
 
I don't think it's a CORS thing
This is a browser-level block
That's based on the request more than on the domain
 
@rlemon i've cors Header installed the same way

https://enable-cors.org/server.html
 
"permissions": [ "tabs", "storage" ,"http://127.0.0.1:5000/*" ]
I think this should be without the *, @za001a
 
@MadaraUchiha i'll give it a try
@MadaraUchiha didnt work :S
 
2:42 PM
@za001a Also, the Access-Control-Allow-* headers are headers the server is supposed to send to the client, the client is not supposed to send them.
Something is causing Chrome to flag your request as suspicious and blocks it
Also, you're passing a FormData object to the fetch
 
@MadaraUchiha so i should remove them from js right ?
 
@za001a Yes
 
I think you can pass formdata to fetch just fine, can't you?
 
@ndugger Yes, but not if the Access-Control-Allow-Accept header is application/json
 
oh, right
 
2:44 PM
I'm almost sure that passing a FormData object means you're sending urlencoded body.
 
it could also be a multipart/form-data
 
@MadaraUchiha i've removed all of them except
req.setRequestHeader("dataType",'json');
        req.setRequestHeader('responseType','application/json');
 
@za001a dataType and responseType are not valid HTTP headers though
You're confusing with jQuery's $.ajax
 
oh ok
yea
 
'content-type', 'your/mom'
 
2:47 PM
most of thje online answers are in jquery
 
@ndugger I think that sending a FormData automagically sets this header
 
I think you're right
 
@za001a Now, you have Access-Control-Allow-Headers in your python code
Which marks which headers are allowed to be sent with the request
What you have there is invalid application/json
 
@ndugger that is so funny i wanna smack u on the head with my tablet
 
same
 
2:48 PM
@ndugger .... l
@MadaraUchiha could u please tell me how to do it then in python ?
 
I need 24 rep
pls
 
@za001a Yes, by not copy and pasting code from Stack Overflow.
 
It's gonna take like 3 weeks of waiting to just get 24
 
Your CORS headers are a mess, you need to understand how CORS works, what the flow is, and what each header does.
 
@ndugger I went to upvote you, but then I clicked on your profile and had a seizure
 
2:50 PM
(Also, it's not Python specific, CORS headers are an HTTP thing)
 
I'm trying to use Javascript to manipulate elements in an SVG area, but when I add new elements, they end up not being visible. They're showing up in the dom, and all their attributes are pretty much identical to the elements I deleted, but they don't show up on the page.
 
giving people seizures is my new hobby
 
@MadaraUchiha trust me i've been reading alot about this ffishing problem and most of the resources just explains what we are suppose to do but no toturial for flask or other backend lang
tell this moment i am not sure what is blocking it the front or the bk end
@MadaraUchiha i know i've been copy and pasting answer as my last chance of hope
@MadaraUchiha i figured once it works i can clean up the mess
all i'm sending is just an array of chrs
 
I don't know what to tell you, you need to understand what you're doing to debug the problem, and you need to understand how CORS work to understand what you're doing.
If you read and don't understand something, you can ask about that and we'll try to explain it to you, but we can't do your debugging for you, I'm afraid :(
 
@MadaraUchiha ok fair enough , i will give it another try , can u point me to the right link ?
coz i have seen too many of them u can see the links on my post
i'm usinf glask as a back end
 
There's too many terrible ideas on kickstarter
 
@rlemon "Do you get thirsty? Do you like baseball?" Riiight.. it's for water.. :)
No other way to abuse that
 
@MadaraUchiha just to be clear , my frontend is fine , i just need to add the right Code to my flask , am i right ?
 
soda pop only
legally
 
@za001a I don't know, you need to debug.,
 
3:04 PM
Didn't someone make a kickstarter for someone to eat a bowl of potato salad if they got enough money?
 
@MadaraUchiha how to debug a problem like this if its connection between both sides ?
 
@Neil no they sent out bites of it
it was a kickstarter to just make potato salad
they made like $50K iirc
 
i just want to make sure that atleast 1 side of the equation is right to debug the other
 
wow
my brother thought up the idea of having a kickstarter for something a lot of people would want.. you take that money, invest it, and then after some time you just say the project failed and give them back their money
free money basically (he didn't actually do it)
 
I think that would be illegal
 
3:06 PM
also it's held in escrow
 
then that wouldn't be possible
 
tell your brother that he's wrong
 
unless you're talking about landing a campaign - promising to ship - not shipping - and trying to refund a year later.
then yea it might work
but probably get sued
 
It's one of those days. I'm already thinking about what I want for lunch
 
well I don't think you can get sued if your project fails and you get your money back
though it wouldn't surprise me if it's happened
 
3:09 PM
I'm pretty sure kickstarter only pays if you reach the goal. unlike gofundme
so you'd have to have a successful campaign, then fail to deliver on your product.
 
oh yeah, I suppose that would be bad :)
 
o/
 
3:37 PM
hi @KevinB
managed to make it work
with required = "required", title ="this is my error"
but the thing is i have a list of items
so i have an index which i go on with
its the list contains one item the message is
this is my error
if it contains multiple items its this is my error (i + 1)
it works for newly added items, but the first one who was there before the others items keeps the first error message assigned to it
without the i+1
 
 
2 hours later…
5:16 PM
opinions on using the request npm package compared to using the https native package?
 
it's easier but less control
http[s] is pretty damn simple tho
 
I really like the standard http/s modules
Super easy to use
 
yea, request is an okay abstraction over top. but it really isn't that valuable.
 
Hi everybody
I'm kinda new here so excuse me if my question is inappropriate :)
Anybody in here whove worked with jspdf and react?
 
@MohammadSaad 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.
 
5:47 PM
yeah, I think I'll stick with the http/s module. Easy enough to use.
 
Well I'm trying to screenshot a react component and add it in a pdf in another class, but cant seem to figure out how
 
^ that's really cool
 
I think it's bizarre that it's part of the WebRTC api
 
yeah that is kind of weird.
random question: is it possible to cancel an await statement
 

« first day (3083 days earlier)      last day (1860 days later) »