小编use*_*967的帖子

在Windows上构建64位Z3时出错

我按照说明在运行时使用Visual Studio Community 2015在64位Windows 8.1系统上构建Z3

python scripts/mk_make.py -x
Run Code Online (Sandbox Code Playgroud)

但是当我运行nmake时,我收到以下错误:

C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(8848): error C3861:
 '_InterlockedIncrement64': identifier not found
C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(8879): error C3861:
 '_InterlockedDecrement64': identifier not found
C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(8915): error C3861:
 '_InterlockedExchange64': identifier not found
C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(8969): error C3861:
 '_InterlockedExchangeAdd64': identifier not found
C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(8979): error C3861:
 '_InterlockedExchangeAdd64': identifier not found
C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(9026): error C3861:
 '_InterlockedAnd64': identifier not found
C:\Program Files (x86)\Windows Kits\8.1\include\um\winbase.h(9036): error C3861:
 '_InterlockedOr64': identifier not found
C:\Program …
Run Code Online (Sandbox Code Playgroud)

64-bit visual-studio z3

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

Sphinx 的 autodoc 的 automodule 显然没有效果

我在rst包含automodule但似乎没有任何效果的文件上运行 Sphinx 。

以下是详细信息:我有一个 Python 项目,其中agent.py包含一个包含类的文件Agent。我还有一个子目录,里面apidoc有一个文件agent.rst(由 生成sphinx-apidoc):

agent module
============

.. automodule:: agent
   :members:
   :undoc-members:
   :show-inheritance:
Run Code Online (Sandbox Code Playgroud)

sphinx-build -b html apidoc apidoc/_build使用项目目录作为当前工作目录运行 sphinx 。

为了确保找到 Python 文件,我在 中包含了以下内容apidoc/conf.py

agent module
============

.. automodule:: agent
   :members:
   :undoc-members:
   :show-inheritance:
Run Code Online (Sandbox Code Playgroud)

它运行时没有错误,但是当我打开生成的 HTML 文件时,它只显示“代理模块”并且一切都是空白的。为什么不显示类Agent及其成员?

更新:最初的问题很可能是由于我没有包含sphinx.ext.autodocconf.py. 但是,现在我这样做了,我收到了如下警告:

import os
import sys
sys.path.insert(0, os.path.abspath('.'))
Run Code Online (Sandbox Code Playgroud)

python python-sphinx autodoc sphinx-apidoc

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

这个JavaFX/FXML自定义组件有什么问题?

我正在学习编写用于JavaFX 8和Scene Builder的FXML自定义组件.

我编写了下面显示的FXML文件,但是Scene Builder不会打开它,因为例外情况给我提示"打开操作失败":

java.io.IOException: javafx.fxml.LoadException: mycustomcomponent.TicoTeco is not a valid type.
/C:/Users/xxxxx/Documents/NetBeansProjects/MyCustomComponent/src/mycustomcomponent/TicoTeco.fxml:9
    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:92)
    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.(FXOMDocument.java:80)
    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.(FXOMDocument.java:95)
...

为什么我得到这个例外?

这是FXML文件:

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<fx:root type="mycustomcomponent.TicoTeco" prefHeight="93.0" prefWidth="304.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <BorderPane layoutX="61.0" prefHeight="115.0" prefWidth="200.0">
         <left>
            <Button fx:id="tico" mnemonicParsing="false" text="Tico" BorderPane.alignment="CENTER" />
         </left>
         <right>
            <Button fx:id="teco" mnemonicParsing="false" text="Teco" BorderPane.alignment="CENTER" />
         </right>
      </BorderPane>
   </children>
</fx:root>
Run Code Online (Sandbox Code Playgroud)

以下是TicoTeco.java和Main.java的Java文件:

package mycustomcomponent;

import java.io.IOException;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Button; …
Run Code Online (Sandbox Code Playgroud)

java javafx fxml javafx-8 fxmlloader

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

FXMLLoader 工厂方法可以用于用户定义的类吗?

在“Pro JavaFX 8:构建桌面、移动和嵌入式 Java 客户端的权威指南”的第 3 章中,一个示例说明了如何直接在 FXML 文件中指定对象。

您可以在本文末尾找到完整的 FXML 文件以及示例中的其他文件。

这是我正在讨论的片段。该sizes字段使用fx:factory属性来指示必须使用工厂方法 Utilities.createList() 创建一个整数列表,然后用三个整数填充该列表。

<sizes>
    <Utilities fx:factory="createMyCollection">
        <Integer fx:value="1"/>
        <Integer fx:value="2"/>
        <Integer fx:value="3"/>
    </Utilities>
</sizes>
Run Code Online (Sandbox Code Playgroud)

这是Utilities.java:

package projavafx.fxmlbasicfeatures;

import java.util.ArrayList;
import java.util.List;

public class Utilities {
    public static final Double TEN_PCT = 0.1d;
    public static final Double TWENTY_PCT = 0.2d;
    public static final Double THIRTY_PCT = 0.3d;

