code-generation

Minify / Obfuscate PHP Code [closed]

别等时光非礼了梦想. 提交于 2019-11-26 16:59:06
问题 I use Haxe to generate PHP code. (This means you write you code in the Haxe language and get a bunch of php files after compiling.) Today a customer told me that he needs a new feature on a old project made with Haxe. He also told me that he altered some small things on the code for his own needs. Now I first have port his changes to my Haxe code and then add the new feature, because otherwise his changes will be overwritten by the next time I compile the project. To prevent that this happens

Comparison of XSD Code Generators [closed]

蓝咒 提交于 2019-11-26 16:58:26
I'm doing some research in code generation from xsd schema files. My requirements: Must generate C# 2.0 code (or above), using generic collections where needed. Must generate comments from the xsd comments Must generate fully serializable code. Should be able to generate resuable basetypes when generating from multiple xsd's with the same includes. (see also my other questions: How can I generate multiple classes from xsd’s with common includes? and How can I generate comments from xs:documentation tags in a wsdl? I have found the following options: Use xsd.exe (supplied with the SDK and

How can I create database tables from XSD files? [closed]

a 夏天 提交于 2019-11-26 16:04:14
I have a set of XSDs from which I generate data access classes, stored procedures and more. What I don't have is a way to generate database table from these - is there a tool that will generate the DDL statements for me? This is not the same as Create DB table from dataset table , as I do not have dataset tables, but XSDs. Commercial Product: Altova's XML Spy . Note that there's no general solution to this. An XSD can easily describe something that does not map to a relational database. While you can try to "automate" this, your XSD's must be designed with a relational database in mind, or it

Naming Conventions For Partial Class Files

浪子不回头ぞ 提交于 2019-11-26 15:17:35
问题 I'm generating the bulk of my ASP.NET MVC scaffolding code. All generated files are partial classes which use standard naming conventions. For example, my employee controller file is named EmployeeController.cs. If I wish to extend the EmployeeController with custom, non-generated logic, I create a second partial class file named EmployeeControllerCustom.cs. I separate the custom and generated logic into two different files so the next time I generate the EmployeeController my custom changes

Can I define properties in partial classes, then mark them with attributes in another partial class?

情到浓时终转凉″ 提交于 2019-11-26 15:16:22
问题 Is there a way I can have a generated code file like so: public partial class A { public string a {get; set;} } and then in another file: public partial class A { [Attribute("etc")] public string a {get; set;} } So that I can have a class generated from the database and then use a non-generated file to mark it up? 回答1: I've seen something like this done in an article by Scott Guthrie (near the end of it) - didn't try it myself, though. http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net

How to make CMake reconfiguration depend on custom file?

你离开我真会死。 提交于 2019-11-26 14:43:20
问题 I have a project under CMake with some files generated with python generator from XML files. I cannot specify all files generated by this generator in CMakeLists.txt so I use file globbing for this. The problem is that when I update my XML files or generator sources (which are in the same repository) I would like to have my build system reconfigured so changed files are taken into account when rebuilding the code (via make for example). Is it possible to make CMake treat some files like it

Is it possible to programmatically compile java source code in memory only?

拥有回忆 提交于 2019-11-26 12:58:11
问题 I have found many references explaining how to programmatically compile a Java class using the JavaCompiler class: JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); int result = compiler.run(null, null, null, \"a_file_name\"); However, I would like to know if there is an open source library that let me compile source code generated programmatically (therefore without a src file being involved) and generate some byte code in an output stream (without generating a class file in the

How can I see the machine code generated by v8?

删除回忆录丶 提交于 2019-11-26 12:39:52
问题 Does anybody know how I can see the actual machine code that v8 generates from Javascript? I\'ve gotten as far as Script::Compile() in src/api.cc but I can\'t figure out where to go from there. 回答1: I don't know how to invoke the disassembler from C++ code, but there is a quick-and-dirty way to get a disassembly from the shell. First, compile v8 with disassembler support: scons [your v8 build options here] disassembler=on sample=shell Now you can invoke the shell with the "--print_code"

How to emit and execute Java bytecode at runtime?

a 夏天 提交于 2019-11-26 12:08:58
问题 I am writing an interpreter in Java for a domain-specific language with some scripting capabilities. I have already implemented a parser and now need to do a back end. To this end I am considering either to write my own interpreter (either working with abstract syntax trees or with some custom bytecodes) or target JVM (emit and execute Java bytecode at runtime). Could someone with more experience in this area say how feasible is the approach of targeting JVM and what libraries would you

Should I store generated code in source control

折月煮酒 提交于 2019-11-26 11:43:36
This is a debate I'm taking a part in. I would like to get more opinions and points of view. We have some classes that are generated in build time to handle DB operations (in This specific case, with SubSonic, but I don't think it is very important for the question). The generation is set as a pre-build step in Visual Studio. So every time a developer (or the official build process) runs a build, these classes are generated, and then compiled into the project. Now some people are claiming, that having these classes saved in source control could cause confusion, in case the code you get, doesn