Import pprint for every breakpoint()

Every time I use breakpoint() in python I inevitably end up importing pprint (from pprint import pprint). Is there a way to automatically add pprint to the namespace whenever breakpoint() is reached? Python 3.8.5 Similar questions that don’t quite solve this problem or predate the implementation of breakpoint() Automatically import modules when entering the python… Read More Import pprint for every breakpoint()

Why is this requests get not working with this url

If i run this Python code my program just hangs up. (I don`t get any error.) import requests url = "https://raw.githubusercontent.com/tensorflow/docs/master/site/en/tutorials/generative/dcgan.ipynb" r = requests.get(url) But this works perfectly fine as expected. import requests url = "https://stackoverflow.com" r = requests.get(url) Using curl to get the github file worked also fine. curl https://raw.githubusercontent.com/tensorflow/docs/master/site/en/tutorials/generative/dcgan.ipynb So can you reproduce… Read More Why is this requests get not working with this url

Accidentally running TypeScript code directly with `node` without `ts-node`, why does it work?

I have set up a very simple node.js project with TypeScript. My package.json, from which you can see what packages I have installed (there is no ts-node), looks like this: { "name": "mydemo", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "lint": "eslint . –fix", "test": "echo \"Error: no test specified\" && exit 1", },… Read More Accidentally running TypeScript code directly with `node` without `ts-node`, why does it work?

mysql if exists return the record value instead of regular output

I want a select that if/exists it returns the ‘link’ value instead of regular output. so instead of ‘1’ it returns the ‘link’ Is that possible? SELECT IF( EXISTS( SELECT link FROM modules WHERE module=’license’ ), 1, ‘/dashboard/’ ) >Solution : Use aggregation with MAX() (or MIN()): SELECT COALESCE(MAX(link), ‘/dashboard/’) link FROM modules WHERE module… Read More mysql if exists return the record value instead of regular output