Why are the “Paste JSON As Classes” and “Paste XML As Classes” commands disabled (grayed out) in Visual Studio? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago. Improve this question I'm using Visual Studio 2017 15.9.0 Preview 4.0. I'm trying to use the "Paste XML As Classes" command available under "Edit > Paste Special" but it's grayed out: I got the (incorrect) feeling that this command would allow me to pick a file that contained XML, or have some other sort of UI. The articles I None of the articles I found talk about cases where these

2021-06-26 21:59:04    分类:问答    c#   .net   visual-studio   visual-studio-2017   codegen

LLVM Backend : Replacing indirect jmps for x86 backend

I want to replace indirect jmp *(eax) instructions in the code to mov *(eax),ebx; jmp *ebx for the x86 executables. Before implementing this, i would like to make LLVM compiler, log an output every time it detects a jmp *(eax) instruction by adding some print statements. Then i want to move on to replacing the indirect sequence. From what i have seen from google searches and articles, i can probably achieve this by modifying the x86asmprinter in the llvm backend. But i am not sure how to go about it. Any help or reading would be appreciated. Note: My actual requirement deals with indirect

2021-06-23 22:50:47    分类:问答    x86   llvm   code-generation   codegen

Generate Fortran subroutine with SymPy codegen for a system of equations

Building on a former example that I've found here, I try to find out how to generate a Fortran code that correspond to a specific form that I need to stick to. The required FORTRAN code will look like this (it is based on the FitzHugh–Nagumo model): SUBROUTINE FF(NE,U,PAR,F) ! ---------- -- ! Define the nonlinear term IMPLICIT NONE INTEGER, INTENT(IN) :: NE DOUBLE PRECISION, INTENT(IN) :: U(NE),PAR(*) DOUBLE PRECISION, INTENT(OUT) :: F(NE) DOUBLE PRECISION u,v,e,a1,a0 u=U(1) v=U(2) e=PAR(1) a1=PAR(2) a0=PAR(3) F(1)= u-u**3-v F(2)= e*(u-a1*v-a0) END SUBROUTINE FF I manage to create the right

2021-06-14 01:36:34    分类:问答    python   python-2.7   code-generation   sympy   codegen

Xcode 9 build issue with Date vs NSDate for NSManagedObject

Xcode 9 generates different code for Date type attribute of the entity in simulator vs device. I have codegen feature under Class set to category/extension in coredata. Until Xcode 8.3 (latest) it was all working fine (NSDate always). Below is the auto generated code by Xcode 9 (Swift 4) for the attribute - On Device:- @NSManaged public var requiredDate: Date? AND, On Simulator:- @NSManaged public var requiredDate: NSDate? Anyone encountered this problem? What is the best solution for a project with 50+ members to fix this until an Xcode update fix it (I hope there is an apple radar for this)?

2021-06-05 17:33:34    分类:问答    xcode   date   core-data   nsmanagedobject   codegen

一个 XSD、两个代码生成工具、两个命名空间(One XSD, two code generation tools, two namespaces)

问题 我有一个 XSD 文件,我也想从中生成 C# 和 Java 类。 我首先根据我的类所在的 C# 命名空间在 XSD 中设置命名空间。 这一代(使用 Microsoft 工具)运行良好,序列化也运行良好,我可以针对 XSD 验证它们 - 完美。 现在我想用 JAXB 创建 java 类。 问题是将要创建的类与 C# 中的类具有不同的包结构。 所以当我将 XSD 命名空间设置为 java 的包结构时,它工作正常。 我可以序列化和验证 XML。 现在我的问题是:有没有办法解决这个问题? (两个生成工具都有一个 XSD)我是否缺乏对命名空间实际需要的理解? 谢谢 编辑:既然好像有误会,我加了个例子 XSD: targetNamespace = "http://foo.bar/mySubNs/model" C# 模型命名空间:com.foo.mySubNs.model(适合 XSD 命名空间)所有生成的类都将具有通过 MS 代码生成器提供的相同命名空间 Java Modelnamespace : com.foo.myOtherSubNs.model(不同于 XSD 命名空间)生成的类将具有“C# 命名空间”。 因此,这些类将无法编译。 如果我在为 Java 生成代码期间更改命名空间,我可以编译这些类。 到现在为止还挺好。 但是我将无法针对 XSD 验证该 java 类生成的 XML

