code-generation

Adding my template to the list of code generation items in Studio 2010

I have taken the POCO tt templates that can be used in Studio 2010 with Entity Framework and modified them to better fit my needs. I have added a few things to make testing easier. Now I want to be able to right click on the entity framework design surface, choose "Add Code Generation Item" and select my templates instead of the built ...

Can CodeDom add Source Code Files to a Project?

I have been using CodeDom to do some code generation. It works great, but I haven't found a way to include the generated source code files in a project. I started using T4 and the T4Toolbox to generate code because it supports integration with project files. Does anyone know if CodeDom supports this functionality too? I'd consider taki...

How to trace all method invocations from a class?

Hi, I want to trace all invocations of methods from a Foo class. Another class that would override all the methods from Foo like this... @Override public void blah() { System.out.println("blah()"); super.blah(); } ...would do - but do I really need to override them all (over 100 methods)? Can this be done in some smarter wa...

T4 code generation without Visual Studio 2010?

Is it possible to run T4 code generation without needing Visual Studio 2010? Basically I have to build an in house ORM (don't ask..if I had a choice I wouldn't). I was planning to use subsonic as a base but change some things and how they work. However my main question is can I run T4 from an external application that I write, so I can u...

VsAddin or T4 for code generation (VS 2008)

I have build an Addin for code generation (C#, VS 08) for our team. The addin creates a new menu entry if i click on a file in the solution explorer. There i can choose a destination test project where the 2 files are generated to. For the code generation process i need informations from the selected item in the solution explorer (like...

Form generation/validation libraries in Python

I'm a developer in Python coming from a PHP background. In PHP most frameworks included a decent form generation/validation API (Zend and CakePHP come to mind). At my new company we try to stay away from Django and use Werkzeug extensively. I've looked at FormEncode and Formular. Formular seems better to me, but there must be stuff...

is it possible to markup all programming languages under object oriented paradigm using a common markup schema?

i have planned to develop a tool that converts a program written in a programming language (eg: Java) to a common markup language (eg: XML) and that markup code is converted to another language (eg: C#). in simple words, it is a programming language converter that converts program written in one language to another language. i think i...

Java code generation

What are the leading frameworks for java code generation? I am not looking for a DB or app generation tool. I have a skeleton of a class, and I need to generate it with different dynamic parts for different use cases. The majority of the class is identical, hence I want to run code that generates different flavors of the class. Anyone ...

functions vs repeated code

Hey everyone, 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 woul...

Why do I get this syntax error in my code generating program?

I want to generate some lines of Perl code by using file handling in Perl, for example: open(FILEHANDLE, ">ex.pl") or die "cannot open file for reading: $!"; print FILEHANDLE "use LWP::UserAgent;" .... .... some code is here .... print FILEHANDLE "my \$ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; r...

source code(COBOL) generation using a java program

I am going to write a code generator to generate a COBOL program using some input file of records. I am going to implement it as java program. I think XML/XSL approach would not be appropriate in this case, because the input file is not in XML format. I think a template processor would be helpful, because some parts of it can be generat...

What is the best free Code Generators for ASP.net C#? and Best Snippet Tool?

What is the best free Code Generators for ASP.net C#? I know it is opinion based but I would like to have a list and I searched and found a few and some that said they were free but ended up only being a free trial. Also what is the Best Snippet Tool to add snippets to Visual Studio 2008? I can not get the one I found to work since I ...

Creating Java Classes from Ontology

Hi, I have an ontology file (in RDF) which expresses the entities in the app that I am writing. I am using Jena, and can access the Concepts and create/access the resources by directly manipulating triples. To make things easier, I created a set of Java classes, one for each type of resource in my ontology, keeping in mind their inherit...

Using types in a T4 tempate that exist in the same project as the template

I'm working on my first T4 code generation tool to add some Stored Procedure helper code to my project. I've created custom types (e.g. StoredProcedure and StoredProcedureParameter to help with my code generation and have included the assembly and namespace references in my code: <#@ template debug="false" hostspecific="false" language...

how to handle db schema updates when using schemabinding and updating often

I'm using a MS SQL Server db and use plenty of views (for use with an O/R mapper). A little annoyance is that I'd like to use schema binding update with scripts (to deploy on servers and put in a source control system) but run into the issue that whenever I want to e.g. add a column to a table, I have to first drop all views that re...

Generating Runtime code(structs,classes) in C#

Hello, I need to generate structs and classes at run time in C#(might be in CLI) managed environment. Suppose I have all data and all data types associated with those data memebers of some class/struct. Now I need to generate structs/classes at runtime and after that I need to map data inside those runtime created structs fields. e.g I...

HTML generation problem

I'm trying to generate a small part of the page using jquery which is generating in the wrong matter even though the code looks solid. $('#stages').html(""); var stage = $("#stages"); var L = $('<h2></h2>').attr('id', 'startachat').append('Who do you wish to connect to?'); stage.append(L); var k = $('<table></table>').at...

antlr to generate python code is feasible?

the requirement is to generate several classes which inherits the base ORM class, and this class may have several static properties like columns and other things, and little bit python expressions that can be eval at run time for small business logic, my question is, it is feasible to use antlr for such kind of things, as I'm not much f...

Data Access using ASP.NET, what is the best?

I have been asking my self this question from the time i started workin in the software development field, What is the best way to access data? Which gives the best performance? Which is the best for maintainability? There are lots of solutions to deal with database in the Asp.Net web app, Entity framework 4.0 Classes generator usin...

Pragmatic programmer code generation exercise

I am reading the The Pragmatic programmer and doing the following exercise in .net world (Chapter 3 - Code Generators) The Exercise "Write a code generator that takes the input in Listing 1, and generates output in two languages of your choice. Try to make it easy to add new languages." Listing 1 # Add a product # to the 'on-order' ...