I have several constants in a PHP application I'm developing. I've defined a Constants class and the defined the constants as const VAR_NAME = value; in this class. I would like to share these constants between my JavaScript and PHP code. Is there a DRY (Don't Repeat Yourself) mechanism to share them?
class Constants {
const RESOU...
I have started working on some code left behind by previous developers, and I'm having a strange issue with it. The code is C# in ASP.NET 2.0, and I'm using ReSharper 4.1 in Visual Studio 2008.
This code compiles just fine and works in my Web app, but ReSharper is barfing on it with the message, "Cannot resolve symbol '<name of class he...
My question seems easy but is little more theoretical than it looks. There are Code Generation software or application building software that gets done without the use of a programming language. Application like VE Server and VE Designer from Intelliun should accomplish this task. My question is, in reality have someone out there trac...
Given a Dataset XSD file, is it possible to generate java classes, that don't make use of System.Data?
I've tried running a test using JAXB's XJC tool, but it doesn't produce anything terribly useful.
Update: I've tried XmlBeans also, following Fernando's suggestion, and it generates something similar to the XJC output - that is, class ...
I am specifically looking for JPA code generation technique
First, what are all the project could generate JPA complaint code? (Eg. HibernateTools)
Second, I would also like to customize the code generation utility, as it has to compliant to our corporate standards.
If not, what are all the framework available to generate java code us...
I am looking for one or more resources on best practices for c# codegen (writing c# via code at runtime).
...
I wish to set an attribute on a public property in .NET, however I do not have access to the explicit property itself, as this has been code generated in another file.
I have this field:
public virtual string Name { get; set; }
I wish to set this:
[ValidateNonEmpty("Name is required", ExecutionOrder = 1)]
public virtual string Name ...
Can I get Visual Studio to transform the built-in aliases into the System types? For example, if I define the following interface
public interface IExample
{
Int32 DoWork(String input);
}
and use VS to automatically generate the interface, I get the built-in types.
public class Demo : IExample
{
public int DoWork(string input...
I can find a direct table foreign key in c# like:
foreach (ForeignKey key in CurrentTable.ForeignKeys) {
Console.WriteLine("FK:" + key.ReferencedTable);
}
The classic representation for a many to many relationship is achieved via an intermediate table that has a one to many relation to the two principa...
CodeSmith has a nice StringUtils class that can be used to change database object names to singular, plural, camel case, pascal case, etc... Very useful for creating data access layers in their code generation tool.
I'm trying to port some CodeSmith templates to the T4 template files used by Visual Studio, and I'm trying to find a si...
How can I garble javascript code before sending it to client side. I don't want to expose functionalities. The code is already compressed using jsmin.
...
I have several web services in the same package that throw a custom exception. The problem is that the generated exception class contains a reference to the web service that generated it, so I can't use the same exception name across multiple web services. Is there a way to make Axis2 generate the exception classes inside the web servi...
If you have a simple enough schema with basic boolean string fields, how to go about writing a code generator in C++.
If you ever wrote , how did you start. Articles/recommendation welcome.
EDIT: Note that this is not the standard CORBA idl.
...
Is it possible via script/tool to generate a delete statement based on the tables fk relations.
i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the FK relations for me ?
(btw I...
Is anyone using the built-in code generation provided via text templates (using .tt files)? If so what are the main pro's/con's over other solutions like codesmith?
...
In an application scaffolding project on which I'm working, I'm trying to decide whether to use Oslo, T4 or CodeDom for generating code. Our goals are to keep dependencies to a minimum and drive code generation for a domain driven design from user stories. The first step will be to create the tests from the user stories, but we want the ...
I'm working on a framework in PHP, part of this frameworks job is to write SQL code to generate new MySQL columns.
What is the most elegant way to pass in a bunch of parameters for a column and then turn that into SQL code? As an example here is some YAML I have, that specifies parameters for creating a varchar column:
- type: characte...
It is useful to have skeleton or template files that you can just copy and use as a basis for a new script or app.
For example, I use the following ones (emacs with the auto-insert module automatically opens a copy of the appropriate skeleton file when I create a new file).
Perl:
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
my...
I am currently developing a small project of mine that generates SQL calls in a dynamic way to be used by an other software. The SQL calls are not known beforehand and therefore I would like to be able to unit test the object that generates the SQL.
Do you have a clue of how would be the best approach to do this? Bear in mind that ther...
I am just getting into the idea of code generation for repetitive coding tasks and have seen both of these approaches. I've seen the XSLT approach in an Apress book Code Generation in Microsoft .Net and have read about the T4 approach in relation to what's new in the MVC framework.
What kind of projects is each method better suited for?...