Questions tagged [codegen]

Use codegen for questions related to language features or tools which facilitate translating code between languages or creating code from metadata

References

161 questions
5
votes
3 answers

Is it possible to customize Slick code generation to have generated classes extend custom traits?

I'm currently using Slick codegen (version 3.2.0-M1) to generate Slick code for a database. Many of my tables contain the same columns (with the same name and type), and so I would like to have some methods that can perform operations on these…
Jeremy K
  • 81
  • 3
5
votes
1 answer

Visual Studio code generation - Use uppercase type names

I prefer to use actual type names for primitive types instead of their corresponding keywords, such as String instead of string, Int32 instead of int, etc., because I like to have consistent syntax highlight and casing - that is, typenames are…
Balázs
  • 2,841
  • 2
  • 14
  • 33
4
votes
1 answer

Why do gcc and clang generate so much code for std::find?

I entered the following code into godbolt.org, and compiled it with gcc 10.1 and clang 10: #include #include typedef std::vector V; template InputIt myfind(InputIt first, InputIt last, const T&…
4
votes
0 answers

OPENAPI/Swagger codegen AdditionnalProperties extends HashMap : play(jackson) deserialization failure.

My problem is a little bit complicated, I'll try to explain it clearly. To do it, I've done a simple project. I'm using Swagger codegen to generate Java classes from swagger file. In the swagger file, a definition is using additionnalProperties. …
user3560649
  • 81
  • 1
  • 3
4
votes
1 answer

Swagger codegen ignore null fields for POJO classes

I'm making a REST API and I would like to add at the class generation the Jackson annotation to ignore null fields, so I would like to add this annotation onfly for certain classes, not for the hole project. I know that this could be acomplished by…
Florin Lei
  • 421
  • 8
  • 14
4
votes
2 answers

MATLAB to C-code

I am following MathWorks guide to converting MATLAB code to C-code. The first step is to enter %#codegen after every function that I want converted to C-code, however doing so has given me the following prompt on the code below. function…
4
votes
2 answers

OOP Matlab inheritance issue with Matlab coder (Simulink MATLAB Function block)

I have defined an abstract base class measurementHandler < handle which defines the interface for all inherited classes. Two subclasses of this class are a < measurementHandler and b < measurementHandler. I now have a function which should return a…
3
votes
1 answer

RazorGenerator.MsBuild - Achieving harmony from Developer machine to Buildserver

We are currently using the RazorGenerator library to generate pre-compiled views for a project. Up until now we have been using the Visual Studio Extension to handle the generation, with these generated files also being committed to our repository.…
Grant Trevor
  • 962
  • 8
  • 20
3
votes
1 answer

Get a function declaration from another llvm::Module

In my application i have 2 LLVM modules - the runtime one (which contains void foo(int * a) function definition) and executable one (which i'm creating using LLVM C++ API). In my executable module i create int main(int argc, char ** argv) and want…
arrowd
  • 30,130
  • 7
  • 72
  • 96
3
votes
0 answers

JDK14 can't run "java --add-opens"

I'm doing a small project to learn swagger-codegen. When I'm executing "mvn clean install" the next errors appear: Unable to make public boolean java.util.Collections$EmptyMap.isEmpty() accessible: module java.base does not "opens java.util" to…
kinderproc
  • 108
  • 7
3
votes
3 answers

Generate C code with Sympy. Replace Pow(x,2) by x*x

I am generating C code with sympy the using the Common Subexpression Elimination (CSE) routine and the ccode printer. However, I would like to have powered expressions as (x*x) instead of pow(x,2). Anyway to do this? Example: import sympy as sp a=…
Manuel Oliveira
  • 355
  • 2
  • 13
3
votes
1 answer

openapi 3.0 valid minimum and maximum values

I have below schema definition to represent commission amount in my openapi contract. commissionAmount: type: number minimum: -99999.99 maximum: 99999.99 Generated Code: @Valid @DecimalMin("-99999.99") @DecimalMax("99999.99") public…
Sridhar
  • 1,572
  • 1
  • 18
  • 38
3
votes
1 answer

Can graphql codegen automatically generate types for hooks' result data field?

I'm using graphql codegen hooks, which results are of the type: ApolloReactCommon.QueryResult, meaning it's an object that has data, loading and error fields. Most generally, I'll use the data in other components, where I need to define its type. I…
Tbaut
  • 78
  • 5
3
votes
3 answers

swagger codegen --> angular6: rxjs observable compile error

When using to angular 6 and swagger codegen, i'm getting typescript compiler errors related to rxjs: Cannot find module 'rxjs-compat/Observable' I found the…
Datum Geek
  • 753
  • 7
  • 13
3
votes
1 answer

Common sub-expression elimination using sympy

I am trying to learn using sympy to optimize the numerical evaluation of mathematical expressions in C. On one side I know that sympy can generate C code to evaluate one expression as follows: from mpmath import * from sympy.utilities.codegen…
1
2
3
10 11