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
13
votes
4 answers

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…
Aakash Basu
  • 1,137
  • 2
  • 15
  • 39
12
votes
2 answers

What's the use of Moshi's Kotlin codegen?

I've recently started using Moshi for my Android app and I'm curious to know more about what the annotation @JsonClass(generateAdapter = true) really does. Example data class: data class Person( val name: String ) I'm able to…
Jignesh Shah
  • 389
  • 2
  • 13
12
votes
3 answers

swagger codegen is overwriting my custom code in generated files

I used the swagger codegen to generate jaxrs server side classes and also client side java classes. This is the command I used to generate the classes java -jar modules/swagger-codegen-distribution/target/swagger-codegen-distribution-2.1.2-M1.jar …
Nikhil S
  • 121
  • 1
  • 4
10
votes
2 answers

Unable to find any GraphQL type definitions for the following pointers: src/**/*.graphql

I am using the @graphql-codegen/cli tool to generate typescript types out of my graphql server. Here is my codegen.yml content: overwrite: true schema: "http://localhost:3001/graphql" documents: "src/**/*.graphql" generates: …
TheSoul
  • 2,726
  • 7
  • 30
  • 58
10
votes
3 answers

How do I extract the names from a simple function?

I've got this piece of code: import inspect import ast def func(foo): return foo.bar - foo.baz s = inspect.getsource(func) xx = ast.parse(s) class VisitCalls(ast.NodeVisitor): def visit_Name(self, what): if what.id == 'foo': …
Eddy Pronk
  • 6,030
  • 5
  • 29
  • 53
9
votes
3 answers

how to avoid default method implementation in swagger codegen interface?

I would like to avoid "default" implementation in interface generate by the maven plugin swagger codegen. For example, with petstore swagger : http://petstore.swagger.io/v2/swagger.json I generate interface with maven plugin :
awat
  • 95
  • 1
  • 5
9
votes
1 answer

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…
Ohm
  • 2,077
  • 3
  • 24
  • 62
9
votes
1 answer

FreeBSD Echoprint codegen

I am trying to compile Echoprint codegen on FreeBSD, but fail. But here's what i get when i try to run make or make install > make "Makefile", line 35: Missing dependency operator "Makefile", line 39: Need an operator "Makefile", line 41: Need an…
Ibolit
  • 8,071
  • 5
  • 46
  • 76
8
votes
2 answers

Is adaptive parsing possible in Prolog?

I am attempting to write an adaptive parser in Prolog: in other words, a parser that can modify its own parsing rules at runtime. In order to do this, I'll need to generate new predicates at runtime, but I'm not sure if this is possible. Would it be…
Anderson Green
  • 25,996
  • 59
  • 164
  • 297
7
votes
4 answers

How to append a method to existing class using annotation processing in java / kotlin?

I'm new to annotation processing and code generation. I want to find out how can I perform such operation like appending new method to existing class. Here is an example of what I want to do: Assume that we have a class with with custom annotations…
Andrei Vinogradov
  • 1,637
  • 10
  • 26
7
votes
1 answer

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…
Ashok
  • 6,034
  • 1
  • 34
  • 50
6
votes
1 answer

CoreData Ambiguous reference to member 'id' Xcode 12

I have a coredata entity with an attribute id of type String when trying to reference that attribute from a key path it throws an error let path = #keyPath(User.id) //Ambiguous reference to member 'id' the codegen is set to Class Definition. I…
zombie
  • 4,242
  • 2
  • 19
  • 48
6
votes
1 answer

Generating annotations using JavaPoet

I am writing a code generator using JavaPoet and need to put an annotation on the class For example : package some.package import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.Entity; import…
nvalada
  • 245
  • 1
  • 10
6
votes
1 answer

Swagger-codegen get started

I'm looking to get into Swagger, more specifically, the swagger-codegen tool. I find the provided information, documentation and specs in both github and http://swagger.io/ to be rather confusing (plus, some links to code examples were broken…
5
votes
1 answer

How to make Xcode core data code generated files to be public accessed

I am a bit confused with new codegen functionality. While developing, you could lookup all files that exist in projects. But not with codegen. However, it worked well. But it doesn't fit new framework-oriented programming paradigm. Scenario: I have…
gaussblurinc
  • 3,476
  • 8
  • 31
  • 61
1
2 3
10 11