code-generation

Axis2 generated Stubs are thread-safe?

有些话、适合烂在心里 提交于 2019-12-30 10:13:09
问题 Are the Stubs generated by WSDL2JAVA (using XMLBeans binding option) through Axis2 1.5.4 thread-safe? Actually I have created one Stub for a Web Service that I am invoking through multiple threads. I have configured my own MultiThreadedHttpConnectionmanager and set the HTTPConstants.REUSE_HTTP_CLIENT as well but I am seeing some NullPointerExceptions in stub._getServiceClient().cleanupTransport that I call after each invocation. Sometimes the threads hang too. At the same time I noticed that

Automatically parsing PHP to separate PHP code from HTML

一曲冷凌霜 提交于 2019-12-30 09:43:10
问题 I'm working on a large PHP code base; I'd like to separate the PHP code from the HTML and JavaScript. (I need to do several automatic search-and-replaces on the PHP code, and different ones on the HTML, and different on the JS). Is there a good parser engine that could separate out the PHP for me? I could do this using regular expressions, but they're not perfect. I could build something in ANTLR, perhaps, but a good already existing solution would be best. I should make clear: I don't want

Emulating lambdas in C?

家住魔仙堡 提交于 2019-12-30 09:38:05
问题 I should mention that I'm generating code in C, as opposed to doing this manually. I say this because it doesn't matter too much if there's a lot of code behind it, because the compiler should manage it all. Anyway, how would I go around emulating a lambda in C? I was thinking I could just generate a function with some random name somewhere in the source code and then call that? I'm not too sure. I haven't really tried anything just yet, since I wanted to get the idea down before I implement

How to generate Spring WebMVC CRUD API

被刻印的时光 ゝ 提交于 2019-12-30 03:33:07
问题 What I want to do is to create a full Spring WebMVC CRUD API from database tables/Hibernate JPA entities, into an existing Maven Web Project. What I want generate, to be precise: Spring WebMVC controller (mapping&implementation) The JPA entity (if not given) - ofc. using the standard generation built in to most IDEs Spring Data JPA repository Optionally modifying some other files (f.e. adding the entity to existing persistence.xml) Is there a project for this? What would be the best way to

Compiler output language - LLVM IR vs C

牧云@^-^@ 提交于 2019-12-30 03:09:08
问题 For writing a compiler, what are the advantages and disadvantages of using LLVM IR vs C for a target language? I know both are used, and I imagine that the final machine code would be similar if I were to use clang to compile the C. So what are other things to consider? 回答1: I've used LLVM IR for a few compiler back ends and have worked with compilers that use C as a back end. One thing that I found that gave the LLVM IR an advantage is that it is typed. It is hard to make completely ill

Using Roslyn to parse/transform/generate code: am I aiming too high, or too low?

萝らか妹 提交于 2019-12-29 18:42:02
问题 (What I'm trying to do is work around the Application.Settings/MVVM problem by generating an interface and wrapper class from the vs-generated settings file.) What I'd like to do is: Parse a class declaration from file Generate an interface declaration based on just the (non static) properties of the class Generate a wrapper class which implements this interface, takes an instance of the original class in the constructor, and 'pipes' all the properties through to the instance. Generate

Using Roslyn to parse/transform/generate code: am I aiming too high, or too low?

谁说胖子不能爱 提交于 2019-12-29 18:40:34
问题 (What I'm trying to do is work around the Application.Settings/MVVM problem by generating an interface and wrapper class from the vs-generated settings file.) What I'd like to do is: Parse a class declaration from file Generate an interface declaration based on just the (non static) properties of the class Generate a wrapper class which implements this interface, takes an instance of the original class in the constructor, and 'pipes' all the properties through to the instance. Generate

Sitecore Glass Mapper always null

时光总嘲笑我的痴心妄想 提交于 2019-12-29 08:41:40
问题 I am using Sitecore Glass Mapper for a new project I'm setting up. We are using Sitecore 7.2, latest version of Team Development for Sitecore (TDS) code generation and the latest version of glass. The code I am trying to execute: var b = new SitecoreContext(); var c = b.GetCurrentItem<T01_Homepage>(); b is not null. c is null. var d = b.GetItem<T01_Homepage>("path") d is null. I added my assembly in GlassMapperScCustom: public static IConfigurationLoader[] GlassLoaders(){ var attributes = new

How to check for the presence of an OrderBy in a ObjectQuery<T> expression tree

余生长醉 提交于 2019-12-28 12:42:34
问题 I'm using T4 for generating repositories for LINQ to Entities entities. The repository contains (amongst other things) a List method suitable for paging. The documentation for Supported and Unsupported Methods does not mention it, but you can't "call" Skip on a unordered IQueryable . It will raise the following exception: System.NotSupportedException: The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'.. I

What should be modified to change the URL of a web service in C#?

☆樱花仙子☆ 提交于 2019-12-28 04:27:07
问题 I have one problem and it is some time ago I have added a Webservice proxy class into my application by copying all the generated code (copy paste the text of the .cs content). And it worked! But now I need to change the URL used by this web-service proxy class and I am not sure what and where to change in the code. I would appreciate if you can give me a clue that can guide me to find the right place so that I can update the url of the web service. 回答1: You should change the URL using web