2021-06-03 14:37:57    分类:技术分享    c#   java   xsd   jaxb   codegen

One XSD, two code generation tools, two namespaces

I have a XSD file, from which I want to generate C# and Java classes as well. I first set the namespace in the XSD according to my C# namespace where my classes resides. The generation (with the Microsoft tools) works fine and also the serialisation works great and I can validat them against the XSD - perfect. Now I want to create java classes with JAXB. The problem is that the classes which are going to be created have a different package structure then the one in C#. So when I set the XSD namespace to the package structure of java, it works fine. I can serialize and validate the XML. Now my

2021-05-13 13:35:53    分类:问答    c#   java   xsd   jaxb   codegen

Apache Spark Codegen Stage grows beyond 64 KB

I'm getting an error when I'm feature engineering on 30+ columns to create about 200+ columns. It is not failing the job, but the ERROR shows. I want to know how can I avoid this. Spark - 2.3.1 Python - 3.6 Cluster Config - 1 Master - 32 GB RAM, 16 Cores 4 Slaves - 16 GB RAM, 8 Cores Input data - 8 partitions of parquet file with snappy compression. My Spark-Submit -> spark-submit --master spark:// --num-executors 4 --executor-cores 5 --executor-memory 10G --driver-cores 5 --driver-memory 25G --conf spark.sql.shuffle.partitions=60 --conf spark.driver.maxResultSize=2G --conf

2021-04-16 18:06:39    分类:问答    apache-spark   pyspark   codegen   janino

如何在带有emxArray参数的C程序中使用由MATLAB Coder代码生成的C库?(How to use C library created by MATLAB Coder codegen in C program with emxArray arguments?)

问题 由codegen创建的C函数(C静态库)采用const emxArray_uint32_T类型的输入参数,并返回emxArray_struct_T类型的值。 就像类型所暗示的那样,输入是uint32的数组,而输出是struct的数组。 我不确定如何在我的C程序中使用此功能。 对于输入,我应该声明uint32_T类型的数组还是使用emxArray_uint32_T类型? 对于输出,由于我不知道输出数组的大小,如何声明结构体数组以接收该函数的返回值? 我把这个问题放在MATLAB答案中,但是还没有运气。 谢谢! 回答1 如果您使用过C ++,则emxArray数据类型类似于std::vector生成的C等效项。 即,这就是生成的代码表示动态分配的数组的方式。 它们存储数据和大小指针以及其他一些细节。 如果查看生成代码的目录,则应该找到一个名为<functionName>_emxAPI.h的文件。 该文件声明了一些实用程序函数,这些函数使构造和销毁emxArray值更加简单。 使用它们创建emxArray值可确保正确初始化所有字段,并使您的代码与对emxArray类型的任何可能更改emxArray 。 在我制作的一个示例中,该示例采用一个uint32值数组并且还返回了这样一个数组,我看到了以下函数: extern emxArray_uint32_T

2021-04-10 04:40:46    分类:技术分享    c   matlab   types   matlab-coder   codegen

How to use C library created by MATLAB Coder codegen in C program with emxArray arguments?

The C function (C static library) created by codegen takes an input argument of type const emxArray_uint32_T and return values of type emxArray_struct_T. As the type suggests, input is an array of uint32 and output is an array of struct. I'm not sure how to use this function in my C program. For the input, should I declare an array of type uint32_T or use the type emxArray_uint32_T ? For the output, because I don't know the size of the output array, how to declare the array of struct to receive the return values from the function? I put the question in MATLAB answers but have not luck.. Thanks

2021-03-30 05:50:35    分类:问答    c   matlab   types   matlab-coder   codegen