code-generation

Is there a Perl script to implement C++ Class get/set member functions?

Hi, I was reading this morning the book The Pragmatic Programmer Chapter 3 on Basic Tools every programmer should have and they mentioned Code Generation Tools. They mentioned one Perl script for C++ programs which helped automate the process of implementing the get/set() member functions for private data members. Does anyone know abou...

SqlMetal generating garbage association names

Why is SqlMetal messing up the Association names. For e.g. in my 'TextMessage' table i have two columns referencing the 'ApplicationUser' table. 'SenderUserId' and 'RecipientUserId' When I run SqlMetal and look at my 'ApplicationUser' class For 'RecipientUserId' it generates: [Association(Name="FK__TextMessa__Recip__72910220", Storage...

What pitfalls to expect from generation of classes from database tables using Reflection.Emit and xsd files ?!

I am playing with class generation ( one class for a table - inheritance etc. not to be considered for now ... ). So I copied shamelessly from here the Reflection.Emit code. Reworked it to be generated per table in a given database and created the files with the following batch call in the Project's bin folder : for /f "tokens=*" %%...

Generate DTOs from Object

Hi there, I want to auto gen some DTOs from some of my existing objects, I was wondering if there already exist a Resharper, DevExpress or VSX open source to use, I need a tool to look into my code and let me choose which properties I want to include in my DTO and then generate a class based on that... ...

How do I create strongly typed dataset during runtime using C# ?

I need to create a strongly typed dataset during run-time for the user preferred target database. Visual studio has massive design time support for creating typed datasets. I need to automate the process of generating typed datasets for the target database at runtime. It should create... 1.) XSD file. 2.) Typed dataset represnting the...

Why a very good PHP framework - Qcodo (or Qcubed - its branch) - is so unpopular?

I am wondering why this framework (QCodo) is almost forgotten and totally unpopular. I've started using it a few years ago and it is the only thing that keeps me with PHP. Yeah ... its development is stuck (that's why there is now more active branch Qcubed) but it is still very good piece of software. Its main advantages: Event driv...

Formatting generated C# code

Duplicate C# to format (indent, align) C# properly I am generating a bunch of code and would like it's initial output (pre ctrl+K, Ctrl+D) to look reasonable. Managing indents is a royal pain and there has to be a utility or class out there I can embed inside of my code generator. I am embedding this into a VS add-in and in a ...

return only Digits 0-9 from a String

I need a regular expression that I can use in VBScript and .NET that will return only the numbers that are found in a string. For Example any of the following "strings" should return only 1231231234 123 123 1234 (123) 123-1234 123-123-1234 (123)123-1234 123.123.1234 123 123 1234 1 2 3 1 2 3 1 2 3 4 This will be used in an email pa...

Unit tests for automatically generated code: automatic or manual?

I know similar questions have been asked before but they don't really have the information I'm looking for - I'm not asking about the mechanics of how to generate unit tests, but whether it's a good idea. I've written a module in Python which contains objects representing physical constants and units of measurement. A lot of the units ...

Code generation tool targeting C++ and C#

I have a set of applications that are being built using a combination of C# and C++. We have a set of shared objects between the two languages, and rather than define each one separately in each language, I would prefer to use a code generation tool. Ideally such a tool would be FOSS, although that's not an absolute requirement. The o...

Download contents of the PHP generated page from another PHP script

I have a PHP script on a server that generates the XML data on the fly, say with Content-Disposition:attachment or with simple echo, doesn't matter. I'll name this file www.something.com/myOwnScript.php On another server, in another PHP script I want to be able to get this file (to avoid "saving file to disk") as a string (using the pat...

Is there a simple preprocessor/code-generator like GNU M4 that can be called from Ant?

I need to maintain some old XSL code and I've discovered that there's a lot of duplication in the XSL files. It looks like there isn't an easy include/import function for XSL which would allow me to move the code to a different file and just include it when needed. This sounds like it could be done with Model Driven Development tools b...

Automatically generate c# class

I often find I am writing a class similar to the following (but with a varying number of members, types of members, etc). Is it possible to do this automatically, easily, and for free? So I would like to provide the parameters "Foo", "int", "apples", "bool", "banana", "Bar", and "clementine" and have the rest of code generated for me. ...

Is there a template or something for generating a switch statement for Java enum in Eclipse?

Is there a template or something for generating a switch statement for Java enum in Eclipse? So that when I got an enum and I want to have a switch with all the values, I didn't have to write all it myself? ...

Is it possible to generate JPA entity classes from a database schema at runtime?

IDEs like Netbeans allow generation of entity classes through a persistence context. If you had access to underlying generation method (not sure if it is an external tool or part of the IDE), could you generate database entity classes dynamically at runtime? The idea being that you could hook into the entity classes using reflection. I ...

Does IronRuby have a CodeDomProvider?

If not is one scheduled? ...

Why does Java code generated to perform an operation run more slowly than an "interpreter loop"?

I have some Java code which performs bitwise operations on a BitSet. I have a list of operations and can "interpret" them by looping over them, but it's important to me that I can perform these operations as quickly as possible, so I've been trying to dynamically generate code to apply them. I generate Java source to perform the operat...

How to debug/break in codedom compiled code.

I have an application which loads up c# source files dynamically and runs them as plugins. When I am running the main application in debug mode, is it possible to debug into the dynamic assembly? Obviously setting breakpoints is problematic, since the source is not part of the original project, but should I be able to step into, or brea...

What does the "Generate Validation Methods" checkbox in the Managed Object Class Generation dialog do?

What does the "Generate Validation Methods" checkbox in the Managed Object Class Generation dialog do? ...

Why generate long serialVersionUID instead of a simple 1L?

When class implements Serializable in eclipse i have two options: add default serialVersionUID(1L) or generated serialVersionUID(3567653491060394677L). I think that first one is cooler, but many times i saw people using the second option. is there any reason to generate long serialVersionUID? ...