« first day (5008 days earlier)      last day (7 days later) » 

3:47 AM
Hi! I just want to ask if there's a mapping from TextMate scopes to Pygments tokens? I can't find any question about it, and Pygments tokens seem to differ from TextMate scopes.
 
 
4 hours later…
7:47 AM
@AshwinPhadke A lot of tools and even more features aren't made with programatic usage in mind. Anything that specifies a specific, parseable output format isn't a stable information source to begin with.
*…that doesn't specify…
 
 
2 hours later…
10:18 AM
@MisterMiyagi Git has an interesting approach here. 'But because Git was initially a toolkit for a version control system rather than a full user-friendly VCS, it has a number of subcommands that do low-level work and were designed to be chained together UNIX-style or called from scripts. These commands are generally referred to as Git’s “plumbing” commands, while the more user-friendly commands are called “porcelain” commands.'
I think it's generally a problem in the UNIX world how much of it is de facto parsing of string outputs. At least have a --json flag, or even better, pass around objects as with PowerShell, but of course that isn't possible across different programming languages.
 
Definitely a +1 from me for JSON output.
Or depending on the usecase, another (semi) structured format such as CSV.
 
0
Q: How to debug Triton Python, especially Triton-JIT compiler passes?

ShoreI would like to do the following: Build triton Python (which run from Python script): Into specific directory Build all cpp files with debug symbol LLVM which used by triton should also be built with debug symbols Run a Python file to debug: Related Python script Called cpp functions or obje...

gosh some people cannot follow explicit instructions to save themselves
granted pip install -e python looks weird but the editable flag should have clue in something...
 
10:37 AM
Huh, I wasn't aware that -e forces local installs (though it makes sense in hindsight).
Would have expected pip install -e ./python or somesuch.
 
11:18 AM
yeah, or the project shouldn't create a situation where that nonsensical looking instruction is part of the process
they could have amended it to -e ./python to make it clearer that it's the one in the current directory
still, point is when people ask "I try to install the thing and I don't know how someone please give me instructions" while don't tell people that 1) they've followed the standard instruction and it doesn't work and 2) worse, they actually skipped a pretty critical step and now nothing works and 3) they don't note any of this down
 
 
3 hours later…
2:19 PM
late morning cabbages, folks!
 
 
2 hours later…
4:30 PM
Have I just teleported to an alternate universe? This comment seems ridiculous. Of course SO is about implementation so why dump some theoretical and then cause the OP to raise another question?
 
 
2 hours later…
6:12 PM
anyone able to help me figure out why my flask+CORS works on HTTP but not HTTPS? I have a feeling this has smething to do with it, but I do need a grownup to help
 
What is the error?
 
requests.post(...) from localhost works just fine on the HTTPS endpoint. But if I attempt a fetch(...) in the browser's dev console, I get Cross-Origin Request Blocked
 
Well, they are very different things. What is the URL you are trying to fetch from the frontend?
You'll need to give quite a bit more context, however you anonymise it. Browsers will just block HTTP requests from HTTPS sites in a lot of cases
 
I'll gladly give as much context as I can, within the limits of not divulging work things. Also, standing up APIs isn't exactly my strongest suit, so please bear with me
 
There are ways around it, in that you can proxy the request through the backend, but it's not pretty. Like at all.
 
6:23 PM
I have a flask API running on an EC2 instance. The API runs an endpoint at https://api.sub.domain.com/ep. It listens for POST on port 5000
I have certbot managing SSL certs with nginx on that EC2 instance. Nginx forwards 443 to 5000
AWS security groups allow global ingress on 443, which is how requests.post(...) works
 
I'm not sure if you're still typing so I'll wait a little longer before responding
 
I've hit EOL. Sorry, I'll make that more explicit next time
 
:P
Everything you've said has no real bearing on the problem you have
It's almost certainly the browser that is blocking you, not AWS. Your fetch() is trying to hit a HTTP resource from a site served over HTTPS. That's a paddlin'
 
