code-generation

Generate C# code for Oracle table

I have this XML for a table structure in Oracle (export option in PL/SQL developer). How can I generate code in C# for get entity class? <?xml version="1.0" encoding="utf-8"?> <ROWDATA> <ROW> <Name>ID_TRANSACCION</Name> <Type>NUMBER(12)</Type> <Nullable></Nullable> <Default></Default> <Comments>Identificador unico ...

Intellisense in the code based on custom config sections

In VS.NET 2008 / .NET Framework 3.5, Is there anyway to generate intellisense based on the custom config sections? I've got a config section looks like this: <custom> <key name="NameGoesHere" /> <key name="SecondNameGoesHere" /> </custom> Currently this is tied to a custom config section class so I call it like ...

XSLT Append to Result Document

Hi, I have an XSLT script that I use for code generation where I process multiple input XML files, and output the files to Javascript code. For each xml input file, I output one Javascript file. So, I would have the following files/transformations occuring: view1.xml -> view1.js view2.xml -> view2.js ... Now I have a requirement ...

Java Image Editor which renders output as source code?

Alex explained what I'm looking for much better than I have: You want an existing program that allows you to draw a picture, captures what you do as you draw, and writes each action as a Java command. When you click the "Drawl Oval" tool and click at 0,0 and then at 50,50, it would generate the line g.drawOval(0,0,50,50...

How can i make a template of my Visual Studio Solution files?

Hello, i use n-tier programing on c# and i want to make a template to generate code easily (this is .cs, .csproj and .sln) my question is, how can i make it? and if exist a software, which one you recomend??? it will be very useful your opinion ...

How do I generate C# code from WADL files?

I am looking for a code generator than can generate C# code to access RESTful web services described by WADL files in a way similar to how wadl2java works. Doing som searching I came across the rest-api-code-gen project on Google Code, but although the latest source does in fact support C#, the REST Describe & Compile demo site does not...

Adding an attribute to a class by using properties editor

Visual studio allows you to design component visually. For example, you are designing a windows form. You change its property in the properties editor. The IDE will generate the code in a partial class in xx.designer.cs file. We can customize this behavior by changing the UITypeEditor for the properties. The question now is , Can we ex...

Write Java Method Signature with Annotated paramaters with JDT

Hi, I am writing an eclipse plug-in which generates code. I am leveraging eclipse jdt to gen out classes, fields, and methods. One of the requirements I have is to generate methods with annotated paramaters... public returnType foo(@someAnnotation int id) { ..... ..... } Does anybody know how to write out the @someAnnotat...

Java garbage collection of run-time generated code

I'm looking at the possibility of generating Java byte code at run time (hopefully directly in memory rather than via class files, though I imagine that won't make a difference to my question). I understand this can be done, the question is, does the garbage collector sweep up no-longer-used code? I remember some years ago seeing it cla...

Is there an elegant way to make a EnvDTE.CodeProperty ReadOnly?

I need to switch my CodeProperty between read only and read / write. I can achive this with Edit points and ReplaceText so: if(readOnly) { CodeFunction setter = codeProperty.Setter; TextPoint start = setter.StartPoint; TextPoint end = setter.EndPoint; start.CreateEditPoint().ReplaceText(end, string.Empty, 0); } else { CodeFunction ...

What's the project of choice for compiling GPB to AS3?

Inside a Java project I use Google Protocol Buffers (GPB) for serializing my objects. I can use the same .proto files in auxiliary Python code, which is great. Now I'm adding a Flex client to the whole thing and I'd like to use the same .proto files once more. It seems there's a couple of projects out there which compile .proto files to...

Best practice for writing a code generator

I'm about to writing an app which will be making use of the state and command patterns. The States will act as a facade to the commands. There are 7 states and about 50 Commands which not all the states can execute, any method for which the command cannot be executed will throw an execption, otherwise It will create the command, execute...

Should/can one generate a database schema of ones classes?

I have designed some classes using Visual Studio class diagramming. Now I would like to persist this data using ORM and maybe other persistence mechanisms. I am wondering if there is a way to generate the SQL based on the properties in my classes, since they fairly well represent the database structure needed. This would save me a lot of...

Are there any libraries for generating Python source?

I'd like to write a code generation tool that will allow me to create sourcefiles for dynamically generated classes. I can create the class and use it in code, but it would be nice to have a sourcefile both for documentation and to allow something to import. Does such a thing exist? I've seen sourcecodegen, but I'd rather avoid messin...

Silverlight - Support For Dynamic Code?

I'm trying to understand a little about the relationship of server-side code to client side code in Silverlight. I would anticipate that you can't simply 'eval' a string and have new code, but could you load an assembly on the server side and include it with the Silverlight code that is sent down to the client? I'm a complete 'noob' wh...

Generating all possible trees of depth N?

I have several different types of tree nodes, each of which may have anywhere from 0 to 5 children. I'm trying to figure out an algorithm to generate all possible trees of depth <= N. Any help here? I'm having trouble figuring out how to recursively walk the tree given that each change I make to a node may expose new subtrees (or remo...

Dynamically loading and unloading a a dll generated using CSharpCodeProvider

I have an app that uses some code scripts to generate dll's at run-time and invoke them as needed and have run into some questions before i go ahead and code it ! Is it possible to unload them from memory when not needed ? If not - what would be the performance impact of loading them into separate appdomains and invoking the calls using...

Do any Java libraries use annotations for code generation?

Is anyone aware of a library that uses the the techniques (annotations and classworking) described in this article for automatically generating the standard Object methods toString(), equals() and hashcode() for standard java classes? ...

Using reflection for code gen?

I'm writing a console tool to generate some C# code for objects in a class library. The best/easiest way I can actual generate the code is to use reflection after the library has been built. It works great, but this seems like a haphazard approch at best. Since the generated code will be compiled with the library, after making a change I...

function passed as template argument

I'm looking for the rules involving passing C++ templates functions as arguments. This is supported by C++ as shown by an example here: #include <iostream> void add1(int &v) { v+=1; } void add2(int &v) { v+=2; } template <void (*T)(int &)> void doOperation() { int temp=0; T(temp); std::cout << "Result is " << temp << std::e...