Problem with cyclic dependencies between types and functions from different files in F#

My current project uses AST with 40 different types (discriminated unions) and several types from this AST has cyclic dependency. The types are not so big, therefore I put them in one file and...

golang: given a string, output an equivalent golang string literal

Writing go applications which output valid go code is probably best done using the built-in "go" package and some of its sub-packages ("go/ast", "go/token", "go/printer", etc). To create a...

automatic declaring c types on python variables for cython

I need to speed up python code via cython. To get an additional speed up I want to automatically declaring C types on python variables. To do this I want to find assignments like a = 1.0 ,that try...

How to discover all package types at runtime?

As far as I'm aware (see here, and here) there is no type discovery mechanism in the reflect package, which expects that you already have an instance of the type or value you want to inspect. Is...

AST Deserialization issue and build module error

So, I don't know how but one day I've start getting this type or errors: (sometimes two...

How to add an import to the file with Babel

Say you have a file with: AddReactImport(); And the plugin: export default function ({types: t }) { return { visitor: { CallExpression(p) { if (p.node.callee.name ===...

How to monkey patch python list __setitem__ method

I'd like to monkey-patch Python lists, in particular, replacing the __setitem__ method with custom code. Note that I am not trying to extend, but to overwrite the builtin types. For example: >>>...

clang: finding the SourceRange/SourceLocation of a QualType

While iterating the AST I encounter VarDecl objects. These have a type, "QualType". Now I would like to find the location in the original source of these QualTypes. I've heard somewhere that...

Type information in Abstract Syntax Trees

What type information exists in an abstract syntax tree? How are ASTs used for type inferencing? I don't understand how type input and output can be derived given an AST when none of the nodes...

Tasks stuck with sbt 1.0

Following the "https://www.coursera.org/learn/scala-spark-big-data/supplement/R7FJ9/eclipse-tutorial" course, I'm trying to create a eclipse project from sbt, by adding sbteclipse plugin. sbt new...

How can I access the AST that VSCode creates

I write a VSCode Extension for UI5 JavaScript. The most missing Feature is to have IntelliSense for UI5. Using UI5 typings it will work but not in all. This works: var testvar1 = new...

(Lazy) Haskell undefined/bottom in OCaml

Haskell has a really swell undefined value, which lazily raises an exception (upon evaluation). Ocaml is of course strict, so as far as I can tell there is no equivalent of Haskell's undefined....

Find clang::Type in Clang AST by name

In Clang AST, is it possible to find type by name? For example I have qualified name : nspace::my_type<int, 10u>. How can I check if type is present in current translation unit?

python 3: type inferencing with mypy?

Given the following snippet in python 3 def foo() -> List[X]: pass class X: def bar(self) -> MYTYPE: pass for the following expression: [x.bar() for x in foo()] Can I utilize mypy package...

Cuda Runtime Error cudaErrorNoDevice: no CUDA-capable device is detected

I am using Chainer, Cupy for CUDA 8.0 . I am trying to train machine learning model using python3.5 script, but I got this error: cupy.cuda.runtime.CUDARuntimeError: cudaErrorNoDevice: no...

Problem with using Black code formatter; can't import _ast3

I want to use "Black code formatter" for one of my python projects. I've successfully installed it with "pip install black", which gave an output in the cmd which showed that all requirements were...

How to programmatically retrieve the package path where a given type is declared?

I am looking for a way to retrieve the package(s) installed locally which contain the declaration for a given type and the default package name. ie: // FindPackagesForType returns the list of...

Converting string typed Abstract Syntax Tree(AST) to Python Code?

I am working on a parsed AST string of Python code. Now, I am at a stage where I want to convert small tree structures back to code for some analysis. import ast ast_string =...

How to store and load a Python dictionary with HDF5

I'm having issues loading (I think storing is working – a file is being created and contains data) a dictionary (string key and array/list value) from a HDF5 file. I'm receiving the following...

Programmatically determine pip 'user install' location Scripts directory

As explained in pip's documentation a user can install packages in his personal account using pip install --user <pkg>. How can I programmatically determine the user install location for scripts...

AttributeError: module 'tensorflow' has no attribute 'compat' when loading tf.compat.v1.train.SessionRunHook

I can see that this question has been asked before here tensorflow-has-no-attribute-compat but the answer given was to Microsoft Visual C++ 2015-2019 Redistributable (x64) It did not work for the...

How to transform TypeScript code before type-checking using Compiler API

The Intent I want to use the TypeScript's Compiler API to experiment with operator overloading in TypeScript code. Specifically, I want to find all instances of x + y and turn them into op_add(x,...

Why does `conda list cudnn` have no output after `conda install pytorch torchvision cudatoolkit=10.2 -c pytorch` installation

*Please feel free to vote "Reopen" at the bottom of this question. The reason is that I have marked this as a duplicate although the answers there are not clear enough for this question.* As soon...

Python Django Web application not able to deploy on Heroku using Waitress server

I have tried to deployed my django application several times on Heroku and then i finally succeeded . It is working fine on localhost ,however, when i use the link provided by heroku, the page...

Why can't I use Pyautogui in Ubuntu 20.04 LTS?

I've been trying to use Pyautogui at Ubuntu, but I simply can't make it work, while I have no trouble doing it at Windows. It doesn't matter what dependency I install, everytime I try to use...

This version of ChromeDriver only supports Chrome version 87 Current browser version is 90.0.4430.93

ChromeDriver is giving an error about its version being too low: This version of ChromeDriver only supports Chrome version 87 Current browser version is 90.0.4430.93. I've updated pip's packages...

NameError: name '_mysql' is not defined -- On airflow start in MacOSX

There are numbers of articles on the titled question but none of them worked for me. The detailed error is as follows: Traceback (most recent call last): File...

Python3 Import Error: undefined symbol: aes_hw_encrypt

I am trying to use DialogFlow to make a small talk chatbot on Raspberry Pi 4, and I am getting this error: ImportError:...

Remark: How to parse HTML tags and their content in MDAST

I'm trying to parse a GitHub-flavoured markdown file using Unified and Remark-Parse to generate a MDAST. I'm able to parse most of it correctly and easily, however I'm having trouble parsing the...

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway

I try to use library cv2 for changing picture. In mode debug I found out that problem in function cv2.namedWindow: def run(self): name_of_window = 'Test_version' image_cv2 =...