小编raz*_*e92的帖子

jaxb2-maven-plugin 使用 xmlns 前缀生成 package-info.java

我想用 jaxb2-maven-plugin 生成 java 类。我正在使用以下配置:

pom.xml:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>2.5.0</version>
    <executions>
        <execution>
            <id>SomeID</id>
            <goals>
                <goal>xjc</goal>
            </goals>
            <configuration>
                <extension>true</extension>
                <clearOutputDir>true</clearOutputDir>
                <sources>
                    <source>src/main/xsd/schema.xsd</source>
                </sources>
                <noGeneratedHeaderComments>true</noGeneratedHeaderComments>
            </configuration>
        </execution>
    </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

架构.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://my.target.namespace/uri" 
    xmlns="http://my.target.namespace/uri" 
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:h="http://my.uri.for.prefix.h"
    xmlns:f="http://my.target.namespace/uri">
    
    <xsd:import namespace="http://my.uri.for.prefix.h" schemaLocation="schema2.xsd"/> 
    
    <xsd:complexType name="FooType">
        <xsd:sequence>
            <xsd:element ref="h:something" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="FooType" type="FooType" />
 
</xsd:schema>
Run Code Online (Sandbox Code Playgroud)

Jaxb2 插件正在为我生成以下package-info.java

@javax.xml.bind.annotation.XmlSchema(namespace = "http://my.target.namespace/uri", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package ...;
Run Code Online (Sandbox Code Playgroud)

但是,我想得到的是:

@javax.xml.bind.annotation.XmlSchema(namespace = "http://my.target.namespace/uri", xmlns = {
        @XmlNs(prefix="f", namespaceURI="http://my.target.namespace/uri"),
        @XmlNs(prefix="h", namespaceURI="http://my.uri.for.prefix.h")
}, …
Run Code Online (Sandbox Code Playgroud)

java jaxb xjc maven jaxb2-maven-plugin

5
推荐指数
1
解决办法
520
查看次数

Scikit Learn PolynomialFeatures - include_bias 选项的用途是什么?

在 scikit-learn 的 PolynomialFeatures 预处理器中,有一个 include_bias 选项。这基本上只是向数据框添加一列 1。我想知道这样做有什么意义。当然,您可以将其设置为 False。但从理论上讲,有或没有一列 1 以及生成的多项式特征如何影响回归。

这是文档中的解释,但我似乎无法从中得到任何关于为什么应该使用或不使用它的有用信息。

include_bias : 布尔值

如果为 True(默认),则包括一个偏差列,其中所有多项式幂为零的特征(即一列 - 作为线性模型中的截距项)。

regression linear-regression scikit-learn polynomials data-science

3
推荐指数
1
解决办法
1206
查看次数

Makefile编译二进制,而不是可执行文件

当我在make之后运行可执行文件时,bash引发以下错误:

$ ./prog 
-bash: ./prog: cannot execute binary file
Run Code Online (Sandbox Code Playgroud)

我的makefile:

CC = g++ -std=c++11
LDFLAGS = -undefined dynamic_lookup -bundle
OBJ = main.o datetime.o logger.o WeatherApi.o tinyxml2.o tflower.o tservo.o


prog: $(OBJ)
    $(CC) -o $@ $(OBJ) $(LDFLAGS)

%.o: %.cpp
    $(CC) -c $<

clean:
    rm -r *.o
Run Code Online (Sandbox Code Playgroud)

我错了什么?


更新2:

感谢您的评论 SergayA.在本文的帮助下链接python后它可以工作.


更新1:

-undefined dynamic_lookup -bundle在一些评论后删除了标志,所以我遇到了Python的问题.要使用Python.hi,请将环境变量设置为此路径: CPLUS_INCLUDE_PATH=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/

2 warnings generated.
g++ -std=c++11 -c datetime.cpp
g++ -std=c++11 -c logger.cpp
g++ -std=c++11 -c WeatherApi.cpp
g++ -std=c++11 -c tinyxml2.cpp
g++ -std=c++11 -c …
Run Code Online (Sandbox Code Playgroud)

c++ python macos makefile g++

1
推荐指数
1
解决办法
167
查看次数