code-generation

How to use a custom strategy with the jOOQ code-generator and Maven?

两盒软妹~` 提交于 2019-12-10 01:56:54
问题 With jOOQ, I may want to combine using the jOOQ code generator with Maven and a custom generator strategy. It looks as though this can be done as such (leaving out irrelevant parts): <plugin> <groupId>org.jooq</groupId> <artifactId>jooq-codegen-maven</artifactId> <version>2.2.2</version> <!-- The plugin should hook into the generate goal --> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <generator> <name>org.jooq.util

how to generate constructors in eclipse

删除回忆录丶 提交于 2019-12-10 01:50:32
问题 I have a class A and B.M extends A. Now I want a create a constructor of B using code generation option of eclipse which accepts parameters and set values of all fields of B (I mean it should also set fields inherited from A). Is there any shortcut to generate such code in eclipse? 回答1: Right click in the editor and click "Source -> Generate Constructor using Fields". You can select the super constructor to use and also select instance variables to add to the constructor. 回答2: Eclipse (3.5)

Meta language to code generate packed structs for ANSI-C and C# Structs

青春壹個敷衍的年華 提交于 2019-12-09 23:14:38
问题 I'm trying to find a "meta language" that can be used to define a structure and get/set code for members. The catch is that the structure already exists in code, and this "meta language" would serve as bit-for-bit replacement of the original hand-coded structure to allow the headers describing the structures to be generated. The point is that the structures are used as part of a protocol between a C# application and an embedded device (not linux based, think smaller and more constrained like

Generate and parse Python code from C# application

偶尔善良 提交于 2019-12-09 18:01:28
问题 I need to generate Python code to be more specific IronPyton. I also need to be able to parse the code and to load it into AST. I just started looking at some tools. I played with "Oslo" and made a decision that it's not the right tool for me. I just looked very briefly at Coco/R and it looks promising. Does anyone use Coco/R? If you did what's your experience with the tool Can you recommend some other tool? 回答1: The IronPython implementation itself includes a parser and an AST representation

functions vs repeated code

时光怂恿深爱的人放手 提交于 2019-12-09 16:11:49
问题 I am writing some PHP code to create PDFs using the FPDF library. And I basically use the same 4 lines of code to print every line of the document. I was wondering which is more efficient, repeating these 4 lines over and over, or would making it into a function be better? I'm curious because it feels like a function would have a larger overhead becuse the function would only be 4 lines long. The code I am questioning looks like this: $pdf->checkIfPageBreakNeeded($lineheight * 2, true); $text

Code-Generating a Winforms form from a C# POCO Class

巧了我就是萌 提交于 2019-12-09 12:57:34
问题 Is there some open source code already written out there somewhere that will accept a class with properties and validation attributes, and output a Windows form with controls that correspond to those properties? Examples: public bool IsRed { get; set; } produces a checkbox with an Is Red? label. public int NumberOfDays { get; set; } produces a text box with a label called Number of Days and restricts input to numeric characters only. [Required] public Color Color { get; set; } where Color is

Is there a Java library to generate class files from an AST?

余生长醉 提交于 2019-12-09 09:16:02
问题 This page describes how I can use the code generator in javac to generate code given that I can build an AST (using a separate parser which I wrote). The technique involves editing javac's source code to basically bypass the Java parser, so that one could supply his/her own AST to the code generator. This could work, but I was hoping to do it in a slightly cleaner way. I want to include the code generating part of javac as a library in my project so I can use it to generate code, without

Visual Studio 2015 not automatically adding asterisk for multiline comments

不打扰是莪最后的温柔 提交于 2019-12-09 02:20:09
问题 When typing multi-line comments Visual studio used to add an automatic asterisk to each new line of the comment as I press enter(apparently 2015 does not do this anymore). I really liked this. As of right now though, if I type "/*" and enter, Visual studio does not try to autocomplete it at all. In fact, it even lets me end the comment with "*/" , too, instead of doing it for me. So my question is: is anyone else experiencing this? How do I get the original functionality back, so each new

Generate classes from XSD

怎甘沉沦 提交于 2019-12-09 01:23:21
问题 You are doing contract first development of web services in a SOA world. After editing an XSD file, what is the best way to automatically (re)generate .net classes from the XSD files? 回答1: xsd.exe will generate new classes for you. Depending on how Visual Studio is set up, adding xsd.exe to "Properties / build events / post-build events" will force a regeneration every time you do a rebuild. 回答2: If using .net 1.1 or 2.0, xsd.exe. If using 3.0 or 3.5, svcutil.exe. If you don't mind using non

Do you use code generation tools?

被刻印的时光 ゝ 提交于 2019-12-08 23:42:33
问题 Do you use code-generation tools (aside from those used to generate proxies and from designers built-in to visual studio)? What part(s) of your application do you generate? Do you typically roll your own generator? If so, what type of generator do you write (asp templates, coddom etc.). If not, what 3rd party tools do you use? I am currently working on a few different projects wich all use a custom code-generator that handles everything from generating the database structure, business