code-generation

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

大憨熊 提交于 2019-12-23 02:45:13
问题 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 manual SQL typing, and give me a nice start. I didn't start with the database model because I want to have my persistence decoupled from the actual "domain

How to retrieve metadata for return values of an sql server stored procedure

风格不统一 提交于 2019-12-23 02:42:40
问题 I want to analyze an SQL Server stored procedure from .NET code to retrieve metadata for the data/columns it returns (not OUTPUT parameters). Like when you drag/drop a sp on a DataSet i VisualStudio and it automatically generates columns. It could be useful for me for some code generation I'm testing out. The procedures contains simple select statements like SELECT a,b FROM c and I'd like to get metadata about a and b. 回答1: You can use SET FMTONLY ON (and execute it) - but this is a bit hit-n

Generating simple CRUD stored procs

前提是你 提交于 2019-12-22 18:40:35
问题 I'm working on a project that is subject to certain corporate standards relating to SQL implementation. Specifically, that all SQL Server content be accessed only via stored proc. (No ORM or LINQ.) 80% or more of our needs can be handled through the basic CRUD (CREATE, READ, UPDATE, DELETE) type of procedure that should be fairly simple to generate. However, I've been unsuccessful so far in locating an existing tool that will generate these fairly simple "base" stored procedures. So, can

Play framework auto javascript and CSS minifier

安稳与你 提交于 2019-12-22 18:15:14
问题 Does anyone know a good play plugin that automatically minifies javascript and css to attach to a production play server? I've found this one, but I guess there are more out there: https://github.com/greenlaw110/play-greenscript The main problem I see here is that the having javascript being generated from the play side, the plugin would have to detect JS code that gets generated on the fly. Mainly because I'm writing values directly into the javascript like: function foo${handlerID}(someVar)

drools programmatically generate a fact model

霸气de小男生 提交于 2019-12-22 12:38:12
问题 I need to generate an enormous fact model using an ontology external to drools. Now, I could certainly write a script/program to pull this off. My approach would be to generate a java bean for each ontology class which contains the appropriate fields, methods, and references to other java objects based on ontological relationships (probably in a map). My question is whether drools has a more elegant way to approach this problem. I figure it must be a common problem that the fact model is

drools programmatically generate a fact model

半腔热情 提交于 2019-12-22 12:38:10
问题 I need to generate an enormous fact model using an ontology external to drools. Now, I could certainly write a script/program to pull this off. My approach would be to generate a java bean for each ontology class which contains the appropriate fields, methods, and references to other java objects based on ontological relationships (probably in a map). My question is whether drools has a more elegant way to approach this problem. I figure it must be a common problem that the fact model is

Code generating JUnit based on Abstract Syntax tree walk

馋奶兔 提交于 2019-12-22 12:25:08
问题 Assuming I have the following class and method: package generation; class HelloWorld { public boolean isEven(int val) { if ( (val % 2) == 0) return true; else return false; } } Assume I want to generated the following JUnit test: package generation; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; public class HelloWorldTest { @Test public void testIsEven() { HelloWorld h = new HelloWorld(); assertTrue(h.isEven(2)); assertFalse(h

T4 Output to String

醉酒当歌 提交于 2019-12-22 11:29:08
问题 I am new to T4, I want to generate CRUD Stored Procedures, Data access layer, output to string, I am trying to create kind of webservice api to be useful to other programmers also, just input the data, and download zip file. I have searched a lot but could not find a way to generate output to string, is it possible, any articles, links, a bit of code if possible would be helpful. Yes, we can also use StringBuilder, but The question is "T4 Output to String" please all type of answers are

Do you generate your data dictionary? [closed]

三世轮回 提交于 2019-12-22 05:28:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Do you generate your data dictionary? If so, how? I use extended procedures in SQL Server 2005 to hold onto table and field information. I have some queries that create a dictionary out of them, but it's ... meh. Do you have a particular query or tool you use? Do you generate it off of your database diagrams?

Generate Fortran subroutine with SymPy codegen for a system of equations

こ雲淡風輕ζ 提交于 2019-12-22 04:13:08
问题 Building on a former example that I've found here, I try to find out how to generate a Fortran code that correspond to a specific form that I need to stick to. The required FORTRAN code will look like this (it is based on the FitzHugh–Nagumo model): SUBROUTINE FF(NE,U,PAR,F) ! ---------- -- ! Define the nonlinear term IMPLICIT NONE INTEGER, INTENT(IN) :: NE DOUBLE PRECISION, INTENT(IN) :: U(NE),PAR(*) DOUBLE PRECISION, INTENT(OUT) :: F(NE) DOUBLE PRECISION u,v,e,a1,a0 u=U(1) v=U(2) e=PAR(1)