code-generation

symfony2 propel crud generator

核能气质少年 提交于 2019-12-11 01:57:49
问题 Hi not sure why I cannot find an answer for this already im sure im not the first person that wants to do this. Ive just started using symfony again after 4 years and Im trying to use symfony2 with propel. I have used propel for many yours and get on well with it so would like to continue using it. In symfony 1.x there used to be crud generators I see there still is in symfony2 but only for doctrine. Is there any support and/or plugin available for easy crud generation for propel in symfony2

Compile dynamically generated class at runtime w/o writing to File

北城以北 提交于 2019-12-11 00:55:37
问题 I'm generating java sources with JCodeModel and now want to compile at runtime. But I don't want to write the Java files to disc before. As far as I can see, the dynamic compiling is possible with javax.tools.JavaCompiler (see example) , but it looks like I need the source code for this. Unfortunately I can't find a way to directly get the source code from a JDefinedClass. It seems as if I need to write a JDefinedClass to a File object on disc and read the source afterwards. Is this really

gwt-exporter doesn't generate code (Java to Javascript)

安稳与你 提交于 2019-12-10 23:56:19
问题 I want to generate Javascript code from an existing Java project (original question here). I use GWT in conjunction with gwt-exporter. After I GWT compile, none of my types appear in any of the generated code. I have GameEntryPoint.java package game.client; import org.timepedia.exporter.client.ExporterUtil; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.JavaScriptObject; public class GameEntryPoint implements EntryPoint { @Override public void onModuleLoad() {

Organise Imports Eclipse Method

断了今生、忘了曾经 提交于 2019-12-10 21:08:44
问题 I need to know which method is called inside eclipse when I press " CTRL + SHIFT + O " (Organise Imports), in order to invoke it after a code generation. What the name of this method and where can I find it (Package.Interface) Thanks 回答1: "Organize Imports" action is contributed by org.eclipse.jdt.ui.actions.OrganizeImportsAction , which, in turn, calls org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation . 回答2: Finaly Managed to do it with this code (targetSite is a

ReST Proxy Object Generator

≯℡__Kan透↙ 提交于 2019-12-10 20:29:00
问题 A third party company has written a set of ReST service. I've got all the code working, but in hindsight, to remove some of the leg work, I thought someone might know of a code generator that connects to the ReST service and works out what request and response objects need to be created and generate the code for those. I had a look on google, but didn't see anything suitable (maybe it's called something else). I'm looking for functionality similar to adding a Web Reference in Visual studio,

Associativity and Precedence of Expressions when Generating C / C++ Code?

試著忘記壹切 提交于 2019-12-10 19:59:55
问题 I have written a basic compiler which generates an AST, correctly taking account of the operator precedence in expressions. However, when performing code generation to produce C++ code, I'm unsure of how to handle the use of brackets. For this expression: A - (B - c) The AST below: - / \ A - / \ B C Should correctly generate the previous expression including the parentheses, however if the second operator was an addition operator (for example), the parentheses would be unecessary. I would

Automatically-generated Python constructor

旧时模样 提交于 2019-12-10 19:34:09
问题 I have countless Python classes from various projects from SQLAlchemy (and a couple from Pygame as well), and I recently noticed a pattern in many of them: their constructors always went something like this: class Foo(Base): def __init__(self, first, last, email, mi=""): self.first = first self.last = last self.email = email self.mi = mi ... whereby the only thing the constructor did was to transfer a set of positional arguments into an exactly identically named set of data members,

Netbeans code-gen woes: How to edit auto generated code?

谁都会走 提交于 2019-12-10 19:34:06
问题 Ok. So here's a netbeans issue thanks to auto generated code from GUI designer. I designed a GUI using netbeans UI designer and it was compiled for java 1.6. After I finished my UI, I realized that I was supposed to do this for Java 1.4 and not 1.6. In the effort to downgrade from 1.6 to 1.4, I altered the form properties to use Swing Extensions Library and I got rid of enhanced forloop and generics in my code and I am stuck with this final error: Error method getString in class org.jdesktop

Getting the CodeClass from argument inside CodeAttribute?

青春壹個敷衍的年華 提交于 2019-12-10 19:26:58
问题 I am working on some T4 code generation, for this I need the CodeClass of the type that is passed inside the constructor of BarAttribute. class Baz { } class Bar : Attribute { public Bar (Type type) { } } [Bar(typeof(Baz))] public class Foo { } This is what I have so far inside my T4 Template, I just give the CodeAttribute '[Bar(typeof(Baz))]' to the function: private CodeClass GetType(CodeElement codeElement) { CodeAttribute attribute = (CodeAttribute)codeElement; if (attribute.Name == "Bar"

Sitecore Glass mapper GetItem<TypeName>(guid) always return null

帅比萌擦擦* 提交于 2019-12-10 18:24:25
问题 I saw a related question: Sitecore Glass Mapper always null But unfortunately it does not give a solution for my case. Here goes a code snippet: var db = Factory.GetDatabase("master"); var context = new SitecoreContext(); // the ID of Needed item var g = new Guid("{F21C04FE-8826-41AB-9F3C-F7BDF5B35C76}"); // just to test if it's possible to fetch item using db.GetItem var i = db.GetItem(new ID(g), Language.Current, Sitecore.Data.Version.Latest); // Grab item var t = context.GetItem<Article>(g