hang on, I'll post my fetch here
fetch("https://api.sub.domain.com/ep",
  	{"method": "POST",
   	"body":JSON.stringify([...]),
   	"headers": {"Authorization": "Bearer *****",
               	"Content-Type": "application/json"
               	}
doesn't that mean it's hitting something over HTTPS rather than HTTP?
 
Yes, it should do, so I'm back to scratching my head
When you see it thrown in the developer console, it's definitely complaining about "https://api.sub.domain.com/ep" with the S?
 
6:38 PM
I'm looking at my await fetch right now and it has https://api.sub.domain.com/ep
 
hahaha
 
EOL
FWIW: we we have a website built by a contractor. That website has a widget. That widget hits my API/endpoint
I am attempting to replicate their issues with a fetch, since according to their widget, my API endpoint is "not working" (that's what they tell me
EOL
 
I don't need EOL all the time :P
 
what does it return? does it return the CORS error or auth error?
 
Maybe it is AWS
 
6:44 PM
I just tried text/plain and it failed in the exact same way. But even if it /were/ that issue, shouldn't my requests.post(...) have failed as well?
The dev console in firefox says Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.sub.domain.com/ep. (Reason: CORS request did not succeed). Status code: (null).
 
well that's an easy one, is CORS enabled on your api on the server side? if yes then this is a auth problem if no then this is a CORS poilicy problem
 
Ok, well that was the error I was asking for earlier
 
CORS /is/ enabled in the Flask API
from flask import Flask, jsonify, request, abort
from flask_cors import CORS, cross_origin


@app.route('/ep', methods=['POST'])
@cross_origin(origin='*',headers=['Content-Type','Authorization'])
@tokenRequired
def ep():
 
But that is the final stage of a request's life. It still has to go through AWS/nginx before it gets to Flask
 
from flask import Flask
from flask_cors import CORS

app = Flask(__name__)
CORS(app)
 
6:49 PM
I don't think that will fix it either. The browser can stop the frontend request before anything even starts
 
@roganjosh good point. There's nothing in /var/log/nginx/error.log or in access.log
@AshwinPhadke I tried that, but nothing changed. Would I still do app.run(...) in the end?
 
@roganjosh it isn't but a good starting point that if Flask is not the issue the request lifecycle is and this issue is at higher level than here
@inspectorG4dget yes, but you have to make sure that request is allwed from CORs for where the request hits your API and not the flask app like @roganjosh said and without knowing what your request goes through this is difficult and can only be solved internally
 
@AshwinPhadke: sidebar - samename!
 
I am 99.99% sure Flask has nothing to do with this. I think it's an AWS thing that's stopping your site page sending requests. That said, I've exceeded my knowledge base here
 
@AshwinPhadke @cross_origin(origin='*', ...) accomplishes that, no? Or do you mean that Firefox/AWS/nginx might be up to something here?
@roganjosh I appreciate you going to bat for me. Very melon
 
6:55 PM
The error suggests to me that AWS refuses to recognise its own domain from a web page. It's a conflict between the browser and your server, not flask itself
Flask is dumb here, right? It just sits on 5000 waiting to be given work. It's nginx that sits in front of it that chooses whether to forward requests on and then post the answers back. That's too late for a CORS error so it's the browser intervening
 
so far, we're on track with my thought process
 
I think I have seen this in the past with AWS but my memory is too hazy :( I think you need to actively open this option but I could just be making it up, sorry
 
the funny thing is that the same endpoint was working before, on HTTP (no S) just fine
 
I swear it's still in these docs
 
@inspectorG4dget then is CORS enabled for HTTPS api?
 
7:05 PM
"CORS is already enabled for the Amazon EC2 API, and is ready for you to use." thus implying "it's not enabled for other things"
 
@inspectorG4dget flask is the last leg here
 
@AshwinPhadke yes. In the code I shared
 
1. try postman, add headers, remove headers make those requests, what do you get?
 
That won't work
 
@roganjosh how come?
 
7:09 PM
Because you're able to send API requests. It's the browser that you're having issues with. You already know you can call the API with requests()
 
ahh. Thanks
 
So, rather, my message should have been "It will work, but rule out nothing" :/
 
@roganjosh ah I must have missed reading that he can make independent requests. , then disable extensions, disable same origin policy in browser and then make those requests. At the end slap a brand new certificate and see if that changes.
 
It's an AWS setting. 50 quatloos on it. I swear we had this with silly Lambda issues in the past but I wasn't leading that project
 
so... either mess with an AWS setting, or a firefox setting?
 
7:15 PM
@roganjosh yes it is, but we can't really know how to guide them through AWS if we don't know what we are looking at, so changing these browser settings will either confirm or eliminate that and they will have to then look at AWS
 
You will not be able to break firefox on this one. Or chrome. When they say "nope" on CORS, they mean it
Please tell me you've read the docs I've linked twice, though?
 
@roganjosh yes this is true, because it is not easy to do that but that's all we got
and the docs you shared
let me share some wisdom that I always use before coming to the internet " seek help internally(within your team) first ". They are your best resource, people on internet can only guess
 
@AshwinPhadke "not easy" is an understatement. Don't even bother fighting it unless you have l33t skillz
 
@roganjosh lol this is true.
 
CORS issues need to be fixed at source
 
7:21 PM
@roganjosh yes I have
 
@roganjosh This should have been at the top of discussions
 
@AshwinPhadke sadly, nobody left around here... I didn't have much choice but to hunt you down
 
@roganjosh Oh my, that smells like an XYZ Q&A. ._.
 
@inspectorG4dget yup, that is is understandable, however that's all I can help with my limited experience
 
@AshwinPhadke Much appreciated, Ashwin. Thanks for at least being my sounding board
 
7:25 PM
@MisterMiyagi I have a video clip in the back of my mind but I can't fully formulate it. Along the lines of "I have some amazing thing <extols the virtues>" --> "can I see it?" --> "no"
Arrg, There's definitely a reference to be had but I think I need to switch off for a bit
 

« first day (5008 days earlier)      last day (7 days later) »