code-generation

XML Schema to C++ Classes [closed]

余生长醉 提交于 2019-11-27 18:46:58
I have to write a C++ Application (using the Qt Framework for the GUI) that can edit data stored in xml files described by a xsd schema file. Is there a tool to convert the xsd schema into C++ Classes? Sounds to me like CodeSynthesis is exactly what you are looking for. It's open source and c++. Altova XML Spy can generate C++ from an XSD, it's commercial but there's a 30 day free trial if you want to try it out. Objective Systems, Inc. XBinder XML Schema Compiler (not only für C++). gSOAP Toolkit can do this too! Its is lightweight, and supports C/C++. I have already used it in very demanding

IntelliJ IDEA GUI builder – no Java code generated

夙愿已清 提交于 2019-11-27 17:54:41
问题 I have designed my GUI form in the IntelliJ IDEA GUI designer, and selected the radio button in Project Settings → GUI Designer to generate source code instead of .class files, but my .java file with code looks like this: public class PovRayEmptyProjectWizardPanelVisual { private JTextField textField1; private JTextField textField2; private JTextField textField3; private JButton button1; } That’s it – no code creating the GUI was generated. How do I manually trigger such code generation, so

How to hide files generated by custom tool in Visual Studio

邮差的信 提交于 2019-11-27 17:21:06
I would like the files generated by my custom tool to be hidden, but I cannot find any documentation on how this is done. An example of what I'm looking for is WPF code behind files. These files are not displayed in the Visual Studio project view, yet are compiled with the project and are available in IntelliSense. WPF code behind files (Window1.g.i.cs, for example), are generated by a custom tool. The solution is to create a Target that adds your files to the Compile ItemGroup rather than adding them explicitly in your .csproj file. That way Intellisense will see them and they will be

Creating unique labels in Haskell

纵饮孤独 提交于 2019-11-27 16:44:42
问题 I'm writing a compiler for a simple imperative language in Haskell, outputting Java bytecode. I've gotten to the point where I'm emitting an abstract representation of bytecodes. While writing code for compiling if-statements I ran in to some trouble. To implement if-statements I need labels to jump to. Therefore I need to generate a name for that label, and that name needs to be unique. My first thought was to thread some state through compileStatement , i.e compileStatement :: Statement ->

Editing/Modifying a .java file programmatically? (not the .class file)

穿精又带淫゛_ 提交于 2019-11-27 16:09:49
问题 So, here is a piece of code using CodeModel that generates java code: JCodeModel cm = new JCodeModel(); JDefinedClass dc = cm._class("foo.Bar"); JMethod m = dc.method(0, int.class, "foo"); m.body()._return(JExpr.lit(5)); File f = new File("C:/target/classes"); f.mkdirs(); cm.build(f); This code generates a .java file: package foo; public class Bar { int foo() { return 5; } } However, I DO NOT want CodeModel to create a new java file for me. I do have a .java file already and would like to add

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

醉酒当歌 提交于 2019-11-27 15:48:12
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. You should change the URL using web.config. If you go to the properties of the web reference added, you should see a property named "'URL Behavior

zip(list1, list2) in Jinja2?

给你一囗甜甜゛ 提交于 2019-11-27 15:46:51
问题 I'm doing code generation in Jinja2 and I frequently want to iterate through two lists together (i.e. variables names and types), is there a simple way to do this or do I need to just pass a pre-zipped list? I was unable to find such a function in the docs or googling. 回答1: Modify the jinja2.Environment global namespace itself if you see fit. import jinja2 env = jinja2.Environment() env.globals.update(zip=zip) # use env to load template(s) This may be helpful in separating view (template)

Code stubbing with Visual Studio 2010 UML modeling

前提是你 提交于 2019-11-27 15:23:13
问题 Currently I'm exploring my way through all the new features added to the Visual Studio 2010 Beta 1 IDE and I found a feature that will hopefully be of great help to me. The UML Modeling tool in the Architecture Edition. I wanted to create a new test project, nothing special. I started out with creating just a standard UML Logical Class Diagram. Then after I had finished I wanted to export my diagram to C# code with class stubs but I couldn't figure out how to do it. So naturally I consulted

Minify / Obfuscate PHP Code [closed]

别说谁变了你拦得住时间么 提交于 2019-11-27 15:01:46
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 again I am looking for some kind of program that minifies / obfuscates the PHP code. The goal is to

Given a type instance, how to get generic type name in C#?

走远了吗. 提交于 2019-11-27 14:24:25
问题 Given a generic type, including List<string> Nullable<Int32> how do i get a generic name for C#? var t = typeof(Nullable<DateTime>); var s = t.GetGenericTypeDefinition().Name + "<" + t.GetGenericArguments()[0].Name + ">"; This yields "Nullable`1<DateTime>" , but i need "Nullable<DateTime>" . 回答1: I see you already accepted an answer, but honestly, that answer isn't going to be enough to do this reliably if you just combine what's in there with what you already wrote. It's on the right track,