    public static List<Integer> createList() {
        return new ArrayList<>();
    }
}
Run Code Online (Sandbox Code Playgroud)

我的问题是:使用这些工厂方法涉及的一般机制是什么?

我想了解 FXMLLoader 如何知道需要使用该add方法将三个整数添加到创建的对象中。自然地,它必须以某种方式 …

javafx fxml javafx-8 fxmlloader

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

使用需要假设A的版本覆盖方法m(List <A> listOfA)是B类扩展A而不必转换每个元素

刚遇到一个我以前没见过的建模问题.

假设我有一个法语人员课程,另一个为医生,另一个为FrenchDoctors,我想写下列内容:

///////// FRANCE

interface FrenchPerson {}

void frenchSpecificBureaucraticProcedure(List<? extends FrenchPerson> frenchPeople) {
    // ...
}

///////// DOCTORS

interface Doctor {}

class DoctorsAssociation {
    void includeNewMembers(List<? extends Doctor> doctors) {
        // ... do stuff
    }       
}

///////// FRENCH DOCTORS

interface FrenchDoctor extends FrenchPerson, Doctor {}

class FrenchDoctorsAssociation extends DoctorsAssociation {

    @Override
    void includeNewMembers(List<? extends Doctor> frenchDoctors) {
        // ERROR: frenchDoctors is List<? extends Doctors>
        // but frenchSpecificBureaucraticProcedure requires List<? extends FrenchDoctor>
        frenchSpecificBureaucraticProcedure(frenchDoctors);

        super.includeNewMembers(frenchDoctors);
    }
}
Run Code Online (Sandbox Code Playgroud)

我的第一个冲动是includeNewMembers使用List<? extends …

java generics inheritance extends

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

pip:“extras_require”必须是一个字典,其值是包含有效项目/版本要求说明符的字符串或字符串列表

我尝试跑步pip install gym==0.21.0

\n

但出现了神秘的错误:

\n
Collecting gym==0.21.0\n  Using cached gym-0.21.0.tar.gz (1.5 MB)\n  Preparing metadata (setup.py) ... error\n  error: subprocess-exited-with-error\n  \n  \xc3\x97 python setup.py egg_info did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [1 lines of output]\n      error in gym setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.\n      [end of output]\n  \n  note: This error originates from a subprocess, and is likely not a problem with …
Run Code Online (Sandbox Code Playgroud)

python pip openai-gym

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

为什么 Eclipse 抱怨该项目指定编译器合规性 1.8,但使用了 JRE 11?

我将 Eclipse 项目编译器合规性设置为 1.8,因为我想生成可以在安装了 JRE 8 的计算机中执行的 jar 文件。

但是,在我的开发计算机中,我只安装了 JRE 11。我认为这没问题,因为我希望 JRE 11 能够执行 1.8 及更高版本的文件。

但是,Eclipse 会生成有关此问题的警告(我找不到禁用方法),并且编译器首选项对话框显示“当选择 1.8 合规性时,请确保安装并激活了兼容的 JRE(当前为 11)”,这使得听起来 JRE 11 与 1.8 不兼容。真的是这样吗?

我在这里到底做了什么错误的假设?

另外,我真的需要安装 JRE 8 才能生成 JRE 8 兼容代码吗?

java eclipse compiler-version

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

为什么在使用 Python 的 copy.deepcopy 时会出现此 TypeError?

我刚刚遇到这个错误copy.deepcopy

import copy
import datetime


class Hours(datetime.timedelta):
    # Using __new__ because timedelta is immutable
    # See /sf/answers/1577224141/.
    def __new__(cls, hours):
        return datetime.timedelta.__new__(cls, hours=hours)


h1 = Hours(2)
h2 = copy.deepcopy(h1)  # TypeError: __new__() takes 2 positional arguments but 4 were given
Run Code Online (Sandbox Code Playgroud)

这是完整的回溯:

Traceback (most recent call last):
  File "/Users/xxxx/Documents/PyCharmProjects/Flow/backend/deepcopy_test.py", line 11, in <module>
    h2 = copy.deepcopy(h1)  # TypeError: __new__() takes 2 positional arguments but 4 were given
  File "/Users/xxxx/.conda/envs/qtdesktopapp/lib/python3.8/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File …
Run Code Online (Sandbox Code Playgroud)

python deep-copy

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

有没有办法在 Python 中没有 for 循环的情况下将可迭代对象中的所有元素添加到列表中?

是否有一种更 Pythonic 的方式(即在一行中,没有循环,也没有简单的初始化)来计算all下面的列表?

all = []
for iterable in iterables:
    all.extend(iterable)  # add all elements in 'iterable' to 'all'
Run Code Online (Sandbox Code Playgroud)

编辑:如果解决方案需要线性时间就可以了。我只是想要一种更易读、更短、更直接的方式。

python iterable list

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